Skip to content

Commit 757d772

Browse files
removed lowcoder-dev-utils
1 parent 2b20d3f commit 757d772

31 files changed

+983
-277
lines changed

.DS_Store

2 KB
Binary file not shown.

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 "./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")],
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/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"jest-environment-jsdom": "^29.5.0",
5252
"lint-staged": "^13.0.1",
5353
"lowcoder-cli": "workspace:^",
54-
"lowcoder-dev-utils": "workspace:^",
5554
"mq-polyfill": "^1.1.8",
5655
"prettier": "^3.1.0",
5756
"rimraf": "^3.0.2",

client/packages/create-lowcoder-plugin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { spawn } from "cross-spawn";
55
import { writeFileSync, existsSync } from "node:fs";
66
import chalk from "chalk";
77
import { createCommand } from "commander";
8-
import { readJson, currentDirName } from "../lowcoder-dev-utils/util.js";
8+
import { readJson, currentDirName } from "../../dev-utils/util.js";
99

1010
const currentDir = currentDirName(import.meta.url);
1111
const pkg = readJson(path.resolve(currentDir, "./package.json"));

client/packages/create-lowcoder-plugin/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"chalk": "4",
88
"commander": "^9.4.1",
99
"cross-spawn": "^7.0.3",
10-
"fs-extra": "^10.1.0",
11-
"lowcoder-dev-utils": "workspace:^"
10+
"fs-extra": "^10.1.0"
1211
},
1312
"license": "MIT",
1413
"keywords": [

client/packages/lowcoder-cli/config/paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
22
import fs from "node:fs";
3-
import { currentDirName } from "../../lowcoder-dev-utils/util.js";
3+
import { currentDirName } from "../dev-utils/util.js";
44

55
const currentDir = currentDirName(import.meta.url);
66
const appDirectory = fs.realpathSync(process.cwd());

client/packages/lowcoder-cli/config/vite.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import react from "@vitejs/plugin-react";
22
import svgrPlugin from "vite-plugin-svgr";
33
import global from "rollup-plugin-external-globals";
4-
import { buildVars } from "../../lowcoder-dev-utils/buildVars.js";
4+
import { buildVars } from "../dev-utils/buildVars.js";
55
import injectCss from "vite-plugin-css-injected-by-js";
6-
import { getLibNames, getAllLibGlobalVarNames } from "../../lowcoder-dev-utils/external.js";
6+
import { getLibNames, getAllLibGlobalVarNames } from "../dev-utils/external.js";
77
import paths from "./paths.js";
88
import { defineConfig } from "vite";
9-
import { readJson } from "../../lowcoder-dev-utils/util.js";
9+
import { readJson } from "../dev-utils/util.js";
1010

1111
const isProduction = process.env.NODE_ENV === "production";
1212
const packageJson = readJson(paths.appPackageJson);
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
export const buildVars = [
2+
{
3+
name: "PUBLIC_URL",
4+
defaultValue: "/",
5+
},
6+
{
7+
name: "REACT_APP_EDITION",
8+
defaultValue: "community",
9+
},
10+
{
11+
name: "REACT_APP_LANGUAGES",
12+
defaultValue: "",
13+
},
14+
{
15+
name: "REACT_APP_COMMIT_ID",
16+
defaultValue: "00000",
17+
},
18+
{
19+
name: "REACT_APP_API_HOST",
20+
defaultValue: "",
21+
},
22+
{
23+
name: "LOWCODER_NODE_SERVICE_URL",
24+
defaultValue: "",
25+
},
26+
{
27+
name: "REACT_APP_ENV",
28+
defaultValue: "production",
29+
},
30+
{
31+
name: "REACT_APP_BUILD_ID",
32+
defaultValue: "",
33+
},
34+
{
35+
name: "REACT_APP_LOG_LEVEL",
36+
defaultValue: "error",
37+
},
38+
{
39+
name: "REACT_APP_IMPORT_MAP",
40+
defaultValue: "{}",
41+
},
42+
{
43+
name: "REACT_APP_SERVER_IPS",
44+
defaultValue: "",
45+
},
46+
{
47+
name: "REACT_APP_BUNDLE_BUILTIN_PLUGIN",
48+
defaultValue: "",
49+
},
50+
{
51+
name: "REACT_APP_BUNDLE_TYPE",
52+
defaultValue: "app",
53+
},
54+
{
55+
name: "REACT_APP_DISABLE_JS_SANDBOX",
56+
defaultValue: "",
57+
},
58+
];

0 commit comments

Comments
 (0)