@markw65/monkeyc-optimizer 1.1.78 → 1.1.79
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/CHANGELOG.md +5 -0
- package/build/api.cjs +38 -38
- package/build/{chunk-Y3DFSFGP.cjs → chunk-PVNDN7BB.cjs} +23 -14
- package/build/optimizer.cjs +18 -18
- package/build/sdk-util.cjs +14 -14
- package/build/worker-thread.cjs +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.79
|
|
6
|
+
|
|
7
|
+
- Keep better track of enum value types in unions of distinct enums
|
|
8
|
+
- Fix an issue that could cause huge amounts of wasted memory, and time, when intersecting class, module or function types.
|
|
9
|
+
|
|
5
10
|
### 1.1.78
|
|
6
11
|
|
|
7
12
|
- Consistently use the name of the project directory to name the prg file
|
package/build/api.cjs
CHANGED
|
@@ -18,51 +18,51 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var api_exports = {};
|
|
20
20
|
__export(api_exports, {
|
|
21
|
-
checkCompilerVersion: () =>
|
|
22
|
-
collectNamespaces: () =>
|
|
23
|
-
createDocumentationMap: () =>
|
|
24
|
-
declKey: () =>
|
|
25
|
-
diagnostic: () =>
|
|
26
|
-
diagnosticHelper: () =>
|
|
27
|
-
findNamesInScope: () =>
|
|
28
|
-
findUsingForNode: () =>
|
|
29
|
-
formatAst: () =>
|
|
30
|
-
formatAstLongLines: () =>
|
|
31
|
-
formatScopedName: () =>
|
|
32
|
-
getApiFunctionInfo: () =>
|
|
33
|
-
getApiMapping: () =>
|
|
34
|
-
getSuperClasses: () =>
|
|
35
|
-
handleImportUsing: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_PVNDN7BB.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_PVNDN7BB.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_PVNDN7BB.createDocumentationMap,
|
|
24
|
+
declKey: () => import_chunk_PVNDN7BB.declKey,
|
|
25
|
+
diagnostic: () => import_chunk_PVNDN7BB.diagnostic,
|
|
26
|
+
diagnosticHelper: () => import_chunk_PVNDN7BB.diagnosticHelper,
|
|
27
|
+
findNamesInScope: () => import_chunk_PVNDN7BB.findNamesInScope,
|
|
28
|
+
findUsingForNode: () => import_chunk_PVNDN7BB.findUsingForNode,
|
|
29
|
+
formatAst: () => import_chunk_PVNDN7BB.formatAst,
|
|
30
|
+
formatAstLongLines: () => import_chunk_PVNDN7BB.formatAstLongLines,
|
|
31
|
+
formatScopedName: () => import_chunk_PVNDN7BB.formatScopedName,
|
|
32
|
+
getApiFunctionInfo: () => import_chunk_PVNDN7BB.getApiFunctionInfo,
|
|
33
|
+
getApiMapping: () => import_chunk_PVNDN7BB.getApiMapping,
|
|
34
|
+
getSuperClasses: () => import_chunk_PVNDN7BB.getSuperClasses,
|
|
35
|
+
handleImportUsing: () => import_chunk_PVNDN7BB.handleImportUsing,
|
|
36
36
|
hasProperty: () => import_chunk_JDC43A3I.hasProperty,
|
|
37
|
-
isClassVariable: () =>
|
|
38
|
-
isLocal: () =>
|
|
39
|
-
isLookupCandidate: () =>
|
|
40
|
-
isStateNode: () =>
|
|
41
|
-
lookupByFullName: () =>
|
|
42
|
-
lookupNext: () =>
|
|
43
|
-
lookupResultContains: () =>
|
|
44
|
-
lookupWithType: () =>
|
|
45
|
-
makeToyboxLink: () =>
|
|
46
|
-
mapVarDeclsByType: () =>
|
|
47
|
-
markInvokeClassMethod: () =>
|
|
48
|
-
parseSdkVersion: () =>
|
|
49
|
-
popRootNode: () =>
|
|
50
|
-
pushRootNode: () =>
|
|
51
|
-
resolveDiagnostics: () =>
|
|
52
|
-
resolveDiagnosticsMap: () =>
|
|
53
|
-
sameLookupResult: () =>
|
|
37
|
+
isClassVariable: () => import_chunk_PVNDN7BB.isClassVariable,
|
|
38
|
+
isLocal: () => import_chunk_PVNDN7BB.isLocal,
|
|
39
|
+
isLookupCandidate: () => import_chunk_PVNDN7BB.isLookupCandidate,
|
|
40
|
+
isStateNode: () => import_chunk_PVNDN7BB.isStateNode,
|
|
41
|
+
lookupByFullName: () => import_chunk_PVNDN7BB.lookupByFullName,
|
|
42
|
+
lookupNext: () => import_chunk_PVNDN7BB.lookupNext,
|
|
43
|
+
lookupResultContains: () => import_chunk_PVNDN7BB.lookupResultContains,
|
|
44
|
+
lookupWithType: () => import_chunk_PVNDN7BB.lookupWithType,
|
|
45
|
+
makeToyboxLink: () => import_chunk_PVNDN7BB.makeToyboxLink,
|
|
46
|
+
mapVarDeclsByType: () => import_chunk_PVNDN7BB.mapVarDeclsByType,
|
|
47
|
+
markInvokeClassMethod: () => import_chunk_PVNDN7BB.markInvokeClassMethod,
|
|
48
|
+
parseSdkVersion: () => import_chunk_PVNDN7BB.parseSdkVersion,
|
|
49
|
+
popRootNode: () => import_chunk_PVNDN7BB.popRootNode,
|
|
50
|
+
pushRootNode: () => import_chunk_PVNDN7BB.pushRootNode,
|
|
51
|
+
resolveDiagnostics: () => import_chunk_PVNDN7BB.resolveDiagnostics,
|
|
52
|
+
resolveDiagnosticsMap: () => import_chunk_PVNDN7BB.resolveDiagnosticsMap,
|
|
53
|
+
sameLookupResult: () => import_chunk_PVNDN7BB.sameLookupResult,
|
|
54
54
|
traverseAst: () => import_chunk_JDC43A3I.traverseAst,
|
|
55
|
-
variableDeclarationName: () =>
|
|
56
|
-
visitReferences: () =>
|
|
57
|
-
visit_resources: () =>
|
|
58
|
-
visitorNode: () =>
|
|
55
|
+
variableDeclarationName: () => import_chunk_PVNDN7BB.variableDeclarationName,
|
|
56
|
+
visitReferences: () => import_chunk_PVNDN7BB.visitReferences,
|
|
57
|
+
visit_resources: () => import_chunk_PVNDN7BB.visit_resources,
|
|
58
|
+
visitorNode: () => import_chunk_PVNDN7BB.visitorNode
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(api_exports);
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_PVNDN7BB = require("./chunk-PVNDN7BB.cjs");
|
|
62
62
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
63
63
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
64
64
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
65
|
-
(0,
|
|
65
|
+
(0, import_chunk_PVNDN7BB.init_api)();
|
|
66
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
67
|
0 && (module.exports = {
|
|
68
68
|
checkCompilerVersion,
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_PVNDN7BB_exports = {};
|
|
30
|
+
__export(chunk_PVNDN7BB_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -139,7 +139,7 @@ __export(chunk_Y3DFSFGP_exports, {
|
|
|
139
139
|
visitorNode: () => visitorNode,
|
|
140
140
|
xml_util_exports: () => xml_util_exports
|
|
141
141
|
});
|
|
142
|
-
module.exports = __toCommonJS(
|
|
142
|
+
module.exports = __toCommonJS(chunk_PVNDN7BB_exports);
|
|
143
143
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
144
144
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
145
145
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -7858,6 +7858,13 @@ function mergeSingle(pair) {
|
|
|
7858
7858
|
const toE = pair.avalue;
|
|
7859
7859
|
const fromE = pair.bvalue;
|
|
7860
7860
|
if (toE.enum !== fromE.enum) {
|
|
7861
|
+
if (toE.value && fromE.value) {
|
|
7862
|
+
const toValue2 = tryUnion(toE.value, fromE.value);
|
|
7863
|
+
if (toValue2) {
|
|
7864
|
+
const e = { value: toValue2 };
|
|
7865
|
+
return [e, true];
|
|
7866
|
+
}
|
|
7867
|
+
}
|
|
7861
7868
|
return [null, true];
|
|
7862
7869
|
}
|
|
7863
7870
|
if (!toE.value) {
|
|
@@ -8286,32 +8293,34 @@ function intersectionValue(pair) {
|
|
|
8286
8293
|
}
|
|
8287
8294
|
case 4096:
|
|
8288
8295
|
case 8192: {
|
|
8289
|
-
const common =
|
|
8296
|
+
const common = /* @__PURE__ */ new Set();
|
|
8290
8297
|
(0, import_chunk_NHZRKHZO.forEach)(
|
|
8291
8298
|
pair.avalue,
|
|
8292
|
-
(sna) => (0, import_chunk_NHZRKHZO.some)(pair.bvalue, (snb) => sna === snb) && common.
|
|
8299
|
+
(sna) => (0, import_chunk_NHZRKHZO.some)(pair.bvalue, (snb) => sna === snb) && common.add(sna)
|
|
8293
8300
|
);
|
|
8294
|
-
if (!common.
|
|
8301
|
+
if (!common.size)
|
|
8295
8302
|
return null;
|
|
8296
|
-
|
|
8303
|
+
const arr = Array.from(common);
|
|
8304
|
+
return arr.length === 1 ? arr[0] : arr;
|
|
8297
8305
|
}
|
|
8298
8306
|
case 16384: {
|
|
8299
|
-
const common =
|
|
8307
|
+
const common = /* @__PURE__ */ new Set();
|
|
8300
8308
|
(0, import_chunk_NHZRKHZO.forEach)(pair.avalue, (sna) => {
|
|
8301
8309
|
const superA = getSuperClasses(sna);
|
|
8302
8310
|
(0, import_chunk_NHZRKHZO.forEach)(pair.bvalue, (snb) => {
|
|
8303
8311
|
if (sna === snb || superA && superA.has(snb)) {
|
|
8304
|
-
common.
|
|
8312
|
+
common.add(sna);
|
|
8305
8313
|
}
|
|
8306
8314
|
const superB = getSuperClasses(snb);
|
|
8307
8315
|
if (superB && superB.has(sna)) {
|
|
8308
|
-
common.
|
|
8316
|
+
common.add(snb);
|
|
8309
8317
|
}
|
|
8310
8318
|
});
|
|
8311
8319
|
});
|
|
8312
|
-
if (!common.
|
|
8320
|
+
if (!common.size)
|
|
8313
8321
|
return null;
|
|
8314
|
-
|
|
8322
|
+
const arr = Array.from(common);
|
|
8323
|
+
return arr.length === 1 ? arr[0] : arr;
|
|
8315
8324
|
}
|
|
8316
8325
|
case 32768: {
|
|
8317
8326
|
const klass = intersection(pair.avalue.klass, pair.bvalue.klass);
|
|
@@ -30198,7 +30207,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30198
30207
|
const opt_time = await (0, import_chunk_NHZRKHZO.first_modified)(
|
|
30199
30208
|
Object.values(fnMap).map((v) => v.output)
|
|
30200
30209
|
);
|
|
30201
|
-
if (source_time < opt_time &&
|
|
30210
|
+
if (source_time < opt_time && 1731172425727 < opt_time) {
|
|
30202
30211
|
return {
|
|
30203
30212
|
hasTests,
|
|
30204
30213
|
diagnostics: prevDiagnostics,
|
|
@@ -30236,7 +30245,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30236
30245
|
hasTests: hasTests2,
|
|
30237
30246
|
diagnostics,
|
|
30238
30247
|
sdkVersion,
|
|
30239
|
-
optimizerVersion: "1.1.
|
|
30248
|
+
optimizerVersion: "1.1.79",
|
|
30240
30249
|
...Object.fromEntries(
|
|
30241
30250
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
30242
30251
|
)
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,30 +18,30 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var optimizer_exports = {};
|
|
20
20
|
__export(optimizer_exports, {
|
|
21
|
-
StateNodeAttributes: () =>
|
|
22
|
-
buildConfigDescription: () =>
|
|
23
|
-
buildOptimizedProject: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_PVNDN7BB.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_PVNDN7BB.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_PVNDN7BB.buildOptimizedProject,
|
|
24
24
|
copyRecursiveAsNeeded: () => import_chunk_NHZRKHZO.copyRecursiveAsNeeded,
|
|
25
|
-
defaultConfig: () =>
|
|
26
|
-
display: () =>
|
|
27
|
-
generateOneConfig: () =>
|
|
28
|
-
generateOptimizedProject: () =>
|
|
29
|
-
getConfig: () =>
|
|
30
|
-
getFnMapAnalysis: () =>
|
|
31
|
-
getProjectAnalysis: () =>
|
|
32
|
-
get_jungle: () =>
|
|
33
|
-
isErrorWithLocation: () =>
|
|
34
|
-
launchSimulator: () =>
|
|
35
|
-
manifestProducts: () =>
|
|
36
|
-
mctree: () =>
|
|
37
|
-
simulateProgram: () =>
|
|
25
|
+
defaultConfig: () => import_chunk_PVNDN7BB.defaultConfig,
|
|
26
|
+
display: () => import_chunk_PVNDN7BB.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_PVNDN7BB.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_PVNDN7BB.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_PVNDN7BB.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_PVNDN7BB.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_PVNDN7BB.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_PVNDN7BB.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_PVNDN7BB.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_PVNDN7BB.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_PVNDN7BB.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_PVNDN7BB.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_PVNDN7BB.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_PVNDN7BB = require("./chunk-PVNDN7BB.cjs");
|
|
41
41
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
42
42
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
43
43
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
44
|
-
(0,
|
|
44
|
+
(0, import_chunk_PVNDN7BB.init_optimizer)();
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
46
|
0 && (module.exports = {
|
|
47
47
|
StateNodeAttributes,
|
package/build/sdk-util.cjs
CHANGED
|
@@ -18,25 +18,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var sdk_util_exports = {};
|
|
20
20
|
__export(sdk_util_exports, {
|
|
21
|
-
SectionKinds: () =>
|
|
22
|
-
appSupport: () =>
|
|
23
|
-
connectiq: () =>
|
|
24
|
-
getDeviceInfo: () =>
|
|
25
|
-
getFunctionDocumentation: () =>
|
|
26
|
-
getLanguages: () =>
|
|
27
|
-
getSdkPath: () =>
|
|
28
|
-
isWin: () =>
|
|
29
|
-
optimizeProgram: () =>
|
|
30
|
-
readPrg: () =>
|
|
31
|
-
readPrgWithOffsets: () =>
|
|
32
|
-
xmlUtil: () =>
|
|
21
|
+
SectionKinds: () => import_chunk_PVNDN7BB.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_PVNDN7BB.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_PVNDN7BB.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_PVNDN7BB.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_PVNDN7BB.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_PVNDN7BB.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_PVNDN7BB.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_PVNDN7BB.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_PVNDN7BB.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_PVNDN7BB.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_PVNDN7BB.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_PVNDN7BB.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_PVNDN7BB = require("./chunk-PVNDN7BB.cjs");
|
|
36
36
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
37
37
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
38
38
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
39
|
-
(0,
|
|
39
|
+
(0, import_chunk_PVNDN7BB.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
package/build/worker-thread.cjs
CHANGED
|
@@ -21,17 +21,17 @@ __export(worker_thread_exports, {
|
|
|
21
21
|
default: () => worker_thread_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(worker_thread_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_PVNDN7BB = require("./chunk-PVNDN7BB.cjs");
|
|
25
25
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
26
26
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
27
27
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
28
28
|
var import_node_worker_threads = require("node:worker_threads");
|
|
29
29
|
var require_worker_thread = (0, import_chunk_ABYVSU2C.__commonJS)({
|
|
30
30
|
"src/worker-thread.ts"() {
|
|
31
|
-
(0,
|
|
31
|
+
(0, import_chunk_PVNDN7BB.init_worker_task)();
|
|
32
32
|
if (import_node_worker_threads.parentPort) {
|
|
33
33
|
import_node_worker_threads.parentPort.on("message", async (task) => {
|
|
34
|
-
return import_node_worker_threads.parentPort.postMessage(await (0,
|
|
34
|
+
return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_PVNDN7BB.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED