@cloudbase/cals 0.5.10 → 0.5.11-alpha.0
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 +0 -0
- package/lib/parser/cals/index.d.ts.map +0 -0
- package/lib/parser/cals/index.js +0 -0
- package/lib/parser/cals/utils/block/index.d.ts +0 -0
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/block/index.js +0 -0
- package/lib/parser/cals/utils/code/index.d.ts +0 -0
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/code/index.js +0 -0
- package/lib/parser/cals/utils/common.d.ts +0 -0
- package/lib/parser/cals/utils/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/common.js +0 -0
- package/lib/parser/cals/utils/runtime.d.ts +0 -0
- package/lib/parser/cals/utils/runtime.d.ts.map +0 -0
- package/lib/parser/cals/utils/runtime.js +0 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts +0 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/spinoff/index.js +0 -0
- package/lib/parser/cals/utils/style.d.ts +0 -0
- package/lib/parser/cals/utils/style.d.ts.map +0 -0
- package/lib/parser/cals/utils/style.js +0 -0
- package/lib/parser/cals/utils/template.d.ts +0 -0
- package/lib/parser/cals/utils/template.d.ts.map +0 -0
- package/lib/parser/cals/utils/template.js +0 -0
- package/lib/parser/cals/utils/version/common.d.ts +0 -0
- package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/common.js +0 -0
- package/lib/parser/cals/utils/version/config.d.ts +0 -0
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/config.js +0 -0
- package/lib/parser/cals/utils/version/index.d.ts +0 -0
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/index.js +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/parses.js +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/utils.js +0 -0
- package/lib/parser/expression/index.d.ts +0 -0
- package/lib/parser/expression/index.d.ts.map +0 -0
- package/lib/parser/expression/index.js +0 -0
- package/lib/parser/index.d.ts +0 -0
- package/lib/parser/index.d.ts.map +0 -0
- package/lib/parser/index.js +0 -0
- package/lib/types/basic/app.d.ts +0 -0
- package/lib/types/basic/app.d.ts.map +0 -0
- package/lib/types/basic/app.js +0 -0
- package/lib/types/basic/common.d.ts +0 -0
- package/lib/types/basic/common.d.ts.map +0 -0
- package/lib/types/basic/common.js +0 -0
- package/lib/types/basic/component.d.ts +0 -0
- package/lib/types/basic/component.d.ts.map +0 -0
- package/lib/types/basic/component.js +0 -0
- package/lib/types/basic/datasource.d.ts +0 -0
- package/lib/types/basic/datasource.d.ts.map +0 -0
- package/lib/types/basic/datasource.js +0 -0
- package/lib/types/index.d.ts +0 -0
- package/lib/types/index.d.ts.map +0 -0
- package/lib/types/index.js +0 -0
- package/lib/types/lcds.d.ts +0 -0
- package/lib/types/lcds.d.ts.map +0 -0
- package/lib/types/lcds.js +0 -0
- package/lib/types/platform/app.d.ts +0 -0
- package/lib/types/platform/app.d.ts.map +0 -0
- package/lib/types/platform/app.js +0 -0
- package/lib/types/platform/common.d.ts +0 -0
- package/lib/types/platform/common.d.ts.map +0 -0
- package/lib/types/platform/common.js +0 -0
- package/lib/types/platform/component.d.ts +0 -0
- package/lib/types/platform/component.d.ts.map +0 -0
- package/lib/types/platform/component.js +0 -0
- package/lib/types/platform/datasource.d.ts +0 -0
- package/lib/types/platform/datasource.d.ts.map +0 -0
- package/lib/types/platform/datasource.js +0 -0
- package/lib/types/platform/widget/form.d.ts +0 -0
- package/lib/types/platform/widget/form.d.ts.map +0 -0
- package/lib/types/platform/widget/form.js +0 -0
- package/lib/types/platform/widget/meta.d.ts +0 -0
- package/lib/types/platform/widget/meta.d.ts.map +0 -0
- package/lib/types/platform/widget/meta.js +0 -0
- package/lib/utils/CSSProperty.d.ts +0 -0
- package/lib/utils/CSSProperty.d.ts.map +0 -0
- package/lib/utils/CSSProperty.js +0 -0
- package/lib/utils/build.d.ts +0 -0
- package/lib/utils/build.d.ts.map +0 -0
- package/lib/utils/build.js +0 -0
- package/lib/utils/constant.d.ts +0 -0
- package/lib/utils/constant.d.ts.map +0 -0
- package/lib/utils/constant.js +0 -0
- package/lib/utils/dts/index.d.ts +5 -0
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +51 -33
- 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/package.json +1 -1
|
File without changes
|
|
File without changes
|
package/lib/parser/cals/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/parser/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/parser/index.js
CHANGED
|
File without changes
|
package/lib/types/basic/app.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/types/basic/app.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
File without changes
|
package/lib/types/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/index.js
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/lcds.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/utils/CSSProperty.js
CHANGED
|
File without changes
|
package/lib/utils/build.d.ts
CHANGED
|
File without changes
|
package/lib/utils/build.d.ts.map
CHANGED
|
File without changes
|
package/lib/utils/build.js
CHANGED
|
File without changes
|
package/lib/utils/constant.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/utils/constant.js
CHANGED
|
File without changes
|
package/lib/utils/dts/index.d.ts
CHANGED
|
@@ -86,4 +86,9 @@ export declare const workerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap
|
|
|
86
86
|
* 通过 js/ts 代码生成 dts
|
|
87
87
|
*/
|
|
88
88
|
export declare function transpileToDTS(code: string): Promise<string>;
|
|
89
|
+
export declare const jsonToDTSWorkerCode = "\nimportScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/json-schema-to-typescript-for-browser.min.js');\n\nfunction transpile(jsonschema) {\n return jstt.compile(jsonschema, 'IWeDa', { additionalProperties: false, bannerComment: '', format: false })\n}\n\naddEventListener('message', (message) => {\n const {action, data: {id, jsonschema}} = message.data\n switch(action) {\n case 'dts':\n transpile(jsonschema).then(dts => {\n postMessage({action: 'dts_back', data: {id, dts}})\n }).catch(err => postMessage({action: 'dts_back', data: {id, dts: 'Parse error:' + err.message}}))\n break\n default:\n break\n }\n})\n";
|
|
90
|
+
/**
|
|
91
|
+
* Webworker 版本的 JSON to DTS
|
|
92
|
+
*/
|
|
93
|
+
export declare function compileJSONToDTS(jsonschema: any): Promise<string>;
|
|
89
94
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/index.ts"],"names":[],"mappings":"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"}
|
package/lib/utils/dts/index.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,10 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
9
|
});
|
|
33
10
|
};
|
|
34
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.transpileToDTS = exports.workerCode = exports.generateWeDaAppDTS = exports.WeDaDTS = exports.IInputDataType = void 0;
|
|
36
|
-
const jstt = __importStar(require("json-schema-to-typescript-for-browser/dist/bundle.js"));
|
|
12
|
+
exports.compileJSONToDTS = exports.jsonToDTSWorkerCode = exports.transpileToDTS = exports.workerCode = exports.generateWeDaAppDTS = exports.WeDaDTS = exports.IInputDataType = void 0;
|
|
37
13
|
const auto_generated_1 = require("./auto-generated");
|
|
38
|
-
const compile = jstt.compile;
|
|
39
14
|
var IInputDataType;
|
|
40
15
|
(function (IInputDataType) {
|
|
41
16
|
IInputDataType["globalState"] = "globalState";
|
|
@@ -312,7 +287,7 @@ function _generateOneItemDTS(inputData, itemType) {
|
|
|
312
287
|
}
|
|
313
288
|
function _compile(jsonschema, isObjNeedWrapper = false) {
|
|
314
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
-
let dts = yield
|
|
290
|
+
let dts = yield compileJSONToDTS(jsonschema);
|
|
316
291
|
if (dts.search(/^export interface IWeDa/) >= 0) {
|
|
317
292
|
dts = dts.replace(/^export interface.*$/m, '');
|
|
318
293
|
dts = dts.substring(0, dts.length - 2);
|
|
@@ -392,13 +367,15 @@ addEventListener('message', (message) => {
|
|
|
392
367
|
}
|
|
393
368
|
})
|
|
394
369
|
`;
|
|
395
|
-
function TypescriptWorker() {
|
|
396
|
-
let
|
|
397
|
-
let sendMessageCallbackFn = {};
|
|
370
|
+
function TypescriptWorker(workerId, workerCode) {
|
|
371
|
+
let typescriptWorkerMap = {};
|
|
398
372
|
return function getInstance() {
|
|
373
|
+
var _a;
|
|
374
|
+
let typescriptWorker = (_a = typescriptWorkerMap[workerId]) === null || _a === void 0 ? void 0 : _a.typescriptWorker;
|
|
399
375
|
if (!typescriptWorker) {
|
|
400
|
-
const
|
|
401
|
-
|
|
376
|
+
const sendMessageCallbackFn = {};
|
|
377
|
+
const workerURL = URL.createObjectURL(new Blob([workerCode]));
|
|
378
|
+
typescriptWorker = new Worker(workerURL + '?name=' + workerId);
|
|
402
379
|
typescriptWorker.onmessage = function (event) {
|
|
403
380
|
const { action } = event.data;
|
|
404
381
|
if (action === 'dts_back') {
|
|
@@ -406,8 +383,13 @@ function TypescriptWorker() {
|
|
|
406
383
|
sendMessageCallbackFn[id] && sendMessageCallbackFn[id](dts);
|
|
407
384
|
}
|
|
408
385
|
};
|
|
386
|
+
typescriptWorkerMap[workerId] = {
|
|
387
|
+
typescriptWorker,
|
|
388
|
+
sendMessageCallbackFn
|
|
389
|
+
};
|
|
409
390
|
}
|
|
410
391
|
function sendMessage(msgData, callbackFn) {
|
|
392
|
+
const { typescriptWorker, sendMessageCallbackFn } = typescriptWorkerMap[workerId];
|
|
411
393
|
const id = Math.random()
|
|
412
394
|
.toString(36)
|
|
413
395
|
.substring(2, 5);
|
|
@@ -429,7 +411,7 @@ function TypescriptWorker() {
|
|
|
429
411
|
*
|
|
430
412
|
* })
|
|
431
413
|
*/
|
|
432
|
-
const getTypescriptWorker = TypescriptWorker();
|
|
414
|
+
const getTypescriptWorker = TypescriptWorker('transpileToDTS', exports.workerCode);
|
|
433
415
|
/**
|
|
434
416
|
* 通过 js/ts 代码生成 dts
|
|
435
417
|
*/
|
|
@@ -442,3 +424,39 @@ function transpileToDTS(code) {
|
|
|
442
424
|
});
|
|
443
425
|
}
|
|
444
426
|
exports.transpileToDTS = transpileToDTS;
|
|
427
|
+
exports.jsonToDTSWorkerCode = `
|
|
428
|
+
importScripts('https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_url/devtools/json-schema-to-typescript-for-browser.min.js');
|
|
429
|
+
|
|
430
|
+
function transpile(jsonschema) {
|
|
431
|
+
return jstt.compile(jsonschema, 'IWeDa', { additionalProperties: false, bannerComment: '', format: false })
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
addEventListener('message', (message) => {
|
|
435
|
+
const {action, data: {id, jsonschema}} = message.data
|
|
436
|
+
switch(action) {
|
|
437
|
+
case 'dts':
|
|
438
|
+
transpile(jsonschema).then(dts => {
|
|
439
|
+
postMessage({action: 'dts_back', data: {id, dts}})
|
|
440
|
+
}).catch(err => postMessage({action: 'dts_back', data: {id, dts: 'Parse error:' + err.message}}))
|
|
441
|
+
break
|
|
442
|
+
default:
|
|
443
|
+
break
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
`;
|
|
447
|
+
const getCompileJSONToDTSWorker = TypescriptWorker('compileJSONToDTS', exports.jsonToDTSWorkerCode);
|
|
448
|
+
/**
|
|
449
|
+
* Webworker 版本的 JSON to DTS
|
|
450
|
+
*/
|
|
451
|
+
function compileJSONToDTS(jsonschema) {
|
|
452
|
+
return new Promise((resolve, reject) => {
|
|
453
|
+
const worker = getCompileJSONToDTSWorker();
|
|
454
|
+
worker.sendMessage({ action: 'dts', data: { jsonschema } }, (dts) => {
|
|
455
|
+
if (dts.search('Parse error:') === 0)
|
|
456
|
+
reject(dts);
|
|
457
|
+
else
|
|
458
|
+
resolve(dts);
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
exports.compileJSONToDTS = compileJSONToDTS;
|
package/lib/utils/index.d.ts
CHANGED
|
File without changes
|
package/lib/utils/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/utils/index.js
CHANGED
|
File without changes
|