Version3.3.0: Add TS Support#5
Open
Icorcka wants to merge 3 commits into
Open
Conversation
sergey-sign
suggested changes
May 14, 2026
Contributor
sergey-sign
left a comment
There was a problem hiding this comment.
Blocking
The try/catch around require.resolve('@babel/preset-typescript') in lib/webpack.config.coffee only logs console.warn and continues — but the .tsx? webpack rule and the .ts/.tsx extensions are still registered. A project that enables typescript: true without installing the peer dep won't see a clear "missing peer dep" error; it will see a confusing parse error from @babel/preset-env when it hits the first type annotation, wrapped by thread-loader. Please fail fast (throw with the actionable message) or short-circuit both the rule and the extensions when resolution fails.
Should fix
prjPath = ''as a default inmakeBabelis a foot-gun:require.resolve(..., { paths: [''] })silently behaves as ifpathsweren't passed at all, masking the intent. Either requireprjPath(no default) or fall back to a meaningful root.- Consider
paths: [prjPath, __dirname]instead of[prjPath]— falling back to zeropack2's own install dir preserves the previous behavior as a safety net and makes the upgrade strictly non-breaking. - With
svelte: true, typescript: true, the secondifbranch concatenates.ts/.tsxonto the svelte-reset list, so.cjsxis silently dropped. Either intentional and documented, or refactor into a single decision block.
Worth noting
typescript: ">=4.0.0"as a peer dependency is misleading —@babel/preset-typescriptstrips types without consulting thetypescriptpackage. Consider removing it or pinning a more meaningful floor.- No tests added. A small fixture-project build would catch the silent-failure case and the resolution path automatically.
tsconfig.jsonis not consumed at build time —pathsaliases declared there won't translate to module resolution; users still needresolve.alias. Worth documenting.
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.
No description provided.