Skip to content

Commit 7642ca8

Browse files
ianzoneyoyo837
andauthored
chore: rm rollup-plugin-ts (#17992)
* chore: rm rollup-plugin-ts * feat(taro-cli): node version warn * Update packages/taro-platform-harmony-cpp/tsconfig.json Co-authored-by: Amumu <[email protected]> --------- Co-authored-by: Amumu <[email protected]>
1 parent bd2e191 commit 7642ca8

File tree

13 files changed

+173
-180
lines changed

13 files changed

+173
-180
lines changed

examples/blended-taro-component-vue3/taro-project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@tarojs/test-utils-vue3": "^0.1.1",
4949
"@tarojs/webpack5-runner": "3.6.24",
5050
"@types/jest": "^29.3.1",
51-
"@types/node": "^18.15.11",
51+
"@types/node": "^18",
5252
"@types/webpack-env": "^1.13.6",
5353
"@typescript-eslint/eslint-plugin": "^6.2.0",
5454
"@typescript-eslint/parser": "^6.2.0",

examples/mini-program-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181
"typescript": "^4.1.0",
8282
"postcss": "^8.4.38",
8383
"ts-node": "^10.9.1",
84-
"@types/node": "^18.15.11"
84+
"@types/node": "^18"
8585
}
8686
}

examples/taro-list/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"tsconfig-paths-webpack-plugin": "^4.1.0",
8383
"postcss": "^8.4.38",
8484
"ts-node": "^10.9.1",
85-
"@types/node": "^18.15.11",
85+
"@types/node": "^18",
8686
"@types/jest": "^29.3.1",
8787
"jest": "^29.3.1",
8888
"jest-environment-jsdom": "^29.5.0"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"@types/webpack-dev-server": "^3.11.3",
109109
"@typescript-eslint/eslint-plugin": "^7.8.0",
110110
"@typescript-eslint/parser": "^7.8.0",
111-
"@vitest/coverage-istanbul": "^3.2.3",
111+
"@vitest/coverage-istanbul": "^3.2.4",
112112
"babel-jest": "^29.7.0",
113113
"babel-plugin-syntax-jsx": "6.18.0",
114114
"babel-preset-power-assert": "3.0.0",
@@ -163,7 +163,7 @@
163163
"ts-node": "^10.9.1",
164164
"tslib": "^2.6.2",
165165
"typescript": "~5.4.5",
166-
"vitest": "^3.2.3"
166+
"vitest": "^3.2.4"
167167
},
168168
"pnpm": {
169169
"packageExtensions": {

packages/taro-cli/src/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ const DEFAULT_FRAMEWORK = 'react'
1212

1313
export default class CLI {
1414
appPath: string
15-
constructor(appPath) {
15+
constructor(appPath?: string) {
1616
this.appPath = appPath || process.cwd()
17+
const majorVersion = parseInt(process.version.substring(1).split('.')[0], 10)
18+
if (majorVersion < 20) {
19+
console.warn('Taro 将不再支持 Node.js 小于 20 的版本。请升级 Node.js 至 20 或更高版本。')
20+
}
1721
}
1822

1923
run () {

packages/taro-cli/templates/plugin-compile/package.json.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"unzip": "^0.1.11"{{/if}}
3636
},
3737
"devDependencies": {
38-
"@types/node": "^18.15.11"
38+
"@types/node": "^18"
3939
}{{#if (eq pluginType "plugin-template") }},
4040
"resolutions": {
4141
"graceful-fs": "^4.2.11"

packages/taro-platform-harmony-cpp/package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,12 @@
3030
"dev": "pnpm run rollup -w",
3131
"ohpm-publish": "pnpm run tsx --files ./scripts/ohpm-publish",
3232
"remove:reference": "pnpm run tsx --files ./scripts/reference",
33-
"rollup": "rollup --config rollup.config.mts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
33+
"rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
3434
"tsx": "ts-node --skipIgnore"
3535
},
3636
"dependencies": {
3737
"@babel/core": "^7.24.7",
3838
"@babel/preset-env": "^7.24.4",
39-
"@rollup/plugin-alias": "^5.1.0",
40-
"@rollup/plugin-commonjs": "^25.0.8",
41-
"@rollup/plugin-json": "^6.1.0",
42-
"@rollup/plugin-node-resolve": "^15.2.3",
43-
"@rollup/plugin-replace": "^5.0.7",
4439
"@tarojs/parse-css-to-stylesheet": "^1.1.8",
4540
"@tarojs/react": "workspace:*",
4641
"@tarojs/runner-utils": "workspace:*",
@@ -49,13 +44,15 @@
4944
"react": "^18.3.1",
5045
"react-dom": "^18.3.1",
5146
"react-reconciler": "0.29.0",
52-
"rollup": "^3.29.4",
53-
"rollup-plugin-dts": "^6.1.1",
54-
"rollup-plugin-node-externals": "^5.1.3",
55-
"rollup-plugin-ts": "^3.4.5",
5647
"scheduler": "^0.23.2"
5748
},
5849
"devDependencies": {
50+
"rollup": "^3.29.4",
51+
"rollup-plugin-dts": "^6.2.1",
52+
"rollup-plugin-node-externals": "^5.1.3",
53+
"@rollup/plugin-commonjs": "^25.0.8",
54+
"@rollup/plugin-json": "^6.1.0",
55+
"@rollup/plugin-node-resolve": "^15.2.3",
5956
"@rollup/plugin-typescript": "^11.1.6",
6057
"@tarojs/components": "workspace:*",
6158
"@tarojs/helper": "workspace:*",
@@ -66,7 +63,6 @@
6663
"@tarojs/shared": "workspace:*",
6764
"@tarojs/taro": "workspace:*",
6865
"@tarojs/vite-runner": "workspace:*",
69-
"@types/node": "^18.19.34",
7066
"@types/conventional-commits-parser": "^3.0.0",
7167
"conventional-commits-parser": "^3.0.0",
7268
"postcss": "^8.4.38",

packages/taro-platform-harmony-cpp/rollup.config.mts renamed to packages/taro-platform-harmony-cpp/rollup.config.ts

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
import { join } from 'node:path'
2-
31
import common from '@rollup/plugin-commonjs'
42
import json from '@rollup/plugin-json'
53
import { nodeResolve } from '@rollup/plugin-node-resolve'
4+
import ts from '@rollup/plugin-typescript'
65
import fg from 'fast-glob'
76
import { type InputPluginOption, type RollupOptions, defineConfig } from 'rollup'
87
import copy from 'rollup-plugin-copy'
8+
import dts from 'rollup-plugin-dts'
99
import externals from 'rollup-plugin-node-externals'
10-
import ts from 'rollup-plugin-ts'
11-
12-
const cwd = __dirname
1310

1411
// 供 CLI 编译时使用的 Taro 插件入口
1512
const compileConfig: RollupOptions = {
1613
external: [
1714
/^@(system\.|ohos\.|hmscore\/|jd-oh|taro-oh\/)/,
1815
],
19-
input: join(cwd, 'src/index.ts'),
16+
input: 'src/index.ts',
2017
output: {
21-
file: join(cwd, 'dist/index.js'),
18+
file: 'dist/index.js',
2219
format: 'cjs',
2320
sourcemap: false,
2421
exports: 'named'
@@ -52,9 +49,9 @@ const compileConfig: RollupOptions = {
5249
}
5350

5451
const apiConfig: RollupOptions = {
55-
input: join(cwd, 'src/runtime/apis/index.ts'),
52+
input: 'src/runtime/apis/index.ts',
5653
output: {
57-
file: join(cwd, 'dist/runtime/apischunk/index.js'),
54+
file: 'dist/runtime/apischunk/index.js',
5855
format: 'esm',
5956
sourcemap: false,
6057
exports: 'named'
@@ -70,16 +67,26 @@ const apiConfig: RollupOptions = {
7067
nodeResolve({
7168
preferBuiltins: false
7269
}),
73-
ts({
74-
transpileOnly: true,
75-
tsconfig: e => ({
76-
...e,
77-
declaration: true,
78-
})
79-
}),
70+
ts(),
8071
common(),
8172
json(),
8273
]
8374
}
8475

85-
export default defineConfig([compileConfig, apiConfig])
76+
const dtsConfigCjs: RollupOptions = {
77+
input: 'src/index.ts',
78+
output: {
79+
file: 'dist/index.d.ts',
80+
},
81+
plugins: [dts()],
82+
}
83+
84+
const dtsConfigEsm: RollupOptions = {
85+
input: 'src/runtime/apis/index.ts',
86+
output: {
87+
file: 'dist/runtime/apischunk/index.d.ts',
88+
},
89+
plugins: [dts()],
90+
}
91+
92+
export default defineConfig([compileConfig, apiConfig, dtsConfigCjs, dtsConfigEsm])

packages/taro-platform-harmony-cpp/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"strictNullChecks": true,
1919
"target": "ES2021"
2020
},
21-
"include": ["./scripts", "./src", "./types", "./cpp/types", "./rollup.config.mts"],
21+
"include": ["./scripts", "./src", "./types", "./cpp/types", "./rollup.config.ts"],
2222
"ts-node": {
2323
"compilerOptions": {
2424
"forceConsistentCasingInFileNames": true,

packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,10 @@
23282328
},
23292329
"lifestyle": false,
23302330
"like": false,
2331+
"list": {
2332+
"upper-threshold-count": false,
2333+
"lower-threshold-count": false
2334+
},
23312335
"list-builder": {
23322336
"type": {
23332337
"static": false,
@@ -2338,6 +2342,7 @@
23382342
"child-height": false,
23392343
"padding": false
23402344
},
2345+
"list-item": false,
23412346
"list-view": {
23422347
"padding": false
23432348
},

0 commit comments

Comments
 (0)