Skip to content

Commit 54583db

Browse files
authored
Merge pull request #638 from lowcoder-org/dev
Dev - update branch
2 parents a5d099b + e616845 commit 54583db

File tree

411 files changed

+9339
-6766
lines changed

Some content is hidden

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

411 files changed

+9339
-6766
lines changed

.DS_Store

2 KB
Binary file not shown.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Lowcoder CLI
5+
6+
on:
7+
push:
8+
branches: [ "dev" ]
9+
10+
jobs:
11+
publish-package:
12+
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Check version changes
19+
uses: EndBug/version-check@v1
20+
id: check
21+
with:
22+
diff-search: true
23+
static-checking: localIsNew
24+
file-name: client/packages/lowcoder-cli/package.json
25+
file-url: https://unpkg.com/lowcoder-cli@latest/package.json
26+
27+
- name: Version update detected
28+
if: steps.check.outputs.changed == 'true'
29+
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
30+
31+
- name: Set up Node.js for NPM
32+
if: steps.check.outputs.changed == 'true'
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
registry-url: https://registry.npmjs.org/
37+
38+
- name: Install dependencies
39+
if: steps.check.outputs.changed == 'true'
40+
uses: borales/actions-yarn@v4.2.0
41+
with:
42+
cmd: install
43+
dir: client/packages/lowcoder-cli
44+
45+
- name: Publish package to NPM
46+
if: steps.check.outputs.changed == 'true'
47+
run: npm publish
48+
working-directory: client/packages/lowcoder-cli
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.LOWCODERNPMBOT }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Lowcoder Comps
5+
6+
on:
7+
push:
8+
branches: [ "dev" ]
9+
10+
jobs:
11+
publish-package:
12+
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Check version changes
19+
uses: EndBug/version-check@v1
20+
id: check
21+
with:
22+
diff-search: true
23+
static-checking: localIsNew
24+
file-name: client/packages/lowcoder-comps/package.json
25+
file-url: https://unpkg.com/lowcoder-comps@latest/package.json
26+
27+
- name: Version update detected
28+
if: steps.check.outputs.changed == 'true'
29+
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
30+
31+
- name: Set up Node.js for NPM
32+
if: steps.check.outputs.changed == 'true'
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
registry-url: https://registry.npmjs.org/
37+
38+
- name: Install dependencies
39+
if: steps.check.outputs.changed == 'true'
40+
uses: borales/actions-yarn@v4.2.0
41+
with:
42+
cmd: install
43+
dir: client/packages/lowcoder-comps
44+
45+
- name: Publish
46+
if: steps.check.outputs.changed == 'true'
47+
uses: borales/actions-yarn@v4.2.0
48+
with:
49+
cmd: build_publish
50+
dir: client/packages/lowcoder-comps
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.LOWCODERNPMBOT }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Lowcoder Core
5+
6+
on:
7+
push:
8+
branches: [ "dev" ]
9+
10+
jobs:
11+
publish-package:
12+
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Check version changes
19+
uses: EndBug/version-check@v1
20+
id: check
21+
with:
22+
diff-search: true
23+
static-checking: localIsNew
24+
file-name: client/packages/lowcoder-core/package.json
25+
file-url: https://unpkg.com/lowcoder-core@latest/package.json
26+
27+
- name: Version update detected
28+
if: steps.check.outputs.changed == 'true'
29+
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
30+
31+
- name: Set up Node.js for NPM
32+
if: steps.check.outputs.changed == 'true'
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
registry-url: https://registry.npmjs.org/
37+
38+
- name: Install dependencies
39+
if: steps.check.outputs.changed == 'true'
40+
uses: borales/actions-yarn@v4.2.0
41+
with:
42+
cmd: install
43+
dir: client/packages/lowcoder-core
44+
45+
- name: Publish package to NPM
46+
if: steps.check.outputs.changed == 'true'
47+
run: npm publish
48+
working-directory: client/packages/lowcoder-core
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.LOWCODERNPMBOT }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Lowcoder SDK
5+
6+
on:
7+
push:
8+
branches: [ "dev" ]
9+
10+
jobs:
11+
publish-package:
12+
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Check version changes
19+
uses: EndBug/version-check@v1
20+
id: check
21+
with:
22+
diff-search: true
23+
static-checking: localIsNew
24+
file-name: client/packages/lowcoder-sdk/package.json
25+
file-url: https://unpkg.com/lowcoder-sdk@latest/package.json
26+
27+
- name: Version update detected
28+
if: steps.check.outputs.changed == 'true'
29+
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
30+
31+
- name: Set up Node.js for NPM
32+
if: steps.check.outputs.changed == 'true'
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
registry-url: https://registry.npmjs.org/
37+
38+
- name: Install dependencies
39+
if: steps.check.outputs.changed == 'true'
40+
uses: borales/actions-yarn@v4.2.0
41+
with:
42+
cmd: install
43+
dir: client/packages/lowcoder-sdk
44+
45+
- name: Build Package
46+
if: steps.check.outputs.changed == 'true'
47+
uses: borales/actions-yarn@v4.2.0
48+
with:
49+
cmd: build
50+
dir: client/packages/lowcoder-sdk
51+
52+
- name: Publish package to NPM
53+
if: steps.check.outputs.changed == 'true'
54+
run: npm publish
55+
working-directory: client/packages/lowcoder-sdk
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.LOWCODERNPMBOT }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ client/node_modules/
99
client/packages/lowcoder-plugin-demo/.yarn/install-state.gz
1010
client/packages/lowcoder-plugin-demo/yarn.lock
1111
client/packages/lowcoder-plugin-demo/.yarn/cache/@types-node-npm-16.18.68-56f72825c0-094ae9ed80.zip
12+
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ You can access Lowcoder from [cloud-hosted version](https://app.lowcoder.cloud/)
9696
Accelerate the growth of Lowcoder and unleash its potential with your Sponsorship – together, we're shaping the future of Lowcode for everyone!
9797
[Be a Sponsor](https://github.com/sponsors/lowcoder-org)
9898

99-
Like ... @CHSchuepfer. Thank you very much!
99+
Like ... @CHSchuepfer & @spacegoats-io. Thank you very much!!

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dev
1+
dev

client/config/test/jest.config.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import path from "node:path";
2-
import { buildVars } from "../../packages/lowcoder-dev-utils/buildVars.js";
3-
import { currentDirName } from "../../packages/lowcoder-dev-utils/util.js";
1+
import path, { dirname } from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
import { buildVars } from "../../scripts/buildVars.js";
4+
5+
export function currentDirName(importMetaUrl) {
6+
return dirname(fileURLToPath(importMetaUrl));
7+
}
8+
49

510
const globals = {};
611
buildVars.forEach(({ name, defaultValue }) => {
@@ -9,34 +14,34 @@ buildVars.forEach(({ name, defaultValue }) => {
914
const edition = process.env.REACT_APP_EDITION;
1015
const isEEGlobal = edition === "enterprise-global";
1116
const isEE = edition === "enterprise" || isEEGlobal;
12-
const dirname = currentDirName(import.meta.url);
17+
const currentDir = currentDirName(import.meta.url);
1318

1419
export default {
1520
testEnvironment: "jsdom",
1621
moduleNameMapper: {
17-
"react-markdown": path.resolve(dirname, "./mocks/react-markdown.js"),
18-
"\\.md\\?url$": path.resolve(dirname, "./mocks/markdown-url-module.js"),
22+
"react-markdown": path.resolve(currentDir, "./mocks/react-markdown.js"),
23+
"\\.md\\?url$": path.resolve(currentDir, "./mocks/markdown-url-module.js"),
1924
"^@lowcoder-ee(.*)$": path.resolve(
20-
dirname,
25+
currentDir,
2126
isEE ? "../../packages/lowcoder/src/ee/$1" : "../../packages/lowcoder/src/$1"
2227
),
23-
"lowcoder-sdk": path.resolve(dirname, "../../packages/lowcoder/src/index.sdk"),
28+
"lowcoder-sdk": path.resolve(currentDir, "../../packages/lowcoder/src/index.sdk"),
2429
},
2530
globals,
2631
// roots: ["<rootDir>/src"],
2732
modulePaths: [
2833
"<rootDir>/src",
29-
path.resolve(dirname, "../../packages/lowcoder/src"),
30-
path.resolve(dirname, "../../packages/lowcoder-comps/src"),
31-
path.resolve(dirname, "../../packages/lowcoder-design/src"),
34+
path.resolve(currentDir, "../../packages/lowcoder/src"),
35+
path.resolve(currentDir, "../../packages/lowcoder-comps/src"),
36+
path.resolve(currentDir, "../../packages/lowcoder-design/src"),
3237
],
33-
setupFiles: [path.resolve(dirname, "./jest.setup.js")],
34-
setupFilesAfterEnv: [path.resolve(dirname, "./jest.setup-after-env.js")],
38+
setupFiles: [path.resolve(currentDir, "./jest.setup.js")],
39+
setupFilesAfterEnv: [path.resolve(currentDir, "./jest.setup-after-env.js"), 'jest-canvas-mock'],
3540
transform: {
36-
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": path.resolve(dirname, "./transform/babelTransform.js"),
37-
"^.+\\.css$": path.resolve(dirname, "./transform/cssTransform.js"),
41+
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": path.resolve(currentDir, "./transform/babelTransform.js"),
42+
"^.+\\.css$": path.resolve(currentDir, "./transform/cssTransform.js"),
3843
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": path.resolve(
39-
dirname,
44+
currentDir,
4045
"./transform/fileTransform.js"
4146
),
4247
},

client/config/test/jest.setup-after-env.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,36 @@ window.ResizeObserver = function () {
2121
disconnect: () => {},
2222
};
2323
};
24+
25+
Object.defineProperty(window, 'ImageData', { value: 'yourValue' });
26+
Object.defineProperty(window, 'MediaStreamTrack', { value: 'yourValue' });
27+
Object.defineProperty(window, 'URL', {
28+
writable: true,
29+
value: {
30+
createObjectURL: jest.fn(),
31+
}
32+
});
33+
Object.defineProperty(window, "navigator", {
34+
writable: true,
35+
value: {
36+
mediaDevices: {
37+
enumerateDevices: jest.fn(),
38+
},
39+
userAgent: '',
40+
language: '',
41+
browserLanguage: '',
42+
},
43+
});
44+
45+
class Worker {
46+
constructor(stringUrl) {
47+
this.url = stringUrl;
48+
this.onmessage = () => {};
49+
}
50+
51+
postMessage(msg) {
52+
this.onmessage(msg);
53+
}
54+
}
55+
56+
window.Worker = Worker;

client/package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
"@babel/preset-typescript": "^7.18.6",
2626
"@rollup/plugin-typescript": "^8.5.0",
2727
"@testing-library/jest-dom": "^5.16.5",
28-
"@testing-library/react": "^12.0.0",
29-
"@testing-library/user-event": "^13.2.1",
30-
"@types/ali-oss": "^6.16.4",
3128
"@types/file-saver": "^2.0.5",
3229
"@types/jest": "^29.2.2",
3330
"@types/mime": "^2.0.3",
@@ -37,21 +34,19 @@
3734
"@types/react-resizable": "^3.0.5",
3835
"@types/react-router-dom": "^5.3.2",
3936
"@types/shelljs": "^0.8.11",
40-
"@types/styled-components": "^5.1.19",
4137
"@types/stylis": "^4.0.2",
4238
"@types/tern": "0.23.4",
43-
"@types/toposort": "^2.0.3",
4439
"@types/ua-parser-js": "^0.7.36",
4540
"@welldone-software/why-did-you-render": "^6.2.3",
4641
"add": "^2.0.6",
4742
"babel-jest": "^29.3.0",
4843
"babel-preset-react-app": "^10.0.1",
4944
"husky": "^8.0.1",
5045
"jest": "^29.5.0",
46+
"jest-canvas-mock": "^2.5.2",
5147
"jest-environment-jsdom": "^29.5.0",
5248
"lint-staged": "^13.0.1",
5349
"lowcoder-cli": "workspace:^",
54-
"lowcoder-dev-utils": "workspace:^",
5550
"mq-polyfill": "^1.1.8",
5651
"prettier": "^3.1.0",
5752
"rimraf": "^3.0.2",
@@ -67,14 +62,17 @@
6762
},
6863
"packageManager": "yarn@3.6.4",
6964
"resolutions": {
70-
"@types/react": "^17",
65+
"@types/react": "^18",
7166
"moment": "2.29.2",
7267
"canvas": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.2.1.tgz",
7368
"react-virtualized@^9.22.3": "patch:react-virtualized@npm%3A9.22.3#./.yarn/patches/react-virtualized-npm-9.22.3-0fff3cbf64.patch",
7469
"eslint-plugin-only-ascii@^0.0.0": "patch:eslint-plugin-only-ascii@npm%3A0.0.0#./.yarn/patches/eslint-plugin-only-ascii-npm-0.0.0-29e3417685.patch"
7570
},
7671
"dependencies": {
7772
"@lottiefiles/react-lottie-player": "^3.5.3",
73+
"@testing-library/react": "^14.1.2",
74+
"@testing-library/user-event": "^14.5.1",
75+
"@types/styled-components": "^5.1.34",
7876
"antd-mobile": "^5.28.0",
7977
"chalk": "4",
8078
"number-precision": "^1.6.0",

0 commit comments

Comments
 (0)