Skip to content

Commit 2b6a963

Browse files
author
taojiu
committed
refactor(packages): 升级react18、使用pnpm、vite、vitest及相关依赖
1 parent 779fa1c commit 2b6a963

File tree

178 files changed

+7830
-6124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+7830
-6124
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ deploy-space/.env
1515
# IDE
1616
.vscode
1717
.idea
18+
.npmrc
1819

1920
# Logs
2021
logs

babel.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

deploy-space/lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "independent",
3-
"npmClient": "yarn",
3+
"npmClient": "pnpm",
44
"registry": "http://registry.npm.alibaba-inc.com",
55
"useWorkspaces": true,
66
"packages": [

package.json

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,26 @@
1111
]
1212
},
1313
"scripts": {
14-
"build": "./scripts/build.sh",
14+
"build": "sh ./scripts/build.sh",
1515
"build:npm": "lerna run build --stream",
16-
"build:umd": "lerna run build:umd --stream",
1716
"clean": "rimraf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
1817
"clean:lib": "rimraf ./node_modules",
1918
"lint": "f2elint scan -q -i ./packages/*/src",
2019
"lint:fix": "f2elint fix -i ./packages/*/src",
2120
"lint:modules": "f2elint scan -q -i ./modules/*/src",
2221
"lint:modules:fix": "f2elint fix -i ./modules/*/src",
23-
"pub": "npm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog",
24-
"pub:minor": "npm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog",
25-
"pub:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
26-
"pub:premajor": "npm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
27-
"pub:preminor": "npm run watchdog:build && lerna publish preminor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
28-
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",
29-
"pub:prerelease": "npm run watchdog:build && lerna publish prerelease --yes --force-publish --exact --dist-tag beta --preid beta --no-changelog",
22+
"pub": "pnpm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog",
23+
"pub:minor": "pnpm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog",
24+
"pub:major": "pnpm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
25+
"pub:premajor": "pnpm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
26+
"pub:preminor": "pnpm run watchdog:build && lerna publish preminor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
27+
"pub:prepatch": "pnpm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",
28+
"pub:prerelease": "pnpm run watchdog:build && lerna publish prerelease --yes --force-publish --exact --dist-tag beta --preid beta --no-changelog",
3029
"setup": "node ./scripts/setup.js",
31-
"setup:test": "./scripts/setup-for-test.sh",
32-
"setup:skip-build": "./scripts/setup-skip-build.sh",
3330
"start": "node ./scripts/start.js",
34-
"test": "lerna run test --stream",
35-
"test:snapshot": "lerna run test:snapshot",
36-
"watchdog:build": "node ./scripts/watchdog.js",
37-
"sync": "./scripts/sync.sh",
38-
"syncOss": "node ./scripts/sync-oss.js"
31+
"test:ui": "vitest --ui",
32+
"test:cov": "vitest run --coverage",
33+
"watchdog:build": "node ./scripts/watchdog.js"
3934
},
4035
"husky": {
4136
"hooks": {
@@ -44,19 +39,22 @@
4439
}
4540
},
4641
"devDependencies": {
47-
"@alilc/build-plugin-lce": "^0.0.5",
48-
"@alilc/lowcode-test-mate": "^1.0.1",
49-
"@babel/plugin-proposal-decorators": "^7.24.7",
50-
"@types/react-router": "5.1.18",
51-
"babel-jest": "^29",
5242
"del": "^6.1.1",
5343
"execa": "^5.1.1",
5444
"f2elint": "^4.8.0",
5545
"gulp": "^4.0.2",
5646
"husky": "^7.0.4",
5747
"lerna": "^8.1.9",
58-
"rimraf": "^3.0.2",
59-
"typescript": "5.6.3"
48+
"rimraf": "^6.0.1",
49+
"typescript": "5.6.3",
50+
"@vitest/ui": "^2.1.8",
51+
"jsdom": "^25.0.1",
52+
"@testing-library/react": "16.1.0",
53+
"@testing-library/dom": "^10.4.0",
54+
"vite": "^6.0.1",
55+
"vite-plugin-dts": "^4.3.0",
56+
"@vitejs/plugin-react-swc": "3.7.1",
57+
"vitest": "^2.1.8"
6058
},
6159
"resolutions": {
6260
"typescript": "5.6.3",

packages/designer/babel.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/designer/build.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/designer/build.test.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/designer/jest.config.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/designer/package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,36 @@
22
"name": "@felce/lowcode-designer",
33
"version": "1.4.1",
44
"description": "Designer for Ali LowCode Engine",
5-
"main": "lib/index.js",
6-
"module": "es/index.js",
75
"files": [
8-
"lib",
9-
"es"
6+
"dist"
107
],
8+
"main": "src/index.ts",
9+
"module": "src/index.ts",
1110
"scripts": {
12-
"build": "build-scripts build",
13-
"test": "build-scripts test --config build.test.json",
14-
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
11+
"build": "vite build",
12+
"test": "vitest",
13+
"test:cov": "vitest run --coverage"
1514
},
1615
"license": "MIT",
1716
"dependencies": {
1817
"@felce/lowcode-editor-core": "1.4.1",
1918
"@felce/lowcode-types": "1.4.1",
2019
"@felce/lowcode-utils": "1.4.1",
21-
"classnames": "^2.2.6",
20+
"classnames": "^2.5.1",
2221
"react": "^18.3.1",
2322
"react-dom": "^18.3.1",
2423
"ric-shim": "^1.0.1",
2524
"semver": "^7.3.5"
2625
},
2726
"devDependencies": {
28-
"@alib/build-scripts": "^0.1.29",
2927
"@testing-library/react": "^16.0.1",
30-
"@types/classnames": "^2.2.7",
3128
"@types/enzyme": "^3.10.12",
3229
"@types/jest": "^29",
3330
"@types/lodash": "^4.14.165",
3431
"@types/medium-editor": "^5.0.3",
3532
"@types/node": "^18",
36-
"@types/react": "^18",
37-
"@types/react-dom": "^18",
33+
"@types/react": "^18.3.1",
34+
"@types/react-dom": "^18.3.1",
3835
"@types/semver": "7.3.9",
3936
"enzyme": "^3.11.0",
4037
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
@@ -45,7 +42,9 @@
4542
},
4643
"publishConfig": {
4744
"access": "public",
48-
"registry": "https://registry.npmjs.org/"
45+
"registry": "https://registry.npmjs.org/",
46+
"main": "dist/index.umd.js",
47+
"module": "dist/index.es.js"
4948
},
5049
"repository": {
5150
"type": "http",

packages/designer/src/builtin-simulator/host.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ export interface DeviceStyleProps {
8383
viewport?: object;
8484
}
8585

86+
export type DesignerModeType = 'live' | 'design' | 'preview' | 'extend' | 'border';
87+
8688
export interface BuiltinSimulatorProps {
8789
// 从 documentModel 上获取
8890
// suspended?: boolean;
89-
designMode?: 'live' | 'design' | 'preview' | 'extend' | 'border';
91+
designMode?: DesignerModeType;
9092
device?: 'mobile' | 'iphone' | string;
9193
deviceClassName?: string;
9294
environment?: Asset;

0 commit comments

Comments
 (0)