@markw65/monkeyc-optimizer 1.1.29 → 1.1.31

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 CHANGED
@@ -896,3 +896,16 @@ 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.
905
+
906
+ ### 1.1.31
907
+
908
+ - Better error reporting when getApiMapping fails
909
+ - Update getApiMapping to handle api.mir from sdk-6.2.0
910
+ - Update various tests to work with sdk-6.2.0 (including marking one test as an expected failure)
911
+ - Add a test to catch the export-project-using-barrels bug that was fixed in 1.1.30
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: () => import_chunk_PUYLJGKM.checkCompilerVersion,
22
- collectNamespaces: () => import_chunk_PUYLJGKM.collectNamespaces,
23
- createDocumentationMap: () => import_chunk_PUYLJGKM.createDocumentationMap,
24
- diagnostic: () => import_chunk_PUYLJGKM.diagnostic,
25
- diagnosticHelper: () => import_chunk_PUYLJGKM.diagnosticHelper,
26
- findNamesInScope: () => import_chunk_PUYLJGKM.findNamesInScope,
27
- findUsingForNode: () => import_chunk_PUYLJGKM.findUsingForNode,
28
- formatAst: () => import_chunk_PUYLJGKM.formatAst,
29
- formatAstLongLines: () => import_chunk_PUYLJGKM.formatAstLongLines,
30
- getApiFunctionInfo: () => import_chunk_PUYLJGKM.getApiFunctionInfo,
31
- getApiMapping: () => import_chunk_PUYLJGKM.getApiMapping,
32
- getSuperClasses: () => import_chunk_PUYLJGKM.getSuperClasses,
21
+ checkCompilerVersion: () => import_chunk_6OD3V3XN.checkCompilerVersion,
22
+ collectNamespaces: () => import_chunk_6OD3V3XN.collectNamespaces,
23
+ createDocumentationMap: () => import_chunk_6OD3V3XN.createDocumentationMap,
24
+ diagnostic: () => import_chunk_6OD3V3XN.diagnostic,
25
+ diagnosticHelper: () => import_chunk_6OD3V3XN.diagnosticHelper,
26
+ findNamesInScope: () => import_chunk_6OD3V3XN.findNamesInScope,
27
+ findUsingForNode: () => import_chunk_6OD3V3XN.findUsingForNode,
28
+ formatAst: () => import_chunk_6OD3V3XN.formatAst,
29
+ formatAstLongLines: () => import_chunk_6OD3V3XN.formatAstLongLines,
30
+ getApiFunctionInfo: () => import_chunk_6OD3V3XN.getApiFunctionInfo,
31
+ getApiMapping: () => import_chunk_6OD3V3XN.getApiMapping,
32
+ getSuperClasses: () => import_chunk_6OD3V3XN.getSuperClasses,
33
33
  hasProperty: () => import_chunk_MBTLUWXR.hasProperty,
34
- isClassVariable: () => import_chunk_PUYLJGKM.isClassVariable,
35
- isLocal: () => import_chunk_PUYLJGKM.isLocal,
36
- isLookupCandidate: () => import_chunk_PUYLJGKM.isLookupCandidate,
37
- isStateNode: () => import_chunk_PUYLJGKM.isStateNode,
38
- lookupByFullName: () => import_chunk_PUYLJGKM.lookupByFullName,
39
- lookupNext: () => import_chunk_PUYLJGKM.lookupNext,
40
- lookupResultContains: () => import_chunk_PUYLJGKM.lookupResultContains,
41
- lookupWithType: () => import_chunk_PUYLJGKM.lookupWithType,
42
- makeToyboxLink: () => import_chunk_PUYLJGKM.makeToyboxLink,
43
- mapVarDeclsByType: () => import_chunk_PUYLJGKM.mapVarDeclsByType,
44
- markInvokeClassMethod: () => import_chunk_PUYLJGKM.markInvokeClassMethod,
45
- parseSdkVersion: () => import_chunk_PUYLJGKM.parseSdkVersion,
46
- sameLookupResult: () => import_chunk_PUYLJGKM.sameLookupResult,
34
+ isClassVariable: () => import_chunk_6OD3V3XN.isClassVariable,
35
+ isLocal: () => import_chunk_6OD3V3XN.isLocal,
36
+ isLookupCandidate: () => import_chunk_6OD3V3XN.isLookupCandidate,
37
+ isStateNode: () => import_chunk_6OD3V3XN.isStateNode,
38
+ lookupByFullName: () => import_chunk_6OD3V3XN.lookupByFullName,
39
+ lookupNext: () => import_chunk_6OD3V3XN.lookupNext,
40
+ lookupResultContains: () => import_chunk_6OD3V3XN.lookupResultContains,
41
+ lookupWithType: () => import_chunk_6OD3V3XN.lookupWithType,
42
+ makeToyboxLink: () => import_chunk_6OD3V3XN.makeToyboxLink,
43
+ mapVarDeclsByType: () => import_chunk_6OD3V3XN.mapVarDeclsByType,
44
+ markInvokeClassMethod: () => import_chunk_6OD3V3XN.markInvokeClassMethod,
45
+ parseSdkVersion: () => import_chunk_6OD3V3XN.parseSdkVersion,
46
+ sameLookupResult: () => import_chunk_6OD3V3XN.sameLookupResult,
47
47
  traverseAst: () => import_chunk_MBTLUWXR.traverseAst,
48
- variableDeclarationName: () => import_chunk_PUYLJGKM.variableDeclarationName,
49
- visitReferences: () => import_chunk_PUYLJGKM.visitReferences,
50
- visit_resources: () => import_chunk_PUYLJGKM.visit_resources,
51
- visitorNode: () => import_chunk_PUYLJGKM.visitorNode
48
+ variableDeclarationName: () => import_chunk_6OD3V3XN.variableDeclarationName,
49
+ visitReferences: () => import_chunk_6OD3V3XN.visitReferences,
50
+ visit_resources: () => import_chunk_6OD3V3XN.visit_resources,
51
+ visitorNode: () => import_chunk_6OD3V3XN.visitorNode
52
52
  });
53
53
  module.exports = __toCommonJS(api_exports);
54
- var import_chunk_PUYLJGKM = require("./chunk-PUYLJGKM.cjs");
54
+ var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.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, import_chunk_PUYLJGKM.init_api)();
58
+ (0, import_chunk_6OD3V3XN.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 chunk_PUYLJGKM_exports = {};
30
- __export(chunk_PUYLJGKM_exports, {
29
+ var chunk_6OD3V3XN_exports = {};
30
+ __export(chunk_6OD3V3XN_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(chunk_PUYLJGKM_exports);
125
+ module.exports = __toCommonJS(chunk_6OD3V3XN_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
  }
@@ -19210,52 +19213,47 @@ async function getApiMapping(state, resourcesMap, manifestXML) {
19210
19213
  state.sdkVersion = parseSdkVersion(match[1]);
19211
19214
  }
19212
19215
  }
19213
- const api = (await fs2.readFile(`${sdk}bin/api.mir`)).toString().replace(/\r\n/g, "\n").replace(/^(\s*type)\s/gm, "$1def ");
19214
- try {
19215
- const ast = parser.parse(api, null, {
19216
- filepath: "api.mir"
19217
- });
19218
- if (resourcesMap) {
19219
- const rezAst = state ? state.rezAst || { type: "Program", body: [] } : ast;
19220
- add_resources_to_ast(state, rezAst, resourcesMap, manifestXML);
19221
- if (state) {
19222
- state.rezAst = rezAst;
19223
- state.manifestXML = manifestXML;
19224
- }
19225
- }
19226
- const result = collectNamespaces(ast, state);
19227
- if (state && state.rezAst) {
19228
- collectNamespaces(state.rezAst, state);
19229
- }
19230
- negativeFixups.forEach((fixup) => {
19231
- const vs = fixup.split(".").reduce((state2, part) => {
19232
- const decls = isStateNode(state2) && state2.decls?.[part];
19233
- if (!Array.isArray(decls) || decls.length !== 1 || !decls[0]) {
19234
- throw `Failed to find and fix negative constant ${fixup}`;
19235
- }
19236
- return decls[0];
19237
- }, result);
19238
- const value2 = isStateNode(vs) ? vs.node : vs;
19239
- if (!value2 || value2.type !== "EnumStringMember" && (value2.type !== "VariableDeclarator" || value2.kind !== "const")) {
19240
- throw `Negative constant ${fixup} did not refer to a constant`;
19241
- }
19242
- const init = (0, import_chunk_MBTLUWXR.getLiteralNode)(value2.init);
19243
- if (!init || init.type !== "Literal") {
19244
- throw `Negative constant ${fixup} was not a Literal`;
19245
- }
19246
- if (typeof init.value !== "number") {
19247
- console.log(`Negative fixup ${fixup} was not a number!`);
19248
- } else if (init.value > 0) {
19249
- init.value = -init.value;
19250
- init.raw = "-" + init.raw;
19251
- } else {
19252
- }
19253
- });
19254
- return result;
19255
- } catch (e) {
19256
- console.error(`${e}`);
19257
- return null;
19258
- }
19216
+ const api = (await fs2.readFile(`${sdk}bin/api.mir`)).toString().replace(/\r\n/g, "\n").replace(/^(\s*static)?\s*<init>\s*\{\s*\}\s*?\n/gm, "").replace(/^(\s*type)\s/gm, "$1def ");
19217
+ const ast = parser.parse(api, null, {
19218
+ filepath: "api.mir"
19219
+ });
19220
+ if (resourcesMap) {
19221
+ const rezAst = state ? state.rezAst || { type: "Program", body: [] } : ast;
19222
+ add_resources_to_ast(state, rezAst, resourcesMap, manifestXML);
19223
+ if (state) {
19224
+ state.rezAst = rezAst;
19225
+ state.manifestXML = manifestXML;
19226
+ }
19227
+ }
19228
+ const result = collectNamespaces(ast, state);
19229
+ if (state && state.rezAst) {
19230
+ collectNamespaces(state.rezAst, state);
19231
+ }
19232
+ negativeFixups.forEach((fixup) => {
19233
+ const vs = fixup.split(".").reduce((state2, part) => {
19234
+ const decls = isStateNode(state2) && state2.decls?.[part];
19235
+ if (!Array.isArray(decls) || decls.length !== 1 || !decls[0]) {
19236
+ throw `Failed to find and fix negative constant ${fixup}`;
19237
+ }
19238
+ return decls[0];
19239
+ }, result);
19240
+ const value2 = isStateNode(vs) ? vs.node : vs;
19241
+ if (!value2 || value2.type !== "EnumStringMember" && (value2.type !== "VariableDeclarator" || value2.kind !== "const")) {
19242
+ throw `Negative constant ${fixup} did not refer to a constant`;
19243
+ }
19244
+ const init = (0, import_chunk_MBTLUWXR.getLiteralNode)(value2.init);
19245
+ if (!init || init.type !== "Literal") {
19246
+ throw `Negative constant ${fixup} was not a Literal`;
19247
+ }
19248
+ if (typeof init.value !== "number") {
19249
+ console.log(`Negative fixup ${fixup} was not a number!`);
19250
+ } else if (init.value > 0) {
19251
+ init.value = -init.value;
19252
+ init.raw = "-" + init.raw;
19253
+ } else {
19254
+ }
19255
+ });
19256
+ return result;
19259
19257
  }
19260
19258
  function isStateNode(node) {
19261
19259
  return (0, import_chunk_MBTLUWXR.hasProperty)(node, "node");
@@ -29844,7 +29842,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
29844
29842
  const opt_time = await (0, import_chunk_PVBIKZYZ.first_modified)(
29845
29843
  Object.values(fnMap).map((v) => v.output)
29846
29844
  );
29847
- if (source_time < opt_time && 1685575802667 < opt_time) {
29845
+ if (source_time < opt_time && 1687277028413 < opt_time) {
29848
29846
  return {
29849
29847
  hasTests,
29850
29848
  diagnostics: prevDiagnostics,
@@ -29881,7 +29879,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
29881
29879
  hasTests: hasTests2,
29882
29880
  diagnostics,
29883
29881
  sdkVersion,
29884
- optimizerVersion: "1.1.29",
29882
+ optimizerVersion: "1.1.31",
29885
29883
  ...Object.fromEntries(
29886
29884
  configOptionsToCheck.map((option) => [option, config[option]])
29887
29885
  )
@@ -30104,6 +30102,26 @@ var init_optimizer = (0, import_chunk_ABYVSU2C.__esm)({
30104
30102
  ];
30105
30103
  }
30106
30104
  });
30105
+ function restoreQualifier(qualifier) {
30106
+ if (qualifier.resourceMap) {
30107
+ Object.values(qualifier.resourceMap).forEach((doc) => restoreDocument(doc));
30108
+ }
30109
+ if (qualifier.barrelMap) {
30110
+ Object.values(qualifier.barrelMap).forEach((barrel) => {
30111
+ restoreQualifier(barrel.qualifier);
30112
+ restoreDocument(barrel.xml);
30113
+ });
30114
+ }
30115
+ }
30116
+ function restoreDocument(obj) {
30117
+ Object.setPrototypeOf(obj, xml_util_exports.Document.prototype);
30118
+ const doc = obj;
30119
+ if (doc.body.elements) {
30120
+ Object.setPrototypeOf(doc.body, xml_util_exports.Nodes.prototype);
30121
+ } else {
30122
+ Object.setPrototypeOf(doc.body, Error.prototype);
30123
+ }
30124
+ }
30107
30125
  async function performTask(task) {
30108
30126
  const type = task.type;
30109
30127
  const handler = Object.prototype.hasOwnProperty.call(workerTaskHandlers, type) && workerTaskHandlers[type];
@@ -30127,13 +30145,9 @@ var init_worker_task = (0, import_chunk_ABYVSU2C.__esm)({
30127
30145
  return generateOptimizedProject(data.options);
30128
30146
  },
30129
30147
  generateOneConfig(data) {
30130
- if (data.buildConfig.resourceMap) {
30131
- Object.values(data.buildConfig.resourceMap).forEach(
30132
- (doc) => Object.setPrototypeOf(doc, xml_util_exports.Document.prototype)
30133
- );
30134
- }
30148
+ restoreQualifier(data.buildConfig);
30135
30149
  if (data.manifestXML) {
30136
- Object.setPrototypeOf(data.manifestXML, xml_util_exports.Document.prototype);
30150
+ restoreDocument(data.manifestXML);
30137
30151
  }
30138
30152
  return generateOneConfig(
30139
30153
  data.buildConfig,
@@ -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: () => import_chunk_PUYLJGKM.StateNodeAttributes,
22
- buildOptimizedProject: () => import_chunk_PUYLJGKM.buildOptimizedProject,
21
+ StateNodeAttributes: () => import_chunk_6OD3V3XN.StateNodeAttributes,
22
+ buildOptimizedProject: () => import_chunk_6OD3V3XN.buildOptimizedProject,
23
23
  copyRecursiveAsNeeded: () => import_chunk_PVBIKZYZ.copyRecursiveAsNeeded,
24
- defaultConfig: () => import_chunk_PUYLJGKM.defaultConfig,
25
- display: () => import_chunk_PUYLJGKM.display,
26
- generateApiMirTests: () => import_chunk_PUYLJGKM.generateApiMirTests,
27
- generateOneConfig: () => import_chunk_PUYLJGKM.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_PUYLJGKM.generateOptimizedProject,
29
- getConfig: () => import_chunk_PUYLJGKM.getConfig,
30
- getProjectAnalysis: () => import_chunk_PUYLJGKM.getProjectAnalysis,
31
- get_jungle: () => import_chunk_PUYLJGKM.get_jungle,
32
- isErrorWithLocation: () => import_chunk_PUYLJGKM.isErrorWithLocation,
33
- launchSimulator: () => import_chunk_PUYLJGKM.launchSimulator,
34
- manifestProducts: () => import_chunk_PUYLJGKM.manifestProducts,
35
- mctree: () => import_chunk_PUYLJGKM.mctree,
36
- simulateProgram: () => import_chunk_PUYLJGKM.simulateProgram
24
+ defaultConfig: () => import_chunk_6OD3V3XN.defaultConfig,
25
+ display: () => import_chunk_6OD3V3XN.display,
26
+ generateApiMirTests: () => import_chunk_6OD3V3XN.generateApiMirTests,
27
+ generateOneConfig: () => import_chunk_6OD3V3XN.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_6OD3V3XN.generateOptimizedProject,
29
+ getConfig: () => import_chunk_6OD3V3XN.getConfig,
30
+ getProjectAnalysis: () => import_chunk_6OD3V3XN.getProjectAnalysis,
31
+ get_jungle: () => import_chunk_6OD3V3XN.get_jungle,
32
+ isErrorWithLocation: () => import_chunk_6OD3V3XN.isErrorWithLocation,
33
+ launchSimulator: () => import_chunk_6OD3V3XN.launchSimulator,
34
+ manifestProducts: () => import_chunk_6OD3V3XN.manifestProducts,
35
+ mctree: () => import_chunk_6OD3V3XN.mctree,
36
+ simulateProgram: () => import_chunk_6OD3V3XN.simulateProgram
37
37
  });
38
38
  module.exports = __toCommonJS(optimizer_exports);
39
- var import_chunk_PUYLJGKM = require("./chunk-PUYLJGKM.cjs");
39
+ var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.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, import_chunk_PUYLJGKM.init_optimizer)();
43
+ (0, import_chunk_6OD3V3XN.init_optimizer)();
44
44
  // Annotate the CommonJS export names for ESM import in node:
45
45
  0 && (module.exports = {
46
46
  StateNodeAttributes,
@@ -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: () => import_chunk_PUYLJGKM.SectionKinds,
22
- appSupport: () => import_chunk_PUYLJGKM.appSupport,
23
- connectiq: () => import_chunk_PUYLJGKM.connectiq,
24
- getDeviceInfo: () => import_chunk_PUYLJGKM.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_PUYLJGKM.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_PUYLJGKM.getLanguages,
27
- getSdkPath: () => import_chunk_PUYLJGKM.getSdkPath,
28
- isWin: () => import_chunk_PUYLJGKM.isWin,
29
- optimizeProgram: () => import_chunk_PUYLJGKM.optimizeProgram,
30
- readPrg: () => import_chunk_PUYLJGKM.readPrg,
31
- readPrgWithOffsets: () => import_chunk_PUYLJGKM.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_PUYLJGKM.xml_util_exports
21
+ SectionKinds: () => import_chunk_6OD3V3XN.SectionKinds,
22
+ appSupport: () => import_chunk_6OD3V3XN.appSupport,
23
+ connectiq: () => import_chunk_6OD3V3XN.connectiq,
24
+ getDeviceInfo: () => import_chunk_6OD3V3XN.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_6OD3V3XN.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_6OD3V3XN.getLanguages,
27
+ getSdkPath: () => import_chunk_6OD3V3XN.getSdkPath,
28
+ isWin: () => import_chunk_6OD3V3XN.isWin,
29
+ optimizeProgram: () => import_chunk_6OD3V3XN.optimizeProgram,
30
+ readPrg: () => import_chunk_6OD3V3XN.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_6OD3V3XN.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_6OD3V3XN.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_PUYLJGKM = require("./chunk-PUYLJGKM.cjs");
35
+ var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.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, import_chunk_PUYLJGKM.init_sdk_util)();
39
+ (0, import_chunk_6OD3V3XN.init_sdk_util)();
40
40
  // Annotate the CommonJS export names for ESM import in node:
41
41
  0 && (module.exports = {
42
42
  SectionKinds,
@@ -9,7 +9,7 @@ export { visitorNode, visitReferences } from "./visitor";
9
9
  export { traverseAst, hasProperty, visit_resources };
10
10
  export declare function parseSdkVersion(version: string | undefined): number;
11
11
  export declare function checkCompilerVersion(version: string, sdkVer: number): boolean | undefined;
12
- export declare function getApiMapping(state?: ProgramState, resourcesMap?: Record<string, JungleResourceMap>, manifestXML?: xmlUtil.Document): Promise<ProgramStateNode | null>;
12
+ export declare function getApiMapping(state?: ProgramState, resourcesMap?: Record<string, JungleResourceMap>, manifestXML?: xmlUtil.Document): Promise<ProgramStateNode>;
13
13
  export declare function isStateNode(node: {
14
14
  type: string;
15
15
  }): node is StateNode;
@@ -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 {};
@@ -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 import_chunk_PUYLJGKM = require("./chunk-PUYLJGKM.cjs");
24
+ var import_chunk_6OD3V3XN = require("./chunk-6OD3V3XN.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, import_chunk_PUYLJGKM.init_worker_task)();
31
+ (0, import_chunk_6OD3V3XN.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, import_chunk_PUYLJGKM.performTask)(task));
34
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_6OD3V3XN.performTask)(task));
35
35
  });
36
36
  }
37
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@markw65/monkeyc-optimizer",
3
3
  "type": "commonjs",
4
- "version": "1.1.29",
4
+ "version": "1.1.31",
5
5
  "description": "Source to source optimizer for Garmin Monkey C code",
6
6
  "main": "build/optimizer.cjs",
7
7
  "types": "build/src/optimizer.d.ts",