feat!: require node 20.19, drop cjs build

This commit is contained in:
Kevin Deng
2025-10-07 00:32:25 +08:00
parent 9c44facdc9
commit 183a90d8fb
9 changed files with 73 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
declare function transformOn( declare function transformOn(
obj: Record<string, any> obj: Record<string, any>
): Record<`on${string}`, any>; ): Record<`on${string}`, any>;
export = transformOn;
export { transformOn as default, transformOn as 'module.exports' };

View File

@@ -1,9 +1,9 @@
const transformOn = (obj) => { function transformOn(obj) {
const result = {}; const result = {};
Object.keys(obj).forEach((evt) => { Object.keys(obj).forEach((evt) => {
result[`on${evt[0].toUpperCase()}${evt.slice(1)}`] = obj[evt]; result[`on${evt[0].toUpperCase()}${evt.slice(1)}`] = obj[evt];
}); });
return result; return result;
}; }
module.exports = transformOn; export { transformOn as default, transformOn as 'module.exports' };

View File

@@ -1,14 +1,17 @@
{ {
"name": "@vue/babel-helper-vue-transform-on", "name": "@vue/babel-helper-vue-transform-on",
"version": "1.5.0", "version": "1.5.0",
"type": "commonjs", "type": "module",
"description": "to help transform on", "description": "to help transform on",
"author": "Amour1688 <lcz_1996@foxmail.com>", "author": "Amour1688 <lcz_1996@foxmail.com>",
"license": "MIT", "license": "MIT",
"main": "index.js", "exports": {
"types": "index.d.ts", ".": "./index.mjs",
"./package.json": "./package.json"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git" "url": "git+https://github.com/vuejs/babel-plugin-jsx.git",
"directory": "packages/babel-helper-vue-transform-on"
} }
} }

View File

@@ -5,20 +5,18 @@
"author": "Amour1688 <lcz_1996@foxmail.com>", "author": "Amour1688 <lcz_1996@foxmail.com>",
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-jsx#readme", "homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-jsx#readme",
"license": "MIT", "license": "MIT",
"type": "commonjs", "type": "module",
"main": "dist/index.js", "main": "./dist/index.mjs",
"module": "dist/index.mjs", "module": "./dist/index.mjs",
"types": "dist/index.d.ts", "types": "./dist/index.d.mts",
"exports": { "exports": {
".": { ".": "./dist/index.mjs",
"import": "./dist/index.mjs", "./package.json": "./package.json"
"require": "./dist/index.js"
},
"./*": "./*"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git" "url": "git+https://github.com/vuejs/babel-plugin-jsx.git",
"directory": "packages/babel-plugin-jsx"
}, },
"bugs": { "bugs": {
"url": "https://github.com/vuejs/babel-plugin-jsx/issues" "url": "https://github.com/vuejs/babel-plugin-jsx/issues"

View File

@@ -203,3 +203,4 @@ const plugin: (
}); });
export default plugin; export default plugin;
export { plugin as 'module.exports' };

View File

@@ -2,34 +2,22 @@
"name": "@vue/babel-plugin-resolve-type", "name": "@vue/babel-plugin-resolve-type",
"version": "1.5.0", "version": "1.5.0",
"description": "Babel plugin for resolving Vue types.", "description": "Babel plugin for resolving Vue types.",
"author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>", "author": "Kevin Deng <sxzz@sxzz.moe>",
"funding": "https://github.com/sponsors/sxzz", "funding": "https://github.com/sponsors/sxzz",
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-resolve-type#readme", "homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-resolve-type#readme",
"license": "MIT", "license": "MIT",
"type": "commonjs", "type": "module",
"main": "dist/index.js", "main": "./dist/index.mjs",
"module": "dist/index.mjs", "module": "./dist/index.mjs",
"types": "dist/index.d.ts", "types": "./dist/index.d.mts",
"exports": { "exports": {
".": { ".": "./dist/index.mjs",
"dev": "./src/index.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git" "url": "git+https://github.com/vuejs/babel-plugin-jsx.git",
}, "directory": "packages/babel-plugin-resolve-type"
"publishConfig": {
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
}
}, },
"bugs": { "bugs": {
"url": "https://github.com/vuejs/babel-plugin-jsx/issues" "url": "https://github.com/vuejs/babel-plugin-jsx/issues"

View File

@@ -324,3 +324,4 @@ function addProperty<T extends BabelCore.types.Node>(
} }
return object; return object;
} }
export { plugin as 'module.exports' };

41
pnpm-lock.yaml generated
View File

@@ -61,7 +61,7 @@ importers:
version: 3.6.2 version: 3.6.2
tsdown: tsdown:
specifier: ^0.15.6 specifier: ^0.15.6
version: 0.15.6(typescript@5.9.3) version: 0.15.6(publint@0.3.14)(typescript@5.9.3)
tslib: tslib:
specifier: ^2.8.1 specifier: ^2.8.1
version: 2.8.1 version: 2.8.1
@@ -1040,6 +1040,10 @@ packages:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@publint/pack@0.1.2':
resolution: {integrity: sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==}
engines: {node: '>=18'}
'@quansync/fs@0.1.5': '@quansync/fs@0.1.5':
resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==} resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==}
@@ -2428,6 +2432,10 @@ packages:
monaco-editor@0.54.0: monaco-editor@0.54.0:
resolution: {integrity: sha512-hx45SEUoLatgWxHKCmlLJH81xBo0uXP4sRkESUpmDQevfi+e7K1VuiSprK6UpQ8u4zOcKNiH0pMvHvlMWA/4cw==} resolution: {integrity: sha512-hx45SEUoLatgWxHKCmlLJH81xBo0uXP4sRkESUpmDQevfi+e7K1VuiSprK6UpQ8u4zOcKNiH0pMvHvlMWA/4cw==}
mri@1.2.0:
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
engines: {node: '>=4'}
ms@2.1.3: ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@@ -2559,6 +2567,11 @@ packages:
proto-list@1.2.4: proto-list@1.2.4:
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
publint@0.3.14:
resolution: {integrity: sha512-14/VNBvWsrBeqWNDw8c/DK5ERcZBUwL1rnkVx18cQnF3zadr3GfoYtvD8mxi1dhkWpaPHp8kfi92MDbjMeW3qw==}
engines: {node: '>=18'}
hasBin: true
punycode@2.3.1: punycode@2.3.1:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'} engines: {node: '>=6'}
@@ -2692,6 +2705,10 @@ packages:
run-parallel@1.2.0: run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
sade@1.8.1:
resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
engines: {node: '>=6'}
safe-regex-test@1.1.0: safe-regex-test@1.1.0:
resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
@@ -4042,6 +4059,9 @@ snapshots:
'@pkgjs/parseargs@0.11.0': '@pkgjs/parseargs@0.11.0':
optional: true optional: true
'@publint/pack@0.1.2':
optional: true
'@quansync/fs@0.1.5': '@quansync/fs@0.1.5':
dependencies: dependencies:
quansync: 0.2.11 quansync: 0.2.11
@@ -5462,6 +5482,9 @@ snapshots:
dompurify: 3.1.7 dompurify: 3.1.7
marked: 14.0.0 marked: 14.0.0
mri@1.2.0:
optional: true
ms@2.1.3: {} ms@2.1.3: {}
nanoid@3.3.11: {} nanoid@3.3.11: {}
@@ -5576,6 +5599,14 @@ snapshots:
proto-list@1.2.4: {} proto-list@1.2.4: {}
publint@0.3.14:
dependencies:
'@publint/pack': 0.1.2
package-manager-detector: 1.4.0
picocolors: 1.1.1
sade: 1.8.1
optional: true
punycode@2.3.1: {} punycode@2.3.1: {}
quansync@0.2.11: {} quansync@0.2.11: {}
@@ -5716,6 +5747,11 @@ snapshots:
dependencies: dependencies:
queue-microtask: 1.2.3 queue-microtask: 1.2.3
sade@1.8.1:
dependencies:
mri: 1.2.0
optional: true
safe-regex-test@1.1.0: safe-regex-test@1.1.0:
dependencies: dependencies:
call-bound: 1.0.4 call-bound: 1.0.4
@@ -5857,7 +5893,7 @@ snapshots:
dependencies: dependencies:
typescript: 5.9.3 typescript: 5.9.3
tsdown@0.15.6(typescript@5.9.3): tsdown@0.15.6(publint@0.3.14)(typescript@5.9.3):
dependencies: dependencies:
ansis: 4.2.0 ansis: 4.2.0
cac: 6.7.14 cac: 6.7.14
@@ -5874,6 +5910,7 @@ snapshots:
tree-kill: 1.2.2 tree-kill: 1.2.2
unconfig: 7.3.3 unconfig: 7.3.3
optionalDependencies: optionalDependencies:
publint: 0.3.14
typescript: 5.9.3 typescript: 5.9.3
transitivePeerDependencies: transitivePeerDependencies:
- '@ts-macro/tsc' - '@ts-macro/tsc'

View File

@@ -6,8 +6,10 @@ export default defineConfig({
'./packages/babel-plugin-resolve-type', './packages/babel-plugin-resolve-type',
], ],
entry: ['src/index.ts'], entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: { oxc: true }, dts: { oxc: true },
target: 'es2015', target: 'node20.19',
platform: 'neutral', platform: 'neutral',
inlineOnly: [],
exports: true,
fixedExtension: true,
}); });