@markw65/monkeyc-optimizer 1.1.78 → 1.1.80
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 +9 -0
- package/build/api.cjs +38 -38
- package/build/{chunk-Y3DFSFGP.cjs → chunk-3KM4FHVN.cjs} +22 -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,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.80
|
|
6
|
+
|
|
7
|
+
- Proper fix for union of distinct enum values (the fix in 1.1.79 didn't always work)
|
|
8
|
+
|
|
9
|
+
### 1.1.79
|
|
10
|
+
|
|
11
|
+
- Keep better track of enum value types in unions of distinct enums
|
|
12
|
+
- Fix an issue that could cause huge amounts of wasted memory, and time, when intersecting class, module or function types.
|
|
13
|
+
|
|
5
14
|
### 1.1.78
|
|
6
15
|
|
|
7
16
|
- 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_3KM4FHVN.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_3KM4FHVN.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_3KM4FHVN.createDocumentationMap,
|
|
24
|
+
declKey: () => import_chunk_3KM4FHVN.declKey,
|
|
25
|
+
diagnostic: () => import_chunk_3KM4FHVN.diagnostic,
|
|
26
|
+
diagnosticHelper: () => import_chunk_3KM4FHVN.diagnosticHelper,
|
|
27
|
+
findNamesInScope: () => import_chunk_3KM4FHVN.findNamesInScope,
|
|
28
|
+
findUsingForNode: () => import_chunk_3KM4FHVN.findUsingForNode,
|
|
29
|
+
formatAst: () => import_chunk_3KM4FHVN.formatAst,
|
|
30
|
+
formatAstLongLines: () => import_chunk_3KM4FHVN.formatAstLongLines,
|
|
31
|
+
formatScopedName: () => import_chunk_3KM4FHVN.formatScopedName,
|
|
32
|
+
getApiFunctionInfo: () => import_chunk_3KM4FHVN.getApiFunctionInfo,
|
|
33
|
+
getApiMapping: () => import_chunk_3KM4FHVN.getApiMapping,
|
|
34
|
+
getSuperClasses: () => import_chunk_3KM4FHVN.getSuperClasses,
|
|
35
|
+
handleImportUsing: () => import_chunk_3KM4FHVN.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_3KM4FHVN.isClassVariable,
|
|
38
|
+
isLocal: () => import_chunk_3KM4FHVN.isLocal,
|
|
39
|
+
isLookupCandidate: () => import_chunk_3KM4FHVN.isLookupCandidate,
|
|
40
|
+
isStateNode: () => import_chunk_3KM4FHVN.isStateNode,
|
|
41
|
+
lookupByFullName: () => import_chunk_3KM4FHVN.lookupByFullName,
|
|
42
|
+
lookupNext: () => import_chunk_3KM4FHVN.lookupNext,
|
|
43
|
+
lookupResultContains: () => import_chunk_3KM4FHVN.lookupResultContains,
|
|
44
|
+
lookupWithType: () => import_chunk_3KM4FHVN.lookupWithType,
|
|
45
|
+
makeToyboxLink: () => import_chunk_3KM4FHVN.makeToyboxLink,
|
|
46
|
+
mapVarDeclsByType: () => import_chunk_3KM4FHVN.mapVarDeclsByType,
|
|
47
|
+
markInvokeClassMethod: () => import_chunk_3KM4FHVN.markInvokeClassMethod,
|
|
48
|
+
parseSdkVersion: () => import_chunk_3KM4FHVN.parseSdkVersion,
|
|
49
|
+
popRootNode: () => import_chunk_3KM4FHVN.popRootNode,
|
|
50
|
+
pushRootNode: () => import_chunk_3KM4FHVN.pushRootNode,
|
|
51
|
+
resolveDiagnostics: () => import_chunk_3KM4FHVN.resolveDiagnostics,
|
|
52
|
+
resolveDiagnosticsMap: () => import_chunk_3KM4FHVN.resolveDiagnosticsMap,
|
|
53
|
+
sameLookupResult: () => import_chunk_3KM4FHVN.sameLookupResult,
|
|
54
54
|
traverseAst: () => import_chunk_JDC43A3I.traverseAst,
|
|
55
|
-
variableDeclarationName: () =>
|
|
56
|
-
visitReferences: () =>
|
|
57
|
-
visit_resources: () =>
|
|
58
|
-
visitorNode: () =>
|
|
55
|
+
variableDeclarationName: () => import_chunk_3KM4FHVN.variableDeclarationName,
|
|
56
|
+
visitReferences: () => import_chunk_3KM4FHVN.visitReferences,
|
|
57
|
+
visit_resources: () => import_chunk_3KM4FHVN.visit_resources,
|
|
58
|
+
visitorNode: () => import_chunk_3KM4FHVN.visitorNode
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(api_exports);
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_3KM4FHVN = require("./chunk-3KM4FHVN.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_3KM4FHVN.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_3KM4FHVN_exports = {};
|
|
30
|
+
__export(chunk_3KM4FHVN_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_3KM4FHVN_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,12 @@ 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 result = cloneType(toE.value);
|
|
7863
|
+
unionInto(result, fromE.value);
|
|
7864
|
+
const e = { value: result };
|
|
7865
|
+
return [e, true];
|
|
7866
|
+
}
|
|
7861
7867
|
return [null, true];
|
|
7862
7868
|
}
|
|
7863
7869
|
if (!toE.value) {
|
|
@@ -8286,32 +8292,34 @@ function intersectionValue(pair) {
|
|
|
8286
8292
|
}
|
|
8287
8293
|
case 4096:
|
|
8288
8294
|
case 8192: {
|
|
8289
|
-
const common =
|
|
8295
|
+
const common = /* @__PURE__ */ new Set();
|
|
8290
8296
|
(0, import_chunk_NHZRKHZO.forEach)(
|
|
8291
8297
|
pair.avalue,
|
|
8292
|
-
(sna) => (0, import_chunk_NHZRKHZO.some)(pair.bvalue, (snb) => sna === snb) && common.
|
|
8298
|
+
(sna) => (0, import_chunk_NHZRKHZO.some)(pair.bvalue, (snb) => sna === snb) && common.add(sna)
|
|
8293
8299
|
);
|
|
8294
|
-
if (!common.
|
|
8300
|
+
if (!common.size)
|
|
8295
8301
|
return null;
|
|
8296
|
-
|
|
8302
|
+
const arr = Array.from(common);
|
|
8303
|
+
return arr.length === 1 ? arr[0] : arr;
|
|
8297
8304
|
}
|
|
8298
8305
|
case 16384: {
|
|
8299
|
-
const common =
|
|
8306
|
+
const common = /* @__PURE__ */ new Set();
|
|
8300
8307
|
(0, import_chunk_NHZRKHZO.forEach)(pair.avalue, (sna) => {
|
|
8301
8308
|
const superA = getSuperClasses(sna);
|
|
8302
8309
|
(0, import_chunk_NHZRKHZO.forEach)(pair.bvalue, (snb) => {
|
|
8303
8310
|
if (sna === snb || superA && superA.has(snb)) {
|
|
8304
|
-
common.
|
|
8311
|
+
common.add(sna);
|
|
8305
8312
|
}
|
|
8306
8313
|
const superB = getSuperClasses(snb);
|
|
8307
8314
|
if (superB && superB.has(sna)) {
|
|
8308
|
-
common.
|
|
8315
|
+
common.add(snb);
|
|
8309
8316
|
}
|
|
8310
8317
|
});
|
|
8311
8318
|
});
|
|
8312
|
-
if (!common.
|
|
8319
|
+
if (!common.size)
|
|
8313
8320
|
return null;
|
|
8314
|
-
|
|
8321
|
+
const arr = Array.from(common);
|
|
8322
|
+
return arr.length === 1 ? arr[0] : arr;
|
|
8315
8323
|
}
|
|
8316
8324
|
case 32768: {
|
|
8317
8325
|
const klass = intersection(pair.avalue.klass, pair.bvalue.klass);
|
|
@@ -30198,7 +30206,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30198
30206
|
const opt_time = await (0, import_chunk_NHZRKHZO.first_modified)(
|
|
30199
30207
|
Object.values(fnMap).map((v) => v.output)
|
|
30200
30208
|
);
|
|
30201
|
-
if (source_time < opt_time &&
|
|
30209
|
+
if (source_time < opt_time && 1731196989092 < opt_time) {
|
|
30202
30210
|
return {
|
|
30203
30211
|
hasTests,
|
|
30204
30212
|
diagnostics: prevDiagnostics,
|
|
@@ -30236,7 +30244,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30236
30244
|
hasTests: hasTests2,
|
|
30237
30245
|
diagnostics,
|
|
30238
30246
|
sdkVersion,
|
|
30239
|
-
optimizerVersion: "1.1.
|
|
30247
|
+
optimizerVersion: "1.1.80",
|
|
30240
30248
|
...Object.fromEntries(
|
|
30241
30249
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
30242
30250
|
)
|
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_3KM4FHVN.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_3KM4FHVN.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_3KM4FHVN.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_3KM4FHVN.defaultConfig,
|
|
26
|
+
display: () => import_chunk_3KM4FHVN.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_3KM4FHVN.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_3KM4FHVN.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_3KM4FHVN.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_3KM4FHVN.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_3KM4FHVN.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_3KM4FHVN.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_3KM4FHVN.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_3KM4FHVN.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_3KM4FHVN.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_3KM4FHVN.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_3KM4FHVN.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_3KM4FHVN = require("./chunk-3KM4FHVN.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_3KM4FHVN.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_3KM4FHVN.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_3KM4FHVN.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_3KM4FHVN.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_3KM4FHVN.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_3KM4FHVN.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_3KM4FHVN.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_3KM4FHVN.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_3KM4FHVN.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_3KM4FHVN.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_3KM4FHVN.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_3KM4FHVN.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_3KM4FHVN.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_3KM4FHVN = require("./chunk-3KM4FHVN.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_3KM4FHVN.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_3KM4FHVN = require("./chunk-3KM4FHVN.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_3KM4FHVN.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_3KM4FHVN.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED