Skip to content

Commit b61f6c0

Browse files
authored
Merge pull request #20030 from apache/fix/ts-type-visibility
Fix that in users' .d.ts `import('echarts/types/dist/shared')` can not visit `'echarts/types/dist/shared.d.ts'` since v5.5.0
2 parents 4b2d52f + a209486 commit b61f6c0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

package.README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# NOTICE about package.json
22

3-
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 .
3+
**[[!Remember!]]**: update the "exports" field of `package.json` if adding new public entry files.
44

5+
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 .
56

67
## Public and private
78

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

3132
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.
3233

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

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

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@
129129
"./index.js": "./index.js",
130130
"./theme/*": "./theme/*",
131131
"./i18n/*": "./i18n/*",
132+
"./types/dist/charts": "./types/dist/charts.d.ts",
133+
"./types/dist/components": "./types/dist/components.d.ts",
134+
"./types/dist/core": "./types/dist/core.d.ts",
135+
"./types/dist/echarts": "./types/dist/echarts.d.ts",
136+
"./types/dist/features": "./types/dist/features.d.ts",
137+
"./types/dist/option": "./types/dist/option.d.ts",
138+
"./types/dist/renderers": "./types/dist/renderers.d.ts",
139+
"./types/dist/shared": "./types/dist/shared.d.ts",
132140
"./ssr/client/index": {
133141
"types": "./ssr/client/index.d.ts",
134142
"import": "./ssr/client/index.js",

0 commit comments

Comments
 (0)