@cloudbase/cals 0.3.33-alpha.0 → 0.3.33
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/parser/cals/index.d.ts +1 -1
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +12 -2
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +7 -2
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/style.d.ts.map +1 -1
- package/lib/parser/cals/utils/transform/index.d.ts +4 -0
- package/lib/parser/cals/utils/transform/index.d.ts.map +1 -0
- package/lib/parser/cals/utils/transform/index.js +247 -0
- package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/common.js +6 -3
- package/lib/parser/cals/utils/version/config.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/config.js +6 -1
- package/lib/parser/cals/utils/version/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/utils.js +3 -1
- package/lib/parser/expression/index.d.ts.map +1 -1
- package/lib/parser/expression/index.js +4 -2
- package/lib/parser/index.d.ts +0 -1
- package/lib/parser/index.d.ts.map +1 -1
- package/lib/parser/index.js +1 -7
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/basic/app.d.ts.map +1 -1
- package/lib/types/basic/common.d.ts.map +1 -1
- package/lib/types/basic/component.d.ts +5 -0
- package/lib/types/basic/component.d.ts.map +1 -1
- package/lib/types/basic/datasource.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/lcds.d.ts.map +1 -1
- package/lib/types/platform/app.d.ts +0 -4
- package/lib/types/platform/app.d.ts.map +1 -1
- package/lib/types/platform/component.d.ts.map +1 -1
- package/lib/types/platform/datasource.d.ts +2 -2
- package/lib/types/platform/datasource.d.ts.map +1 -1
- package/lib/types/platform/widget/form.d.ts.map +1 -1
- package/lib/types/platform/widget/meta.d.ts.map +1 -1
- package/lib/utils/build.js +8 -8
- package/lib/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/parser/cals/utils/code/index.d.ts +0 -31
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/code/index.js +0 -364
|
@@ -97,6 +97,7 @@ export declare function serializeComponent(ctx: ISerializeContext & ({
|
|
|
97
97
|
directives?: {
|
|
98
98
|
waIf?: IDynamicValue;
|
|
99
99
|
waFor?: IDynamicValue;
|
|
100
|
+
waForKey?: IDynamicValue;
|
|
100
101
|
};
|
|
101
102
|
listeners?: any[];
|
|
102
103
|
style: any;
|
|
@@ -291,7 +292,6 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
291
292
|
author: string;
|
|
292
293
|
description: string;
|
|
293
294
|
domain?: string;
|
|
294
|
-
originHistoryId?: string;
|
|
295
295
|
};
|
|
296
296
|
dependencies: IDependencies;
|
|
297
297
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/cals/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EAGd,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EACL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAc5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,cAAc,GAAG,wBAAwB,CAAC,EAC/E,IAAI,EAAE,GAAG,GACR,cAAc,CAmDhB;AAWD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,iBAAiB,GAAG;IACvB,IAAI,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;CAC3C,EACD,SAAS,EAAE,GAAG,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAC9B,eAAe,GAAG,iBAAiB,CAoHrC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,GAAG,CAwBzE;AAaD,wBAAgB,+BAA+B,CAAC,IAAI,EAAE;IACpD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACzC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;KAAE,CAAC;IAC/C,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;KAAE,CAAC;CAC1C;;;;;;;mBAIY,MAAM;mBACN,MAAM;sBACH,MAAM;;;6BACwB,OAAO;;;wBACnC,MAAM;;;EA8BvB"}
|
package/lib/parser/cals/index.js
CHANGED
|
@@ -191,7 +191,7 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
191
191
|
return _value;
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
data[processedKey] = processedValue;
|
|
194
|
+
data[processedKey] = (0, lodash_1.cloneDeep)(processedValue);
|
|
195
195
|
}
|
|
196
196
|
extra[originKey] = processedExtra;
|
|
197
197
|
});
|
|
@@ -342,6 +342,14 @@ function serializeDirecties(ctx, directives, scope = 'page') {
|
|
|
342
342
|
scope,
|
|
343
343
|
}).value}`
|
|
344
344
|
: undefined,
|
|
345
|
+
key: directives.waForKey
|
|
346
|
+
? serializeValue({
|
|
347
|
+
ctx,
|
|
348
|
+
key: 'waForKey',
|
|
349
|
+
dynamicValue: directives.waIf,
|
|
350
|
+
scope,
|
|
351
|
+
}).value
|
|
352
|
+
: undefined,
|
|
345
353
|
};
|
|
346
354
|
for (let key in processed) {
|
|
347
355
|
let map = processed;
|
|
@@ -352,8 +360,9 @@ function serializeDirecties(ctx, directives, scope = 'page') {
|
|
|
352
360
|
return undefined;
|
|
353
361
|
}
|
|
354
362
|
function deserializeDirecties(ctx, directives) {
|
|
355
|
-
let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if'])
|
|
363
|
+
let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if']) !== undefined ? deserializeValue(ctx, ':if', directives[':if']).value : { value: true };
|
|
356
364
|
let waFor = (directives === null || directives === void 0 ? void 0 : directives[':for']) ? deserializeValue(ctx, ':for', directives[':for']).value : undefined;
|
|
365
|
+
const waForKey = (directives === null || directives === void 0 ? void 0 : directives.key) ? deserializeValue(ctx, 'key', directives.key).value : undefined;
|
|
357
366
|
if (waFor) {
|
|
358
367
|
let { type, value } = waFor;
|
|
359
368
|
if (type === expression_1.PropBindType.expression) {
|
|
@@ -363,6 +372,7 @@ function deserializeDirecties(ctx, directives) {
|
|
|
363
372
|
let processed = {
|
|
364
373
|
waIf: (waIf === null || waIf === void 0 ? void 0 : waIf.value) === true ? undefined : waIf,
|
|
365
374
|
waFor,
|
|
375
|
+
waForKey,
|
|
366
376
|
};
|
|
367
377
|
for (let key in processed) {
|
|
368
378
|
let map = processed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EAEhB,MAAM,mBAAmB,CAAA;AAQ1B,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IACD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACrC;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,eAAe,GAAG,iBAAiB,GACxC,aAAa,CAyDf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAK1E,wBAAgB,cAAc,CAC5B,UAAU,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAoB,EACpD,WAAW,GAAE,MAAM,EAAO,GACzB,MAAM,CAqDR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAK1E,wBAAgB,cAAc,CAC5B,UAAU,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAoB,EACpD,WAAW,GAAE,MAAM,EAAO,GACzB,MAAM,CAqDR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,OAwCtC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CA4B1E;AAED,wBAAgB,aAAa,CAAC,iBAAiB,GAAE,GAAG,EAAO,OAiB1D;AAED,wBAAgB,cAAc,CAAC,SAAS,GAAE,GAAG,EAAO,SAenD;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,OAgExE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAKjE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,OAWvC"}
|
|
@@ -61,7 +61,7 @@ function readComponents(properties = {}, excludeKeys = []) {
|
|
|
61
61
|
}
|
|
62
62
|
exports.readComponents = readComponents;
|
|
63
63
|
function readDirectives(cmp) {
|
|
64
|
-
var _a;
|
|
64
|
+
var _a, _b;
|
|
65
65
|
const directives = {};
|
|
66
66
|
// 默认为 true,节省体积不记录
|
|
67
67
|
if (cmp.data && cmp.data._visible !== true) {
|
|
@@ -90,13 +90,18 @@ function readDirectives(cmp) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
if (directives.waFor && ((_b = cmp.data) === null || _b === void 0 ? void 0 : _b._waForKey)) {
|
|
94
|
+
directives.waForKey = {
|
|
95
|
+
value: cmp.data._waForKey,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
93
98
|
return directives;
|
|
94
99
|
}
|
|
95
100
|
exports.readDirectives = readDirectives;
|
|
96
101
|
function readDynamicData(cmp) {
|
|
97
102
|
var _a, _b;
|
|
98
103
|
const data = {};
|
|
99
|
-
const ignoredProps = ['_visible', '_waFor'];
|
|
104
|
+
const ignoredProps = ['_visible', '_waFor', '_waForKey'];
|
|
100
105
|
// Read data
|
|
101
106
|
for (const prop in cmp.data) {
|
|
102
107
|
if (ignoredProps.indexOf(prop) > -1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/spinoff/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EAMb,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/spinoff/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EAMb,MAAM,mBAAmB,CAAA;AAwI1B;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE;IACR,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB,GACA,YAAY,CAiCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/style.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/style.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,GAA2B,GACrC,GAAG,CAUL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/transform/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA4B,MAAM,yBAAyB,CAAC;AAEjF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,KAAA,iBAkDvE;AAED,wBAAsB,qBAAqB,CAAC,GAAG,KAAA,gBAmD9C"}
|
|
@@ -0,0 +1,247 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.generateCalsFromLocal = exports.generateLocalFromCals = void 0;
|
|
27
|
+
const path_1 = require("path");
|
|
28
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
29
|
+
const index_1 = require("../../../../types/index");
|
|
30
|
+
function generateLocalFromCals(cals, options) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const { outputDir } = options || { outputDir: './' };
|
|
33
|
+
const { id, label, dataSources, envId, dependencies, items = [], resources = [], extra = {} } = cals, restCals = __rest(cals, ["id", "label", "dataSources", "envId", "dependencies", "items", "resources", "extra"]);
|
|
34
|
+
const _a = extra || {}, { npmDependencies = {} } = _a, restExtra = __rest(_a, ["npmDependencies"]);
|
|
35
|
+
// 补充json数据
|
|
36
|
+
if (Object.keys(restExtra).length) {
|
|
37
|
+
restCals['extra'] = restExtra;
|
|
38
|
+
}
|
|
39
|
+
const { localResources, jsonResourcces } = splitCodeResources(resources);
|
|
40
|
+
if (jsonResourcces.length) {
|
|
41
|
+
restCals['resources'] = jsonResourcces;
|
|
42
|
+
}
|
|
43
|
+
yield Promise.all([
|
|
44
|
+
// generate app meta
|
|
45
|
+
ensureWriteFile((0, path_1.join)(outputDir, 'meta.json'), JSON.stringify(restCals, undefined, 2)),
|
|
46
|
+
// generate app package.json
|
|
47
|
+
ensureWriteFile((0, path_1.join)(outputDir, 'package.json'), JSON.stringify({
|
|
48
|
+
name: id,
|
|
49
|
+
// version: '1.0.0',
|
|
50
|
+
description: label,
|
|
51
|
+
scripts: {},
|
|
52
|
+
license: 'MIT',
|
|
53
|
+
dependencies: Object.assign(Object.assign({}, dependencies), npmDependencies),
|
|
54
|
+
}, undefined, 2)),
|
|
55
|
+
// generate app code resource
|
|
56
|
+
...localResources.map((resource) => localizeCodeResources(resource, { base: outputDir })),
|
|
57
|
+
]);
|
|
58
|
+
yield Promise.all(items.reduce((list, page) => {
|
|
59
|
+
const { id, type, resources = [], directives, component } = page, restPage = __rest(page, ["id", "type", "resources", "directives", "component"]);
|
|
60
|
+
const { localResources, jsonResourcces } = splitCodeResources(resources);
|
|
61
|
+
if (jsonResourcces.length) {
|
|
62
|
+
restPage['resources'] = jsonResourcces;
|
|
63
|
+
}
|
|
64
|
+
const pageRootDir = (0, path_1.join)(outputDir, 'pages', id);
|
|
65
|
+
// generate page meta json
|
|
66
|
+
list.push(ensureWriteFile((0, path_1.join)(pageRootDir, 'meta.json'), JSON.stringify(restPage, undefined, 2)));
|
|
67
|
+
// generate page code resources
|
|
68
|
+
list.push(...localResources.map((resource) => localizeCodeResources(resource, { base: pageRootDir })));
|
|
69
|
+
return list;
|
|
70
|
+
}, []));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
exports.generateLocalFromCals = generateLocalFromCals;
|
|
74
|
+
function generateCalsFromLocal(dir) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const rootDir = (0, path_1.resolve)(process.cwd(), dir);
|
|
77
|
+
const [appMeta, packageJson] = yield Promise.all([
|
|
78
|
+
fs_extra_1.default.readJSON((0, path_1.resolve)(rootDir, 'meta.json')),
|
|
79
|
+
fs_extra_1.default.readJson((0, path_1.resolve)(rootDir, 'package.json')),
|
|
80
|
+
]);
|
|
81
|
+
const { name: id, description: label, dependencies = {} } = packageJson;
|
|
82
|
+
const npmDependencies = {};
|
|
83
|
+
Object.entries(dependencies).forEach(([key, value]) => {
|
|
84
|
+
if (!/^weda:/.test(value)) {
|
|
85
|
+
npmDependencies[key] = value;
|
|
86
|
+
delete dependencies[key];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
Object.assign(appMeta, {
|
|
90
|
+
id,
|
|
91
|
+
label,
|
|
92
|
+
dependencies,
|
|
93
|
+
});
|
|
94
|
+
if (!appMeta.extra) {
|
|
95
|
+
appMeta.extra = {};
|
|
96
|
+
}
|
|
97
|
+
appMeta.extra.npmDependencies = npmDependencies;
|
|
98
|
+
// 处理 resource
|
|
99
|
+
appMeta.resources = yield generateCodeResourcesJson((0, path_1.resolve)(rootDir, 'resources'), appMeta.resources || [], 'global');
|
|
100
|
+
const pageNames = yield fs_extra_1.default.readdir((0, path_1.resolve)(rootDir, 'pages'));
|
|
101
|
+
appMeta.items = yield Promise.all(pageNames.map((pageName) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const pageRootDir = (0, path_1.resolve)(rootDir, 'pages', pageName);
|
|
103
|
+
const pageMeta = yield fs_extra_1.default.readJSON((0, path_1.resolve)(pageRootDir, 'meta.json'));
|
|
104
|
+
Object.assign(pageMeta, {
|
|
105
|
+
id: pageName,
|
|
106
|
+
type: 'PAGE',
|
|
107
|
+
directives: { ':if': true },
|
|
108
|
+
component: 'PAGE',
|
|
109
|
+
});
|
|
110
|
+
pageMeta.resource = yield generateCodeResourcesJson((0, path_1.resolve)(pageRootDir, 'resources'), pageMeta.resources || [], pageName);
|
|
111
|
+
return pageMeta;
|
|
112
|
+
})));
|
|
113
|
+
return appMeta;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
exports.generateCalsFromLocal = generateCalsFromLocal;
|
|
117
|
+
function splitCodeResources(resources) {
|
|
118
|
+
// resource 分组,部分存储于文件,部分存储于json
|
|
119
|
+
const localResources = [];
|
|
120
|
+
const jsonResourcces = [];
|
|
121
|
+
for (const resource of resources) {
|
|
122
|
+
switch (resource.codeType) {
|
|
123
|
+
case index_1.ECodeType.STATE:
|
|
124
|
+
case index_1.ECodeType.COMPUTEDN: {
|
|
125
|
+
jsonResourcces.push(resource);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
default:
|
|
129
|
+
localResources.push(resource);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
localResources,
|
|
134
|
+
jsonResourcces,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const TYPE_EXT_MAP = {
|
|
138
|
+
[index_1.ECodeType.THEME]: 'less',
|
|
139
|
+
[index_1.ECodeType.STYLE]: 'less',
|
|
140
|
+
[index_1.ECodeType.RENDERER]: 'jsx',
|
|
141
|
+
};
|
|
142
|
+
function localizeCodeResources(resource, options) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const { base } = options || { base: './' };
|
|
145
|
+
if (!resource || (resource === null || resource === void 0 ? void 0 : resource.type) !== 'CODE' || (resource === null || resource === void 0 ? void 0 : resource.name) === '____index____') {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const ext = TYPE_EXT_MAP[resource.codeType] || 'js';
|
|
149
|
+
return ensureWriteFile((0, path_1.join)(base, `${resource.path.replace(/^(.*?)\//, './resources/')}.${ext}`), resource.code);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function ensureWriteFile(_filePath, content) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const filePath = (0, path_1.resolve)(process.cwd(), _filePath);
|
|
155
|
+
console.log(`write file: ${filePath}`);
|
|
156
|
+
yield fs_extra_1.default.ensureFile(filePath);
|
|
157
|
+
return fs_extra_1.default.writeFile(filePath, content);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const readDir = function (src, base) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const state = yield fs_extra_1.default.stat(src);
|
|
163
|
+
if (state.isDirectory()) {
|
|
164
|
+
const list = yield fs_extra_1.default.readdir(src);
|
|
165
|
+
const res = yield Promise.all(list.map((name) => readDir((0, path_1.join)(src, name), base)));
|
|
166
|
+
return res.reduce((list, item) => {
|
|
167
|
+
list.push(...item);
|
|
168
|
+
return list;
|
|
169
|
+
}, []);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const code = yield fs_extra_1.default.readFile(src);
|
|
173
|
+
const extName = (0, path_1.extname)(src);
|
|
174
|
+
const baseName = (0, path_1.basename)(src, extName);
|
|
175
|
+
const codePath = (0, path_1.relative)(base, src).replace(new RegExp(`${extName}$`), '');
|
|
176
|
+
const meta = {
|
|
177
|
+
type: 'CODE',
|
|
178
|
+
name: baseName,
|
|
179
|
+
code: code.toString(),
|
|
180
|
+
path: codePath,
|
|
181
|
+
};
|
|
182
|
+
switch (extName) {
|
|
183
|
+
case '.less': {
|
|
184
|
+
if (baseName === 'theme') {
|
|
185
|
+
meta.codeType = index_1.ECodeType.THEME;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
meta.codeType = index_1.ECodeType.STYLE;
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
case '.jsx': {
|
|
193
|
+
meta.codeType = index_1.ECodeType.RENDERER;
|
|
194
|
+
}
|
|
195
|
+
default: {
|
|
196
|
+
switch (baseName) {
|
|
197
|
+
case 'lifecycle':
|
|
198
|
+
meta.codeType = index_1.ECodeType.LIFECYCLE;
|
|
199
|
+
break;
|
|
200
|
+
case 'state':
|
|
201
|
+
meta.codeType = index_1.ECodeType.RENDERER;
|
|
202
|
+
break;
|
|
203
|
+
case 'computed':
|
|
204
|
+
meta.codeType = index_1.ECodeType.RENDERER;
|
|
205
|
+
break;
|
|
206
|
+
default: {
|
|
207
|
+
if (/^common\//.test(codePath)) {
|
|
208
|
+
if (baseName === 'mp_config') {
|
|
209
|
+
meta.codeType = index_1.ECodeType.MPCONFIG;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
meta.codeType = index_1.ECodeType.NORMAL_MODULE;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else if (/^handler\//.test(codePath)) {
|
|
216
|
+
meta.codeType = index_1.ECodeType.HANDLER_FN;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
// 跳过意义不明的文件
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return [meta];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
function generateCodeResourcesJson(dir, currentResources = [], prefix = '') {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
const resources = yield readDir(dir, dir);
|
|
234
|
+
const currentResourceMap = currentResources.reduce((map, current) => {
|
|
235
|
+
map[current.path] = current;
|
|
236
|
+
return map;
|
|
237
|
+
}, {});
|
|
238
|
+
for (const meta of resources) {
|
|
239
|
+
const processPath = (0, path_1.join)(prefix, meta.path);
|
|
240
|
+
if (currentResourceMap[processPath]) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
currentResources.push(Object.assign(Object.assign({}, meta), { path: processPath }));
|
|
244
|
+
}
|
|
245
|
+
return currentResources;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/common.ts"],"names":[],"mappings":"AAaA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAE1C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,QAczC;AAGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,QAOtC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/common.ts"],"names":[],"mappings":"AAaA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAE1C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,QAczC;AAGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,QAOtC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QAkB3C;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,GAAG,QAsFrD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QA8C3C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QAyB3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,QAgB9C;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,GAAG,QAQpD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,QAczC;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,GAAG,EACX,UAAU,UAAQ,QAqJnB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,QAsCvC"}
|
|
@@ -55,7 +55,8 @@ function translateListeners(comp) {
|
|
|
55
55
|
const { listeners = [] } = xProps;
|
|
56
56
|
listeners.forEach((listenerItem) => {
|
|
57
57
|
const { handler } = listenerItem;
|
|
58
|
-
if (listenerItem.trigger === 'click' ||
|
|
58
|
+
if (listenerItem.trigger === 'click' ||
|
|
59
|
+
listenerItem.trigger === '__weapps_action_trigger_click') {
|
|
59
60
|
listenerItem.trigger = 'tap';
|
|
60
61
|
}
|
|
61
62
|
if (handler.moduleName === 'gsd-kbone') {
|
|
@@ -210,7 +211,8 @@ function translateClassList(comp) {
|
|
|
210
211
|
}
|
|
211
212
|
if (xProps['classNameListBind']) {
|
|
212
213
|
// @ts-ignore
|
|
213
|
-
xProps['classListBind'] =
|
|
214
|
+
xProps['classListBind'] =
|
|
215
|
+
xProps['classListBind'] || xProps.classNameListBind;
|
|
214
216
|
// @ts-ignore
|
|
215
217
|
xProps.classListBind.value = xProps.classListBind.bindDataPath;
|
|
216
218
|
// @ts-ignore
|
|
@@ -353,7 +355,8 @@ function addFormItem(comp, key, parent, isOnlySlot = false) {
|
|
|
353
355
|
}
|
|
354
356
|
catch (e) { }
|
|
355
357
|
if (parent) {
|
|
356
|
-
if (!parent.xComponent ||
|
|
358
|
+
if (!parent.xComponent ||
|
|
359
|
+
(parent.xComponent && parent.xComponent.name !== 'FormItem')) {
|
|
357
360
|
// add FormItem
|
|
358
361
|
const newFormItemId = (0, utils_1.getId)();
|
|
359
362
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyKH,eAAO,MAAM,sBAAsB,UAMlC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyKH,eAAO,MAAM,sBAAsB,UAMlC,CAAA;AAED,eAAO,MAAM,mBAAmB,UAgB/B,CAAA;AAED,eAAO,MAAM,2BAA2B,UAgDvC,CAAA;AAGD,eAAO,MAAM,mCAAmC,UAK/C,CAAA;AAGD,eAAO,MAAM,4BAA4B,QAA6B,CAAA"}
|
|
@@ -239,6 +239,11 @@ exports.GSD_H5_REACT_COMPONENT_KEYS = [
|
|
|
239
239
|
'Wx-page-mate',
|
|
240
240
|
];
|
|
241
241
|
// 支持选区的组件白名单
|
|
242
|
-
exports.COMPONENT_SELECTABLEBLOCK_WHITELIST = [
|
|
242
|
+
exports.COMPONENT_SELECTABLEBLOCK_WHITELIST = [
|
|
243
|
+
'modeltable',
|
|
244
|
+
'modelcreate',
|
|
245
|
+
'modelupdate',
|
|
246
|
+
'modeldetail',
|
|
247
|
+
];
|
|
243
248
|
// 支持选区的组件库命名正则表达式
|
|
244
249
|
exports.MODULE_SELECTABLEBLOCK_REGEX = /^cloudbase_bussiness.*$/i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/index.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/index.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,OAazC;AAgCD,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAqBzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parses.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/parses.ts"],"names":[],"mappings":"AAcA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QAmC5C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QA4G5C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,QA4B9C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"parses.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/parses.ts"],"names":[],"mappings":"AAcA,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QAmC5C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QA4G5C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,QA4B9C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAyBlE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QAuF5C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,QAM9C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAc1C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAmDlE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAanE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAGnE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAQ3E;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QA6CnE;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,GAAG,QAgDnD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAwD1C;AAGD,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,GAAG,QAuB1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/utils.ts"],"names":[],"mappings":"AASA,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,QA6B7B;AAED,wBAAgB,KAAK,WAEpB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,SAAK,UAQ3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAK,UAQ9C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAO,EAAE,IAAI,EAAE,GAAG,QAO/D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,QAKzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,OAItC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,uBAWlD;AAED,wBAAgB,SAAS,CAAC,GAAG,SAAK,oBAEjC;AAED,wBAAgB,aAAa,CAAC,GAAG,KAAK,WAErC;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,WAoBlD;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,GAAG,EACT,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,EACnC,IAAI,SAAK,GACR,GAAG,CAmBL"}
|
|
@@ -30,7 +30,9 @@ function init(json) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const idNums = ids
|
|
33
|
+
const idNums = ids
|
|
34
|
+
.map((id) => parseInt(id.replace('id', '')))
|
|
35
|
+
.filter((item) => !isNaN(item));
|
|
34
36
|
maxId = Math.max(...idNums);
|
|
35
37
|
}
|
|
36
38
|
exports.init = init;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/expression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../parser/expression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE1D,eAAO,MAAM,YAAY,EAAE,OAO1B,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAcpB,CAAA;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,KAAK,YAAY;IACjB,QAAQ,aAAa;IACrB,OAAO,aAAa;IACpB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,SAAS,UAAU;IACnB;;OAEG;IACH,SAAS,WAAW;IACpB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,iBAAiB;IAC5B,SAAS,cAAc;IACvB,SAAS,eAAe;IACxB,SAAS,eAAe;IACxB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE,GAAG,CAAA;IACV,KAAK,CAAC,EAAE,GAAG,CA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,oBAAoB,CAAC,UAAU,EAAE,MAAM;IAIvC,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;IAclE,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;IAuGlE,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;IA0BrE,eAAe,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAW3E,kBAAkB,CAAC,IAAI,EAAE;QACvB,cAAc,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;QACnC,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;QAChB,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B;IAWD,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;QACJ,cAAc,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;QACnC,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;KACjB,EACD,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;CAuB3B"}
|
|
@@ -234,7 +234,9 @@ class DynamicValueParser {
|
|
|
234
234
|
}
|
|
235
235
|
case '$for':
|
|
236
236
|
options.type = PropBindType.forItem;
|
|
237
|
-
options.value = this.expressionString
|
|
237
|
+
options.value = this.expressionString
|
|
238
|
+
.slice(expression.start, expression.end)
|
|
239
|
+
.replace(/^\$for\./, '');
|
|
238
240
|
break;
|
|
239
241
|
default: {
|
|
240
242
|
throw new ParseError({
|
|
@@ -289,7 +291,7 @@ class DynamicValueParser {
|
|
|
289
291
|
return prefix;
|
|
290
292
|
}
|
|
291
293
|
_replaceExpression(meta) {
|
|
292
|
-
let { memberProperty, index, replacer, expressionString = this.expressionString } = meta;
|
|
294
|
+
let { memberProperty, index, replacer, expressionString = this.expressionString, } = meta;
|
|
293
295
|
let prefix = this._generatePrefix(memberProperty, index);
|
|
294
296
|
return expressionString.replace(new RegExp(escapeRegExp(prefix)), replacer);
|
|
295
297
|
}
|
package/lib/parser/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './cals/index';
|
|
2
2
|
export { upgrageToVersion2 } from './cals/utils/version';
|
|
3
3
|
export { processComponentModule } from './cals/utils/spinoff';
|
|
4
|
-
export { calsToCode, codeToCals, fileToCode, ICodeItem, checkForConflicts, autoResolveConflicts, } from './cals/utils/code';
|
|
5
4
|
export { parseComponentCals } from './cals/utils/block';
|
|
6
5
|
export { ActionType, IDataBind, PropBindType } from './expression/index';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
|
package/lib/parser/index.js
CHANGED
|
@@ -10,18 +10,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.PropBindType = exports.ActionType = exports.parseComponentCals = exports.
|
|
13
|
+
exports.PropBindType = exports.ActionType = exports.parseComponentCals = exports.processComponentModule = exports.upgrageToVersion2 = void 0;
|
|
14
14
|
__exportStar(require("./cals/index"), exports);
|
|
15
15
|
var version_1 = require("./cals/utils/version");
|
|
16
16
|
Object.defineProperty(exports, "upgrageToVersion2", { enumerable: true, get: function () { return version_1.upgrageToVersion2; } });
|
|
17
17
|
var spinoff_1 = require("./cals/utils/spinoff");
|
|
18
18
|
Object.defineProperty(exports, "processComponentModule", { enumerable: true, get: function () { return spinoff_1.processComponentModule; } });
|
|
19
|
-
var code_1 = require("./cals/utils/code");
|
|
20
|
-
Object.defineProperty(exports, "calsToCode", { enumerable: true, get: function () { return code_1.calsToCode; } });
|
|
21
|
-
Object.defineProperty(exports, "codeToCals", { enumerable: true, get: function () { return code_1.codeToCals; } });
|
|
22
|
-
Object.defineProperty(exports, "fileToCode", { enumerable: true, get: function () { return code_1.fileToCode; } });
|
|
23
|
-
Object.defineProperty(exports, "checkForConflicts", { enumerable: true, get: function () { return code_1.checkForConflicts; } });
|
|
24
|
-
Object.defineProperty(exports, "autoResolveConflicts", { enumerable: true, get: function () { return code_1.autoResolveConflicts; } });
|
|
25
19
|
var block_1 = require("./cals/utils/block");
|
|
26
20
|
Object.defineProperty(exports, "parseComponentCals", { enumerable: true, get: function () { return block_1.parseComponentCals; } });
|
|
27
21
|
var index_1 = require("./expression/index");
|