Skip to content

Commit

Permalink
fix(compat): add entities to @vue/compat deps to fix CJS edge cases
Browse files Browse the repository at this point in the history
Fixes vuejs#10609

Unlike the `vue` package, direct dependencies of `@vue/compat` are not
externalized:
https://github.com/vuejs/core/blob/201936f9a3909ae9dca4e131e1f5ad5a1c0feb77/rollup.config.js#L274

So it depends on `entities` directly in its CJS build, unlike the `vue`
one which indirectly depends on it via `@vue/compiler-core`.
So `entities` must be explicitly added to `@vue/compat` deps to avoid
incorrect dependency resolution due to different `node_modules` layouts,
such as in vuejs#10609.
  • Loading branch information
haoqunjiang committed Dec 9, 2024
1 parent 201936f commit 499b298
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ jobs:

- name: Release
run: pnpx pkg-pr-new publish --compact --pnpm './packages/*'

# Wait for one 1 minute to let the bot post the original comment

# TODO:
# Update comments posted by pkg-pr-new bot to include `install-vue@pr` or `install-vue@commit` notes
2 changes: 1 addition & 1 deletion packages/compiler-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dependencies": {
"@babel/parser": "catalog:",
"@vue/shared": "workspace:*",
"entities": "^4.5.0",
"entities": "catalog:",
"estree-walker": "catalog:",
"source-map-js": "catalog:"
},
Expand Down
1 change: 1 addition & 0 deletions packages/vue-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue-compat#readme",
"dependencies": {
"@babel/parser": "catalog:",
"entities": "catalog:",
"estree-walker": "catalog:",
"source-map-js": "catalog:"
},
Expand Down
8 changes: 7 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ packages:
catalog:
'@babel/parser': ^7.25.3
'@babel/types': ^7.25.2
'entities': '^4.5.0'
'estree-walker': ^2.0.2
'magic-string': ^0.30.11
'source-map-js': ^1.2.0
Expand Down

0 comments on commit 499b298

Please sign in to comment.