@markw65/monkeyc-optimizer 1.1.72 → 1.1.73
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 +4 -0
- package/build/api.cjs +37 -37
- package/build/{chunk-O23K24OV.cjs → chunk-XNAPUWVE.cjs} +19 -13
- 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,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.73
|
|
6
|
+
|
|
7
|
+
- Fix an issue formatting body-less class/module/program nodes.
|
|
8
|
+
|
|
5
9
|
### 1.1.72
|
|
6
10
|
|
|
7
11
|
- Update to [@markw65/prettier-plugin-monkeyc@1.0.59](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1059)
|
package/build/api.cjs
CHANGED
|
@@ -18,50 +18,50 @@ 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
|
-
diagnostic: () =>
|
|
25
|
-
diagnosticHelper: () =>
|
|
26
|
-
findNamesInScope: () =>
|
|
27
|
-
findUsingForNode: () =>
|
|
28
|
-
formatAst: () =>
|
|
29
|
-
formatAstLongLines: () =>
|
|
30
|
-
formatScopedName: () =>
|
|
31
|
-
getApiFunctionInfo: () =>
|
|
32
|
-
getApiMapping: () =>
|
|
33
|
-
getSuperClasses: () =>
|
|
34
|
-
handleImportUsing: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_XNAPUWVE.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_XNAPUWVE.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_XNAPUWVE.createDocumentationMap,
|
|
24
|
+
diagnostic: () => import_chunk_XNAPUWVE.diagnostic,
|
|
25
|
+
diagnosticHelper: () => import_chunk_XNAPUWVE.diagnosticHelper,
|
|
26
|
+
findNamesInScope: () => import_chunk_XNAPUWVE.findNamesInScope,
|
|
27
|
+
findUsingForNode: () => import_chunk_XNAPUWVE.findUsingForNode,
|
|
28
|
+
formatAst: () => import_chunk_XNAPUWVE.formatAst,
|
|
29
|
+
formatAstLongLines: () => import_chunk_XNAPUWVE.formatAstLongLines,
|
|
30
|
+
formatScopedName: () => import_chunk_XNAPUWVE.formatScopedName,
|
|
31
|
+
getApiFunctionInfo: () => import_chunk_XNAPUWVE.getApiFunctionInfo,
|
|
32
|
+
getApiMapping: () => import_chunk_XNAPUWVE.getApiMapping,
|
|
33
|
+
getSuperClasses: () => import_chunk_XNAPUWVE.getSuperClasses,
|
|
34
|
+
handleImportUsing: () => import_chunk_XNAPUWVE.handleImportUsing,
|
|
35
35
|
hasProperty: () => import_chunk_JDC43A3I.hasProperty,
|
|
36
|
-
isClassVariable: () =>
|
|
37
|
-
isLocal: () =>
|
|
38
|
-
isLookupCandidate: () =>
|
|
39
|
-
isStateNode: () =>
|
|
40
|
-
lookupByFullName: () =>
|
|
41
|
-
lookupNext: () =>
|
|
42
|
-
lookupResultContains: () =>
|
|
43
|
-
lookupWithType: () =>
|
|
44
|
-
makeToyboxLink: () =>
|
|
45
|
-
mapVarDeclsByType: () =>
|
|
46
|
-
markInvokeClassMethod: () =>
|
|
47
|
-
parseSdkVersion: () =>
|
|
48
|
-
popRootNode: () =>
|
|
49
|
-
pushRootNode: () =>
|
|
50
|
-
resolveDiagnostics: () =>
|
|
51
|
-
resolveDiagnosticsMap: () =>
|
|
52
|
-
sameLookupResult: () =>
|
|
36
|
+
isClassVariable: () => import_chunk_XNAPUWVE.isClassVariable,
|
|
37
|
+
isLocal: () => import_chunk_XNAPUWVE.isLocal,
|
|
38
|
+
isLookupCandidate: () => import_chunk_XNAPUWVE.isLookupCandidate,
|
|
39
|
+
isStateNode: () => import_chunk_XNAPUWVE.isStateNode,
|
|
40
|
+
lookupByFullName: () => import_chunk_XNAPUWVE.lookupByFullName,
|
|
41
|
+
lookupNext: () => import_chunk_XNAPUWVE.lookupNext,
|
|
42
|
+
lookupResultContains: () => import_chunk_XNAPUWVE.lookupResultContains,
|
|
43
|
+
lookupWithType: () => import_chunk_XNAPUWVE.lookupWithType,
|
|
44
|
+
makeToyboxLink: () => import_chunk_XNAPUWVE.makeToyboxLink,
|
|
45
|
+
mapVarDeclsByType: () => import_chunk_XNAPUWVE.mapVarDeclsByType,
|
|
46
|
+
markInvokeClassMethod: () => import_chunk_XNAPUWVE.markInvokeClassMethod,
|
|
47
|
+
parseSdkVersion: () => import_chunk_XNAPUWVE.parseSdkVersion,
|
|
48
|
+
popRootNode: () => import_chunk_XNAPUWVE.popRootNode,
|
|
49
|
+
pushRootNode: () => import_chunk_XNAPUWVE.pushRootNode,
|
|
50
|
+
resolveDiagnostics: () => import_chunk_XNAPUWVE.resolveDiagnostics,
|
|
51
|
+
resolveDiagnosticsMap: () => import_chunk_XNAPUWVE.resolveDiagnosticsMap,
|
|
52
|
+
sameLookupResult: () => import_chunk_XNAPUWVE.sameLookupResult,
|
|
53
53
|
traverseAst: () => import_chunk_JDC43A3I.traverseAst,
|
|
54
|
-
variableDeclarationName: () =>
|
|
55
|
-
visitReferences: () =>
|
|
56
|
-
visit_resources: () =>
|
|
57
|
-
visitorNode: () =>
|
|
54
|
+
variableDeclarationName: () => import_chunk_XNAPUWVE.variableDeclarationName,
|
|
55
|
+
visitReferences: () => import_chunk_XNAPUWVE.visitReferences,
|
|
56
|
+
visit_resources: () => import_chunk_XNAPUWVE.visit_resources,
|
|
57
|
+
visitorNode: () => import_chunk_XNAPUWVE.visitorNode
|
|
58
58
|
});
|
|
59
59
|
module.exports = __toCommonJS(api_exports);
|
|
60
|
-
var
|
|
60
|
+
var import_chunk_XNAPUWVE = require("./chunk-XNAPUWVE.cjs");
|
|
61
61
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
62
62
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
63
63
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
64
|
-
(0,
|
|
64
|
+
(0, import_chunk_XNAPUWVE.init_api)();
|
|
65
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
66
|
0 && (module.exports = {
|
|
67
67
|
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_XNAPUWVE_exports = {};
|
|
30
|
+
__export(chunk_XNAPUWVE_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -138,7 +138,7 @@ __export(chunk_O23K24OV_exports, {
|
|
|
138
138
|
visitorNode: () => visitorNode,
|
|
139
139
|
xml_util_exports: () => xml_util_exports
|
|
140
140
|
});
|
|
141
|
-
module.exports = __toCommonJS(
|
|
141
|
+
module.exports = __toCommonJS(chunk_XNAPUWVE_exports);
|
|
142
142
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
143
143
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
144
144
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -19842,18 +19842,24 @@ function formatAstLongLines(node) {
|
|
|
19842
19842
|
const filter = (s) => s.type !== "ClassDeclaration" && s.type !== "ModuleDeclaration" && s.type !== "FunctionDeclaration";
|
|
19843
19843
|
switch (node.type) {
|
|
19844
19844
|
case "ClassDeclaration":
|
|
19845
|
-
node
|
|
19846
|
-
|
|
19847
|
-
|
|
19845
|
+
if (node.body?.body) {
|
|
19846
|
+
node = { ...node };
|
|
19847
|
+
node.body = { ...node.body };
|
|
19848
|
+
node.body.body = node.body.body.filter((c) => filter(c.item));
|
|
19849
|
+
}
|
|
19848
19850
|
break;
|
|
19849
19851
|
case "ModuleDeclaration":
|
|
19850
|
-
node
|
|
19851
|
-
|
|
19852
|
-
|
|
19852
|
+
if (node.body?.body) {
|
|
19853
|
+
node = { ...node };
|
|
19854
|
+
node.body = { ...node.body };
|
|
19855
|
+
node.body.body = node.body.body.filter(filter);
|
|
19856
|
+
}
|
|
19853
19857
|
break;
|
|
19854
19858
|
case "Program":
|
|
19855
|
-
node
|
|
19856
|
-
|
|
19859
|
+
if (node.body) {
|
|
19860
|
+
node = { ...node };
|
|
19861
|
+
node.body = node.body.filter(filter);
|
|
19862
|
+
}
|
|
19857
19863
|
break;
|
|
19858
19864
|
}
|
|
19859
19865
|
return formatAst(node, null, { printWidth: 1e4 });
|
|
@@ -30115,7 +30121,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30115
30121
|
const opt_time = await (0, import_chunk_NHZRKHZO.first_modified)(
|
|
30116
30122
|
Object.values(fnMap).map((v) => v.output)
|
|
30117
30123
|
);
|
|
30118
|
-
if (source_time < opt_time &&
|
|
30124
|
+
if (source_time < opt_time && 1722003035546 < opt_time) {
|
|
30119
30125
|
return {
|
|
30120
30126
|
hasTests,
|
|
30121
30127
|
diagnostics: prevDiagnostics,
|
|
@@ -30153,7 +30159,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30153
30159
|
hasTests: hasTests2,
|
|
30154
30160
|
diagnostics,
|
|
30155
30161
|
sdkVersion,
|
|
30156
|
-
optimizerVersion: "1.1.
|
|
30162
|
+
optimizerVersion: "1.1.73",
|
|
30157
30163
|
...Object.fromEntries(
|
|
30158
30164
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
30159
30165
|
)
|
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_XNAPUWVE.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_XNAPUWVE.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_XNAPUWVE.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_XNAPUWVE.defaultConfig,
|
|
26
|
+
display: () => import_chunk_XNAPUWVE.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_XNAPUWVE.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_XNAPUWVE.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_XNAPUWVE.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_XNAPUWVE.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_XNAPUWVE.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_XNAPUWVE.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_XNAPUWVE.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_XNAPUWVE.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_XNAPUWVE.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_XNAPUWVE.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_XNAPUWVE.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_XNAPUWVE = require("./chunk-XNAPUWVE.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_XNAPUWVE.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_XNAPUWVE.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_XNAPUWVE.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_XNAPUWVE.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_XNAPUWVE.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_XNAPUWVE.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_XNAPUWVE.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_XNAPUWVE.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_XNAPUWVE.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_XNAPUWVE.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_XNAPUWVE.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_XNAPUWVE.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_XNAPUWVE.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_XNAPUWVE = require("./chunk-XNAPUWVE.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_XNAPUWVE.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_XNAPUWVE = require("./chunk-XNAPUWVE.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_XNAPUWVE.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_XNAPUWVE.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED