@markw65/monkeyc-optimizer 1.1.29 → 1.1.30
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/README.md +6 -0
- package/build/api.cjs +31 -31
- package/build/{chunk-PUYLJGKM.cjs → chunk-QINU6R5E.cjs} +30 -11
- package/build/optimizer.cjs +17 -17
- package/build/sdk-util.cjs +14 -14
- package/build/src/worker-task.d.ts +1 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -896,3 +896,9 @@ No functional change, just fixes a typo that broke the typescript exports.
|
|
|
896
896
|
|
|
897
897
|
- Enhancements
|
|
898
898
|
- various methods used by the extension for completion and hover info have been updated to give more accurate results.
|
|
899
|
+
|
|
900
|
+
### 1.1.30
|
|
901
|
+
|
|
902
|
+
- Bug fixes
|
|
903
|
+
- Fixes an issue where exporting a project that uses barrels could fail.
|
|
904
|
+
- Fixes a type analysis bug that could result in the type checker incorrectly thinking two types were disjoint.
|
package/build/api.cjs
CHANGED
|
@@ -18,44 +18,44 @@ 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
|
-
getApiFunctionInfo: () =>
|
|
31
|
-
getApiMapping: () =>
|
|
32
|
-
getSuperClasses: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_QINU6R5E.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_QINU6R5E.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_QINU6R5E.createDocumentationMap,
|
|
24
|
+
diagnostic: () => import_chunk_QINU6R5E.diagnostic,
|
|
25
|
+
diagnosticHelper: () => import_chunk_QINU6R5E.diagnosticHelper,
|
|
26
|
+
findNamesInScope: () => import_chunk_QINU6R5E.findNamesInScope,
|
|
27
|
+
findUsingForNode: () => import_chunk_QINU6R5E.findUsingForNode,
|
|
28
|
+
formatAst: () => import_chunk_QINU6R5E.formatAst,
|
|
29
|
+
formatAstLongLines: () => import_chunk_QINU6R5E.formatAstLongLines,
|
|
30
|
+
getApiFunctionInfo: () => import_chunk_QINU6R5E.getApiFunctionInfo,
|
|
31
|
+
getApiMapping: () => import_chunk_QINU6R5E.getApiMapping,
|
|
32
|
+
getSuperClasses: () => import_chunk_QINU6R5E.getSuperClasses,
|
|
33
33
|
hasProperty: () => import_chunk_MBTLUWXR.hasProperty,
|
|
34
|
-
isClassVariable: () =>
|
|
35
|
-
isLocal: () =>
|
|
36
|
-
isLookupCandidate: () =>
|
|
37
|
-
isStateNode: () =>
|
|
38
|
-
lookupByFullName: () =>
|
|
39
|
-
lookupNext: () =>
|
|
40
|
-
lookupResultContains: () =>
|
|
41
|
-
lookupWithType: () =>
|
|
42
|
-
makeToyboxLink: () =>
|
|
43
|
-
mapVarDeclsByType: () =>
|
|
44
|
-
markInvokeClassMethod: () =>
|
|
45
|
-
parseSdkVersion: () =>
|
|
46
|
-
sameLookupResult: () =>
|
|
34
|
+
isClassVariable: () => import_chunk_QINU6R5E.isClassVariable,
|
|
35
|
+
isLocal: () => import_chunk_QINU6R5E.isLocal,
|
|
36
|
+
isLookupCandidate: () => import_chunk_QINU6R5E.isLookupCandidate,
|
|
37
|
+
isStateNode: () => import_chunk_QINU6R5E.isStateNode,
|
|
38
|
+
lookupByFullName: () => import_chunk_QINU6R5E.lookupByFullName,
|
|
39
|
+
lookupNext: () => import_chunk_QINU6R5E.lookupNext,
|
|
40
|
+
lookupResultContains: () => import_chunk_QINU6R5E.lookupResultContains,
|
|
41
|
+
lookupWithType: () => import_chunk_QINU6R5E.lookupWithType,
|
|
42
|
+
makeToyboxLink: () => import_chunk_QINU6R5E.makeToyboxLink,
|
|
43
|
+
mapVarDeclsByType: () => import_chunk_QINU6R5E.mapVarDeclsByType,
|
|
44
|
+
markInvokeClassMethod: () => import_chunk_QINU6R5E.markInvokeClassMethod,
|
|
45
|
+
parseSdkVersion: () => import_chunk_QINU6R5E.parseSdkVersion,
|
|
46
|
+
sameLookupResult: () => import_chunk_QINU6R5E.sameLookupResult,
|
|
47
47
|
traverseAst: () => import_chunk_MBTLUWXR.traverseAst,
|
|
48
|
-
variableDeclarationName: () =>
|
|
49
|
-
visitReferences: () =>
|
|
50
|
-
visit_resources: () =>
|
|
51
|
-
visitorNode: () =>
|
|
48
|
+
variableDeclarationName: () => import_chunk_QINU6R5E.variableDeclarationName,
|
|
49
|
+
visitReferences: () => import_chunk_QINU6R5E.visitReferences,
|
|
50
|
+
visit_resources: () => import_chunk_QINU6R5E.visit_resources,
|
|
51
|
+
visitorNode: () => import_chunk_QINU6R5E.visitorNode
|
|
52
52
|
});
|
|
53
53
|
module.exports = __toCommonJS(api_exports);
|
|
54
|
-
var
|
|
54
|
+
var import_chunk_QINU6R5E = require("./chunk-QINU6R5E.cjs");
|
|
55
55
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
56
56
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
57
57
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
58
|
-
(0,
|
|
58
|
+
(0, import_chunk_QINU6R5E.init_api)();
|
|
59
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
60
|
0 && (module.exports = {
|
|
61
61
|
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_QINU6R5E_exports = {};
|
|
30
|
+
__export(chunk_QINU6R5E_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -122,7 +122,7 @@ __export(chunk_PUYLJGKM_exports, {
|
|
|
122
122
|
visitorNode: () => visitorNode,
|
|
123
123
|
xml_util_exports: () => xml_util_exports
|
|
124
124
|
});
|
|
125
|
-
module.exports = __toCommonJS(
|
|
125
|
+
module.exports = __toCommonJS(chunk_QINU6R5E_exports);
|
|
126
126
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
127
127
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
128
128
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -13200,6 +13200,9 @@ function couldBeHelper(a, b, shallow) {
|
|
|
13200
13200
|
if (a.value == null || b.value == null || a.value === b.value) {
|
|
13201
13201
|
return true;
|
|
13202
13202
|
}
|
|
13203
|
+
if (common & SingletonTypeTagsConst) {
|
|
13204
|
+
return true;
|
|
13205
|
+
}
|
|
13203
13206
|
if (common & ValueTypeTagsConst && common & UnionDataTypeTagsConst) {
|
|
13204
13207
|
return true;
|
|
13205
13208
|
}
|
|
@@ -29844,7 +29847,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29844
29847
|
const opt_time = await (0, import_chunk_PVBIKZYZ.first_modified)(
|
|
29845
29848
|
Object.values(fnMap).map((v) => v.output)
|
|
29846
29849
|
);
|
|
29847
|
-
if (source_time < opt_time &&
|
|
29850
|
+
if (source_time < opt_time && 1686169752423 < opt_time) {
|
|
29848
29851
|
return {
|
|
29849
29852
|
hasTests,
|
|
29850
29853
|
diagnostics: prevDiagnostics,
|
|
@@ -29881,7 +29884,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29881
29884
|
hasTests: hasTests2,
|
|
29882
29885
|
diagnostics,
|
|
29883
29886
|
sdkVersion,
|
|
29884
|
-
optimizerVersion: "1.1.
|
|
29887
|
+
optimizerVersion: "1.1.30",
|
|
29885
29888
|
...Object.fromEntries(
|
|
29886
29889
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
29887
29890
|
)
|
|
@@ -30104,6 +30107,26 @@ var init_optimizer = (0, import_chunk_ABYVSU2C.__esm)({
|
|
|
30104
30107
|
];
|
|
30105
30108
|
}
|
|
30106
30109
|
});
|
|
30110
|
+
function restoreQualifier(qualifier) {
|
|
30111
|
+
if (qualifier.resourceMap) {
|
|
30112
|
+
Object.values(qualifier.resourceMap).forEach((doc) => restoreDocument(doc));
|
|
30113
|
+
}
|
|
30114
|
+
if (qualifier.barrelMap) {
|
|
30115
|
+
Object.values(qualifier.barrelMap).forEach((barrel) => {
|
|
30116
|
+
restoreQualifier(barrel.qualifier);
|
|
30117
|
+
restoreDocument(barrel.xml);
|
|
30118
|
+
});
|
|
30119
|
+
}
|
|
30120
|
+
}
|
|
30121
|
+
function restoreDocument(obj) {
|
|
30122
|
+
Object.setPrototypeOf(obj, xml_util_exports.Document.prototype);
|
|
30123
|
+
const doc = obj;
|
|
30124
|
+
if (doc.body.elements) {
|
|
30125
|
+
Object.setPrototypeOf(doc.body, xml_util_exports.Nodes.prototype);
|
|
30126
|
+
} else {
|
|
30127
|
+
Object.setPrototypeOf(doc.body, Error.prototype);
|
|
30128
|
+
}
|
|
30129
|
+
}
|
|
30107
30130
|
async function performTask(task) {
|
|
30108
30131
|
const type = task.type;
|
|
30109
30132
|
const handler = Object.prototype.hasOwnProperty.call(workerTaskHandlers, type) && workerTaskHandlers[type];
|
|
@@ -30127,13 +30150,9 @@ var init_worker_task = (0, import_chunk_ABYVSU2C.__esm)({
|
|
|
30127
30150
|
return generateOptimizedProject(data.options);
|
|
30128
30151
|
},
|
|
30129
30152
|
generateOneConfig(data) {
|
|
30130
|
-
|
|
30131
|
-
Object.values(data.buildConfig.resourceMap).forEach(
|
|
30132
|
-
(doc) => Object.setPrototypeOf(doc, xml_util_exports.Document.prototype)
|
|
30133
|
-
);
|
|
30134
|
-
}
|
|
30153
|
+
restoreQualifier(data.buildConfig);
|
|
30135
30154
|
if (data.manifestXML) {
|
|
30136
|
-
|
|
30155
|
+
restoreDocument(data.manifestXML);
|
|
30137
30156
|
}
|
|
30138
30157
|
return generateOneConfig(
|
|
30139
30158
|
data.buildConfig,
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,29 +18,29 @@ 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
|
-
buildOptimizedProject: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_QINU6R5E.StateNodeAttributes,
|
|
22
|
+
buildOptimizedProject: () => import_chunk_QINU6R5E.buildOptimizedProject,
|
|
23
23
|
copyRecursiveAsNeeded: () => import_chunk_PVBIKZYZ.copyRecursiveAsNeeded,
|
|
24
|
-
defaultConfig: () =>
|
|
25
|
-
display: () =>
|
|
26
|
-
generateApiMirTests: () =>
|
|
27
|
-
generateOneConfig: () =>
|
|
28
|
-
generateOptimizedProject: () =>
|
|
29
|
-
getConfig: () =>
|
|
30
|
-
getProjectAnalysis: () =>
|
|
31
|
-
get_jungle: () =>
|
|
32
|
-
isErrorWithLocation: () =>
|
|
33
|
-
launchSimulator: () =>
|
|
34
|
-
manifestProducts: () =>
|
|
35
|
-
mctree: () =>
|
|
36
|
-
simulateProgram: () =>
|
|
24
|
+
defaultConfig: () => import_chunk_QINU6R5E.defaultConfig,
|
|
25
|
+
display: () => import_chunk_QINU6R5E.display,
|
|
26
|
+
generateApiMirTests: () => import_chunk_QINU6R5E.generateApiMirTests,
|
|
27
|
+
generateOneConfig: () => import_chunk_QINU6R5E.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_QINU6R5E.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_QINU6R5E.getConfig,
|
|
30
|
+
getProjectAnalysis: () => import_chunk_QINU6R5E.getProjectAnalysis,
|
|
31
|
+
get_jungle: () => import_chunk_QINU6R5E.get_jungle,
|
|
32
|
+
isErrorWithLocation: () => import_chunk_QINU6R5E.isErrorWithLocation,
|
|
33
|
+
launchSimulator: () => import_chunk_QINU6R5E.launchSimulator,
|
|
34
|
+
manifestProducts: () => import_chunk_QINU6R5E.manifestProducts,
|
|
35
|
+
mctree: () => import_chunk_QINU6R5E.mctree,
|
|
36
|
+
simulateProgram: () => import_chunk_QINU6R5E.simulateProgram
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(optimizer_exports);
|
|
39
|
-
var
|
|
39
|
+
var import_chunk_QINU6R5E = require("./chunk-QINU6R5E.cjs");
|
|
40
40
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
41
41
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
42
42
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
43
|
-
(0,
|
|
43
|
+
(0, import_chunk_QINU6R5E.init_optimizer)();
|
|
44
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
45
|
0 && (module.exports = {
|
|
46
46
|
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_QINU6R5E.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_QINU6R5E.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_QINU6R5E.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_QINU6R5E.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_QINU6R5E.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_QINU6R5E.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_QINU6R5E.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_QINU6R5E.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_QINU6R5E.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_QINU6R5E.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_QINU6R5E.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_QINU6R5E.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_QINU6R5E = require("./chunk-QINU6R5E.cjs");
|
|
36
36
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
37
37
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
38
38
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
39
|
-
(0,
|
|
39
|
+
(0, import_chunk_QINU6R5E.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
|
@@ -83,6 +83,6 @@ export declare const workerTaskHandlers: {
|
|
|
83
83
|
}>;
|
|
84
84
|
};
|
|
85
85
|
type RemovePromise<T> = T extends Promise<infer U> ? U : T;
|
|
86
|
-
export type WorkerTaskResult<T> = T extends WorkerTask ? RemovePromise<ReturnType<typeof workerTaskHandlers[T["type"]]>> : never;
|
|
86
|
+
export type WorkerTaskResult<T> = T extends WorkerTask ? RemovePromise<ReturnType<(typeof workerTaskHandlers)[T["type"]]>> : never;
|
|
87
87
|
export declare function performTask<T extends WorkerTask>(task: T): Promise<WorkerTaskResult<T>>;
|
|
88
88
|
export {};
|
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_QINU6R5E = require("./chunk-QINU6R5E.cjs");
|
|
25
25
|
var import_chunk_PVBIKZYZ = require("./chunk-PVBIKZYZ.cjs");
|
|
26
26
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.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_QINU6R5E.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_QINU6R5E.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED