@cloudbase/cals 0.3.35-alpha.0 → 0.3.37
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 +13 -4
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +77 -8
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +9 -4
- 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 +5 -1
- package/lib/parser/cals/utils/version/config.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/index.js +5 -1
- package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/parses.js +5 -1
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
- package/lib/parser/expression/index.d.ts.map +1 -1
- package/lib/parser/index.d.ts +0 -1
- package/lib/parser/index.d.ts.map +1 -1
- package/lib/parser/index.js +6 -8
- 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/index.js +5 -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/common.d.ts.map +1 -1
- package/lib/types/platform/component.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/utils/build.js +8 -4
- package/lib/utils/constant.d.ts.map +1 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +5 -1
- package/package.json +2 -3
- package/lib/parser/cals/utils/code/index.d.ts +0 -35
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/code/index.js +0 -419
|
@@ -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;
|
|
@@ -150,7 +151,10 @@ export declare function deserializePage(ctx: {
|
|
|
150
151
|
type: string;
|
|
151
152
|
code: string;
|
|
152
153
|
description?: string;
|
|
153
|
-
path?: string;
|
|
154
|
+
path?: string; /**
|
|
155
|
+
* 依赖描述
|
|
156
|
+
* map 由 数组处理得到
|
|
157
|
+
*/
|
|
154
158
|
name: string;
|
|
155
159
|
}[];
|
|
156
160
|
listeners: {
|
|
@@ -220,7 +224,10 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
220
224
|
type: string;
|
|
221
225
|
code: string;
|
|
222
226
|
description?: string;
|
|
223
|
-
path?: string;
|
|
227
|
+
path?: string; /**
|
|
228
|
+
* 依赖描述
|
|
229
|
+
* map 由 数组处理得到
|
|
230
|
+
*/
|
|
224
231
|
name: string;
|
|
225
232
|
}[];
|
|
226
233
|
listeners: {
|
|
@@ -242,7 +249,10 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
242
249
|
type: string;
|
|
243
250
|
code: string;
|
|
244
251
|
description?: string;
|
|
245
|
-
path?: string;
|
|
252
|
+
path?: string; /**
|
|
253
|
+
* 依赖描述
|
|
254
|
+
* map 由 数组处理得到
|
|
255
|
+
*/
|
|
246
256
|
name: string;
|
|
247
257
|
}[];
|
|
248
258
|
datasources: IPlatformDataSource[];
|
|
@@ -291,7 +301,6 @@ export declare function deserializePlatformApp(data: IPlatformApp, optsions: {
|
|
|
291
301
|
author: string;
|
|
292
302
|
description: string;
|
|
293
303
|
domain?: string;
|
|
294
|
-
originHistoryId?: string;
|
|
295
304
|
};
|
|
296
305
|
dependencies: IDependencies;
|
|
297
306
|
};
|
|
@@ -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,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KA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,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
|
@@ -173,6 +173,7 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
173
173
|
originKey = matched[1];
|
|
174
174
|
(0, lodash_1.unset)(data, originKey);
|
|
175
175
|
}
|
|
176
|
+
const originKeyArr = originKey.split('.');
|
|
176
177
|
if ((0, lodash_1.get)(data, processedKey) == undefined) {
|
|
177
178
|
/* 选区结构处理 [formily] to [CALS] */
|
|
178
179
|
if (Array.isArray(processedValue) && (processedValue === null || processedValue === void 0 ? void 0 : processedValue.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
|
|
@@ -191,23 +192,82 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
191
192
|
return _value;
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
// 为动态数据且有多级,将{":range.0.label": "$page.dataset.state.test1"}转为{ range: [{ label: "$page.dataset.state.test1"}] }
|
|
196
|
+
if (matched && originKeyArr.length >= 2) {
|
|
197
|
+
(0, lodash_1.set)(data, replaceWithColon(originKey), (0, lodash_1.cloneDeep)(processedValue));
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
data[processedKey] = (0, lodash_1.cloneDeep)(processedValue);
|
|
201
|
+
}
|
|
195
202
|
}
|
|
196
203
|
extra[originKey] = processedExtra;
|
|
197
204
|
});
|
|
198
205
|
return { data, extra };
|
|
199
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* 将{ range: [{ label: "$page.dataset.state.test1"}] }的path range.0.label 转为range.0.:label
|
|
209
|
+
* @param key
|
|
210
|
+
* @returns
|
|
211
|
+
*/
|
|
212
|
+
function replaceWithColon(key) {
|
|
213
|
+
const keyArr = key.split('.');
|
|
214
|
+
// 最深一层前面加上":"
|
|
215
|
+
keyArr[keyArr.length - 1] = `:${keyArr[keyArr.length - 1]}`;
|
|
216
|
+
return keyArr.join('.');
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* 预处理,先还原数据。
|
|
220
|
+
* 将range: [{":label": "$page.dataset.state.test1"}]还原为:":range.0.label": "$page.dataset.state.test1"
|
|
221
|
+
* 支持递归
|
|
222
|
+
* @param parent 根节点
|
|
223
|
+
* @param current 当前节点
|
|
224
|
+
* @param path 路径
|
|
225
|
+
* @returns
|
|
226
|
+
*/
|
|
227
|
+
function recoverSynamicMap(parent, current, path = '') {
|
|
228
|
+
Object.keys(current).forEach((key) => {
|
|
229
|
+
let value = current[key];
|
|
230
|
+
if ((0, lodash_1.isArray)(value)) {
|
|
231
|
+
// 注意如果是 selectableBlock 独立处理
|
|
232
|
+
if (value === null || value === void 0 ? void 0 : value.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock))) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
// 数组必须在前面
|
|
236
|
+
value.forEach((valueItem, valueIndex) => {
|
|
237
|
+
if ((0, lodash_1.isObject)(valueItem)) {
|
|
238
|
+
valueItem = recoverSynamicMap(parent, valueItem, `${path === '' ? '' : `${path}.`}${key}.${valueIndex}`);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
else if ((0, lodash_1.isObject)(value)) {
|
|
243
|
+
value = recoverSynamicMap(parent, value, `${path === '' ? '' : `${path}.`}${key}`);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
const matched = key.match(DYNAMIC_KEY_REG);
|
|
247
|
+
if (matched) {
|
|
248
|
+
parent[`:${path === '' ? '' : `${path}.`}${matched[1]}`] = current[key];
|
|
249
|
+
if (current !== parent) {
|
|
250
|
+
// 如果是第一层级,说明current和parent相等,不unset
|
|
251
|
+
(0, lodash_1.unset)(current, key);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
return current;
|
|
257
|
+
}
|
|
200
258
|
function deserializeDynamicMap(ctx, map, extraMap) {
|
|
201
|
-
var _a, _b
|
|
259
|
+
var _a, _b;
|
|
202
260
|
let data = {};
|
|
261
|
+
const clonedMap = (0, lodash_1.cloneDeep)(map);
|
|
262
|
+
// 还原flatten path
|
|
263
|
+
map = recoverSynamicMap(clonedMap, clonedMap, '');
|
|
203
264
|
for (let key in map || {}) {
|
|
204
|
-
let value =
|
|
265
|
+
let value = map === null || map === void 0 ? void 0 : map[key];
|
|
205
266
|
let matched = key.match(DYNAMIC_KEY_REG);
|
|
206
267
|
let { key: processedKey, value: processedValue } = deserializeValue(ctx, key, value, extraMap === null || extraMap === void 0 ? void 0 : extraMap[matched ? matched[1] : key]);
|
|
207
268
|
/* 选区结构处理 [CALS] to [formily] */
|
|
208
|
-
if (Array.isArray(processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) && ((
|
|
209
|
-
|
|
210
|
-
(_c = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.value) === null || _c === void 0 ? void 0 : _c.forEach((_value) => {
|
|
269
|
+
if (Array.isArray(processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) && ((_a = processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) === null || _a === void 0 ? void 0 : _a.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
|
|
270
|
+
(_b = processedValue === null || processedValue === void 0 ? void 0 : processedValue.value) === null || _b === void 0 ? void 0 : _b.forEach((_value) => {
|
|
211
271
|
var _a, _b, _c, _d;
|
|
212
272
|
const module = (_b = (_a = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _a === void 0 ? void 0 : _a.module) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
213
273
|
const component = (_d = (_c = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _c === void 0 ? void 0 : _c.component) === null || _d === void 0 ? void 0 : _d.toLowerCase();
|
|
@@ -218,7 +278,6 @@ function deserializeDynamicMap(ctx, map, extraMap) {
|
|
|
218
278
|
}
|
|
219
279
|
return _value;
|
|
220
280
|
});
|
|
221
|
-
processedValue = valueTmp;
|
|
222
281
|
}
|
|
223
282
|
if (processedValue !== undefined) {
|
|
224
283
|
data[processedKey] = processedValue;
|
|
@@ -342,6 +401,14 @@ function serializeDirecties(ctx, directives, scope = 'page') {
|
|
|
342
401
|
scope,
|
|
343
402
|
}).value}`
|
|
344
403
|
: undefined,
|
|
404
|
+
key: directives.waForKey
|
|
405
|
+
? serializeValue({
|
|
406
|
+
ctx,
|
|
407
|
+
key: 'waForKey',
|
|
408
|
+
dynamicValue: directives.waForKey,
|
|
409
|
+
scope,
|
|
410
|
+
}).value
|
|
411
|
+
: undefined,
|
|
345
412
|
};
|
|
346
413
|
for (let key in processed) {
|
|
347
414
|
let map = processed;
|
|
@@ -352,8 +419,9 @@ function serializeDirecties(ctx, directives, scope = 'page') {
|
|
|
352
419
|
return undefined;
|
|
353
420
|
}
|
|
354
421
|
function deserializeDirecties(ctx, directives) {
|
|
355
|
-
let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if'])
|
|
422
|
+
let waIf = (directives === null || directives === void 0 ? void 0 : directives[':if']) !== undefined ? deserializeValue(ctx, ':if', directives[':if']).value : { value: true };
|
|
356
423
|
let waFor = (directives === null || directives === void 0 ? void 0 : directives[':for']) ? deserializeValue(ctx, ':for', directives[':for']).value : undefined;
|
|
424
|
+
const waForKey = (directives === null || directives === void 0 ? void 0 : directives.key) ? deserializeValue(ctx, 'key', directives.key).value : undefined;
|
|
357
425
|
if (waFor) {
|
|
358
426
|
let { type, value } = waFor;
|
|
359
427
|
if (type === expression_1.PropBindType.expression) {
|
|
@@ -363,6 +431,7 @@ function deserializeDirecties(ctx, directives) {
|
|
|
363
431
|
let processed = {
|
|
364
432
|
waIf: (waIf === null || waIf === void 0 ? void 0 : waIf.value) === true ? undefined : waIf,
|
|
365
433
|
waFor,
|
|
434
|
+
waForKey,
|
|
366
435
|
};
|
|
367
436
|
for (let key in processed) {
|
|
368
437
|
let map = processed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAqB,MAAM,mBAAmB,CAAC;AAI1F,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACtC;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,aAAa,CAyD/G"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAqB,MAAM,mBAAmB,CAAC;AAI1F,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACtC;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,aAAa,CAyD/G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYnD,aAAK,UAAU,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAGrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAyED,wBAAgB,YAAY,CAE1B,IAAI,EAAE,GAAG,EAAE,EAEX,KAAK,EAAE,GAAG,EAAE,GACX,UAAU,CA6CZ"}
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYnD,aAAK,UAAU,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAGrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAyED,wBAAgB,YAAY,CAE1B,IAAI,EAAE,GAAG,EAAE,EAEX,KAAK,EAAE,GAAG,EAAE,GACX,UAAU,CA6CZ"}
|
|
@@ -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":["../../../../src/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"}
|
|
@@ -7,7 +7,7 @@ const common_1 = require("./common");
|
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
function readComponents(properties = {}, excludeKeys = []) {
|
|
9
9
|
var _a;
|
|
10
|
-
const cmps = {};
|
|
10
|
+
const cmps /* IWeAppPage['componentInstances'] */ = {};
|
|
11
11
|
for (const key in properties) {
|
|
12
12
|
if (excludeKeys.indexOf(key) > -1) {
|
|
13
13
|
continue;
|
|
@@ -61,8 +61,8 @@ function readComponents(properties = {}, excludeKeys = []) {
|
|
|
61
61
|
}
|
|
62
62
|
exports.readComponents = readComponents;
|
|
63
63
|
function readDirectives(cmp) {
|
|
64
|
-
var _a;
|
|
65
|
-
const directives = {};
|
|
64
|
+
var _a, _b;
|
|
65
|
+
const directives /* IWeAppComponentInstance['xProps']['directives'] */ = {};
|
|
66
66
|
// 默认为 true,节省体积不记录
|
|
67
67
|
if (cmp.data && cmp.data._visible !== true) {
|
|
68
68
|
directives.waIf = {
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/spinoff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAqHjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE;IACR,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,GACA,YAAY,CAqBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../parser/cals/utils/style.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF"}
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF"}
|
|
@@ -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,QAe3C;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,GAAG,QAsFrD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QA8C3C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QAwB3C;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,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UAAQ,QAiJ/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,QAsCvC"}
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/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,QAe3C;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,GAAG,QAsFrD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QA8C3C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,QAwB3C;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,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UAAQ,QAiJ/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,QAsCvC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -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,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAgB/B,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAgDvC,CAAC;AAGF,eAAO,MAAM,mCAAmC,UAA8D,CAAC;AAG/G,eAAO,MAAM,4BAA4B,QAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyKH,eAAO,MAAM,sBAAsB,UAMlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAgB/B,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAgDvC,CAAC;AAGF,eAAO,MAAM,mCAAmC,UAA8D,CAAC;AAG/G,eAAO,MAAM,4BAA4B,QAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,OAWzC;AAgCD,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAqBzD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parses.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/parses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parses.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/parses.ts"],"names":[],"mappings":"AAWA,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,QAuBlE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,QAoF5C;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,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../parser/cals/utils/version/utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,QA2B7B;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,uBASlD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,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;IAgGlE,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,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;IAMD,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE;QACJ,cAAc,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,EACD,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;CAuB3B"}
|
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
|