From 3884730c4e8e3eccfbe2406e4171f761c38af4c3 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Dec 2024 09:12:34 +0800 Subject: [PATCH] chore(auto-import): use Rslib to build (#13249) --- packages/vant-auto-import-resolver/build.js | 1 - .../vant-auto-import-resolver/package.json | 20 ++- .../vant-auto-import-resolver/rslib.config.ts | 8 + packages/vant-compat/build.js | 1 - packages/vant-compat/package.json | 2 +- pnpm-lock.yaml | 145 ++++++++++++++++-- 6 files changed, 149 insertions(+), 28 deletions(-) delete mode 100644 packages/vant-auto-import-resolver/build.js create mode 100644 packages/vant-auto-import-resolver/rslib.config.ts delete mode 100644 packages/vant-compat/build.js diff --git a/packages/vant-auto-import-resolver/build.js b/packages/vant-auto-import-resolver/build.js deleted file mode 100644 index f696cf294..000000000 --- a/packages/vant-auto-import-resolver/build.js +++ /dev/null @@ -1 +0,0 @@ -require('../vant-use/build'); diff --git a/packages/vant-auto-import-resolver/package.json b/packages/vant-auto-import-resolver/package.json index 559eff46e..d254b8abd 100644 --- a/packages/vant-auto-import-resolver/package.json +++ b/packages/vant-auto-import-resolver/package.json @@ -1,15 +1,16 @@ { "name": "@vant/auto-import-resolver", "version": "1.2.1", + "type": "module", "description": "Vant auto import resolver based on unplugin-vue-components", - "main": "dist/index.cjs.js", - "module": "dist/index.esm.mjs", + "main": "dist/index.cjs", + "module": "dist/index.js", "typings": "dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/index.esm.mjs", - "require": "./dist/index.cjs.js" + "import": "./dist/index.js", + "require": "./dist/index.cjs" } }, "sideEffects": false, @@ -17,13 +18,10 @@ "dist" ], "scripts": { - "clean": "rimraf ./dist", - "dev": "node ./build.js -w", - "build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly", - "build:bundle": "node ./build.js", - "build": "pnpm clean && pnpm build:bundle && pnpm build:types", + "dev": "rslib dev", + "build": "rslib build", "release": "vant-cli release", - "prepare": "pnpm build" + "prepublishOnly": "pnpm build" }, "publishConfig": { "access": "public", @@ -39,7 +37,7 @@ "author": "chenjiahan", "license": "MIT", "devDependencies": { - "rimraf": "^6.0.1", + "@rslib/core": "^0.1.3", "typescript": "^5.7.2" } } diff --git a/packages/vant-auto-import-resolver/rslib.config.ts b/packages/vant-auto-import-resolver/rslib.config.ts new file mode 100644 index 000000000..3542eef72 --- /dev/null +++ b/packages/vant-auto-import-resolver/rslib.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from '@rslib/core'; + +export default defineConfig({ + lib: [ + { format: 'esm', syntax: 'es2021', dts: true }, + { format: 'cjs', syntax: 'es2021' }, + ], +}); diff --git a/packages/vant-compat/build.js b/packages/vant-compat/build.js deleted file mode 100644 index f696cf294..000000000 --- a/packages/vant-compat/build.js +++ /dev/null @@ -1 +0,0 @@ -require('../vant-use/build'); diff --git a/packages/vant-compat/package.json b/packages/vant-compat/package.json index 479b9dba6..fc0f149a8 100644 --- a/packages/vant-compat/package.json +++ b/packages/vant-compat/package.json @@ -33,7 +33,7 @@ "author": "chenjiahan", "license": "MIT", "devDependencies": { - "@rslib/core": "^0.1.1", + "@rslib/core": "^0.1.3", "@vue/runtime-core": "^3.5.13", "typescript": "^5.7.2", "vant": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b2cec8f4..fefa3b6f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -139,9 +139,9 @@ importers: packages/vant-auto-import-resolver: devDependencies: - rimraf: - specifier: ^6.0.1 - version: 6.0.1 + '@rslib/core': + specifier: ^0.1.3 + version: 0.1.3(typescript@5.7.2) typescript: specifier: ^5.7.2 version: 5.7.2 @@ -288,8 +288,8 @@ importers: packages/vant-compat: devDependencies: '@rslib/core': - specifier: ^0.1.1 - version: 0.1.1(typescript@5.7.2) + specifier: ^0.1.3 + version: 0.1.3(typescript@5.7.2) '@vue/runtime-core': specifier: ^3.5.13 version: 3.5.13 @@ -1014,6 +1014,11 @@ packages: engines: {node: '>=16.7.0'} hasBin: true + '@rsbuild/core@1.1.9': + resolution: {integrity: sha512-mHZveEwlTtW9nxWa+T0xUm6ssm+HkDYZ0NENLfWMUmsL0LjMJrpQzRlbD+p5+9Uf+KXUo3Dbtv0ScA+p7cuGTg==} + engines: {node: '>=16.7.0'} + hasBin: true + '@rsbuild/plugin-babel@1.0.3': resolution: {integrity: sha512-3S/ykXv7KRo0FxVpkjoHFUwB04nKINIET1kuv4xiRaDmeww1Tp0wl9h4u8a7d7gU/4FllyoUflY8TVhci/o05g==} peerDependencies: @@ -1042,8 +1047,8 @@ packages: peerDependencies: '@rsbuild/core': 1.x - '@rslib/core@0.1.1': - resolution: {integrity: sha512-D/zCLzhNNM7DkuR/XNVFyB9er8OpmBpSJZQYeQgjuShg+JtXTWYX/DbmTniHpeO9B0ydMFS84WFO9ZAzGlDd6A==} + '@rslib/core@0.1.3': + resolution: {integrity: sha512-M4P5KSGKWJZyB0zIMeHTBXqk9Uk7ZQB9fxxd8JJFMYhCiTBkx0zoA69XICyjFzgKLQ6sEGfbISnXNPLuLLgflg==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: @@ -1060,49 +1065,97 @@ packages: cpu: [arm64] os: [darwin] + '@rspack/binding-darwin-arm64@1.1.5': + resolution: {integrity: sha512-eEynmyPPl+OGYQ9LRFwiQosyRfcca3OQB73akqY4mqDRl39OyiBjq7347DLHJysgbm9z+B1bsiLuh2xc6mdclQ==} + cpu: [arm64] + os: [darwin] + '@rspack/binding-darwin-x64@1.1.4': resolution: {integrity: sha512-ECmcTJecXwqhqqpOjfjIcwDp8UqJ3D1Crc2COG+wUfwejtbqs9twUTaufZz7U7xna+oyfJ4GRNSKS9xs4N2kPQ==} cpu: [x64] os: [darwin] + '@rspack/binding-darwin-x64@1.1.5': + resolution: {integrity: sha512-I6HPRgogewU5v1OKe3noEzq2U1FCEYAbW+smy+lPvpTW+3X6PlVMzTT4oelhB0EXDQ+KxjXH9KpOKON1hg/JGg==} + cpu: [x64] + os: [darwin] + '@rspack/binding-linux-arm64-gnu@1.1.4': resolution: {integrity: sha512-QVRFV6+z1DopeGn8rLRbBNrWXuBvp7J19lTtvx9F5mItzTiBVHmNqFt31namm59xkhHJ3leng7l2F39qcOMOIA==} cpu: [arm64] os: [linux] + '@rspack/binding-linux-arm64-gnu@1.1.5': + resolution: {integrity: sha512-LQnqucNa6Dr6y3By+/M2ARO4jDR3AM+PuCsHgzlYT0RDRLS+Ow3f50WbNBf7eI/DhrEA0aucYL3sz1ljguB3EA==} + cpu: [arm64] + os: [linux] + '@rspack/binding-linux-arm64-musl@1.1.4': resolution: {integrity: sha512-UCateQWfEpEyFOC/tkuicXpIm81s5DavcwKjX3wwh1JB/KO6UxGHK8F75BV4K3Coo/UEiNCvL8xrB7eDjMDwYg==} cpu: [arm64] os: [linux] + '@rspack/binding-linux-arm64-musl@1.1.5': + resolution: {integrity: sha512-b9L/9HJxrWY4cezPWqgj28I9Xe2XxwLHu8x0CMGobwF2XKR0QQVLAst38RW/EusJ8TURdyvNEOuRZlWEIJuYOw==} + cpu: [arm64] + os: [linux] + '@rspack/binding-linux-x64-gnu@1.1.4': resolution: {integrity: sha512-Nz5Bt1PDxebVRU321h9AGkLRQL5n9Xgt+rluWAXLVtyxM9aPavmvu1n6/G9stXwQdnUVrZIUs7EzhIhWBe5R/A==} cpu: [x64] os: [linux] + '@rspack/binding-linux-x64-gnu@1.1.5': + resolution: {integrity: sha512-0az52ZXTg/ErCGC1v/oFLWByKAiXvng4euv+prwMWF6p1pA7lfLRLzdibDFO4KgC16Zlfcg3hqs7YikLng4x+w==} + cpu: [x64] + os: [linux] + '@rspack/binding-linux-x64-musl@1.1.4': resolution: {integrity: sha512-1XG795a+M4vE7JLyeDa1oktr4WU/I5IQ9d8Vk3PVtF59IxnKpjOb3vdGhXP7Ke2zWP6C2YQzWotez6AbO3uWeA==} cpu: [x64] os: [linux] + '@rspack/binding-linux-x64-musl@1.1.5': + resolution: {integrity: sha512-EF/LJTtCTkuti2gJnCyvXHC5Q2L5M4+RXm5kj9Bfu/t0Zmmfe6Jd5QUsifgogioeL0ZsH/Pou5QiiVcOFcqFKQ==} + cpu: [x64] + os: [linux] + '@rspack/binding-win32-arm64-msvc@1.1.4': resolution: {integrity: sha512-1hXOgHxnrBmjBNUluy9MbFMQi4lnAS199JD5UHRc2mx5i+D8cjAiBsWHzIcK4xzsxu2IYgVGsJcdIA8/zV/PVQ==} cpu: [arm64] os: [win32] + '@rspack/binding-win32-arm64-msvc@1.1.5': + resolution: {integrity: sha512-VEqhK6HwIHby6gtOkxIx66SkqYndiaP1ddZ3X39RLE40TY3KlNgfG/SzbN9J5Qb+8jjq3ogV8n50+wLEGkhiWw==} + cpu: [arm64] + os: [win32] + '@rspack/binding-win32-ia32-msvc@1.1.4': resolution: {integrity: sha512-Jfq6gF5QKOYZsgDYRx+fWipDHmtHxq6jniws1WAE8F5w1qIt/dAHzW3a6+3VwCih9lQEEH3Rimy/ECB0oergng==} cpu: [ia32] os: [win32] + '@rspack/binding-win32-ia32-msvc@1.1.5': + resolution: {integrity: sha512-Yi2BwYehc5/sRVgI7zTGYJKjnV8UszAJt/stWdFHaq82chHiuuF/tQd1WcBUq0Iin9ylBMo16mRJAuFkFmJ74Q==} + cpu: [ia32] + os: [win32] + '@rspack/binding-win32-x64-msvc@1.1.4': resolution: {integrity: sha512-d9HUGVfNFhB+r32kDPkzHeMmgwemTFsDymnWJUgUrojzTJ326JrDmEXVeCnAHfwBSC9w4/mp4H+4iGhIdKSo9w==} cpu: [x64] os: [win32] + '@rspack/binding-win32-x64-msvc@1.1.5': + resolution: {integrity: sha512-4UArXYqJO1Ni7TmCw1T11JnrwfpoThDdiQ9k1P1voBWK3bDahPEBOptk9ZPu2+ZuRX8hFrvumRKkLY3oy7fTMw==} + cpu: [x64] + os: [win32] + '@rspack/binding@1.1.4': resolution: {integrity: sha512-XdR/4DACpLqNjxEw+ikg5FN2dQbOAxj7fDlndNio0l+m8ThPiIsetkJ2FNSlxt/K4SVnIrwAkhE5kabVNKR4EA==} + '@rspack/binding@1.1.5': + resolution: {integrity: sha512-RsSkgi56Q5XUXut0qweLSE1C4Ogcm7g/ueKoOgsbHAYVKrCs9/dTFlPHWSIAaI7QWh0GWEePR/MM2O2HIu+1rw==} + '@rspack/core@1.1.4': resolution: {integrity: sha512-JUU1pS11TY3/MwnezBfLLp3+7zfkd4Adzo8Pv4f4R1KoJyX1FYBFBcKnfZBlaGYi2C2e5ZDrrHxQlrPmygjbuw==} engines: {node: '>=16.0.0'} @@ -1112,6 +1165,15 @@ packages: '@swc/helpers': optional: true + '@rspack/core@1.1.5': + resolution: {integrity: sha512-/FmxDeMuW8fJkhz8fHuCu7OiJHFKW78xclEu7LkEujWl4PqJgdWjUL/6FWIj50spRwj6PRfuc31hFSL4hbNfCA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@swc/helpers': '>=0.5.1' + peerDependenciesMeta: + '@swc/helpers': + optional: true + '@rspack/lite-tapable@1.0.1': resolution: {integrity: sha512-VynGOEsVw2s8TAlLf/uESfrgfrq2+rcXB1muPJYBWbsm1Oa6r5qVQhjA5ggM6z/coYPrsVMgovl3Ff7Q7OCp1w==} engines: {node: '>=16.0.0'} @@ -2474,8 +2536,8 @@ packages: rrweb-cssom@0.7.1: resolution: {integrity: sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==} - rsbuild-plugin-dts@0.1.1: - resolution: {integrity: sha512-pm0tVPioQGaF8O50S9j51oAjIVfM0Sn0+BteZ1TIv5t3cBdQmI9dmd15YJERrwsZAAUPAtuwIWM1TmEGH2m4zQ==} + rsbuild-plugin-dts@0.1.3: + resolution: {integrity: sha512-a2O1U7LnzW9+53A7+DXvGhAgmZdmi07Cu12CkCcP9uMcOu5dnFR5JlFPVCN/se5P9h32bGnUJ0bKqR8UrLmJxA==} engines: {node: '>=16.0.0'} peerDependencies: '@microsoft/api-extractor': ^7 @@ -3650,6 +3712,13 @@ snapshots: '@swc/helpers': 0.5.15 core-js: 3.39.0 + '@rsbuild/core@1.1.9': + dependencies: + '@rspack/core': 1.1.5(@swc/helpers@0.5.15) + '@rspack/lite-tapable': 1.0.1 + '@swc/helpers': 0.5.15 + core-js: 3.39.0 + '@rsbuild/plugin-babel@1.0.3(@rsbuild/core@1.1.7)': dependencies: '@babel/core': 7.26.0 @@ -3703,10 +3772,10 @@ snapshots: - vue - webpack-cli - '@rslib/core@0.1.1(typescript@5.7.2)': + '@rslib/core@0.1.3(typescript@5.7.2)': dependencies: - '@rsbuild/core': 1.1.7 - rsbuild-plugin-dts: 0.1.1(@rsbuild/core@1.1.7)(typescript@5.7.2) + '@rsbuild/core': 1.1.9 + rsbuild-plugin-dts: 0.1.3(@rsbuild/core@1.1.9)(typescript@5.7.2) tinyglobby: 0.2.10 optionalDependencies: typescript: 5.7.2 @@ -3714,30 +3783,57 @@ snapshots: '@rspack/binding-darwin-arm64@1.1.4': optional: true + '@rspack/binding-darwin-arm64@1.1.5': + optional: true + '@rspack/binding-darwin-x64@1.1.4': optional: true + '@rspack/binding-darwin-x64@1.1.5': + optional: true + '@rspack/binding-linux-arm64-gnu@1.1.4': optional: true + '@rspack/binding-linux-arm64-gnu@1.1.5': + optional: true + '@rspack/binding-linux-arm64-musl@1.1.4': optional: true + '@rspack/binding-linux-arm64-musl@1.1.5': + optional: true + '@rspack/binding-linux-x64-gnu@1.1.4': optional: true + '@rspack/binding-linux-x64-gnu@1.1.5': + optional: true + '@rspack/binding-linux-x64-musl@1.1.4': optional: true + '@rspack/binding-linux-x64-musl@1.1.5': + optional: true + '@rspack/binding-win32-arm64-msvc@1.1.4': optional: true + '@rspack/binding-win32-arm64-msvc@1.1.5': + optional: true + '@rspack/binding-win32-ia32-msvc@1.1.4': optional: true + '@rspack/binding-win32-ia32-msvc@1.1.5': + optional: true + '@rspack/binding-win32-x64-msvc@1.1.4': optional: true + '@rspack/binding-win32-x64-msvc@1.1.5': + optional: true + '@rspack/binding@1.1.4': optionalDependencies: '@rspack/binding-darwin-arm64': 1.1.4 @@ -3750,6 +3846,18 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.1.4 '@rspack/binding-win32-x64-msvc': 1.1.4 + '@rspack/binding@1.1.5': + optionalDependencies: + '@rspack/binding-darwin-arm64': 1.1.5 + '@rspack/binding-darwin-x64': 1.1.5 + '@rspack/binding-linux-arm64-gnu': 1.1.5 + '@rspack/binding-linux-arm64-musl': 1.1.5 + '@rspack/binding-linux-x64-gnu': 1.1.5 + '@rspack/binding-linux-x64-musl': 1.1.5 + '@rspack/binding-win32-arm64-msvc': 1.1.5 + '@rspack/binding-win32-ia32-msvc': 1.1.5 + '@rspack/binding-win32-x64-msvc': 1.1.5 + '@rspack/core@1.1.4(@swc/helpers@0.5.15)': dependencies: '@module-federation/runtime-tools': 0.5.1 @@ -3759,6 +3867,15 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.15 + '@rspack/core@1.1.5(@swc/helpers@0.5.15)': + dependencies: + '@module-federation/runtime-tools': 0.5.1 + '@rspack/binding': 1.1.5 + '@rspack/lite-tapable': 1.0.1 + caniuse-lite: 1.0.30001664 + optionalDependencies: + '@swc/helpers': 0.5.15 + '@rspack/lite-tapable@1.0.1': {} '@swc/helpers@0.5.15': @@ -5308,9 +5425,9 @@ snapshots: rrweb-cssom@0.7.1: {} - rsbuild-plugin-dts@0.1.1(@rsbuild/core@1.1.7)(typescript@5.7.2): + rsbuild-plugin-dts@0.1.3(@rsbuild/core@1.1.9)(typescript@5.7.2): dependencies: - '@rsbuild/core': 1.1.7 + '@rsbuild/core': 1.1.9 magic-string: 0.30.14 picocolors: 1.1.1 tinyglobby: 0.2.10