Skip to content

Commit

Permalink
fix: In users' .d.ts import('echarts/types/dist/shared') can not vi…
Browse files Browse the repository at this point in the history
…sit `'echarts/types/dist/shared.d.ts'` since v5.5.0. Fix it. Fix #19663.
  • Loading branch information
100pah committed Jun 13, 2024
1 parent a4db0d4 commit 71541f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# NOTICE about package.json

See more details about in the "exports" field of `package.json` and why it is written like that in https://github.com/apache/echarts/pull/19513 .
**[[!Remember!]]**: update the "exports" field of `package.json` if adding new public entry files.

See more details about in the "exports" field of `package.json` and why it is written like that in https://github.com/apache/echarts/pull/19513 .

## Public and private

Expand Down Expand Up @@ -30,6 +31,8 @@ The other entries listed in the `"exports"` field of `package.json` make the int

Since `v5.5.0`, `"type": "module"` and `"exports: {...}"` are added to `package.json`. When upgrading to `v5.5.0+`, if you meet some problems about "can not find/resolve xxx" when importing `echarts/i18n/xxx` or `echarts/theme/xxx` or some internal files, it probably because of the issue "file extension not fully specified". Please try to make the file extension fully specified (that is, `import 'xxx/xxx/xxx.js'` rather than `import 'xxx/xxx/xxx'`), or change the config of you bundler tools to support auto adding file extensions.

About `"./types/dist/shared": "./types/dist/shared.d.ts",` in "exports", see https://github.com/apache/echarts/pull/19663 .


## Use physical entry file or alias in `"exports"` of `package.json`

Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@
"./index.js": "./index.js",
"./theme/*": "./theme/*",
"./i18n/*": "./i18n/*",
"./types/dist/charts": "./types/dist/charts.d.ts",
"./types/dist/components": "./types/dist/components.d.ts",
"./types/dist/core": "./types/dist/core.d.ts",
"./types/dist/echarts": "./types/dist/echarts.d.ts",
"./types/dist/features": "./types/dist/features.d.ts",
"./types/dist/option": "./types/dist/option.d.ts",
"./types/dist/renderers": "./types/dist/renderers.d.ts",
"./types/dist/shared": "./types/dist/shared.d.ts",
"./ssr/client/index": {
"types": "./ssr/client/index.d.ts",
"import": "./ssr/client/index.js",
Expand Down

0 comments on commit 71541f8

Please sign in to comment.