Repository navigation
fix: ship bongo/client types - #86
Merged
Merged
Conversation
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tscfailed on a new site fromcreate-bongo, with no change to the template. The installed packages gave 6 errors.Causes and changes
bongo/clienthad no types in the package.client.d.tsre-exported from./src/client/index, andsrc/is not infiles. Soclient,navigate,on, andoffhad no types, and({ to })in the template'smain.tswas an implicitany.client.d.tsnow declares the API itself, asindex.d.tsdoes. A new type test,src/client/types.test.ts, makesbunx tsc -p .fail when the declarations andsrc/clientdisagree.index.d.tsusesBufferandBufferEncoding($assets.load), so it needs Node types. TypeScript 6 and later load no@typespackage unlesstypeslists it, so an installed@types/nodealone does not help. The template adds@types/node@^24, asenginesasks for Node 24, and sets"types": ["node"].Symbol.dispose. That is not in thees2024ores2025lib, but@types/nodedeclares it, so (2) fixes this too. The template target goes fromes2023toes2024.es2025would need TypeScript 6 or later, and the template does not install TypeScript, so the user's editor decides the version.Not changed
index.d.tskeepsBuffer, with no/// <reference types="node" />. With a reference, each project that reads bongo's types would need@types/node.typesin the template, to["bongo/env"]. When this PR merges, feat: add script mode values #82 takes["bongo/env", "node"].Test plan
bun test(858 pass),bunx tsc -p .,bunx tsc -p build,bun run buildclient.d.tschanges, such asprefetchwithout'tap'@bongo/bongoand@bongo/markdown, scaffolded a site withcreate-bongo, and installed the tarballs. Onmain,tscgives 6 errors. With this branch,tscis clean andbongo buildpasses.