-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone content-tag implemented via conditional exports in package.json #44
Conversation
ae7baeb
to
50e660c
Compare
50e660c
to
3d4ee8d
Compare
@@ -1,20 +1,45 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the root package.json now is the package.json that is published. previously, a separate package.json was used
"exports": { | ||
".": { | ||
"types": "index.d.ts", | ||
"browser": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this conditional export is what enables browser mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(assuming vite isn't falling back to the "default" exports (pkg/node/content_tag.cjs) and polyfilling all the node stuff for the browser)
…g/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md under Node16 -- so we switch to Node18 to resolve
aa6cd07
to
101d72c
Compare
cache: 'npm' | ||
- run: npm ci | ||
- run: ./build.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have this consistent with release workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the release workflow already run npm run build
, so this is covered
yes, if this did the same thing meaning npm run build the two would be in
sync
…On Fri, Dec 1, 2023, 22:58 NullVoxPopuli ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In .github/workflows/ci.yml
<#44 (comment)>
:
> cache: 'npm'
- - run: npm ci
+ - run: ./build.sh
the release workflow already run npm run build, so this is covered
—
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABHPNIYA6WWEOZLJLNEWL23YHJOHRAVCNFSM6AAAAABADKFMUKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONRQGY3TGMJTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
…repo-dist content-tag PR embroider-build/content-tag#44
Alternative to: #41
Changes:
files
entry includes thepkg
directoryexports
with conditional/subpath entries to target node/browser separately since wasm-pack generates very different output for each target (there isn't a need for this if they went for full async-only API, but 🤷 )vite
has for Packages using self-referencing imports will fail to resolve ("moduleResolution": "node16" and package.json "exports") vitejs/vite#9731 -- which is settingresolve-alias
for"package-name": "."
(current directory) so that vite can resolve the "self's" exports. So we currently don't have automated browser testing atm. We could set up qunit instead of vitest, but we currently need to handroll a reporter to the CLI, because vite/vitest haven't given us those APIs to build custom reporters. GlimmerVM is already doing this, so it "just" needs to be extracted.This is the error:
publint
and@arethetypeswrong/cli
to help me be more confident that the package.json was correctly configured so we don't have to rapid publishes to fix bugs with package.json config.@arethetypeswrong/cli
reported some issues which are resolved now.One being this issue which is resolved by using node newer than 16 -- which... we don't declare node support at all, and node 16 is EOL'd so it seems fine to bump the CI's node.
In a real app
because my confidence in non-monorepo layouts is way lower (can't test with real projects with real module resolution),
here is a real usage:
Results:
top-level-await causes component loading to break embroider#1678
and this code likely would work once that 1678 issue is resolved.