@cloudbase/cals 1.0.49 → 1.0.50

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.
Files changed (87) hide show
  1. package/lib/parser/cals/utils/template.js +3 -3
  2. package/package.json +3 -3
  3. package/lib/parser/cals/utils/block/index.js +0 -151
  4. package/lib/parser/cals/utils/code/index.js +0 -393
  5. package/lib/parser/cals/utils/common.js +0 -268
  6. package/lib/parser/cals/utils/getUsedResources.d.ts +0 -10
  7. package/lib/parser/cals/utils/getUsedResources.d.ts.map +0 -1
  8. package/lib/parser/cals/utils/getUsedResources.js +0 -128
  9. package/lib/parser/cals/utils/runtime.js +0 -268
  10. package/lib/parser/cals/utils/style.js +0 -472
  11. package/lib/parser/cals/utils/version/common.js +0 -385
  12. package/lib/parser/cals/utils/version/config.d.ts +0 -16
  13. package/lib/parser/cals/utils/version/config.d.ts.map +0 -1
  14. package/lib/parser/cals/utils/version/config.js +0 -244
  15. package/lib/parser/cals/utils/version/index.js +0 -96
  16. package/lib/parser/cals/utils/version/parses.js +0 -581
  17. package/lib/parser/cals/utils/version/utils.d.ts +0 -14
  18. package/lib/parser/cals/utils/version/utils.d.ts.map +0 -1
  19. package/lib/parser/cals/utils/version/utils.js +0 -148
  20. package/lib/parser/expression/index.d.ts +0 -123
  21. package/lib/parser/expression/index.d.ts.map +0 -1
  22. package/lib/parser/expression/index.js +0 -301
  23. package/lib/parser/plugins/postcss-rpx2clac.d.ts +0 -18
  24. package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +0 -1
  25. package/lib/parser/plugins/postcss-rpx2clac.js +0 -68
  26. package/lib/types/basic/app.d.ts +0 -73
  27. package/lib/types/basic/app.d.ts.map +0 -1
  28. package/lib/types/basic/app.js +0 -2
  29. package/lib/types/basic/common.d.ts +0 -93
  30. package/lib/types/basic/common.d.ts.map +0 -1
  31. package/lib/types/basic/common.js +0 -2
  32. package/lib/types/basic/component.d.ts +0 -211
  33. package/lib/types/basic/component.d.ts.map +0 -1
  34. package/lib/types/basic/component.js +0 -2
  35. package/lib/types/basic/datasource.d.ts +0 -50
  36. package/lib/types/basic/datasource.d.ts.map +0 -1
  37. package/lib/types/basic/datasource.js +0 -2
  38. package/lib/types/index.js +0 -42
  39. package/lib/types/lcds.js +0 -25
  40. package/lib/types/platform/app.js +0 -11
  41. package/lib/types/platform/common.d.ts +0 -181
  42. package/lib/types/platform/common.d.ts.map +0 -1
  43. package/lib/types/platform/common.js +0 -87
  44. package/lib/types/platform/component.d.ts +0 -139
  45. package/lib/types/platform/component.d.ts.map +0 -1
  46. package/lib/types/platform/component.js +0 -11
  47. package/lib/types/platform/datasource.d.ts +0 -467
  48. package/lib/types/platform/datasource.d.ts.map +0 -1
  49. package/lib/types/platform/datasource.js +0 -2
  50. package/lib/types/platform/eventFlow.d.ts +0 -20
  51. package/lib/types/platform/eventFlow.d.ts.map +0 -1
  52. package/lib/types/platform/eventFlow.js +0 -2
  53. package/lib/types/platform/query.d.ts +0 -67
  54. package/lib/types/platform/query.d.ts.map +0 -1
  55. package/lib/types/platform/query.js +0 -2
  56. package/lib/types/platform/theme.js +0 -2
  57. package/lib/types/platform/widget/form.d.ts +0 -5
  58. package/lib/types/platform/widget/form.d.ts.map +0 -1
  59. package/lib/types/platform/widget/form.js +0 -5
  60. package/lib/types/platform/widget/meta.d.ts +0 -60
  61. package/lib/types/platform/widget/meta.d.ts.map +0 -1
  62. package/lib/types/platform/widget/meta.js +0 -6
  63. package/lib/utils/CSSProperty.d.ts +0 -64
  64. package/lib/utils/CSSProperty.d.ts.map +0 -1
  65. package/lib/utils/CSSProperty.js +0 -89
  66. package/lib/utils/build.d.ts +0 -2
  67. package/lib/utils/build.d.ts.map +0 -1
  68. package/lib/utils/build.js +0 -75
  69. package/lib/utils/dts/auto-generated.d.ts +0 -2
  70. package/lib/utils/dts/auto-generated.d.ts.map +0 -1
  71. package/lib/utils/dts/auto-generated.js +0 -1796
  72. package/lib/utils/dts/build.d.ts +0 -2
  73. package/lib/utils/dts/build.d.ts.map +0 -1
  74. package/lib/utils/dts/build.js +0 -136
  75. package/lib/utils/dts/index.js +0 -1008
  76. package/lib/utils/index.js +0 -27
  77. package/lib/utils/version/common.d.ts +0 -3
  78. package/lib/utils/version/common.d.ts.map +0 -1
  79. package/lib/utils/version/common.js +0 -27
  80. package/lib/utils/version/featureChecker.js +0 -35
  81. package/lib/utils/version/migrations/version4.js +0 -199
  82. package/lib/utils/version-migrations/common.d.ts +0 -5
  83. package/lib/utils/version-migrations/common.d.ts.map +0 -1
  84. package/lib/utils/version-migrations/common.js +0 -29
  85. package/lib/utils/version-migrations/version4.d.ts +0 -3
  86. package/lib/utils/version-migrations/version4.d.ts.map +0 -1
  87. package/lib/utils/version-migrations/version4.js +0 -199
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/build.ts"],"names":[],"mappings":""}
@@ -1,136 +0,0 @@
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
- const fs_extra_1 = __importDefault(require("fs-extra"));
16
- const path_1 = __importDefault(require("path"));
17
- const child_process_1 = __importDefault(require("child_process"));
18
- const os_1 = __importDefault(require("os"));
19
- const node_watch_1 = __importDefault(require("node-watch"));
20
- /**
21
- * 生成函数公式的 dts
22
- * 已包含的函数公式:packages/weda-client/src/common/<calculation|logic|text|time>
23
- */
24
- function buildFormulaDTS() {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- // 确保在 packages/cals 目录执行该脚本
27
- const baseDirPath = path_1.default.resolve('..', 'weda-client', 'src', 'common');
28
- const formulaDirs = ['calculation', 'logic', 'text', 'time'];
29
- const dtsList = yield Promise.all(formulaDirs.map((fDir) => {
30
- return genDTS(fDir);
31
- }));
32
- return dtsList.join('\n');
33
- function genDTS(fDir) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const randomId = Math.random().toString(36).substring(2, 6);
36
- const tempDtsPath = path_1.default.resolve(os_1.default.tmpdir(), `weda-temp-${randomId}.d.ts`);
37
- yield new Promise((resolve) => {
38
- child_process_1.default.exec(`tsc ${path_1.default.resolve(baseDirPath, fDir, 'index.ts')} --declaration --emitDeclarationOnly --allowSyntheticDefaultImports true --out ${tempDtsPath}`, () => {
39
- resolve('done');
40
- });
41
- });
42
- const dts = yield fs_extra_1.default.readFile(tempDtsPath, 'utf8');
43
- yield fs_extra_1.default.remove(tempDtsPath);
44
- // 去掉最外层的模块声明
45
- return dts
46
- .replace(/^declare module.*$/m, '')
47
- .replace(/^\}$/m, '')
48
- .replace(/^\s+/gm, '');
49
- });
50
- }
51
- });
52
- }
53
- function genWeDaAPPDTS() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- console.log('genWeDaAPPDTS processing...');
56
- /**
57
- * 获取所有的 DTS
58
- */
59
- const wedaFrameworkDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), 'utf8'); // 低码框架
60
- const wedaAppDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), 'utf-8'); // app对象
61
- const wedaPageDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), 'utf-8'); // page对象
62
- const wedaAuthDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), 'utf8'); // auth对象
63
- const wedaCloudDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), 'utf-8'); // cloud对象
64
- const wedaUtilsDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), 'utf-8'); // page对象
65
- const wedaDeviceDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-device.d.ts'), 'utf8'); // device对象
66
- const wedaEnvDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-env.d.ts'), 'utf8'); // env对象
67
- const wedaWedaContextDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-wedaContext.d.ts'), 'utf8'); // wedaContext对象
68
- const formulaDTS = yield buildFormulaDTS(); // 函数公式
69
- /**
70
- * 聚合 DTS
71
- */
72
- const wedaDTS = groupDTSs({
73
- wedaFrameworkDTS,
74
- wedaAppDTS,
75
- wedaPageDTS,
76
- wedaAuthDTS,
77
- wedaCloudDTS,
78
- wedaUtilsDTS,
79
- wedaDeviceDTS,
80
- wedaEnvDTS,
81
- wedaWedaContextDTS,
82
- formulaDTS,
83
- });
84
- /**
85
- * 将聚合结果保存在 auto-generated.ts
86
- */
87
- yield fs_extra_1.default.writeFile(path_1.default.resolve(__dirname, 'auto-generated.ts'), `export const wedaDTS = \`${wedaDTS}\``, 'utf8');
88
- console.log('genWeDaAPPDTS done!');
89
- });
90
- }
91
- /**
92
- * 聚合所有的 DTS(不包括动态生成的)
93
- */
94
- function groupDTSs({ wedaFrameworkDTS = '', wedaAppDTS = '', wedaPageDTS = '', wedaAuthDTS = '', wedaCloudDTS = '', wedaUtilsDTS = '', wedaDeviceDTS = '', wedaEnvDTS = '', wedaWedaContextDTS = '', formulaDTS = '', }) {
95
- let resultDts = wedaFrameworkDTS;
96
- // $app
97
- resultDts = resultDts.replaceAll("// $app - Don't touch me", wedaAppDTS);
98
- // $page
99
- resultDts = resultDts.replaceAll("// $page - Don't touch me", wedaPageDTS);
100
- // $w.auth
101
- resultDts = resultDts.replaceAll("// $w.auth - Don't touch me", wedaAuthDTS.replace(/declare/g, ''));
102
- // $w.cloud
103
- resultDts = resultDts.replaceAll("// $w.cloud - Don't touch me", wedaCloudDTS.replace(/declare/g, ''));
104
- // $w.device
105
- resultDts = resultDts.replaceAll("// $w.device - Don't touch me", wedaDeviceDTS.replace(/declare/g, ''));
106
- // $w.env
107
- resultDts = resultDts.replaceAll("// $w.env - Don't touch me", wedaEnvDTS.replace(/declare/g, ''));
108
- // $w.wedaContext
109
- resultDts = resultDts.replaceAll("// $w.wedaContext - Don't touch me", wedaWedaContextDTS.replace(/declare/g, ''));
110
- // $w.utils
111
- resultDts = resultDts.replaceAll("// $w.utils - Don't touch me", wedaUtilsDTS.replace(/declare/g, ''));
112
- // 函数公式:$w.xxx
113
- resultDts = resultDts.replaceAll("// Formula 函数公式 - Don't touch me", formulaDTS.replace(/export/g, ''));
114
- // 函数公式:全局变量提示
115
- resultDts = resultDts.replace("// Global Formula 全局函数公式- Don't touch me", formulaDTS.replace(/export/g, 'declare'));
116
- return resultDts;
117
- }
118
- function main() {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- yield genWeDaAPPDTS();
121
- const [, , watchArgv] = process.argv;
122
- if (watchArgv === '--watch') {
123
- console.log('Start watching mode');
124
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), genWeDaAPPDTS);
125
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), genWeDaAPPDTS);
126
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), genWeDaAPPDTS);
127
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), genWeDaAPPDTS);
128
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), genWeDaAPPDTS);
129
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-device.d.ts'), genWeDaAPPDTS);
130
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-env.d.ts'), genWeDaAPPDTS);
131
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-wedaContext.d.ts'), genWeDaAPPDTS);
132
- (0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), genWeDaAPPDTS);
133
- }
134
- });
135
- }
136
- main();