This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch fix/ts-type-visibility in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 71541f85af970bfe78cf397f177d2e23a08a1104 Author: 100pah <sushuang0...@gmail.com> AuthorDate: Fri Jun 14 02:42:37 2024 +0800 fix: In users' .d.ts `import('echarts/types/dist/shared')` can not visit `'echarts/types/dist/shared.d.ts'` since v5.5.0. Fix it. Fix #19663. --- package.README.md | 5 ++++- package.json | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.README.md b/package.README.md index 0b51fbc9b..0960ecbbd 100644 --- a/package.README.md +++ b/package.README.md @@ -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 @@ -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 to [...] +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` diff --git a/package.json b/package.json index 3b4dd0fe3..6b25aab43 100644 --- a/package.json +++ b/package.json @@ -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", --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org