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(
obj: Record<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 = {};
Object.keys(obj).forEach((evt) => {
result[`on${evt[0].toUpperCase()}${evt.slice(1)}`] = obj[evt];
});
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",
"version": "1.5.0",
"type": "commonjs",
"type": "module",
"description": "to help transform on",
"author": "Amour1688 <lcz_1996@foxmail.com>",
"license": "MIT",
"main": "index.js",
"types": "index.d.ts",
"exports": {
".": "./index.mjs",
"./package.json": "./package.json"
},
"repository": {
"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>",
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-jsx#readme",
"license": "MIT",
"type": "commonjs",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./*": "./*"
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
"repository": {
"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": {
"url": "https://github.com/vuejs/babel-plugin-jsx/issues"

View File

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

View File

@@ -2,34 +2,22 @@
"name": "@vue/babel-plugin-resolve-type",
"version": "1.5.0",
"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",
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-resolve-type#readme",
"license": "MIT",
"type": "commonjs",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"exports": {
".": {
"dev": "./src/index.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git"
},
"publishConfig": {
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
}
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git",
"directory": "packages/babel-plugin-resolve-type"
},
"bugs": {
"url": "https://github.com/vuejs/babel-plugin-jsx/issues"

View File

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

41
pnpm-lock.yaml generated
View File

@@ -61,7 +61,7 @@ importers:
version: 3.6.2
tsdown:
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:
specifier: ^2.8.1
version: 2.8.1
@@ -1040,6 +1040,10 @@ packages:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
'@publint/pack@0.1.2':
resolution: {integrity: sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==}
engines: {node: '>=18'}
'@quansync/fs@0.1.5':
resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==}
@@ -2428,6 +2432,10 @@ packages:
monaco-editor@0.54.0:
resolution: {integrity: sha512-hx45SEUoLatgWxHKCmlLJH81xBo0uXP4sRkESUpmDQevfi+e7K1VuiSprK6UpQ8u4zOcKNiH0pMvHvlMWA/4cw==}
mri@1.2.0:
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
engines: {node: '>=4'}
ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@@ -2559,6 +2567,11 @@ packages:
proto-list@1.2.4:
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:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
@@ -2692,6 +2705,10 @@ packages:
run-parallel@1.2.0:
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:
resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
engines: {node: '>= 0.4'}
@@ -4042,6 +4059,9 @@ snapshots:
'@pkgjs/parseargs@0.11.0':
optional: true
'@publint/pack@0.1.2':
optional: true
'@quansync/fs@0.1.5':
dependencies:
quansync: 0.2.11
@@ -5462,6 +5482,9 @@ snapshots:
dompurify: 3.1.7
marked: 14.0.0
mri@1.2.0:
optional: true
ms@2.1.3: {}
nanoid@3.3.11: {}
@@ -5576,6 +5599,14 @@ snapshots:
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: {}
quansync@0.2.11: {}
@@ -5716,6 +5747,11 @@ snapshots:
dependencies:
queue-microtask: 1.2.3
sade@1.8.1:
dependencies:
mri: 1.2.0
optional: true
safe-regex-test@1.1.0:
dependencies:
call-bound: 1.0.4
@@ -5857,7 +5893,7 @@ snapshots:
dependencies:
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:
ansis: 4.2.0
cac: 6.7.14
@@ -5874,6 +5910,7 @@ snapshots:
tree-kill: 1.2.2
unconfig: 7.3.3
optionalDependencies:
publint: 0.3.14
typescript: 5.9.3
transitivePeerDependencies:
- '@ts-macro/tsc'

View File

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