@markw65/monkeyc-optimizer 1.1.94 → 1.1.96

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 CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to the "monkeyc-optimizer" package will be documented in this file.
4
4
 
5
+ ### 1.1.96
6
+
7
+ - Update to [@markw65/prettier-plugin-monkeyc@1.0.66](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1066)
8
+ - Insert a single space after the comma in a list of exclusions if there was at least one space already.
9
+ - Fix [Minor documentation issue regarding running the optimizer via the command line](https://github.com/markw65/monkeyc-optimizer/issues/68)
10
+ - Fix ["Export Optimized Project" fails with "doc.processRefs is not a function"](https://github.com/markw65/monkeyc-optimizer/issues/69)
11
+ - Fix ["Export Optimized Project" fails if extended code takes up more than one page](https://github.com/markw65/monkeyc-optimizer/issues/70)
12
+ - Fix ["Undefined symbol" due to variable resolution issue in jungle file](https://github.com/markw65/monkeyc-optimizer/issues/71)
13
+
14
+ ### 1.1.95
15
+
16
+ - Fix a regression introduced in `1.1.94`
17
+ - Fix lookup of calls in data flow to ignore locals
18
+ - Revert a fix I put in to match [a Garmin bug](https://forums.garmin.com/developer/connect-iq/i/bug-reports/relative-paths-in-local-variables-in-jungle-files-are-resolved-incorrectly) since that bug was fixed in `Sdk-8.0.0`.
19
+
5
20
  ### 1.1.94
6
21
 
7
22
  - Update to [@markw65/prettier-plugin-monkeyc@1.0.65](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1065)
package/build/api.cjs CHANGED
@@ -18,52 +18,52 @@ 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_5SB3QASN.checkCompilerVersion,
22
- clearDiagnostics: () => import_chunk_5SB3QASN.clearDiagnostics,
23
- collectNamespaces: () => import_chunk_5SB3QASN.collectNamespaces,
24
- createDocumentationMap: () => import_chunk_5SB3QASN.createDocumentationMap,
25
- declKey: () => import_chunk_5SB3QASN.declKey,
26
- diagnostic: () => import_chunk_5SB3QASN.diagnostic,
27
- diagnosticHelper: () => import_chunk_5SB3QASN.diagnosticHelper,
28
- findNamesInScope: () => import_chunk_5SB3QASN.findNamesInScope,
29
- findUsingForNode: () => import_chunk_5SB3QASN.findUsingForNode,
30
- formatAst: () => import_chunk_5SB3QASN.formatAst,
31
- formatAstLongLines: () => import_chunk_5SB3QASN.formatAstLongLines,
32
- formatScopedName: () => import_chunk_5SB3QASN.formatScopedName,
33
- getApiFunctionInfo: () => import_chunk_5SB3QASN.getApiFunctionInfo,
34
- getApiMapping: () => import_chunk_5SB3QASN.getApiMapping,
35
- getSuperClasses: () => import_chunk_5SB3QASN.getSuperClasses,
36
- handleImportUsing: () => import_chunk_5SB3QASN.handleImportUsing,
21
+ checkCompilerVersion: () => import_chunk_4C4RQPFP.checkCompilerVersion,
22
+ clearDiagnostics: () => import_chunk_4C4RQPFP.clearDiagnostics,
23
+ collectNamespaces: () => import_chunk_4C4RQPFP.collectNamespaces,
24
+ createDocumentationMap: () => import_chunk_4C4RQPFP.createDocumentationMap,
25
+ declKey: () => import_chunk_4C4RQPFP.declKey,
26
+ diagnostic: () => import_chunk_4C4RQPFP.diagnostic,
27
+ diagnosticHelper: () => import_chunk_4C4RQPFP.diagnosticHelper,
28
+ findNamesInScope: () => import_chunk_4C4RQPFP.findNamesInScope,
29
+ findUsingForNode: () => import_chunk_4C4RQPFP.findUsingForNode,
30
+ formatAst: () => import_chunk_4C4RQPFP.formatAst,
31
+ formatAstLongLines: () => import_chunk_4C4RQPFP.formatAstLongLines,
32
+ formatScopedName: () => import_chunk_4C4RQPFP.formatScopedName,
33
+ getApiFunctionInfo: () => import_chunk_4C4RQPFP.getApiFunctionInfo,
34
+ getApiMapping: () => import_chunk_4C4RQPFP.getApiMapping,
35
+ getSuperClasses: () => import_chunk_4C4RQPFP.getSuperClasses,
36
+ handleImportUsing: () => import_chunk_4C4RQPFP.handleImportUsing,
37
37
  hasProperty: () => import_chunk_UBAYZSM3.hasProperty,
38
- isClassVariable: () => import_chunk_5SB3QASN.isClassVariable,
39
- isLocal: () => import_chunk_5SB3QASN.isLocal,
40
- isLookupCandidate: () => import_chunk_5SB3QASN.isLookupCandidate,
41
- isStateNode: () => import_chunk_5SB3QASN.isStateNode,
42
- lookupByFullName: () => import_chunk_5SB3QASN.lookupByFullName,
43
- lookupNext: () => import_chunk_5SB3QASN.lookupNext,
44
- lookupResultContains: () => import_chunk_5SB3QASN.lookupResultContains,
45
- lookupWithType: () => import_chunk_5SB3QASN.lookupWithType,
46
- makeToyboxLink: () => import_chunk_5SB3QASN.makeToyboxLink,
47
- mapVarDeclsByType: () => import_chunk_5SB3QASN.mapVarDeclsByType,
48
- markInvokeClassMethod: () => import_chunk_5SB3QASN.markInvokeClassMethod,
49
- parseSdkVersion: () => import_chunk_5SB3QASN.parseSdkVersion,
50
- popRootNode: () => import_chunk_5SB3QASN.popRootNode,
51
- pushRootNode: () => import_chunk_5SB3QASN.pushRootNode,
52
- resolveDiagnostics: () => import_chunk_5SB3QASN.resolveDiagnostics,
53
- resolveDiagnosticsMap: () => import_chunk_5SB3QASN.resolveDiagnosticsMap,
54
- sameLookupResult: () => import_chunk_5SB3QASN.sameLookupResult,
38
+ isClassVariable: () => import_chunk_4C4RQPFP.isClassVariable,
39
+ isLocal: () => import_chunk_4C4RQPFP.isLocal,
40
+ isLookupCandidate: () => import_chunk_4C4RQPFP.isLookupCandidate,
41
+ isStateNode: () => import_chunk_4C4RQPFP.isStateNode,
42
+ lookupByFullName: () => import_chunk_4C4RQPFP.lookupByFullName,
43
+ lookupNext: () => import_chunk_4C4RQPFP.lookupNext,
44
+ lookupResultContains: () => import_chunk_4C4RQPFP.lookupResultContains,
45
+ lookupWithType: () => import_chunk_4C4RQPFP.lookupWithType,
46
+ makeToyboxLink: () => import_chunk_4C4RQPFP.makeToyboxLink,
47
+ mapVarDeclsByType: () => import_chunk_4C4RQPFP.mapVarDeclsByType,
48
+ markInvokeClassMethod: () => import_chunk_4C4RQPFP.markInvokeClassMethod,
49
+ parseSdkVersion: () => import_chunk_4C4RQPFP.parseSdkVersion,
50
+ popRootNode: () => import_chunk_4C4RQPFP.popRootNode,
51
+ pushRootNode: () => import_chunk_4C4RQPFP.pushRootNode,
52
+ resolveDiagnostics: () => import_chunk_4C4RQPFP.resolveDiagnostics,
53
+ resolveDiagnosticsMap: () => import_chunk_4C4RQPFP.resolveDiagnosticsMap,
54
+ sameLookupResult: () => import_chunk_4C4RQPFP.sameLookupResult,
55
55
  traverseAst: () => import_chunk_UBAYZSM3.traverseAst,
56
- variableDeclarationName: () => import_chunk_5SB3QASN.variableDeclarationName,
57
- visitReferences: () => import_chunk_5SB3QASN.visitReferences,
58
- visit_resources: () => import_chunk_5SB3QASN.visit_resources,
59
- visitorNode: () => import_chunk_5SB3QASN.visitorNode
56
+ variableDeclarationName: () => import_chunk_4C4RQPFP.variableDeclarationName,
57
+ visitReferences: () => import_chunk_4C4RQPFP.visitReferences,
58
+ visit_resources: () => import_chunk_4C4RQPFP.visit_resources,
59
+ visitorNode: () => import_chunk_4C4RQPFP.visitorNode
60
60
  });
61
61
  module.exports = __toCommonJS(api_exports);
62
- var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.cjs");
62
+ var import_chunk_4C4RQPFP = require("./chunk-4C4RQPFP.cjs");
63
63
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
64
64
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
65
65
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
66
- (0, import_chunk_5SB3QASN.init_api)();
66
+ (0, import_chunk_4C4RQPFP.init_api)();
67
67
  // Annotate the CommonJS export names for ESM import in node:
68
68
  0 && (module.exports = {
69
69
  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_5SB3QASN_exports = {};
30
- __export(chunk_5SB3QASN_exports, {
29
+ var chunk_4C4RQPFP_exports = {};
30
+ __export(chunk_4C4RQPFP_exports, {
31
31
  EnumTagsConst: () => EnumTagsConst,
32
32
  LastTypeTag: () => LastTypeTag,
33
33
  ObjectLikeTagsConst: () => ObjectLikeTagsConst,
@@ -140,7 +140,7 @@ __export(chunk_5SB3QASN_exports, {
140
140
  visitorNode: () => visitorNode,
141
141
  xml_util_exports: () => xml_util_exports
142
142
  });
143
- module.exports = __toCommonJS(chunk_5SB3QASN_exports);
143
+ module.exports = __toCommonJS(chunk_4C4RQPFP_exports);
144
144
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
145
145
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
146
146
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
@@ -12037,27 +12037,24 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
12037
12037
  const modifiableDecl = (decls, callees, node) => {
12038
12038
  if (!callees) {
12039
12039
  const lv = node.type === "AssignmentExpression" ? node.left : node.type === "UpdateExpression" ? node.argument : null;
12040
- if (!lv) return true;
12041
- if (lv.type === "MemberExpression") {
12042
- if (lv.computed) {
12043
- if (lv.property.type === "Literal") {
12044
- return false;
12045
- }
12046
- if ((lv.property.type !== "UnaryExpression" || lv.property.operator !== ":") && !couldBe(
12047
- {
12048
- type: 131072
12049
- /* Symbol */
12050
- },
12051
- evaluate(istate, lv.property).value
12052
- )) {
12053
- return false;
12054
- }
12040
+ if (lv?.type === "MemberExpression" && lv.computed) {
12041
+ if (lv.property.type === "Literal") {
12042
+ return false;
12043
+ }
12044
+ if ((lv.property.type !== "UnaryExpression" || lv.property.operator !== ":") && !couldBe(
12045
+ {
12046
+ type: 131072
12047
+ /* Symbol */
12048
+ },
12049
+ evaluate(istate, lv.property).value
12050
+ )) {
12051
+ return false;
12055
12052
  }
12056
12053
  }
12057
12054
  }
12058
12055
  return (0, import_chunk_IJS7AYMN.some)(
12059
12056
  decls,
12060
- (decl) => decl.type === "VariableDeclarator" && decl.node.kind === "var" && !isLocal(decl) && (0, import_chunk_IJS7AYMN.some)(callees, (callee) => functionMayModify(state, callee, decl))
12057
+ (decl) => decl.type === "VariableDeclarator" && decl.node.kind === "var" && !isLocal(decl) && (!callees || (0, import_chunk_IJS7AYMN.some)(callees, (callee) => functionMayModify(state, callee, decl)))
12061
12058
  );
12062
12059
  };
12063
12060
  const mergeSuccState = (top, curState) => {
@@ -18750,17 +18747,18 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
18750
18747
  }
18751
18748
  return canon;
18752
18749
  };
18753
- const findDecl = (node) => {
18750
+ const findDecl = (node, nonLocal = false) => {
18754
18751
  const path8 = [];
18755
18752
  const root2 = node;
18756
18753
  while (node.type === "MemberExpression" && (wantsAllRefs || !node.computed)) {
18757
18754
  path8.unshift(node);
18758
18755
  node = node.object;
18756
+ nonLocal = false;
18759
18757
  }
18760
18758
  if (node.type !== "Identifier" && node.type !== "ThisExpression") {
18761
18759
  return null;
18762
18760
  }
18763
- let [, results] = state.lookup(node);
18761
+ let [, results] = nonLocal ? state.lookupNonlocal(node) : state.lookup(node);
18764
18762
  if (!results) {
18765
18763
  return wantsAllRefs ? { type: "Unknown", node: path8.pop() } : null;
18766
18764
  }
@@ -19016,7 +19014,7 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
19016
19014
  case "CallExpression": {
19017
19015
  liveDef(null, stmt);
19018
19016
  if (wantsAllRefs) {
19019
- const calleeDecl = findDecl(node.callee);
19017
+ const calleeDecl = findDecl(node.callee, true);
19020
19018
  if (calleeDecl) {
19021
19019
  const mod = {
19022
19020
  type: "mod",
@@ -23263,9 +23261,14 @@ function markLocals(context) {
23263
23261
  context.debugXml.body.children("localVars").children("entry").elements.forEach((entry) => {
23264
23262
  const { startPc, endPc, stackId, name, arg } = entry.attr;
23265
23263
  (0, import_node_assert16.default)(startPc && endPc && stackId && name);
23266
- const spc = Number(startPc.value.value) & PC_OFFSET_MASK;
23267
- const epc = (Number(endPc.value.value) & PC_OFFSET_MASK) + 1;
23264
+ const spcRaw = Number(startPc.value.value);
23265
+ const epcRaw = Number(endPc.value.value) + 1;
23268
23266
  const sid = Number(stackId.value.value);
23267
+ if ((spcRaw & SECTION_PC_MASK) !== TEXT_SECTION_PC || (epcRaw & SECTION_PC_MASK) !== TEXT_SECTION_PC) {
23268
+ return;
23269
+ }
23270
+ const spc = spcRaw & PC_OFFSET_MASK;
23271
+ const epc = epcRaw & PC_OFFSET_MASK;
23269
23272
  let locals = localMap.get(spc);
23270
23273
  if (!locals) {
23271
23274
  locals = [];
@@ -23294,9 +23297,7 @@ function markLocals(context) {
23294
23297
  }
23295
23298
  const locals = localMap.get(bc.offset);
23296
23299
  locals?.forEach((localInfo) => {
23297
- if (live.has(localInfo.sid)) {
23298
- (0, import_node_assert16.default)(!live.has(localInfo.sid));
23299
- }
23300
+ (0, import_node_assert16.default)(!live.has(localInfo.sid));
23300
23301
  live.set(localInfo.sid, localInfo);
23301
23302
  const e = ends.get(localInfo.epc);
23302
23303
  if (e == null) {
@@ -25882,13 +25883,7 @@ function evaluate_locals(assignments) {
25882
25883
  while (true) {
25883
25884
  assignments = assignments.filter((a) => {
25884
25885
  if (a.names.length === 1 && a.values.every((v) => v.type === "Literal")) {
25885
- locals[a.names[0]] = a.values.map((v) => {
25886
- if ("source" in v) {
25887
- v = { ...v };
25888
- delete v.source;
25889
- }
25890
- return v;
25891
- });
25886
+ locals[a.names[0]] = a.values;
25892
25887
  return false;
25893
25888
  }
25894
25889
  return true;
@@ -25896,11 +25891,11 @@ function evaluate_locals(assignments) {
25896
25891
  const newLength = Object.keys(locals).length;
25897
25892
  if (newLength === localsLength) break;
25898
25893
  localsLength = newLength;
25899
- const process_list = (values) => {
25894
+ const process_list = (names, values) => {
25900
25895
  for (let i = values.length; i--; ) {
25901
25896
  const v = values[i];
25902
25897
  if (v.type === "Compound") {
25903
- process_list(v.values);
25898
+ process_list(null, v.values);
25904
25899
  if (v.values.every((s) => s.type === "Literal")) {
25905
25900
  values[i] = {
25906
25901
  type: "Literal",
@@ -25909,12 +25904,15 @@ function evaluate_locals(assignments) {
25909
25904
  }
25910
25905
  } else if (v.type === "QualifiedName" && v.names.length === 1 && (0, import_chunk_UBAYZSM3.hasProperty)(locals, v.names[0])) {
25911
25906
  values.splice(i, 1, ...locals[v.names[0]]);
25907
+ if (names?.length === 1 && values.every((v2) => v2.type === "Literal")) {
25908
+ locals[names[0]] = values;
25909
+ }
25912
25910
  } else if (v.type === "SubList") {
25913
- process_list(v.values);
25911
+ process_list(null, v.values);
25914
25912
  }
25915
25913
  }
25916
25914
  };
25917
- assignments.forEach((a) => process_list(a.values));
25915
+ assignments.forEach((a) => process_list(a.names, a.values));
25918
25916
  }
25919
25917
  return assignments;
25920
25918
  }
@@ -27445,7 +27443,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
27445
27443
  const opt_time = await (0, import_chunk_IJS7AYMN.first_modified)(
27446
27444
  Object.values(fnMap).map((v) => v.output)
27447
27445
  );
27448
- if (source_time < opt_time && 1769823563413 < opt_time) {
27446
+ if (source_time < opt_time && 1772064318337 < opt_time) {
27449
27447
  return {
27450
27448
  hasTests,
27451
27449
  diagnostics: prevDiagnostics,
@@ -27483,7 +27481,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
27483
27481
  hasTests: hasTests2,
27484
27482
  diagnostics,
27485
27483
  sdkVersion,
27486
- optimizerVersion: "1.1.94",
27484
+ optimizerVersion: "1.1.96",
27487
27485
  ...Object.fromEntries(
27488
27486
  configOptionsToCheck.map((option) => [option, config[option]])
27489
27487
  )
@@ -27663,12 +27661,16 @@ function restoreQualifier(qualifier) {
27663
27661
  }
27664
27662
  if (qualifier.barrelMap) {
27665
27663
  Object.values(qualifier.barrelMap).forEach((barrel) => {
27664
+ Object.values(barrel.resources).forEach((res) => restoreDocument(res));
27666
27665
  restoreQualifier(barrel.qualifier);
27667
27666
  restoreDocument(barrel.xml);
27668
27667
  });
27669
27668
  }
27670
27669
  }
27671
27670
  function restoreDocument(obj) {
27671
+ if (obj instanceof xml_util_exports.Document) {
27672
+ return;
27673
+ }
27672
27674
  Object.setPrototypeOf(obj, xml_util_exports.Document.prototype);
27673
27675
  const doc = obj;
27674
27676
  if (doc.body.elements) {
@@ -28151,6 +28153,7 @@ async function optimizePackage(filepath, devKey, output, config) {
28151
28153
  } finally {
28152
28154
  stopPool();
28153
28155
  }
28156
+ return { output };
28154
28157
  }
28155
28158
  function optimizePrgAndDebug(prgName, prgBuffer, prgOffset, prgLength, xmlName, xmlBuffer, xmlOffset, xmlLength, key, config) {
28156
28159
  const xmlString = Buffer.from(xmlBuffer, xmlOffset, xmlLength).toString();
@@ -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: () => import_chunk_5SB3QASN.StateNodeAttributes,
22
- buildConfigDescription: () => import_chunk_5SB3QASN.buildConfigDescription,
23
- buildOptimizedProject: () => import_chunk_5SB3QASN.buildOptimizedProject,
21
+ StateNodeAttributes: () => import_chunk_4C4RQPFP.StateNodeAttributes,
22
+ buildConfigDescription: () => import_chunk_4C4RQPFP.buildConfigDescription,
23
+ buildOptimizedProject: () => import_chunk_4C4RQPFP.buildOptimizedProject,
24
24
  copyRecursiveAsNeeded: () => import_chunk_IJS7AYMN.copyRecursiveAsNeeded,
25
- defaultConfig: () => import_chunk_5SB3QASN.defaultConfig,
26
- display: () => import_chunk_5SB3QASN.display,
27
- generateOneConfig: () => import_chunk_5SB3QASN.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_5SB3QASN.generateOptimizedProject,
29
- getConfig: () => import_chunk_5SB3QASN.getConfig,
30
- getFnMapAnalysis: () => import_chunk_5SB3QASN.getFnMapAnalysis,
31
- getProjectAnalysis: () => import_chunk_5SB3QASN.getProjectAnalysis,
32
- get_jungle: () => import_chunk_5SB3QASN.get_jungle,
33
- isErrorWithLocation: () => import_chunk_5SB3QASN.isErrorWithLocation,
34
- launchSimulator: () => import_chunk_5SB3QASN.launchSimulator,
35
- manifestProducts: () => import_chunk_5SB3QASN.manifestProducts,
36
- mctree: () => import_chunk_5SB3QASN.mctree,
37
- simulateProgram: () => import_chunk_5SB3QASN.simulateProgram
25
+ defaultConfig: () => import_chunk_4C4RQPFP.defaultConfig,
26
+ display: () => import_chunk_4C4RQPFP.display,
27
+ generateOneConfig: () => import_chunk_4C4RQPFP.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_4C4RQPFP.generateOptimizedProject,
29
+ getConfig: () => import_chunk_4C4RQPFP.getConfig,
30
+ getFnMapAnalysis: () => import_chunk_4C4RQPFP.getFnMapAnalysis,
31
+ getProjectAnalysis: () => import_chunk_4C4RQPFP.getProjectAnalysis,
32
+ get_jungle: () => import_chunk_4C4RQPFP.get_jungle,
33
+ isErrorWithLocation: () => import_chunk_4C4RQPFP.isErrorWithLocation,
34
+ launchSimulator: () => import_chunk_4C4RQPFP.launchSimulator,
35
+ manifestProducts: () => import_chunk_4C4RQPFP.manifestProducts,
36
+ mctree: () => import_chunk_4C4RQPFP.mctree,
37
+ simulateProgram: () => import_chunk_4C4RQPFP.simulateProgram
38
38
  });
39
39
  module.exports = __toCommonJS(optimizer_exports);
40
- var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.cjs");
40
+ var import_chunk_4C4RQPFP = require("./chunk-4C4RQPFP.cjs");
41
41
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
42
42
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
43
43
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
44
- (0, import_chunk_5SB3QASN.init_optimizer)();
44
+ (0, import_chunk_4C4RQPFP.init_optimizer)();
45
45
  // Annotate the CommonJS export names for ESM import in node:
46
46
  0 && (module.exports = {
47
47
  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_5SB3QASN.SectionKinds,
22
- appSupport: () => import_chunk_5SB3QASN.appSupport,
23
- connectiq: () => import_chunk_5SB3QASN.connectiq,
24
- getDeviceInfo: () => import_chunk_5SB3QASN.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_5SB3QASN.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_5SB3QASN.getLanguages,
27
- getSdkPath: () => import_chunk_5SB3QASN.getSdkPath,
28
- isWin: () => import_chunk_5SB3QASN.isWin,
29
- optimizeProgram: () => import_chunk_5SB3QASN.optimizeProgram,
30
- readPrg: () => import_chunk_5SB3QASN.readPrg,
31
- readPrgWithOffsets: () => import_chunk_5SB3QASN.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_5SB3QASN.xml_util_exports
21
+ SectionKinds: () => import_chunk_4C4RQPFP.SectionKinds,
22
+ appSupport: () => import_chunk_4C4RQPFP.appSupport,
23
+ connectiq: () => import_chunk_4C4RQPFP.connectiq,
24
+ getDeviceInfo: () => import_chunk_4C4RQPFP.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_4C4RQPFP.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_4C4RQPFP.getLanguages,
27
+ getSdkPath: () => import_chunk_4C4RQPFP.getSdkPath,
28
+ isWin: () => import_chunk_4C4RQPFP.isWin,
29
+ optimizeProgram: () => import_chunk_4C4RQPFP.optimizeProgram,
30
+ readPrg: () => import_chunk_4C4RQPFP.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_4C4RQPFP.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_4C4RQPFP.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.cjs");
35
+ var import_chunk_4C4RQPFP = require("./chunk-4C4RQPFP.cjs");
36
36
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
37
37
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
38
38
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
39
- (0, import_chunk_5SB3QASN.init_sdk_util)();
39
+ (0, import_chunk_4C4RQPFP.init_sdk_util)();
40
40
  // Annotate the CommonJS export names for ESM import in node:
41
41
  0 && (module.exports = {
42
42
  SectionKinds,
@@ -12,7 +12,9 @@ export declare function readPrgWithOffsets(view: DataView): {
12
12
  view: DataView<ArrayBufferLike>;
13
13
  sections: Record<number, SectionInfo>;
14
14
  };
15
- export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string, config?: BuildConfig): Promise<void | {
15
+ export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string, config?: BuildConfig): Promise<{
16
+ output: string;
17
+ } | {
16
18
  signature: Buffer<ArrayBuffer> | undefined;
17
19
  output: string;
18
20
  }>;
@@ -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_5SB3QASN = require("./chunk-5SB3QASN.cjs");
24
+ var import_chunk_4C4RQPFP = require("./chunk-4C4RQPFP.cjs");
25
25
  var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
26
26
  var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
27
27
  var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
28
28
  var import_node_worker_threads = require("node:worker_threads");
29
29
  var require_worker_thread = (0, import_chunk_VS2QQHAK.__commonJS)({
30
30
  "src/worker-thread.ts"() {
31
- (0, import_chunk_5SB3QASN.init_worker_task)();
31
+ (0, import_chunk_4C4RQPFP.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_5SB3QASN.performTask)(task));
34
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_4C4RQPFP.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.94",
4
+ "version": "1.1.96",
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",
@@ -56,7 +56,7 @@
56
56
  "author": "markw65",
57
57
  "license": "MIT",
58
58
  "dependencies": {
59
- "@markw65/prettier-plugin-monkeyc": "^1.0.65",
59
+ "@markw65/prettier-plugin-monkeyc": "^1.0.66",
60
60
  "7z-wasm": "^1.2.0"
61
61
  },
62
62
  "devDependencies": {