From 05abf1d05d09e9ac419a56b7ec0a0b94108614d1 Mon Sep 17 00:00:00 2001 From: Yann Armelin Date: Mon, 28 Oct 2024 21:45:21 +0100 Subject: [PATCH] fix: esm module type Signed-off-by: Yann Armelin --- package-lock.json | 38 ++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 5389759..74318b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,11 @@ "nyc": "^15.1.0", "rimraf": "^3.0.2", "tick": "0.0.6", + "tsconfig-to-dual-package": "^1.2.0", "typescript": "^5.4.4" + }, + "funding": { + "url": "https://github.com/sponsors/yqnn" } }, "node_modules/@ampproject/remapping": { @@ -1527,6 +1531,22 @@ "node": ">=8" } }, + "node_modules/resolve-tsconfig": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/resolve-tsconfig/-/resolve-tsconfig-1.3.0.tgz", + "integrity": "sha512-Ba5mo3soshb2CnIcNFz75F/80H/2eMVxrlmdgoSDNH7Lr6UAoT3BvxNtc7+VXqKSBlC0SJk2qSXOTcy0/p7cFw==", + "dev": true, + "engines": { + "node": ">=16", + "pnpm": ">=7" + }, + "funding": { + "url": "https://github.com/sponsors/skarab42" + }, + "peerDependencies": { + "typescript": "*" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1723,6 +1743,24 @@ "node": ">=4" } }, + "node_modules/tsconfig-to-dual-package": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-to-dual-package/-/tsconfig-to-dual-package-1.2.0.tgz", + "integrity": "sha512-UtMinqTLfWr9fX6KidLsEcCJoA/jSLPIS00ohpQybMSxA3LlJCRf2DsGPw4AJJ8AP4FOHfbQJFJ5XgLoL7RoLw==", + "dev": true, + "dependencies": { + "resolve-tsconfig": "^1.3.0" + }, + "bin": { + "tsconfig-to-dual-package": "bin/cmd.mjs" + }, + "engines": { + "node": ">=18.3.0 || >=16.17.0" + }, + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", diff --git a/package.json b/package.json index db66ecd..b72d4a0 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "nyc": "^15.1.0", "rimraf": "^3.0.2", "tick": "0.0.6", + "tsconfig-to-dual-package": "^1.2.0", "typescript": "^5.4.4" }, "keywords": [ @@ -53,7 +54,7 @@ "scripts": { "test": "npx nyc --reporter=lcov --reporter=text-summary --reporter=html jasmine --config=jasmine.json", "test-regen": "TEST_REGEN=1 jasmine --config=jasmine.json", - "build": "rimraf dist && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json", + "build": "rimraf dist && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsconfig-to-dual-package tsconfig.esm.json tsconfig.cjs.json", "bench": "bash scripts/benchmark.sh", "profile": "bash scripts/profile.sh && cat profile.txt" },