From f3b078455f0fbe7679c2e6e72cfa67eed1f890ac Mon Sep 17 00:00:00 2001 From: 100pah Date: Tue, 16 Jan 2024 04:26:00 +0800 Subject: [PATCH 1/2] feat: change to default ESM package. For developer testing and node usage in customization module scenario. See apache/echarts#19513 --- build/package.json | 3 +++ dist/package.json | 3 +++ package.json | 14 +++++++++++++- test/package.json | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 build/package.json create mode 100644 dist/package.json create mode 100644 test/package.json diff --git a/build/package.json b/build/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/build/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/package.json b/package.json index 7c2beebc5..bbd92f092 100644 --- a/package.json +++ b/package.json @@ -59,5 +59,17 @@ "ts-jest": "^27.0.6", "typescript": "^4.4.3", "uglify-js": "^3.10.0" + }, + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./dist/zrender.js", + "import": "./index.js" + }, + "./*.js": "./*.js", + "./*.ts": "./*.ts", + "./*.json": "./*.json", + "./*": "./*.js" } -} +} \ No newline at end of file diff --git a/test/package.json b/test/package.json new file mode 100644 index 000000000..6a0d2ef2a --- /dev/null +++ b/test/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file From 565dac52837f5c8054b6990741bc29ccc6915a09 Mon Sep 17 00:00:00 2001 From: 100pah Date: Mon, 22 Jan 2024 12:40:36 +0800 Subject: [PATCH 2/2] [lint] enable comma-dangle, which has been deprecated in eslint. --- src/.eslintrc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.eslintrc.yaml b/src/.eslintrc.yaml index 8fb078f0f..752deedd0 100644 --- a/src/.eslintrc.yaml +++ b/src/.eslintrc.yaml @@ -21,7 +21,7 @@ rules: - "warn" - "error" no-constant-condition: 0 - comma-dangle: 2 + comma-dangle: 0 no-debugger: 2 no-dupe-keys: 2 no-empty-character-class: 2