fix: publish user-facing tsconfig.json for backward compatibility#1351
Open
itxaiohanglover wants to merge 1 commit into
Open
fix: publish user-facing tsconfig.json for backward compatibility#1351itxaiohanglover wants to merge 1 commit into
itxaiohanglover wants to merge 1 commit into
Conversation
The `plasmo/tsconfig.json` file exists in the source but is not included in the `files` field of package.json, so it's not published to npm. Users following older docs/tutorials that use `"extends": "plasmo/tsconfig.json"` get a "Failed to resolve '../../popup.tsx'" build error because Parcel cannot find the non-existent tsconfig, breaking module resolution. Fix: - Rename internal build tsconfig to `tsconfig.build.json` - Create user-facing `tsconfig.json` that re-exports `templates/tsconfig.base.json` - Add `tsconfig.json` to the `files` array so it gets published - Update build scripts to reference `tsconfig.build.json` Fixes PlasmoHQ#1040
3 tasks
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.
Summary
plasmo/tsconfig.jsonexists in the source repo but is not included in thefilesfield ofpackage.json, so it's not published to npm"extends": "plasmo/tsconfig.json"getFailed to resolve '../../popup.tsx' from './.plasmo/static/popup.tsx'because Parcel silently fails when the extended tsconfig doesn't exist, breaking module resolution"plasmo/templates/tsconfig.base"works fine, butplasmo/tsconfig.jsonshould also work for backward compatibilityChanges (minimal)
cli/plasmo/tsconfig.json→cli/plasmo/tsconfig.build.json(internal build config, unchanged content)cli/plasmo/tsconfig.jsonwith{ "extends": "./templates/tsconfig.base.json" }(user-facing alias)cli/plasmo/package.json:"tsconfig.json"tofilesarray (so it gets published)lint:typeandtypescripts to referencetsconfig.build.jsonRoot Cause Analysis
Tested with Plasmo 0.90.5 on Node 18/22 — confirmed that
"extends": "plasmo/tsconfig.json"causes the build failure, and changing to"extends": "plasmo/templates/tsconfig.base"fixes it. Thecreate-plasmoCLI already generates the correct path, but many existing projects use the old path.Fixes #1040