Fix package.json files field (was shipping an empty package)#15
Merged
Conversation
"files": ["dist/**/*"] pointed at a directory that has never existed in this repo (bsc's outDir is build/, not dist/) - `npm pack --dry-run` confirmed the published tarball would contain only LICENSE, README, and package.json, with zero BrighterScript source. Since this package has never been published, this bug was never caught. Changed to src/**/* (matching ropm.rootDir), excluding src/source/roku_modules/** - that's the locally ropm-installed copy of rodash, which consumers regenerate for themselves via their own `ropm install`, not something we should ship inside our own package. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ropm.rootDir only controls where OUR OWN project installs its ropm dependencies (rodash) - it has no effect on how ropm resolves file locations for consumers installing this package. That's controlled by ropm.packageRootDir, which was missing entirely, so a consumer would have had ropm try to copy from the package root instead of src/, finding nothing usable. Verified with a real end-to-end test (npm pack -> install as a dependency in a scratch project -> ropm install -> bsc --validate): files now land correctly under roku_modules and are prefixed as expected. However, that same test surfaced ~1640 real compile errors for the consumer, caused by issues in the engine source itself (bare BGE self-references not getting rewritten by ropm's prefixer, native Roku SDK types like roTimespan/roBitmap getting incorrectly prefixed in type-annotation position, and a rodash alias-name mismatch between our own dev install and a downstream transitive install). Those are out of scope for this PR and need their own investigation before an actual publish. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Found while preparing the first-ever npm/ROPM publish.
Fixed here:
"files": ["dist/**/*"]pointed at a directory that has never existed (bsc'soutDirisbuild/, notdist/).npm pack --dry-runconfirmed the tarball would contain onlyLICENSE/README.md/package.json- zero BrighterScript source. Fixed tosrc/**/*, excludingsrc/source/roku_modules/**(our own locally-installed copy ofrodash, which consumers regenerate for themselves).ropm.rootDironly controls where our own project installs its ropm dependencies (rodash) - it has no effect on how ropm resolves file locations for consumers installing us. That'sropm.packageRootDir, which was missing entirely. Without it, a consumer'sropm installwould try to copy from the package root instead ofsrc/.Verified both fixes with a real end-to-end test:
npm pack→ install the tarball as a dependency in a scratch project →ropm install→bsc --validate. Files now land correctly underroku_modules, prefixed as expected.Not fixed here - found via that same test, needs its own investigation before an actual publish:
That end-to-end test surfaced ~1640 real compile errors for the consumer, from issues in the engine source itself, not this config:
BGE.somethingself-references inside our own source (called from within theBGEnamespace itself) don't get rewritten by ropm's prefixer when it renames the namespace for a consumerroTimespan,roBitmap,roAssociativeArray, etc.) inas Xtype-annotation position, as if they were our own custom typesrodashunder the friendly aliasrodash, but a downstream consumer's transitive install resolves it astkss_rodash_v0(derived from the real npm name@tkss/rodash), so our bundled code's barerodash.xxx()calls don't resolve for anyone but usNone of the existing examples would ever catch this, since they consume the engine via a direct file-copy trick in
bsconfig.json, never through realropm install. Publishing is on hold until that's addressed.Test plan
npm run validate/npm run lintpassnpm pack --dry-runincludes all engine source, excludes roku_modulesvalidatecheck passes