@dckj-npm/lowcode-code-generator 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/dist/standalone-loader.esm.js +0 -100
- package/dist/standalone-loader.esm.js.map +0 -7
- package/dist/standalone-loader.js +0 -127
- package/dist/standalone-loader.js.map +0 -7
- package/types/analyzer/componentAnalyzer.d.ts +0 -2
- package/types/cli/index.d.ts +0 -2
- package/types/cli/init-solution.d.ts +0 -4
- package/types/cli/run.d.ts +0 -15
- package/types/cli/solutions/example-solution.d.ts +0 -4
- package/types/config/env.d.ts +0 -1
- package/types/const/file.d.ts +0 -2
- package/types/const/generator.d.ts +0 -58
- package/types/const/index.d.ts +0 -11
- package/types/core/jsx/handlers/transformJsExpression.d.ts +0 -5
- package/types/core/jsx/handlers/transformThis2Context.d.ts +0 -9
- package/types/core/jsx/util/isLiteralAtomicExpr.d.ts +0 -4
- package/types/core/jsx/util/isSimpleStraightLiteral.d.ts +0 -3
- package/types/core/vue/handlers/transformJsExpression.d.ts +0 -5
- package/types/core/vue/handlers/transformThis2Context.d.ts +0 -9
- package/types/core/vue/util/isLiteralAtomicExpr.d.ts +0 -4
- package/types/core/vue/util/isSimpleStraightLiteral.d.ts +0 -3
- package/types/generator/ChunkBuilder.d.ts +0 -23
- package/types/generator/CodeBuilder.d.ts +0 -17
- package/types/generator/ModuleBuilder.d.ts +0 -7
- package/types/generator/ProjectBuilder.d.ts +0 -62
- package/types/index.d.ts +0 -260
- package/types/parser/SchemaParser.d.ts +0 -25
- package/types/plugins/common/esmodule.d.ts +0 -8
- package/types/plugins/common/requireUtils.d.ts +0 -3
- package/types/plugins/common/styleImport.d.ts +0 -3
- package/types/plugins/component/rax/commonDeps.d.ts +0 -3
- package/types/plugins/component/rax/const.d.ts +0 -18
- package/types/plugins/component/rax/containerClass.d.ts +0 -3
- package/types/plugins/component/rax/containerInitState.d.ts +0 -7
- package/types/plugins/component/rax/containerInjectContext.d.ts +0 -6
- package/types/plugins/component/rax/containerInjectDataSourceEngine.d.ts +0 -12
- package/types/plugins/component/rax/containerInjectUtils.d.ts +0 -6
- package/types/plugins/component/rax/containerLifeCycle.d.ts +0 -8
- package/types/plugins/component/rax/containerMethods.d.ts +0 -6
- package/types/plugins/component/rax/jsx.d.ts +0 -8
- package/types/plugins/component/react/const.d.ts +0 -9
- package/types/plugins/component/react/containerClass.d.ts +0 -3
- package/types/plugins/component/react/containerInitState.d.ts +0 -7
- package/types/plugins/component/react/containerInjectConstants.d.ts +0 -6
- package/types/plugins/component/react/containerInjectContext.d.ts +0 -6
- package/types/plugins/component/react/containerInjectDataSourceEngine.d.ts +0 -23
- package/types/plugins/component/react/containerInjectI18n.d.ts +0 -6
- package/types/plugins/component/react/containerInjectUtils.d.ts +0 -8
- package/types/plugins/component/react/containerLifeCycle.d.ts +0 -9
- package/types/plugins/component/react/containerMethod.d.ts +0 -6
- package/types/plugins/component/react/jsx.d.ts +0 -7
- package/types/plugins/component/react/reactCommonDeps.d.ts +0 -3
- package/types/plugins/component/style/css.d.ts +0 -7
- package/types/plugins/component/vue/apiImport.d.ts +0 -23
- package/types/plugins/component/vue/containerInitVariable.d.ts +0 -7
- package/types/plugins/component/vue/containerInjectDataSourceEngine.d.ts +0 -23
- package/types/plugins/component/vue/containerLifeCycle.d.ts +0 -9
- package/types/plugins/component/vue/containerMethod.d.ts +0 -6
- package/types/plugins/component/vue/containerVue.d.ts +0 -3
- package/types/plugins/component/vue/convert/convert-function.d.ts +0 -6
- package/types/plugins/component/vue/convert/convert-variable.d.ts +0 -11
- package/types/plugins/component/vue/dataSourceMap.d.ts +0 -7
- package/types/plugins/component/vue/esmodule.d.ts +0 -8
- package/types/plugins/component/vue/routerSecond.d.ts +0 -3
- package/types/plugins/component/vue/styleImport.d.ts +0 -0
- package/types/plugins/component/vue/template.d.ts +0 -7
- package/types/plugins/component/vue/vueCommonDeps.d.ts +0 -3
- package/types/plugins/project/constants.d.ts +0 -3
- package/types/plugins/project/framework/icejs/index.d.ts +0 -11
- package/types/plugins/project/framework/icejs/plugins/entry.d.ts +0 -3
- package/types/plugins/project/framework/icejs/plugins/entryHtml.d.ts +0 -3
- package/types/plugins/project/framework/icejs/plugins/globalStyle.d.ts +0 -3
- package/types/plugins/project/framework/icejs/plugins/packageJSON.d.ts +0 -26
- package/types/plugins/project/framework/icejs/plugins/router.d.ts +0 -3
- package/types/plugins/project/framework/icejs/template/files/README.md.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/abc.json.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/build.json.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/editorconfig.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/eslintignore.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/eslintrc.js.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/gitignore.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/jsconfig.json.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/prettierignore.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/prettierrc.js.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/components/Footer/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/components/Footer/index.style.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/components/Logo/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/components/Logo/index.style.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/components/PageNav/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/src/layouts/BasicLayout/menuConfig.js.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/stylelintignore.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/stylelintrc.js.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/files/tsconfig.json.d.ts +0 -2
- package/types/plugins/project/framework/icejs/template/index.d.ts +0 -3
- package/types/plugins/project/framework/icejs/template/static-files.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/index.d.ts +0 -11
- package/types/plugins/project/framework/icejs3/plugins/appConfig.d.ts +0 -5
- package/types/plugins/project/framework/icejs3/plugins/buildConfig.d.ts +0 -7
- package/types/plugins/project/framework/icejs3/plugins/globalStyle.d.ts +0 -3
- package/types/plugins/project/framework/icejs3/plugins/layout.d.ts +0 -3
- package/types/plugins/project/framework/icejs3/plugins/packageJSON.d.ts +0 -26
- package/types/plugins/project/framework/icejs3/template/files/README.md.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/browserslistrc.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/document.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/gitignore.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Footer/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Footer/index.style.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Logo/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/Logo/index.style.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/components/PageNav/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/index.jsx.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/src/layouts/BasicLayout/menuConfig.js.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/tsconfig.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/files/typings.d.ts +0 -2
- package/types/plugins/project/framework/icejs3/template/index.d.ts +0 -3
- package/types/plugins/project/framework/icejs3/template/static-files.d.ts +0 -2
- package/types/plugins/project/framework/rax/index.d.ts +0 -12
- package/types/plugins/project/framework/rax/plugins/appConfig.d.ts +0 -4
- package/types/plugins/project/framework/rax/plugins/buildConfig.d.ts +0 -4
- package/types/plugins/project/framework/rax/plugins/entry.d.ts +0 -4
- package/types/plugins/project/framework/rax/plugins/entryDocument.d.ts +0 -7
- package/types/plugins/project/framework/rax/plugins/globalStyle.d.ts +0 -6
- package/types/plugins/project/framework/rax/plugins/packageJSON.d.ts +0 -4
- package/types/plugins/project/framework/rax/template/files/.eslintignore.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.eslintrc.js.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.gitignore.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.prettierignore.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.prettierrc.js.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.stylelintignore.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/.stylelintrc.js.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/README.md.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/jsconfig.json.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/files/tsconfig.json.d.ts +0 -2
- package/types/plugins/project/framework/rax/template/index.d.ts +0 -3
- package/types/plugins/project/framework/rax/template/static-files.d.ts +0 -2
- package/types/plugins/project/framework/rax/types/RaxFrameworkOptions.d.ts +0 -81
- package/types/plugins/project/framework/vuejs3/index.d.ts +0 -11
- package/types/plugins/project/framework/vuejs3/plugins/form.d.ts +0 -3
- package/types/plugins/project/framework/vuejs3/plugins/hooks.d.ts +0 -3
- package/types/plugins/project/framework/vuejs3/plugins/main.d.ts +0 -4
- package/types/plugins/project/framework/vuejs3/plugins/packageJSON.d.ts +0 -26
- package/types/plugins/project/framework/vuejs3/plugins/router.d.ts +0 -3
- package/types/plugins/project/framework/vuejs3/template/files/css/global.scss.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/css/mixin.scss.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/css/theme.css.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/env.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/eslintignore.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/eslintrc.yml.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/gitignore.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/index.html.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/npmrc.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/postcss.config.cjs.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/prettierignore.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/prettierrc.yml.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/App.vue.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/main.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/utils/utils.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/views/baseIndexA/tabs.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/views/baseIndexA/welcome.vue.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/src/vite-env.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/tsconfig.json.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/tsconfig.node.json.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/files/vite.config.ts.d.ts +0 -2
- package/types/plugins/project/framework/vuejs3/template/index.d.ts +0 -3
- package/types/plugins/project/framework/vuejs3/template/static-files.d.ts +0 -2
- package/types/plugins/project/i18n.d.ts +0 -3
- package/types/plugins/project/utils.d.ts +0 -3
- package/types/polyfills/buffer.d.ts +0 -1
- package/types/postprocessor/index.d.ts +0 -2
- package/types/postprocessor/prettier/index.d.ts +0 -8
- package/types/publisher/disk/index.d.ts +0 -13
- package/types/publisher/disk/utils.d.ts +0 -9
- package/types/publisher/zip/index.d.ts +0 -14
- package/types/publisher/zip/utils.d.ts +0 -5
- package/types/solutions/icejs.d.ts +0 -18
- package/types/solutions/icejs3.d.ts +0 -15
- package/types/solutions/rax-app.d.ts +0 -27
- package/types/solutions/vuejs3.d.ts +0 -22
- package/types/standalone-loader.d.ts +0 -17
- package/types/standalone-worker.d.ts +0 -1
- package/types/standalone.d.ts +0 -260
- package/types/types/analyze.d.ts +0 -5
- package/types/types/column-type.d.ts +0 -316
- package/types/types/core.d.ts +0 -197
- package/types/types/datasource-extra-base.d.ts +0 -32
- package/types/types/datasource-page-helper.d.ts +0 -30
- package/types/types/datasource.d.ts +0 -0
- package/types/types/deps.d.ts +0 -36
- package/types/types/error.d.ts +0 -10
- package/types/types/file.d.ts +0 -14
- package/types/types/index.d.ts +0 -8
- package/types/types/intermediate.d.ts +0 -234
- package/types/types/jsx.d.ts +0 -34
- package/types/types/publisher.d.ts +0 -14
- package/types/types/tab.d.ts +0 -6
- package/types/utils/OrderedSet.d.ts +0 -9
- package/types/utils/Scope.d.ts +0 -12
- package/types/utils/ScopeBindings.d.ts +0 -20
- package/types/utils/aopHelper.d.ts +0 -2
- package/types/utils/apiHandler.d.ts +0 -4
- package/types/utils/changeCase.d.ts +0 -10
- package/types/utils/columnType.d.ts +0 -1
- package/types/utils/common.d.ts +0 -14
- package/types/utils/compositeType.d.ts +0 -3
- package/types/utils/dataSource.d.ts +0 -17
- package/types/utils/debug.d.ts +0 -2
- package/types/utils/encodeJsxAttrString.d.ts +0 -1
- package/types/utils/errors.d.ts +0 -4
- package/types/utils/expressionParser.d.ts +0 -16
- package/types/utils/format.d.ts +0 -1
- package/types/utils/index.d.ts +0 -15
- package/types/utils/jsExpression.d.ts +0 -50
- package/types/utils/jsSlot.d.ts +0 -2
- package/types/utils/jsxHelpers.d.ts +0 -5
- package/types/utils/nodeToJSX.d.ts +0 -32
- package/types/utils/nodeToTemplate.d.ts +0 -17
- package/types/utils/pathHelper.d.ts +0 -6
- package/types/utils/requestHandle.d.ts +0 -72
- package/types/utils/resultHelper.d.ts +0 -51
- package/types/utils/routerHandle.d.ts +0 -11
- package/types/utils/schema.d.ts +0 -24
- package/types/utils/templateHelper.d.ts +0 -11
- package/types/utils/theme.d.ts +0 -9
- package/types/utils/validate.d.ts +0 -8
- package/types/utils/version.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dckj-npm/lowcode-code-generator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19",
|
|
4
4
|
"description": "出码引擎 for LowCode Engine(额外添加vue3处理方案)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"**/*.{js,jsx,ts,tsx}": "eslint"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
+
"@alilc/lowcode-code-generator": "^1.1.7",
|
|
62
63
|
"@alilc/lowcode-types": "^1.0.0",
|
|
63
64
|
"@babel/generator": "^7.12.11",
|
|
64
65
|
"@babel/parser": "^7.12.11",
|
|
@@ -112,8 +113,9 @@
|
|
|
112
113
|
"@types/file-saver": "^2.0.7",
|
|
113
114
|
"@types/jest": "^27.0.2",
|
|
114
115
|
"@types/lodash": "^4.14.162",
|
|
115
|
-
"@types/node": "^14.
|
|
116
|
+
"@types/node": "^14.18.63",
|
|
116
117
|
"@types/prettier": "^2.4.2",
|
|
118
|
+
"@types/react": "^19.0.10",
|
|
117
119
|
"@typescript-eslint/eslint-plugin": "^4.12.0",
|
|
118
120
|
"@typescript-eslint/parser": "^4.12.0",
|
|
119
121
|
"concurrently": "^6.5.1",
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// src/standalone-loader.ts
|
|
2
|
-
import fetch from "node-fetch";
|
|
3
|
-
var packageVersion = "1.2.18";
|
|
4
|
-
var DEFAULT_WORKER_JS = `https://cdn.jsdelivr.net/npm/@dckj-npm/lowcode-code-generator@${packageVersion}/dist/standalone-worker.min.js`;
|
|
5
|
-
var DEFAULT_TIMEOUT_IN_MS = 60 * 1e3;
|
|
6
|
-
var workerJsCache = /* @__PURE__ */ new Map();
|
|
7
|
-
async function init({
|
|
8
|
-
workerJsUrl = DEFAULT_WORKER_JS
|
|
9
|
-
} = {}) {
|
|
10
|
-
await loadWorkerJs(workerJsUrl);
|
|
11
|
-
}
|
|
12
|
-
async function generateCode(options) {
|
|
13
|
-
if (typeof self !== "object") {
|
|
14
|
-
throw new Error("self is not defined");
|
|
15
|
-
}
|
|
16
|
-
if (typeof Worker !== "function") {
|
|
17
|
-
throw new Error("Worker is not supported");
|
|
18
|
-
}
|
|
19
|
-
const workerJsUrl = options.workerJsUrl || DEFAULT_WORKER_JS;
|
|
20
|
-
const workerJs = await loadWorkerJs(workerJsUrl);
|
|
21
|
-
const worker = new Worker(workerJs.url, {
|
|
22
|
-
type: "classic",
|
|
23
|
-
credentials: "omit"
|
|
24
|
-
});
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
const timer = setTimeout(() => {
|
|
27
|
-
reject(new Error("timeout"));
|
|
28
|
-
worker.terminate();
|
|
29
|
-
}, options.timeoutInMs || DEFAULT_TIMEOUT_IN_MS);
|
|
30
|
-
worker.onmessage = (event) => {
|
|
31
|
-
const msg = event.data;
|
|
32
|
-
switch (msg.type) {
|
|
33
|
-
case "ready":
|
|
34
|
-
print("worker is ready.");
|
|
35
|
-
break;
|
|
36
|
-
case "run:begin":
|
|
37
|
-
print("worker is running...");
|
|
38
|
-
break;
|
|
39
|
-
case "run:end":
|
|
40
|
-
print("worker is done.");
|
|
41
|
-
resolve(msg.result);
|
|
42
|
-
clearTimeout(timer);
|
|
43
|
-
worker.terminate();
|
|
44
|
-
break;
|
|
45
|
-
case "run:error":
|
|
46
|
-
printErr(`worker error: ${msg.errorMsg}`);
|
|
47
|
-
clearTimeout(timer);
|
|
48
|
-
reject(new Error(msg.errorMsg || "unknown error"));
|
|
49
|
-
worker.terminate();
|
|
50
|
-
break;
|
|
51
|
-
default:
|
|
52
|
-
print("got unknown msg: %o", msg);
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
worker.onerror = (err) => {
|
|
57
|
-
printErr("worker error: %o", err);
|
|
58
|
-
clearTimeout(timer);
|
|
59
|
-
reject(err);
|
|
60
|
-
worker.terminate();
|
|
61
|
-
};
|
|
62
|
-
worker.postMessage({
|
|
63
|
-
type: "run",
|
|
64
|
-
solution: options.solution,
|
|
65
|
-
schema: options.schema,
|
|
66
|
-
flattenResult: options.flattenResult,
|
|
67
|
-
resourceList: options.resourceList
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async function loadWorkerJs(workerJsUrl) {
|
|
72
|
-
const cached = workerJsCache.get(workerJsUrl);
|
|
73
|
-
if (cached) {
|
|
74
|
-
return cached;
|
|
75
|
-
}
|
|
76
|
-
const workerJsContent = await fetch(workerJsUrl).then((res) => res.text()).catch((err) => {
|
|
77
|
-
throw new Error(`Failed to fetch worker js: ${err}`);
|
|
78
|
-
});
|
|
79
|
-
const workerJs = {
|
|
80
|
-
content: workerJsContent,
|
|
81
|
-
url: self.URL.createObjectURL(
|
|
82
|
-
new self.Blob([workerJsContent], { type: "application/javascript" })
|
|
83
|
-
)
|
|
84
|
-
};
|
|
85
|
-
workerJsCache.set(workerJsUrl, workerJs);
|
|
86
|
-
return workerJs;
|
|
87
|
-
}
|
|
88
|
-
function print(msg, ...args) {
|
|
89
|
-
console.debug(`[code-generator/loader]: ${msg}`, ...args);
|
|
90
|
-
}
|
|
91
|
-
function printErr(msg, ...args) {
|
|
92
|
-
console.debug(`[code-generator/loader]: %c${msg}`, "color:red", ...args);
|
|
93
|
-
}
|
|
94
|
-
export {
|
|
95
|
-
DEFAULT_TIMEOUT_IN_MS,
|
|
96
|
-
DEFAULT_WORKER_JS,
|
|
97
|
-
generateCode,
|
|
98
|
-
init
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=standalone-loader.esm.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/standalone-loader.ts"],
|
|
4
|
-
"sourcesContent": ["import fetch from 'node-fetch';\r\nimport type { IPublicTypeProjectSchema, ResultDir } from '@alilc/lowcode-types';\r\nimport type { FlattenFile } from './types/file';\r\nimport {ResourceListType} from \"./types\";\r\n\r\ndeclare const Worker: any;\r\ndeclare const self: any;\r\ndeclare const __PACKAGE_VERSION__: string;\r\n\r\nconst packageVersion = __PACKAGE_VERSION__ || 'latest';\r\n\r\nexport const DEFAULT_WORKER_JS = `https://cdn.jsdelivr.net/npm/@dckj-npm/lowcode-code-generator@${packageVersion}/dist/standalone-worker.min.js`;\r\n\r\nexport const DEFAULT_TIMEOUT_IN_MS = 60 * 1000;\r\n\r\nconst workerJsCache = new Map<string, { content: string; url: string }>();\r\n\r\nexport async function init({\r\n workerJsUrl = DEFAULT_WORKER_JS,\r\n}: {\r\n workerJsUrl?: string;\r\n} = {}) {\r\n await loadWorkerJs(workerJsUrl);\r\n}\r\n\r\nexport type Result = ResultDir | FlattenFile[];\r\n\r\nexport async function generateCode(options: {\r\n solution: 'icejs' | 'rax' | 'vuejs3';\r\n schema: IPublicTypeProjectSchema | IPublicTypeProjectSchema[];\r\n resourceList: ResourceListType[];\r\n flattenResult?: boolean;\r\n workerJsUrl?: string;\r\n timeoutInMs?: number;\r\n}): Promise<Result> {\r\n if (typeof self !== 'object') {\r\n throw new Error('self is not defined');\r\n }\r\n\r\n if (typeof Worker !== 'function') {\r\n throw new Error('Worker is not supported');\r\n }\r\n\r\n const workerJsUrl = options.workerJsUrl || DEFAULT_WORKER_JS;\r\n\r\n const workerJs = await loadWorkerJs(workerJsUrl);\r\n\r\n const worker = new Worker(workerJs.url, {\r\n type: 'classic',\r\n credentials: 'omit',\r\n });\r\n\r\n return new Promise((resolve, reject) => {\r\n const timer = setTimeout(() => {\r\n reject(new Error('timeout'));\r\n worker.terminate();\r\n }, options.timeoutInMs || DEFAULT_TIMEOUT_IN_MS);\r\n\r\n worker.onmessage = (event: any) => {\r\n const msg = event.data;\r\n switch (msg.type) {\r\n case 'ready':\r\n print('worker is ready.');\r\n break;\r\n\r\n case 'run:begin':\r\n print('worker is running...');\r\n break;\r\n case 'run:end':\r\n print('worker is done.');\r\n resolve(msg.result);\r\n clearTimeout(timer);\r\n worker.terminate();\r\n break;\r\n case 'run:error':\r\n printErr(`worker error: ${msg.errorMsg}`);\r\n clearTimeout(timer);\r\n reject(new Error(msg.errorMsg || 'unknown error'));\r\n worker.terminate();\r\n break;\r\n default:\r\n print('got unknown msg: %o', msg);\r\n break;\r\n }\r\n };\r\n\r\n worker.onerror = (err: any) => {\r\n printErr('worker error: %o', err);\r\n clearTimeout(timer);\r\n reject(err);\r\n worker.terminate();\r\n };\r\n\r\n worker.postMessage({\r\n type: 'run',\r\n solution: options.solution,\r\n schema: options.schema,\r\n flattenResult: options.flattenResult,\r\n resourceList:options.resourceList\r\n });\r\n });\r\n}\r\n\r\nasync function loadWorkerJs(workerJsUrl: string) {\r\n const cached = workerJsCache.get(workerJsUrl);\r\n if (cached) {\r\n return cached;\r\n }\r\n\r\n const workerJsContent = await fetch(workerJsUrl)\r\n .then((res) => res.text())\r\n .catch((err) => {\r\n throw new Error(`Failed to fetch worker js: ${err}`);\r\n });\r\n\r\n const workerJs = {\r\n content: workerJsContent,\r\n url: self.URL.createObjectURL(\r\n new self.Blob([workerJsContent], { type: 'application/javascript' }),\r\n ),\r\n };\r\n\r\n workerJsCache.set(workerJsUrl, workerJs);\r\n\r\n return workerJs;\r\n}\r\n\r\nfunction print(msg: string, ...args: unknown[]) {\r\n // eslint-disable-next-line no-console\r\n console.debug(`[code-generator/loader]: ${msg}`, ...args);\r\n}\r\n\r\nfunction printErr(msg: string, ...args: unknown[]) {\r\n // eslint-disable-next-line no-console\r\n console.debug(`[code-generator/loader]: %c${msg}`, 'color:red', ...args);\r\n}\r\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,WAAW;AASlB,IAAM,iBAAiB;AAEhB,IAAM,oBAAoB,iEAAiE;AAE3F,IAAM,wBAAwB,KAAK;AAE1C,IAAM,gBAAgB,oBAAI,IAA8C;AAExE,eAAsB,KAAK;AAAA,EACzB,cAAc;AAChB,IAEI,CAAC,GAAG;AACN,QAAM,aAAa,WAAW;AAChC;AAIA,eAAsB,aAAa,SAOf;AAClB,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,OAAO,WAAW,YAAY;AAChC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AAEA,QAAM,cAAc,QAAQ,eAAe;AAE3C,QAAM,WAAW,MAAM,aAAa,WAAW;AAE/C,QAAM,SAAS,IAAI,OAAO,SAAS,KAAK;AAAA,IACtC,MAAM;AAAA,IACN,aAAa;AAAA,EACf,CAAC;AAED,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,QAAQ,WAAW,MAAM;AAC7B,aAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,aAAO,UAAU;AAAA,IACnB,GAAG,QAAQ,eAAe,qBAAqB;AAE/C,WAAO,YAAY,CAAC,UAAe;AACjC,YAAM,MAAM,MAAM;AAClB,cAAQ,IAAI;AAAA,aACL;AACH,gBAAM,kBAAkB;AACxB;AAAA,aAEG;AACH,gBAAM,sBAAsB;AAC5B;AAAA,aACG;AACH,gBAAM,iBAAiB;AACvB,kBAAQ,IAAI,MAAM;AAClB,uBAAa,KAAK;AAClB,iBAAO,UAAU;AACjB;AAAA,aACG;AACH,mBAAS,iBAAiB,IAAI,UAAU;AACxC,uBAAa,KAAK;AAClB,iBAAO,IAAI,MAAM,IAAI,YAAY,eAAe,CAAC;AACjD,iBAAO,UAAU;AACjB;AAAA;AAEA,gBAAM,uBAAuB,GAAG;AAChC;AAAA;AAAA,IAEN;AAEA,WAAO,UAAU,CAAC,QAAa;AAC7B,eAAS,oBAAoB,GAAG;AAChC,mBAAa,KAAK;AAClB,aAAO,GAAG;AACV,aAAO,UAAU;AAAA,IACnB;AAEA,WAAO,YAAY;AAAA,MACjB,MAAM;AAAA,MACN,UAAU,QAAQ;AAAA,MAClB,QAAQ,QAAQ;AAAA,MAChB,eAAe,QAAQ;AAAA,MACvB,cAAa,QAAQ;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AACH;AAEA,eAAe,aAAa,aAAqB;AAC/C,QAAM,SAAS,cAAc,IAAI,WAAW;AAC5C,MAAI,QAAQ;AACV,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,MAAM,MAAM,WAAW,EAC5C,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EACxB,MAAM,CAAC,QAAQ;AACd,UAAM,IAAI,MAAM,8BAA8B,KAAK;AAAA,EACrD,CAAC;AAEH,QAAM,WAAW;AAAA,IACf,SAAS;AAAA,IACT,KAAK,KAAK,IAAI;AAAA,MACZ,IAAI,KAAK,KAAK,CAAC,eAAe,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAAA,IACrE;AAAA,EACF;AAEA,gBAAc,IAAI,aAAa,QAAQ;AAEvC,SAAO;AACT;AAEA,SAAS,MAAM,QAAgB,MAAiB;AAE9C,UAAQ,MAAM,4BAA4B,OAAO,GAAG,IAAI;AAC1D;AAEA,SAAS,SAAS,QAAgB,MAAiB;AAEjD,UAAQ,MAAM,8BAA8B,OAAO,aAAa,GAAG,IAAI;AACzE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
|
|
26
|
-
// src/standalone-loader.ts
|
|
27
|
-
var standalone_loader_exports = {};
|
|
28
|
-
__export(standalone_loader_exports, {
|
|
29
|
-
DEFAULT_TIMEOUT_IN_MS: () => DEFAULT_TIMEOUT_IN_MS,
|
|
30
|
-
DEFAULT_WORKER_JS: () => DEFAULT_WORKER_JS,
|
|
31
|
-
generateCode: () => generateCode,
|
|
32
|
-
init: () => init
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(standalone_loader_exports);
|
|
35
|
-
var import_node_fetch = __toESM(require("node-fetch"));
|
|
36
|
-
var packageVersion = "1.2.18";
|
|
37
|
-
var DEFAULT_WORKER_JS = `https://cdn.jsdelivr.net/npm/@dckj-npm/lowcode-code-generator@${packageVersion}/dist/standalone-worker.min.js`;
|
|
38
|
-
var DEFAULT_TIMEOUT_IN_MS = 60 * 1e3;
|
|
39
|
-
var workerJsCache = /* @__PURE__ */ new Map();
|
|
40
|
-
async function init({
|
|
41
|
-
workerJsUrl = DEFAULT_WORKER_JS
|
|
42
|
-
} = {}) {
|
|
43
|
-
await loadWorkerJs(workerJsUrl);
|
|
44
|
-
}
|
|
45
|
-
async function generateCode(options) {
|
|
46
|
-
if (typeof self !== "object") {
|
|
47
|
-
throw new Error("self is not defined");
|
|
48
|
-
}
|
|
49
|
-
if (typeof Worker !== "function") {
|
|
50
|
-
throw new Error("Worker is not supported");
|
|
51
|
-
}
|
|
52
|
-
const workerJsUrl = options.workerJsUrl || DEFAULT_WORKER_JS;
|
|
53
|
-
const workerJs = await loadWorkerJs(workerJsUrl);
|
|
54
|
-
const worker = new Worker(workerJs.url, {
|
|
55
|
-
type: "classic",
|
|
56
|
-
credentials: "omit"
|
|
57
|
-
});
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
const timer = setTimeout(() => {
|
|
60
|
-
reject(new Error("timeout"));
|
|
61
|
-
worker.terminate();
|
|
62
|
-
}, options.timeoutInMs || DEFAULT_TIMEOUT_IN_MS);
|
|
63
|
-
worker.onmessage = (event) => {
|
|
64
|
-
const msg = event.data;
|
|
65
|
-
switch (msg.type) {
|
|
66
|
-
case "ready":
|
|
67
|
-
print("worker is ready.");
|
|
68
|
-
break;
|
|
69
|
-
case "run:begin":
|
|
70
|
-
print("worker is running...");
|
|
71
|
-
break;
|
|
72
|
-
case "run:end":
|
|
73
|
-
print("worker is done.");
|
|
74
|
-
resolve(msg.result);
|
|
75
|
-
clearTimeout(timer);
|
|
76
|
-
worker.terminate();
|
|
77
|
-
break;
|
|
78
|
-
case "run:error":
|
|
79
|
-
printErr(`worker error: ${msg.errorMsg}`);
|
|
80
|
-
clearTimeout(timer);
|
|
81
|
-
reject(new Error(msg.errorMsg || "unknown error"));
|
|
82
|
-
worker.terminate();
|
|
83
|
-
break;
|
|
84
|
-
default:
|
|
85
|
-
print("got unknown msg: %o", msg);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
worker.onerror = (err) => {
|
|
90
|
-
printErr("worker error: %o", err);
|
|
91
|
-
clearTimeout(timer);
|
|
92
|
-
reject(err);
|
|
93
|
-
worker.terminate();
|
|
94
|
-
};
|
|
95
|
-
worker.postMessage({
|
|
96
|
-
type: "run",
|
|
97
|
-
solution: options.solution,
|
|
98
|
-
schema: options.schema,
|
|
99
|
-
flattenResult: options.flattenResult,
|
|
100
|
-
resourceList: options.resourceList
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
async function loadWorkerJs(workerJsUrl) {
|
|
105
|
-
const cached = workerJsCache.get(workerJsUrl);
|
|
106
|
-
if (cached) {
|
|
107
|
-
return cached;
|
|
108
|
-
}
|
|
109
|
-
const workerJsContent = await (0, import_node_fetch.default)(workerJsUrl).then((res) => res.text()).catch((err) => {
|
|
110
|
-
throw new Error(`Failed to fetch worker js: ${err}`);
|
|
111
|
-
});
|
|
112
|
-
const workerJs = {
|
|
113
|
-
content: workerJsContent,
|
|
114
|
-
url: self.URL.createObjectURL(
|
|
115
|
-
new self.Blob([workerJsContent], { type: "application/javascript" })
|
|
116
|
-
)
|
|
117
|
-
};
|
|
118
|
-
workerJsCache.set(workerJsUrl, workerJs);
|
|
119
|
-
return workerJs;
|
|
120
|
-
}
|
|
121
|
-
function print(msg, ...args) {
|
|
122
|
-
console.debug(`[code-generator/loader]: ${msg}`, ...args);
|
|
123
|
-
}
|
|
124
|
-
function printErr(msg, ...args) {
|
|
125
|
-
console.debug(`[code-generator/loader]: %c${msg}`, "color:red", ...args);
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=standalone-loader.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/standalone-loader.ts"],
|
|
4
|
-
"sourcesContent": ["import fetch from 'node-fetch';\r\nimport type { IPublicTypeProjectSchema, ResultDir } from '@alilc/lowcode-types';\r\nimport type { FlattenFile } from './types/file';\r\nimport {ResourceListType} from \"./types\";\r\n\r\ndeclare const Worker: any;\r\ndeclare const self: any;\r\ndeclare const __PACKAGE_VERSION__: string;\r\n\r\nconst packageVersion = __PACKAGE_VERSION__ || 'latest';\r\n\r\nexport const DEFAULT_WORKER_JS = `https://cdn.jsdelivr.net/npm/@dckj-npm/lowcode-code-generator@${packageVersion}/dist/standalone-worker.min.js`;\r\n\r\nexport const DEFAULT_TIMEOUT_IN_MS = 60 * 1000;\r\n\r\nconst workerJsCache = new Map<string, { content: string; url: string }>();\r\n\r\nexport async function init({\r\n workerJsUrl = DEFAULT_WORKER_JS,\r\n}: {\r\n workerJsUrl?: string;\r\n} = {}) {\r\n await loadWorkerJs(workerJsUrl);\r\n}\r\n\r\nexport type Result = ResultDir | FlattenFile[];\r\n\r\nexport async function generateCode(options: {\r\n solution: 'icejs' | 'rax' | 'vuejs3';\r\n schema: IPublicTypeProjectSchema | IPublicTypeProjectSchema[];\r\n resourceList: ResourceListType[];\r\n flattenResult?: boolean;\r\n workerJsUrl?: string;\r\n timeoutInMs?: number;\r\n}): Promise<Result> {\r\n if (typeof self !== 'object') {\r\n throw new Error('self is not defined');\r\n }\r\n\r\n if (typeof Worker !== 'function') {\r\n throw new Error('Worker is not supported');\r\n }\r\n\r\n const workerJsUrl = options.workerJsUrl || DEFAULT_WORKER_JS;\r\n\r\n const workerJs = await loadWorkerJs(workerJsUrl);\r\n\r\n const worker = new Worker(workerJs.url, {\r\n type: 'classic',\r\n credentials: 'omit',\r\n });\r\n\r\n return new Promise((resolve, reject) => {\r\n const timer = setTimeout(() => {\r\n reject(new Error('timeout'));\r\n worker.terminate();\r\n }, options.timeoutInMs || DEFAULT_TIMEOUT_IN_MS);\r\n\r\n worker.onmessage = (event: any) => {\r\n const msg = event.data;\r\n switch (msg.type) {\r\n case 'ready':\r\n print('worker is ready.');\r\n break;\r\n\r\n case 'run:begin':\r\n print('worker is running...');\r\n break;\r\n case 'run:end':\r\n print('worker is done.');\r\n resolve(msg.result);\r\n clearTimeout(timer);\r\n worker.terminate();\r\n break;\r\n case 'run:error':\r\n printErr(`worker error: ${msg.errorMsg}`);\r\n clearTimeout(timer);\r\n reject(new Error(msg.errorMsg || 'unknown error'));\r\n worker.terminate();\r\n break;\r\n default:\r\n print('got unknown msg: %o', msg);\r\n break;\r\n }\r\n };\r\n\r\n worker.onerror = (err: any) => {\r\n printErr('worker error: %o', err);\r\n clearTimeout(timer);\r\n reject(err);\r\n worker.terminate();\r\n };\r\n\r\n worker.postMessage({\r\n type: 'run',\r\n solution: options.solution,\r\n schema: options.schema,\r\n flattenResult: options.flattenResult,\r\n resourceList:options.resourceList\r\n });\r\n });\r\n}\r\n\r\nasync function loadWorkerJs(workerJsUrl: string) {\r\n const cached = workerJsCache.get(workerJsUrl);\r\n if (cached) {\r\n return cached;\r\n }\r\n\r\n const workerJsContent = await fetch(workerJsUrl)\r\n .then((res) => res.text())\r\n .catch((err) => {\r\n throw new Error(`Failed to fetch worker js: ${err}`);\r\n });\r\n\r\n const workerJs = {\r\n content: workerJsContent,\r\n url: self.URL.createObjectURL(\r\n new self.Blob([workerJsContent], { type: 'application/javascript' }),\r\n ),\r\n };\r\n\r\n workerJsCache.set(workerJsUrl, workerJs);\r\n\r\n return workerJs;\r\n}\r\n\r\nfunction print(msg: string, ...args: unknown[]) {\r\n // eslint-disable-next-line no-console\r\n console.debug(`[code-generator/loader]: ${msg}`, ...args);\r\n}\r\n\r\nfunction printErr(msg: string, ...args: unknown[]) {\r\n // eslint-disable-next-line no-console\r\n console.debug(`[code-generator/loader]: %c${msg}`, 'color:red', ...args);\r\n}\r\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAkB;AASlB,IAAM,iBAAiB;AAEhB,IAAM,oBAAoB,iEAAiE;AAE3F,IAAM,wBAAwB,KAAK;AAE1C,IAAM,gBAAgB,oBAAI,IAA8C;AAExE,eAAsB,KAAK;AAAA,EACzB,cAAc;AAChB,IAEI,CAAC,GAAG;AACN,QAAM,aAAa,WAAW;AAChC;AAIA,eAAsB,aAAa,SAOf;AAClB,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,OAAO,WAAW,YAAY;AAChC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AAEA,QAAM,cAAc,QAAQ,eAAe;AAE3C,QAAM,WAAW,MAAM,aAAa,WAAW;AAE/C,QAAM,SAAS,IAAI,OAAO,SAAS,KAAK;AAAA,IACtC,MAAM;AAAA,IACN,aAAa;AAAA,EACf,CAAC;AAED,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,QAAQ,WAAW,MAAM;AAC7B,aAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,aAAO,UAAU;AAAA,IACnB,GAAG,QAAQ,eAAe,qBAAqB;AAE/C,WAAO,YAAY,CAAC,UAAe;AACjC,YAAM,MAAM,MAAM;AAClB,cAAQ,IAAI;AAAA,aACL;AACH,gBAAM,kBAAkB;AACxB;AAAA,aAEG;AACH,gBAAM,sBAAsB;AAC5B;AAAA,aACG;AACH,gBAAM,iBAAiB;AACvB,kBAAQ,IAAI,MAAM;AAClB,uBAAa,KAAK;AAClB,iBAAO,UAAU;AACjB;AAAA,aACG;AACH,mBAAS,iBAAiB,IAAI,UAAU;AACxC,uBAAa,KAAK;AAClB,iBAAO,IAAI,MAAM,IAAI,YAAY,eAAe,CAAC;AACjD,iBAAO,UAAU;AACjB;AAAA;AAEA,gBAAM,uBAAuB,GAAG;AAChC;AAAA;AAAA,IAEN;AAEA,WAAO,UAAU,CAAC,QAAa;AAC7B,eAAS,oBAAoB,GAAG;AAChC,mBAAa,KAAK;AAClB,aAAO,GAAG;AACV,aAAO,UAAU;AAAA,IACnB;AAEA,WAAO,YAAY;AAAA,MACjB,MAAM;AAAA,MACN,UAAU,QAAQ;AAAA,MAClB,QAAQ,QAAQ;AAAA,MAChB,eAAe,QAAQ;AAAA,MACvB,cAAa,QAAQ;AAAA,IACvB,CAAC;AAAA,EACH,CAAC;AACH;AAEA,eAAe,aAAa,aAAqB;AAC/C,QAAM,SAAS,cAAc,IAAI,WAAW;AAC5C,MAAI,QAAQ;AACV,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,UAAM,kBAAAA,SAAM,WAAW,EAC5C,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EACxB,MAAM,CAAC,QAAQ;AACd,UAAM,IAAI,MAAM,8BAA8B,KAAK;AAAA,EACrD,CAAC;AAEH,QAAM,WAAW;AAAA,IACf,SAAS;AAAA,IACT,KAAK,KAAK,IAAI;AAAA,MACZ,IAAI,KAAK,KAAK,CAAC,eAAe,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAAA,IACrE;AAAA,EACF;AAEA,gBAAc,IAAI,aAAa,QAAQ;AAEvC,SAAO;AACT;AAEA,SAAS,MAAM,QAAgB,MAAiB;AAE9C,UAAQ,MAAM,4BAA4B,OAAO,GAAG,IAAI;AAC1D;AAEA,SAAS,SAAS,QAAgB,MAAiB;AAEjD,UAAQ,MAAM,8BAA8B,OAAO,aAAa,GAAG,IAAI;AACzE;",
|
|
6
|
-
"names": ["fetch"]
|
|
7
|
-
}
|
package/types/cli/index.d.ts
DELETED
package/types/cli/run.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 执行出码 CLI 命令
|
|
3
|
-
* @param args 入参数组
|
|
4
|
-
* @param options 选项
|
|
5
|
-
* @returns {Promise<number>} 错误码
|
|
6
|
-
*/
|
|
7
|
-
export declare function run(args: string[], options: {
|
|
8
|
-
solution: string;
|
|
9
|
-
input?: string;
|
|
10
|
-
output?: string;
|
|
11
|
-
quiet?: boolean;
|
|
12
|
-
verbose?: boolean;
|
|
13
|
-
solutionOptions?: string;
|
|
14
|
-
resourceList?: string;
|
|
15
|
-
}): Promise<number>;
|
package/types/config/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CODE_GENERATOR_ROOT: string;
|
package/types/const/file.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export declare const COMMON_CHUNK_NAME: {
|
|
2
|
-
ExternalDepsImport: string;
|
|
3
|
-
InternalDepsImport: string;
|
|
4
|
-
ImportAliasDefine: string;
|
|
5
|
-
FileVarDefine: string;
|
|
6
|
-
FileUtilDefine: string;
|
|
7
|
-
FileMainContent: string;
|
|
8
|
-
FileExport: string;
|
|
9
|
-
StyleDepsImport: string;
|
|
10
|
-
StyleCssContent: string;
|
|
11
|
-
HtmlContent: string;
|
|
12
|
-
CustomContent: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const CLASS_DEFINE_CHUNK_NAME: {
|
|
15
|
-
Start: string;
|
|
16
|
-
ConstructorStart: string;
|
|
17
|
-
ConstructorContent: string;
|
|
18
|
-
ConstructorEnd: string;
|
|
19
|
-
StaticVar: string;
|
|
20
|
-
StaticMethod: string;
|
|
21
|
-
InsVar: string;
|
|
22
|
-
InsVarMethod: string;
|
|
23
|
-
InsMethod: string;
|
|
24
|
-
InsPrivateMethod: string;
|
|
25
|
-
End: string;
|
|
26
|
-
};
|
|
27
|
-
export declare const TEMPLATE_DEFINE_CHUNK_NAME: {
|
|
28
|
-
TemplateStart: string;
|
|
29
|
-
TemplateDom: string;
|
|
30
|
-
TemplateEnd: string;
|
|
31
|
-
ScriptStart: string;
|
|
32
|
-
ExternalDepsImport: string;
|
|
33
|
-
InternalDepsImport: string;
|
|
34
|
-
ConstVar: string;
|
|
35
|
-
LetVar: string;
|
|
36
|
-
DataSourceMapStart: string;
|
|
37
|
-
DataSourceMapContent: string;
|
|
38
|
-
DataSourceMapEnd: string;
|
|
39
|
-
OnMountedStart: string;
|
|
40
|
-
OnMountedContent: string;
|
|
41
|
-
OnMountedEnd: string;
|
|
42
|
-
UnMountedStart: string;
|
|
43
|
-
UnMountedContent: string;
|
|
44
|
-
UnMountedEnd: string;
|
|
45
|
-
Method: string;
|
|
46
|
-
ScriptEnd: string;
|
|
47
|
-
CssStyleStart: string;
|
|
48
|
-
CssStyleImport: string;
|
|
49
|
-
CssStyleEnd: string;
|
|
50
|
-
};
|
|
51
|
-
export declare const DEFAULT_LINK_AFTER: {
|
|
52
|
-
[x: string]: string[];
|
|
53
|
-
};
|
|
54
|
-
export declare const VUE_DEFAULT_LINK_AFTER: {
|
|
55
|
-
[x: string]: string[];
|
|
56
|
-
};
|
|
57
|
-
export declare const COMMON_SUB_MODULE_NAME = "index";
|
|
58
|
-
export declare const VUE_MODULE_NAME = "@dckj-npm/lowcode-vue-materials";
|
package/types/const/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const NATIVE_ELE_PKG = "native";
|
|
2
|
-
export declare const CONTAINER_TYPE: {
|
|
3
|
-
COMPONENT: string;
|
|
4
|
-
BLOCK: string;
|
|
5
|
-
PAGE: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const SUPPORT_SCHEMA_VERSION_LIST: string[];
|
|
8
|
-
export declare const BUILTIN_SLOT_NAMES: string[];
|
|
9
|
-
export declare const isBuiltinSlotName: (name: string) => boolean;
|
|
10
|
-
export * from './file';
|
|
11
|
-
export * from './generator';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IScope } from '../../../types';
|
|
2
|
-
export declare function transformJsExpr(expr: string, scope: IScope, { dontWrapEval, dontTransformThis2ContextAtRootScope }?: {
|
|
3
|
-
dontWrapEval?: boolean | undefined;
|
|
4
|
-
dontTransformThis2ContextAtRootScope?: boolean | undefined;
|
|
5
|
-
}): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Expression } from '@babel/types';
|
|
2
|
-
import { IScope } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* 将所有的 this.xxx 替换为 __$$context.xxx
|
|
5
|
-
* @param expr
|
|
6
|
-
*/
|
|
7
|
-
export declare function transformThis2Context(expr: string | Expression, scope: IScope, { ignoreRootScope }?: {
|
|
8
|
-
ignoreRootScope?: boolean | undefined;
|
|
9
|
-
}): string;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IScope } from '../../../types';
|
|
2
|
-
export declare function transformJsExpr(expr: string, scope: IScope, { dontWrapEval, dontTransformThis2ContextAtRootScope }?: {
|
|
3
|
-
dontWrapEval?: boolean | undefined;
|
|
4
|
-
dontTransformThis2ContextAtRootScope?: boolean | undefined;
|
|
5
|
-
}): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Expression } from '@babel/types';
|
|
2
|
-
import { IScope } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* 将所有的 this.xxx 替换为 __$$context.xxx
|
|
5
|
-
* @param expr
|
|
6
|
-
*/
|
|
7
|
-
export declare function transformThis2Context(expr: string | Expression, scope: IScope, { ignoreRootScope }?: {
|
|
8
|
-
ignoreRootScope?: boolean | undefined;
|
|
9
|
-
}): string;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BuilderComponentPlugin, IChunkBuilder, ICodeChunk, ICodeStruct } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 代码片段分组
|
|
4
|
-
* @param chunks
|
|
5
|
-
*/
|
|
6
|
-
export declare const groupChunks: (chunks: ICodeChunk[]) => ICodeChunk[][];
|
|
7
|
-
/**
|
|
8
|
-
* 代码片段构建器
|
|
9
|
-
*
|
|
10
|
-
* @export
|
|
11
|
-
* @class ChunkBuilder
|
|
12
|
-
* @template T
|
|
13
|
-
*/
|
|
14
|
-
export declare class ChunkBuilder implements IChunkBuilder {
|
|
15
|
-
private plugins;
|
|
16
|
-
constructor(plugins?: BuilderComponentPlugin[]);
|
|
17
|
-
run(ir: unknown, initialStructure?: ICodeStruct): Promise<{
|
|
18
|
-
chunks: ICodeChunk[][];
|
|
19
|
-
}>;
|
|
20
|
-
getPlugins(): BuilderComponentPlugin[];
|
|
21
|
-
addPlugin(plugin: BuilderComponentPlugin): void;
|
|
22
|
-
}
|
|
23
|
-
export default ChunkBuilder;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ICodeBuilder, ICodeChunk } from '../types';
|
|
2
|
-
export declare class CodeBuilder implements ICodeBuilder {
|
|
3
|
-
private chunkDefinitions;
|
|
4
|
-
private generators;
|
|
5
|
-
constructor(chunkDefinitions?: ICodeChunk[]);
|
|
6
|
-
/**
|
|
7
|
-
* Links all chunks together based on their requirements. Returns an array
|
|
8
|
-
* of ordered chunk names which need to be compiled and glued together.
|
|
9
|
-
*/
|
|
10
|
-
link(chunkDefinitions?: ICodeChunk[]): {
|
|
11
|
-
zIndex: number;
|
|
12
|
-
content: string;
|
|
13
|
-
};
|
|
14
|
-
generateByType(type: string, content: unknown): string;
|
|
15
|
-
private cleanupInvalidChunks;
|
|
16
|
-
}
|
|
17
|
-
export default CodeBuilder;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BuilderComponentPlugin, IContextData, IModuleBuilder, PostProcessor } from '../types';
|
|
2
|
-
export declare function createModuleBuilder(options?: {
|
|
3
|
-
plugins: BuilderComponentPlugin[];
|
|
4
|
-
postProcessors: PostProcessor[];
|
|
5
|
-
mainFileName?: string;
|
|
6
|
-
contextData?: IContextData;
|
|
7
|
-
}): IModuleBuilder;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { IPublicTypeProjectSchema, ResultDir } from '@alilc/lowcode-types';
|
|
2
|
-
import { IProjectBuilder, IProjectPlugins, IProjectTemplate, ISchemaParser, PostProcessor, ResourceListType } from '../types';
|
|
3
|
-
import { IContextData, ProjectPostProcessor, ProjectPreProcessor } from '../types/core';
|
|
4
|
-
export interface ProjectBuilderInitOptions {
|
|
5
|
-
/** 项目模板 */
|
|
6
|
-
template: IProjectTemplate;
|
|
7
|
-
/** 项目插件 */
|
|
8
|
-
plugins: IProjectPlugins;
|
|
9
|
-
/** 模块后置处理器 */
|
|
10
|
-
postProcessors: PostProcessor[];
|
|
11
|
-
/** Schema 解析器 */
|
|
12
|
-
schemaParser?: ISchemaParser;
|
|
13
|
-
/** 项目级别的前置处理器 */
|
|
14
|
-
projectPreProcessors?: ProjectPreProcessor[];
|
|
15
|
-
/** 项目级别的后置处理器 */
|
|
16
|
-
projectPostProcessors?: ProjectPostProcessor[];
|
|
17
|
-
/** 是否处于严格模式 */
|
|
18
|
-
inStrictMode?: boolean;
|
|
19
|
-
/** 一些额外的上下文数据 */
|
|
20
|
-
extraContextData?: Record<string, unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* Hook which is used to customize original options, we can reorder/add/remove plugins/processors
|
|
23
|
-
* of the existing solution.
|
|
24
|
-
*/
|
|
25
|
-
customizeBuilderOptions?(originalOptions: ProjectBuilderInitOptions): ProjectBuilderInitOptions;
|
|
26
|
-
}
|
|
27
|
-
export declare class ProjectBuilder implements IProjectBuilder {
|
|
28
|
-
/** 项目模板 */
|
|
29
|
-
private template;
|
|
30
|
-
/** 项目插件 */
|
|
31
|
-
private plugins;
|
|
32
|
-
/** 模块后置处理器 */
|
|
33
|
-
private postProcessors;
|
|
34
|
-
/** Schema 解析器 */
|
|
35
|
-
private schemaParser;
|
|
36
|
-
/** 项目级别的前置处理器 */
|
|
37
|
-
private projectPreProcessors;
|
|
38
|
-
/** 项目级别的后置处理器 */
|
|
39
|
-
private projectPostProcessors;
|
|
40
|
-
/** 是否处于严格模式 */
|
|
41
|
-
readonly inStrictMode: boolean;
|
|
42
|
-
/** 一些额外的上下文数据 */
|
|
43
|
-
readonly extraContextData: IContextData;
|
|
44
|
-
constructor(builderOptions: ProjectBuilderInitOptions);
|
|
45
|
-
generateProjectOne(originalSchema: IPublicTypeProjectSchema | string): Promise<ResultDir>;
|
|
46
|
-
/**
|
|
47
|
-
* 生成整个项目结构
|
|
48
|
-
* @param originalSchema
|
|
49
|
-
* @param resourceList
|
|
50
|
-
*/
|
|
51
|
-
generateProject(originalSchema: IPublicTypeProjectSchema | string | IPublicTypeProjectSchema[], resourceList: ResourceListType[]): Promise<ResultDir>;
|
|
52
|
-
private createModuleBuilders;
|
|
53
|
-
/**
|
|
54
|
-
* 自定义插槽代码生成
|
|
55
|
-
* @param builders
|
|
56
|
-
* @param parseResult
|
|
57
|
-
* @param buildResult
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
private generateExtraSlots;
|
|
61
|
-
}
|
|
62
|
-
export declare function createProjectBuilder(initOptions: ProjectBuilderInitOptions): IProjectBuilder;
|