@cloudbase/framework-plugin-low-code 1.7.2 → 1.7.3
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/lib/builder/config/common.d.ts +2 -0
- package/lib/builder/config/common.d.ts.map +1 -0
- package/lib/builder/config/common.js +13 -0
- package/lib/builder/config/index.d.ts +3 -0
- package/lib/builder/config/index.d.ts.map +1 -0
- package/lib/builder/config/index.js +29 -0
- package/lib/builder/config/mp.d.ts +2 -0
- package/lib/builder/config/mp.d.ts.map +1 -0
- package/lib/builder/config/mp.js +13 -0
- package/lib/builder/core/copy.d.ts +5 -0
- package/lib/builder/core/copy.d.ts.map +1 -0
- package/lib/builder/core/copy.js +62 -0
- package/lib/builder/core/generate.d.ts +9 -0
- package/lib/builder/core/generate.d.ts.map +1 -0
- package/lib/builder/core/generate.js +128 -0
- package/lib/builder/core/index.d.ts +32 -0
- package/lib/builder/core/index.d.ts.map +1 -0
- package/lib/builder/core/index.js +149 -0
- package/lib/builder/core/material.d.ts +4 -0
- package/lib/builder/core/material.d.ts.map +1 -0
- package/lib/builder/core/material.js +80 -0
- package/lib/builder/core/plugin.d.ts +4 -0
- package/lib/builder/core/plugin.d.ts.map +1 -0
- package/lib/builder/core/plugin.js +30 -0
- package/lib/builder/core/prepare.d.ts +8 -0
- package/lib/builder/core/prepare.d.ts.map +1 -0
- package/lib/builder/core/prepare.js +108 -0
- package/lib/builder/core/webpack.d.ts +15 -0
- package/lib/builder/core/webpack.d.ts.map +1 -0
- package/lib/builder/core/webpack.js +58 -0
- package/lib/builder/mp/BuildContext.d.ts +13 -0
- package/lib/builder/mp/BuildContext.d.ts.map +1 -0
- package/lib/builder/mp/BuildContext.js +2 -0
- package/lib/builder/mp/index.d.ts +33 -0
- package/lib/builder/mp/index.d.ts.map +1 -0
- package/lib/builder/mp/index.js +450 -0
- package/lib/builder/mp/lowcode.d.ts +8 -0
- package/lib/builder/mp/lowcode.d.ts.map +1 -0
- package/lib/builder/mp/lowcode.js +54 -0
- package/lib/builder/mp/materials.d.ts +15 -0
- package/lib/builder/mp/materials.d.ts.map +1 -0
- package/lib/builder/mp/materials.js +338 -0
- package/lib/builder/mp/mixMode.d.ts +10 -0
- package/lib/builder/mp/mixMode.d.ts.map +1 -0
- package/lib/builder/mp/mixMode.js +215 -0
- package/lib/builder/mp/mp_config.d.ts +18 -0
- package/lib/builder/mp/mp_config.d.ts.map +1 -0
- package/lib/builder/mp/mp_config.js +206 -0
- package/lib/builder/mp/util.d.ts +20 -0
- package/lib/builder/mp/util.d.ts.map +1 -0
- package/lib/builder/mp/util.js +243 -0
- package/lib/builder/mp/wxml.d.ts +16 -0
- package/lib/builder/mp/wxml.d.ts.map +1 -0
- package/lib/builder/mp/wxml.js +300 -0
- package/lib/builder/service/builder/copy.d.ts +14 -0
- package/lib/builder/service/builder/copy.d.ts.map +1 -0
- package/lib/builder/service/builder/copy.js +189 -0
- package/lib/builder/service/builder/generate.d.ts +52 -0
- package/lib/builder/service/builder/generate.d.ts.map +1 -0
- package/lib/builder/service/builder/generate.js +792 -0
- package/lib/builder/service/builder/index.d.ts +16 -0
- package/lib/builder/service/builder/index.d.ts.map +1 -0
- package/lib/builder/service/builder/index.js +69 -0
- package/lib/builder/service/builder/plugin.d.ts +8 -0
- package/lib/builder/service/builder/plugin.d.ts.map +1 -0
- package/lib/builder/service/builder/plugin.js +149 -0
- package/lib/builder/service/builder/webpack.d.ts +91 -0
- package/lib/builder/service/builder/webpack.d.ts.map +1 -0
- package/lib/builder/service/builder/webpack.js +589 -0
- package/lib/builder/types/common.d.ts +12 -0
- package/lib/builder/types/common.d.ts.map +1 -0
- package/lib/builder/types/common.js +7 -0
- package/lib/builder/util/common.d.ts +36 -0
- package/lib/builder/util/common.d.ts.map +1 -0
- package/lib/builder/util/common.js +257 -0
- package/lib/builder/util/console.d.ts +2 -0
- package/lib/builder/util/console.d.ts.map +1 -0
- package/lib/builder/util/console.js +13 -0
- package/lib/builder/util/generateFiles.d.ts +6 -0
- package/lib/builder/util/generateFiles.d.ts.map +1 -0
- package/lib/builder/util/generateFiles.js +94 -0
- package/lib/builder/util/index.d.ts +2 -0
- package/lib/builder/util/index.d.ts.map +1 -0
- package/lib/builder/util/index.js +13 -0
- package/lib/builder/util/junk.d.ts +3 -0
- package/lib/builder/util/junk.d.ts.map +1 -0
- package/lib/builder/util/junk.js +25 -0
- package/lib/builder/util/mp.d.ts +5 -0
- package/lib/builder/util/mp.d.ts.map +1 -0
- package/lib/builder/util/mp.js +99 -0
- package/lib/builder/util/name-mangler.d.ts +3 -0
- package/lib/builder/util/name-mangler.d.ts.map +1 -0
- package/lib/builder/util/name-mangler.js +7 -0
- package/lib/builder/util/net.d.ts +3 -0
- package/lib/builder/util/net.d.ts.map +1 -0
- package/lib/builder/util/net.js +54 -0
- package/lib/builder/util/process.d.ts +9 -0
- package/lib/builder/util/process.d.ts.map +1 -0
- package/lib/builder/util/process.js +28 -0
- package/lib/builder/util/style.d.ts +2 -0
- package/lib/builder/util/style.d.ts.map +1 -0
- package/lib/builder/util/style.js +13 -0
- package/lib/builder/util/weapp.d.ts +2 -0
- package/lib/builder/util/weapp.d.ts.map +1 -0
- package/lib/builder/util/weapp.js +13 -0
- package/lib/config/private.d.ts +3 -0
- package/lib/config/private.d.ts.map +1 -0
- package/lib/config/private.js +14 -0
- package/lib/generate.d.ts +2 -0
- package/lib/generate.d.ts.map +1 -0
- package/lib/generate.js +49 -0
- package/lib/generator/config/common.d.ts +6 -0
- package/lib/generator/config/common.d.ts.map +1 -0
- package/lib/generator/config/common.js +25 -0
- package/lib/generator/config/index.d.ts +18 -0
- package/lib/generator/config/index.d.ts.map +1 -0
- package/lib/generator/config/index.js +43 -0
- package/lib/generator/config/mp.d.ts +56 -0
- package/lib/generator/config/mp.d.ts.map +1 -0
- package/lib/generator/config/mp.js +104 -0
- package/lib/generator/core/generate.d.ts +59 -0
- package/lib/generator/core/generate.d.ts.map +1 -0
- package/lib/generator/core/generate.js +663 -0
- package/lib/generator/core/index.d.ts +25 -0
- package/lib/generator/core/index.d.ts.map +1 -0
- package/lib/generator/core/index.js +102 -0
- package/lib/generator/core/material.d.ts +14 -0
- package/lib/generator/core/material.d.ts.map +1 -0
- package/lib/generator/core/material.js +230 -0
- package/lib/generator/template.d.ts +3 -0
- package/lib/generator/template.d.ts.map +1 -0
- package/lib/generator/template.js +3 -0
- package/lib/generator/types/common.d.ts +69 -0
- package/lib/generator/types/common.d.ts.map +1 -0
- package/lib/generator/types/common.js +21 -0
- package/lib/generator/util/common.d.ts +36 -0
- package/lib/generator/util/common.d.ts.map +1 -0
- package/lib/generator/util/common.js +238 -0
- package/lib/generator/util/console.d.ts +3 -0
- package/lib/generator/util/console.d.ts.map +1 -0
- package/lib/generator/util/console.js +17 -0
- package/lib/generator/util/index.d.ts +2 -0
- package/lib/generator/util/index.d.ts.map +1 -0
- package/lib/generator/util/index.js +13 -0
- package/lib/generator/util/name-mangler.d.ts +17 -0
- package/lib/generator/util/name-mangler.d.ts.map +1 -0
- package/lib/generator/util/name-mangler.js +63 -0
- package/lib/generator/util/postcss-rpx.d.ts +11 -0
- package/lib/generator/util/postcss-rpx.d.ts.map +1 -0
- package/lib/generator/util/postcss-rpx.js +16 -0
- package/lib/generator/util/style.d.ts +6 -0
- package/lib/generator/util/style.d.ts.map +1 -0
- package/lib/generator/util/style.js +92 -0
- package/lib/generator/util/weapp.d.ts +5 -0
- package/lib/generator/util/weapp.d.ts.map +1 -0
- package/lib/generator/util/weapp.js +17 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +0 -0
- package/lib/types.d.ts +14 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +19 -0
- package/lib/utils/common.d.ts +0 -0
- package/lib/utils/common.d.ts.map +0 -0
- package/lib/utils/common.js +0 -0
- package/lib/utils/dataSource.d.ts +28 -0
- package/lib/utils/dataSource.d.ts.map +1 -0
- package/lib/utils/dataSource.js +171 -0
- package/lib/utils/index.d.ts +0 -0
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/postProcess.d.ts +3 -0
- package/lib/utils/postProcess.d.ts.map +1 -0
- package/lib/utils/postProcess.js +48 -0
- package/lib/weapps-core/config/index.d.ts +2 -0
- package/lib/weapps-core/config/index.d.ts.map +1 -0
- package/lib/weapps-core/config/index.js +13 -0
- package/lib/weapps-core/config/style.d.ts +7 -0
- package/lib/weapps-core/config/style.d.ts.map +1 -0
- package/lib/weapps-core/config/style.js +70 -0
- package/lib/weapps-core/index.d.ts +6 -0
- package/lib/weapps-core/index.d.ts.map +1 -0
- package/lib/weapps-core/index.js +31 -0
- package/lib/weapps-core/types/action.d.ts +25 -0
- package/lib/weapps-core/types/action.d.ts.map +1 -0
- package/lib/weapps-core/types/action.js +28 -0
- package/lib/weapps-core/types/app.d.ts +142 -0
- package/lib/weapps-core/types/app.d.ts.map +1 -0
- package/lib/weapps-core/types/app.js +21 -0
- package/lib/weapps-core/types/appbuild.d.ts +63 -0
- package/lib/weapps-core/types/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/types/appbuild.js +78 -0
- package/lib/weapps-core/types/code_types.d.ts +26 -0
- package/lib/weapps-core/types/code_types.d.ts.map +1 -0
- package/lib/weapps-core/types/code_types.js +2 -0
- package/lib/weapps-core/types/git.d.ts +7 -0
- package/lib/weapps-core/types/git.d.ts.map +1 -0
- package/lib/weapps-core/types/git.js +2 -0
- package/lib/weapps-core/types/index.d.ts +11 -0
- package/lib/weapps-core/types/index.d.ts.map +1 -0
- package/lib/weapps-core/types/index.js +22 -0
- package/lib/weapps-core/types/lowcode.d.ts +26 -0
- package/lib/weapps-core/types/lowcode.d.ts.map +1 -0
- package/lib/weapps-core/types/lowcode.js +25 -0
- package/lib/weapps-core/types/material.d.ts +90 -0
- package/lib/weapps-core/types/material.d.ts.map +1 -0
- package/lib/weapps-core/types/material.js +9 -0
- package/lib/weapps-core/types/plugins.d.ts +17 -0
- package/lib/weapps-core/types/plugins.d.ts.map +1 -0
- package/lib/weapps-core/types/plugins.js +2 -0
- package/lib/weapps-core/types/style.d.ts +93 -0
- package/lib/weapps-core/types/style.d.ts.map +1 -0
- package/lib/weapps-core/types/style.js +2 -0
- package/lib/weapps-core/types/web.d.ts +120 -0
- package/lib/weapps-core/types/web.d.ts.map +1 -0
- package/lib/weapps-core/types/web.js +2 -0
- package/lib/weapps-core/utils/appbuild.d.ts +6 -0
- package/lib/weapps-core/utils/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/utils/appbuild.js +40 -0
- package/lib/weapps-core/utils/common.d.ts +16 -0
- package/lib/weapps-core/utils/common.d.ts.map +1 -0
- package/lib/weapps-core/utils/common.js +90 -0
- package/lib/weapps-core/utils/file.d.ts +12 -0
- package/lib/weapps-core/utils/file.d.ts.map +1 -0
- package/lib/weapps-core/utils/file.js +142 -0
- package/lib/weapps-core/utils/formily.d.ts +5 -0
- package/lib/weapps-core/utils/formily.d.ts.map +1 -0
- package/lib/weapps-core/utils/formily.js +416 -0
- package/lib/weapps-core/utils/index.d.ts +7 -0
- package/lib/weapps-core/utils/index.d.ts.map +1 -0
- package/lib/weapps-core/utils/index.js +18 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts +4 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts.map +1 -0
- package/lib/weapps-core/utils/lowcdoe.js +69 -0
- package/lib/weapps-core/utils/style.d.ts +17 -0
- package/lib/weapps-core/utils/style.d.ts.map +1 -0
- package/lib/weapps-core/utils/style.js +330 -0
- package/package.json +3 -3
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.cleanVarName = exports.camelcase = exports.upperFirst = exports.getFileNameByUrl = exports.writeLibCommonRes2file = exports.getYyptConfigInfo = exports.getInputProps = exports.getComponentsInfo = exports.deepDealSchema = exports.JsonToStringWithVariableName = exports.simpleDeepClone = exports.deepDeal = exports.isPlainObject = exports.isArray = exports.getMetaInfoBySourceKey = exports.deepDealComponentSchemaJson = exports.promiseWrapper = void 0;
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const url_1 = __importDefault(require("url"));
|
|
18
|
+
const react_schema_renderer_1 = require("@formily/react-schema-renderer");
|
|
19
|
+
function promiseWrapper(p) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
try {
|
|
22
|
+
p.then((i) => resolve([null, i])).catch((e) => resolve([e, null]));
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
resolve([e, null]);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.promiseWrapper = promiseWrapper;
|
|
30
|
+
function deepDealComponentSchemaJson(schema, dealFn) {
|
|
31
|
+
if (!schema)
|
|
32
|
+
return;
|
|
33
|
+
dealFn(schema);
|
|
34
|
+
if (schema.properties) {
|
|
35
|
+
Object.keys(schema.properties).forEach((key) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const childSchema = (_a = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _a === void 0 ? void 0 : _a[key];
|
|
38
|
+
if (childSchema) {
|
|
39
|
+
deepDealComponentSchemaJson(childSchema, dealFn);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.deepDealComponentSchemaJson = deepDealComponentSchemaJson;
|
|
45
|
+
function getMetaInfoBySourceKey(sourceKey) {
|
|
46
|
+
if (!sourceKey) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
const [materialName, name] = sourceKey.split(':');
|
|
50
|
+
return {
|
|
51
|
+
materialName,
|
|
52
|
+
name,
|
|
53
|
+
variableName: camelcase(materialName + '_' + name),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.getMetaInfoBySourceKey = getMetaInfoBySourceKey;
|
|
57
|
+
function isArray(src) {
|
|
58
|
+
return Object.prototype.toString.call(src) === '[object Array]';
|
|
59
|
+
}
|
|
60
|
+
exports.isArray = isArray;
|
|
61
|
+
function isPlainObject(src) {
|
|
62
|
+
return Object.prototype.toString.call(src) === '[object Object]';
|
|
63
|
+
}
|
|
64
|
+
exports.isPlainObject = isPlainObject;
|
|
65
|
+
function deepDeal(src, reviver) {
|
|
66
|
+
if (isArray(src)) {
|
|
67
|
+
for (let i = 0, len = src.length; i < len; i++) {
|
|
68
|
+
deepDeal(src[i], reviver);
|
|
69
|
+
reviver === null || reviver === void 0 ? void 0 : reviver(i, src[i], src);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (isPlainObject(src)) {
|
|
73
|
+
for (const key in src) {
|
|
74
|
+
if (src.hasOwnProperty(key)) {
|
|
75
|
+
deepDeal(src[key], reviver);
|
|
76
|
+
reviver === null || reviver === void 0 ? void 0 : reviver(key, src[key], src);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.deepDeal = deepDeal;
|
|
82
|
+
function simpleDeepClone(data) {
|
|
83
|
+
return JSON.parse(JSON.stringify(data));
|
|
84
|
+
}
|
|
85
|
+
exports.simpleDeepClone = simpleDeepClone;
|
|
86
|
+
function JsonToStringWithVariableName(copyJson, options) {
|
|
87
|
+
let variable = JSON.stringify(copyJson, null, 2)
|
|
88
|
+
.replace(/"%%%(.*?)%%%"/g, function (match, expression) {
|
|
89
|
+
return expression.replace(/\\"/g, '"');
|
|
90
|
+
})
|
|
91
|
+
.replace(/\\'/g, "'");
|
|
92
|
+
if (options.EOL) {
|
|
93
|
+
variable = variable.replace(/\\n/g, '\n').replace(/\\r/g, '\r');
|
|
94
|
+
}
|
|
95
|
+
return variable;
|
|
96
|
+
}
|
|
97
|
+
exports.JsonToStringWithVariableName = JsonToStringWithVariableName;
|
|
98
|
+
function deepDealSchema(sourceSchema, deal) {
|
|
99
|
+
const fieldSchema = new react_schema_renderer_1.Schema(sourceSchema);
|
|
100
|
+
if (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.isObject()) {
|
|
101
|
+
Object.keys(fieldSchema.properties || {}).forEach((key) => {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
const schema = (_a = fieldSchema.properties) === null || _a === void 0 ? void 0 : _a[key];
|
|
104
|
+
const { 'x-props': xProps } = schema || {};
|
|
105
|
+
if (((_b = xProps === null || xProps === void 0 ? void 0 : xProps['data']) === null || _b === void 0 ? void 0 : _b._visible) === false) {
|
|
106
|
+
fieldSchema.setProperty(key, new react_schema_renderer_1.Schema({}));
|
|
107
|
+
}
|
|
108
|
+
else if (schema) {
|
|
109
|
+
deepDealSchema(schema, deal);
|
|
110
|
+
deal === null || deal === void 0 ? void 0 : deal(schema, key);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return fieldSchema.toJSON();
|
|
115
|
+
}
|
|
116
|
+
exports.deepDealSchema = deepDealSchema;
|
|
117
|
+
function getComponentsInfo(appBuildDir, dependencies, fileCodeMap) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const outputObj = {};
|
|
120
|
+
yield Promise.all(dependencies.map(({ name: materialName, components, isComposite }) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
if (isComposite) {
|
|
122
|
+
components.forEach((component) => {
|
|
123
|
+
let compItem = component;
|
|
124
|
+
const sourceKey = `${materialName}:${compItem.name}`;
|
|
125
|
+
outputObj[sourceKey] = Object.assign({ isComposite }, compItem);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
yield Promise.all(components.map(({ name, meta, emitEvents, events = undefined, compConfig, }) => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
outputObj[materialName + ':' + name] = Object.assign(Object.assign({ isComposite }, meta), { events,
|
|
131
|
+
emitEvents,
|
|
132
|
+
compConfig });
|
|
133
|
+
})));
|
|
134
|
+
}
|
|
135
|
+
})));
|
|
136
|
+
return outputObj;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
exports.getComponentsInfo = getComponentsInfo;
|
|
140
|
+
function getInputProps(componentsMetaMap) {
|
|
141
|
+
const outputObj = {};
|
|
142
|
+
for (let key in componentsMetaMap) {
|
|
143
|
+
let component = componentsMetaMap[key];
|
|
144
|
+
const sourceKey = key;
|
|
145
|
+
if (component.isComposite) {
|
|
146
|
+
let compItem = component;
|
|
147
|
+
Object.keys(compItem.dataForm || {}).forEach((key) => {
|
|
148
|
+
var _a, _b;
|
|
149
|
+
const inputProps = ((_a = compItem.dataForm[key]) === null || _a === void 0 ? void 0 : _a.inputProp) || ((_b = compItem.dataForm[key]) === null || _b === void 0 ? void 0 : _b.syncProp);
|
|
150
|
+
if (inputProps) {
|
|
151
|
+
outputObj[sourceKey] = Object.assign({ [key]: inputProps }, (outputObj[sourceKey] || {}));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const inputProps = (component === null || component === void 0 ? void 0 : component.inputProps) || (component === null || component === void 0 ? void 0 : component.syncProps);
|
|
157
|
+
if (inputProps) {
|
|
158
|
+
outputObj[sourceKey] = inputProps;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return outputObj;
|
|
163
|
+
}
|
|
164
|
+
exports.getInputProps = getInputProps;
|
|
165
|
+
function getYyptConfigInfo(extraData) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const configJson = {
|
|
168
|
+
yyptAppKey: '',
|
|
169
|
+
reportUrl: '',
|
|
170
|
+
stopReport: 'true',
|
|
171
|
+
};
|
|
172
|
+
if (!extraData || !extraData.operationService) {
|
|
173
|
+
extraData = extraData || {};
|
|
174
|
+
extraData.operationService = extraData.operationService || {
|
|
175
|
+
yyptEnabled: true,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const yyptAppKey = configJson.yyptAppKey || extraData.operationService.extAppId || '';
|
|
179
|
+
const reportUrl = configJson.reportUrl || extraData.operationService.reportUrl || '';
|
|
180
|
+
const stopReport = configJson.stopReport === 'true' || !extraData.operationService.yyptEnabled;
|
|
181
|
+
return {
|
|
182
|
+
yyptAppKey,
|
|
183
|
+
reportUrl,
|
|
184
|
+
stopReport,
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
exports.getYyptConfigInfo = getYyptConfigInfo;
|
|
189
|
+
function writeLibCommonRes2file(gItem, codeDir) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
const compLibCommonResource = gItem.compLibCommonResource;
|
|
192
|
+
const libCommonResFiles = [];
|
|
193
|
+
libCommonResFiles.push({
|
|
194
|
+
path: path_1.default.join(codeDir, `class.less`),
|
|
195
|
+
code: `
|
|
196
|
+
${compLibCommonResource.theme.variable || ''}
|
|
197
|
+
${compLibCommonResource.class || ''}
|
|
198
|
+
${compLibCommonResource.theme.class || ''}
|
|
199
|
+
`,
|
|
200
|
+
}, {
|
|
201
|
+
path: path_1.default.join(codeDir, 'const.js'),
|
|
202
|
+
code: compLibCommonResource ? compLibCommonResource.const.code : '',
|
|
203
|
+
}, {
|
|
204
|
+
path: path_1.default.join(codeDir, 'tools.js'),
|
|
205
|
+
code: compLibCommonResource ? compLibCommonResource.tools.code : '',
|
|
206
|
+
});
|
|
207
|
+
return libCommonResFiles.reduce((ret, item) => {
|
|
208
|
+
ret[item.path] = {
|
|
209
|
+
code: item.code,
|
|
210
|
+
};
|
|
211
|
+
return ret;
|
|
212
|
+
}, {});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
exports.writeLibCommonRes2file = writeLibCommonRes2file;
|
|
216
|
+
function getFileNameByUrl(fileUrl) {
|
|
217
|
+
const parsedUrl = url_1.default.parse(fileUrl);
|
|
218
|
+
const filename = path_1.default.basename((parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) || '');
|
|
219
|
+
return filename;
|
|
220
|
+
}
|
|
221
|
+
exports.getFileNameByUrl = getFileNameByUrl;
|
|
222
|
+
function upperFirst(str) {
|
|
223
|
+
return str[0].toUpperCase() + str.slice(1);
|
|
224
|
+
}
|
|
225
|
+
exports.upperFirst = upperFirst;
|
|
226
|
+
function camelcase(str, firstUpperCase = false) {
|
|
227
|
+
str = str.replace(/[\:_-]([a-zA-Z])/g, function (l) {
|
|
228
|
+
return l[1].toUpperCase();
|
|
229
|
+
});
|
|
230
|
+
if (firstUpperCase)
|
|
231
|
+
str = str.charAt(0).toUpperCase() + str.slice(1);
|
|
232
|
+
return str;
|
|
233
|
+
}
|
|
234
|
+
exports.camelcase = camelcase;
|
|
235
|
+
function cleanVarName(name) {
|
|
236
|
+
return name.replace(/[@-]/g, '_');
|
|
237
|
+
}
|
|
238
|
+
exports.cleanVarName = cleanVarName;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/generator/util/console.ts"],"names":[],"mappings":"AACA,wBAAgB,MAAM,CAAC,GAAG,GAAG,OAAA,QAY5B;AAED,wBAAgB,GAAG,CAAC,GAAG,GAAG,OAAA,QAEzB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.log = exports.notice = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
function notice(...msg) {
|
|
9
|
+
console.log(chalk_1.default.yellowBright.bold('~~~~~~~~~~~~~~~~~~~~~~~~~~~~我是notice分割线-start~~~~~~~~~~~~~~~~~~~~~~~~~~~'));
|
|
10
|
+
console.log(...msg.map(item => chalk_1.default.yellow(item)));
|
|
11
|
+
console.log(chalk_1.default.yellowBright.bold('~~~~~~~~~~~~~~~~~~~~~~~~~~~~我是notice分割线-end~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'));
|
|
12
|
+
}
|
|
13
|
+
exports.notice = notice;
|
|
14
|
+
function log(...msg) {
|
|
15
|
+
console.log(...msg.map(item => chalk_1.default.hex(item)));
|
|
16
|
+
}
|
|
17
|
+
exports.log = log;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generator/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./common"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default class NameMangler {
|
|
2
|
+
current?: string[];
|
|
3
|
+
mangled: {
|
|
4
|
+
[name: string]: string;
|
|
5
|
+
};
|
|
6
|
+
private leadingChars;
|
|
7
|
+
private candidateChars;
|
|
8
|
+
private blackList;
|
|
9
|
+
constructor(opts?: {
|
|
10
|
+
leadingCharRanges?: string[];
|
|
11
|
+
candidateCharRanges?: string[];
|
|
12
|
+
blackList?: string[];
|
|
13
|
+
});
|
|
14
|
+
private next;
|
|
15
|
+
mangle(name: string): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=name-mangler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-mangler.d.ts","sourceRoot":"","sources":["../../../src/generator/util/name-mangler.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAM;IAEzC,OAAO,CAAC,YAAY,CAAW;IAC/B,OAAO,CAAC,cAAc,CAAW;IACjC,OAAO,CAAC,SAAS,CAAW;gBAG1B,IAAI,GAAE;QACJ,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB;IAgBR,OAAO,CAAC,IAAI;IAyBZ,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAW7B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class NameMangler {
|
|
4
|
+
constructor(opts = {}) {
|
|
5
|
+
this.mangled = {};
|
|
6
|
+
const leadingCharRanges = opts.leadingCharRanges || ['a', 'z', 'A', 'Z'];
|
|
7
|
+
const candidateCharRanges = opts.candidateCharRanges || [
|
|
8
|
+
'a',
|
|
9
|
+
'z',
|
|
10
|
+
'A',
|
|
11
|
+
'Z',
|
|
12
|
+
'0',
|
|
13
|
+
'9',
|
|
14
|
+
];
|
|
15
|
+
this.leadingChars = createCharsFromRanges(leadingCharRanges);
|
|
16
|
+
this.candidateChars = createCharsFromRanges(candidateCharRanges);
|
|
17
|
+
this.blackList = opts.blackList || [];
|
|
18
|
+
}
|
|
19
|
+
next() {
|
|
20
|
+
if (!this.current) {
|
|
21
|
+
this.current = [this.leadingChars[0]];
|
|
22
|
+
return this.current.join('');
|
|
23
|
+
}
|
|
24
|
+
const len = this.current.length;
|
|
25
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
26
|
+
const chars = i === 0 ? this.leadingChars : this.candidateChars;
|
|
27
|
+
const curCharIdx = chars.indexOf(this.current[i]);
|
|
28
|
+
if (curCharIdx < chars.length - 1) {
|
|
29
|
+
this.current[i] = chars[curCharIdx + 1];
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
else if (i === 0) {
|
|
33
|
+
this.current[i] = chars[0];
|
|
34
|
+
this.current.push(chars[0]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.current[i] = chars[0];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return this.current.join('');
|
|
41
|
+
}
|
|
42
|
+
mangle(name) {
|
|
43
|
+
let mangled = this.mangled[name];
|
|
44
|
+
if (!mangled) {
|
|
45
|
+
mangled = this.next();
|
|
46
|
+
if (this.blackList.indexOf(mangled) > -1) {
|
|
47
|
+
return this.mangle(name);
|
|
48
|
+
}
|
|
49
|
+
this.mangled[name] = mangled;
|
|
50
|
+
}
|
|
51
|
+
return mangled;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = NameMangler;
|
|
55
|
+
function createCharsFromRanges(range) {
|
|
56
|
+
const chars = [];
|
|
57
|
+
for (let i = 0; i + 1 < range.length; i += 2) {
|
|
58
|
+
for (let code = range[i].charCodeAt(0); code <= range[i + 1].charCodeAt(0); code++) {
|
|
59
|
+
chars.push(String.fromCharCode(code));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return chars;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postcss-rpx.d.ts","sourceRoot":"","sources":["../../../src/generator/util/postcss-rpx.ts"],"names":[],"mappings":"AAiBA,QAAA,MAAM,MAAM;;;;;;;;CAWX,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const plugin = (opts = {}) => {
|
|
4
|
+
const { zoom = 1 } = opts || {};
|
|
5
|
+
const pxRegExp = /\b(\d+(\.\d+)?)px\b/g;
|
|
6
|
+
return {
|
|
7
|
+
postcssPlugin: 'wx-px2rpx',
|
|
8
|
+
Once(root, { result }) {
|
|
9
|
+
root.replaceValues(pxRegExp, { fast: 'px' }, (string) => {
|
|
10
|
+
return `${zoom * parseInt(string)}rpx`;
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
plugin.postcss = true;
|
|
16
|
+
exports.default = plugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const defaultThemeCode = "\n@example-primary-color: blue;\n// \u6DF7\u7528 ( Mixin )\n/**\n * \u53EF\u4EE5 \u5728\u5168\u5C40style\uFF0C\u6216\u8005\u9875\u9762\u7684style\u4E2D\u4F7F\u7528.mixins()\n * .a {\n color: #111;\n .mixins();\n }\n\n .b {\n color: red;\n .mixins(red);\n }\n * \uFF08\u53CB\u60C5\u63D0\u793A\uFF1A\u4E0D\u5EFA\u8BAEtheme\u4E2D\u4E66\u5199\u5177\u4F53\u7684\u7C7B\u6837\u5F0F\uFF0C \u6216\u8005\u4E0D\u5E26\u62EC\u53F7\u7684mixin\uFF0C\u4F1A\u5BFC\u81F4\u4EE3\u7801\u91CD\u590D\u7F16\u8BD1 \uFF09\n **/\n.mixins(@color: red) {\n display:block;\n padding: 40px;\n background: @color;\n text-decoration:none;\n}\n";
|
|
2
|
+
export declare function processLess(lessCode: string): Promise<string>;
|
|
3
|
+
export declare function processLessToRpx(lessCode: string): Promise<string>;
|
|
4
|
+
export declare function generateDefaultTheme(data: any): any;
|
|
5
|
+
export declare function generateDefaultStyle(data: any): void;
|
|
6
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/generator/util/style.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,yoBAsB5B,CAAC;AAEF,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,mBAIjD;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,mBAItD;AAGD,wBAAgB,oBAAoB,CAAC,IAAI,KAAA,OAexC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,KAAA,QAYxC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.generateDefaultStyle = exports.generateDefaultTheme = exports.processLessToRpx = exports.processLess = exports.defaultThemeCode = void 0;
|
|
16
|
+
const postcss_1 = __importDefault(require("postcss"));
|
|
17
|
+
const less_1 = __importDefault(require("less"));
|
|
18
|
+
const postcss_pxtorem_1 = __importDefault(require("postcss-pxtorem"));
|
|
19
|
+
const postcss_rpx_1 = __importDefault(require("./postcss-rpx"));
|
|
20
|
+
const config_1 = require("../config");
|
|
21
|
+
const THEME = 'theme';
|
|
22
|
+
const STYLE = 'style';
|
|
23
|
+
exports.defaultThemeCode = `
|
|
24
|
+
@example-primary-color: blue;
|
|
25
|
+
// 混用 ( Mixin )
|
|
26
|
+
/**
|
|
27
|
+
* 可以 在全局style,或者页面的style中使用.mixins()
|
|
28
|
+
* .a {
|
|
29
|
+
color: #111;
|
|
30
|
+
.mixins();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.b {
|
|
34
|
+
color: red;
|
|
35
|
+
.mixins(red);
|
|
36
|
+
}
|
|
37
|
+
* (友情提示:不建议theme中书写具体的类样式, 或者不带括号的mixin,会导致代码重复编译 )
|
|
38
|
+
**/
|
|
39
|
+
.mixins(@color: red) {
|
|
40
|
+
display:block;
|
|
41
|
+
padding: 40px;
|
|
42
|
+
background: @color;
|
|
43
|
+
text-decoration:none;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
function processLess(lessCode) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const { css: lessCss } = yield less_1.default.render(lessCode);
|
|
49
|
+
const { css: remCss } = yield (0, postcss_1.default)([(0, postcss_pxtorem_1.default)(config_1.remConfig)]).process(lessCss);
|
|
50
|
+
return remCss;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.processLess = processLess;
|
|
54
|
+
function processLessToRpx(lessCode) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const { css: lessCss } = yield less_1.default.render(lessCode);
|
|
57
|
+
const { css: rpxCss } = yield (0, postcss_1.default)([(0, postcss_rpx_1.default)(config_1.rpxConfig)]).process(lessCss);
|
|
58
|
+
return rpxCss;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.processLessToRpx = processLessToRpx;
|
|
62
|
+
function generateDefaultTheme(data) {
|
|
63
|
+
const lowCodes = data.lowCodes || data.codeModules || [];
|
|
64
|
+
const isHasTheme = lowCodes.find((item) => item.type === THEME);
|
|
65
|
+
if (!isHasTheme) {
|
|
66
|
+
const themeStyle = {
|
|
67
|
+
type: THEME,
|
|
68
|
+
name: THEME,
|
|
69
|
+
code: exports.defaultThemeCode,
|
|
70
|
+
path: `global/${THEME}`,
|
|
71
|
+
system: true,
|
|
72
|
+
};
|
|
73
|
+
lowCodes.unshift(themeStyle);
|
|
74
|
+
return themeStyle;
|
|
75
|
+
}
|
|
76
|
+
return isHasTheme;
|
|
77
|
+
}
|
|
78
|
+
exports.generateDefaultTheme = generateDefaultTheme;
|
|
79
|
+
function generateDefaultStyle(data) {
|
|
80
|
+
const lowCodes = data.lowCodes || data.codeModules || [];
|
|
81
|
+
const isHasSTYLE = lowCodes.find((item) => item.type === STYLE);
|
|
82
|
+
if (!isHasSTYLE) {
|
|
83
|
+
lowCodes.unshift({
|
|
84
|
+
type: STYLE,
|
|
85
|
+
name: STYLE,
|
|
86
|
+
code: '',
|
|
87
|
+
path: `${data.id}/${STYLE}`,
|
|
88
|
+
system: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.generateDefaultStyle = generateDefaultStyle;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IWeAppComponentInstance } from '../../weapps-core';
|
|
2
|
+
export declare function walkThroughWidgets(widgets: {
|
|
3
|
+
[key: string]: IWeAppComponentInstance;
|
|
4
|
+
}, fn: (id: string, widget: IWeAppComponentInstance, parentId: string) => void, currentId?: string): void;
|
|
5
|
+
//# sourceMappingURL=weapp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weapp.d.ts","sourceRoot":"","sources":["../../../src/generator/util/weapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,wBAAgB,kBAAkB,CAChC,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,EACnD,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,EAC3E,SAAS,CAAC,EAAE,MAAM,QAYnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.walkThroughWidgets = void 0;
|
|
4
|
+
function walkThroughWidgets(widgets, fn, currentId) {
|
|
5
|
+
var _a;
|
|
6
|
+
for (const id in widgets) {
|
|
7
|
+
const { properties: children, xComponent, xProps } = widgets[id];
|
|
8
|
+
const { directives } = xProps || {};
|
|
9
|
+
if (((_a = directives === null || directives === void 0 ? void 0 : directives.waIf) === null || _a === void 0 ? void 0 : _a.value) === false) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const isSlot = !xComponent;
|
|
13
|
+
!isSlot && fn(id, widgets[id], currentId);
|
|
14
|
+
children && walkThroughWidgets(children, fn, isSlot ? currentId : id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.walkThroughWidgets = walkThroughWidgets;
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum DEPLOY_MODE {
|
|
2
|
+
PREVIEW = "preview",
|
|
3
|
+
UPLOAD = "upload"
|
|
4
|
+
}
|
|
5
|
+
export declare enum RUNTIME {
|
|
6
|
+
CI = "CI",
|
|
7
|
+
NONE = "",
|
|
8
|
+
CLI = "CLI"
|
|
9
|
+
}
|
|
10
|
+
export declare enum HISTORY_TYPE {
|
|
11
|
+
BROWSER = "BROWSER",
|
|
12
|
+
HASH = "HASH"
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,OAAO;IACjB,EAAE,OAAO;IACT,IAAI,KAAK;IACT,GAAG,QAAQ;CACZ;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd"}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HISTORY_TYPE = exports.RUNTIME = exports.DEPLOY_MODE = void 0;
|
|
4
|
+
var DEPLOY_MODE;
|
|
5
|
+
(function (DEPLOY_MODE) {
|
|
6
|
+
DEPLOY_MODE["PREVIEW"] = "preview";
|
|
7
|
+
DEPLOY_MODE["UPLOAD"] = "upload";
|
|
8
|
+
})(DEPLOY_MODE = exports.DEPLOY_MODE || (exports.DEPLOY_MODE = {}));
|
|
9
|
+
var RUNTIME;
|
|
10
|
+
(function (RUNTIME) {
|
|
11
|
+
RUNTIME["CI"] = "CI";
|
|
12
|
+
RUNTIME["NONE"] = "";
|
|
13
|
+
RUNTIME["CLI"] = "CLI";
|
|
14
|
+
})(RUNTIME = exports.RUNTIME || (exports.RUNTIME = {}));
|
|
15
|
+
var HISTORY_TYPE;
|
|
16
|
+
(function (HISTORY_TYPE) {
|
|
17
|
+
HISTORY_TYPE["BROWSER"] = "BROWSER";
|
|
18
|
+
HISTORY_TYPE["HASH"] = "HASH";
|
|
19
|
+
})(HISTORY_TYPE = exports.HISTORY_TYPE || (exports.HISTORY_TYPE = {}));
|
package/lib/utils/common.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/utils/common.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IWebRuntimeAppData } from 'src/weapps-core';
|
|
2
|
+
export declare const CLOUD_FUNCTION_TYPE = "cloud-function";
|
|
3
|
+
export declare const EXTERNAL_FUNCTION_TYPE = "http";
|
|
4
|
+
export declare const DATABASE_TYPE = "database";
|
|
5
|
+
export declare function getDatasourceResourceName(datasrouce: any, mode: any): string;
|
|
6
|
+
export declare function getAppDatasourceResourceName(appId: any, datasrouce: any, mode: any): string;
|
|
7
|
+
export declare function getDatasourceDatabaseName(dsConfig: any, mode: any): string | null;
|
|
8
|
+
export declare function mergeDependencies(...pkgs: any[]): {};
|
|
9
|
+
export declare function lowercaseKey(obj: any, deep?: boolean): any;
|
|
10
|
+
export declare function standardizeDataSource(ds: any): any;
|
|
11
|
+
export declare function getDatasourceProfiles(datasources: any): any;
|
|
12
|
+
export declare function getDataVarProfiles(appData: IWebRuntimeAppData): {
|
|
13
|
+
$global: any[];
|
|
14
|
+
};
|
|
15
|
+
export declare function getDatasetProfiles(mainAppData: {
|
|
16
|
+
dataset?: any;
|
|
17
|
+
rootPath?: string;
|
|
18
|
+
pageInstanceList?: {
|
|
19
|
+
dataset?: any;
|
|
20
|
+
}[];
|
|
21
|
+
}, apps?: {
|
|
22
|
+
dataset?: any;
|
|
23
|
+
rootPath?: string;
|
|
24
|
+
pageInstanceList?: {
|
|
25
|
+
dataset?: any;
|
|
26
|
+
}[];
|
|
27
|
+
}[]): {};
|
|
28
|
+
//# sourceMappingURL=dataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../src/utils/dataSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,iBAAiB,CAAC;AAMpE,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,aAAa,aAAa,CAAC;AAMxC,wBAAgB,yBAAyB,CAAC,UAAU,KAAA,EAAE,IAAI,KAAA,UAGzD;AAED,wBAAgB,4BAA4B,CAAC,KAAK,KAAA,EAAE,UAAU,KAAA,EAAE,IAAI,KAAA,UAGnE;AAMD,wBAAgB,yBAAyB,CAAC,QAAQ,KAAA,EAAE,IAAI,KAAA,iBAIvD;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,OAAA,MAexC;AAmBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,GAAG,CAU1D;AAOD,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,GAAG,OA6C5C;AAOD,wBAAgB,qBAAqB,CAAC,WAAW,KAAA,OAehD;AAOD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB;;EAU7D;AAiCD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE;IACX,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;CACxC,EACD,IAAI,CAAC,EAAE;IACL,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;CACxC,EAAE,MAiBJ"}
|