@markw65/monkeyc-optimizer 1.1.74 → 1.1.75

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,15 @@
2
2
 
3
3
  All notable changes to the "monkeyc-optimizer" package will be documented in this file.
4
4
 
5
+ ### 1.1.75
6
+
7
+ - Fix issues using personality files from barrels
8
+ - Fix issues with enums values as the base of member expressions
9
+ - Handle `new` expressions as references to the `initialize` method
10
+ - Classes without an explicit `initialize` method get an implicit, empty `initialize`, rather than inheriting the parent's
11
+ - Fix `subtypeOf` for function types.
12
+ - Update tests to work with sdk-7.2.1 and later
13
+
5
14
  ### 1.1.74
6
15
 
7
16
  - Add refs from drawable-ids to the corresponding drawable (Fixes prettier-extension-monkeyc#20)
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: () => import_chunk_7OAMZRC7.checkCompilerVersion,
22
- collectNamespaces: () => import_chunk_7OAMZRC7.collectNamespaces,
23
- createDocumentationMap: () => import_chunk_7OAMZRC7.createDocumentationMap,
24
- diagnostic: () => import_chunk_7OAMZRC7.diagnostic,
25
- diagnosticHelper: () => import_chunk_7OAMZRC7.diagnosticHelper,
26
- findNamesInScope: () => import_chunk_7OAMZRC7.findNamesInScope,
27
- findUsingForNode: () => import_chunk_7OAMZRC7.findUsingForNode,
28
- formatAst: () => import_chunk_7OAMZRC7.formatAst,
29
- formatAstLongLines: () => import_chunk_7OAMZRC7.formatAstLongLines,
30
- formatScopedName: () => import_chunk_7OAMZRC7.formatScopedName,
31
- getApiFunctionInfo: () => import_chunk_7OAMZRC7.getApiFunctionInfo,
32
- getApiMapping: () => import_chunk_7OAMZRC7.getApiMapping,
33
- getSuperClasses: () => import_chunk_7OAMZRC7.getSuperClasses,
34
- handleImportUsing: () => import_chunk_7OAMZRC7.handleImportUsing,
21
+ checkCompilerVersion: () => import_chunk_7GXXJDR3.checkCompilerVersion,
22
+ collectNamespaces: () => import_chunk_7GXXJDR3.collectNamespaces,
23
+ createDocumentationMap: () => import_chunk_7GXXJDR3.createDocumentationMap,
24
+ diagnostic: () => import_chunk_7GXXJDR3.diagnostic,
25
+ diagnosticHelper: () => import_chunk_7GXXJDR3.diagnosticHelper,
26
+ findNamesInScope: () => import_chunk_7GXXJDR3.findNamesInScope,
27
+ findUsingForNode: () => import_chunk_7GXXJDR3.findUsingForNode,
28
+ formatAst: () => import_chunk_7GXXJDR3.formatAst,
29
+ formatAstLongLines: () => import_chunk_7GXXJDR3.formatAstLongLines,
30
+ formatScopedName: () => import_chunk_7GXXJDR3.formatScopedName,
31
+ getApiFunctionInfo: () => import_chunk_7GXXJDR3.getApiFunctionInfo,
32
+ getApiMapping: () => import_chunk_7GXXJDR3.getApiMapping,
33
+ getSuperClasses: () => import_chunk_7GXXJDR3.getSuperClasses,
34
+ handleImportUsing: () => import_chunk_7GXXJDR3.handleImportUsing,
35
35
  hasProperty: () => import_chunk_JDC43A3I.hasProperty,
36
- isClassVariable: () => import_chunk_7OAMZRC7.isClassVariable,
37
- isLocal: () => import_chunk_7OAMZRC7.isLocal,
38
- isLookupCandidate: () => import_chunk_7OAMZRC7.isLookupCandidate,
39
- isStateNode: () => import_chunk_7OAMZRC7.isStateNode,
40
- lookupByFullName: () => import_chunk_7OAMZRC7.lookupByFullName,
41
- lookupNext: () => import_chunk_7OAMZRC7.lookupNext,
42
- lookupResultContains: () => import_chunk_7OAMZRC7.lookupResultContains,
43
- lookupWithType: () => import_chunk_7OAMZRC7.lookupWithType,
44
- makeToyboxLink: () => import_chunk_7OAMZRC7.makeToyboxLink,
45
- mapVarDeclsByType: () => import_chunk_7OAMZRC7.mapVarDeclsByType,
46
- markInvokeClassMethod: () => import_chunk_7OAMZRC7.markInvokeClassMethod,
47
- parseSdkVersion: () => import_chunk_7OAMZRC7.parseSdkVersion,
48
- popRootNode: () => import_chunk_7OAMZRC7.popRootNode,
49
- pushRootNode: () => import_chunk_7OAMZRC7.pushRootNode,
50
- resolveDiagnostics: () => import_chunk_7OAMZRC7.resolveDiagnostics,
51
- resolveDiagnosticsMap: () => import_chunk_7OAMZRC7.resolveDiagnosticsMap,
52
- sameLookupResult: () => import_chunk_7OAMZRC7.sameLookupResult,
36
+ isClassVariable: () => import_chunk_7GXXJDR3.isClassVariable,
37
+ isLocal: () => import_chunk_7GXXJDR3.isLocal,
38
+ isLookupCandidate: () => import_chunk_7GXXJDR3.isLookupCandidate,
39
+ isStateNode: () => import_chunk_7GXXJDR3.isStateNode,
40
+ lookupByFullName: () => import_chunk_7GXXJDR3.lookupByFullName,
41
+ lookupNext: () => import_chunk_7GXXJDR3.lookupNext,
42
+ lookupResultContains: () => import_chunk_7GXXJDR3.lookupResultContains,
43
+ lookupWithType: () => import_chunk_7GXXJDR3.lookupWithType,
44
+ makeToyboxLink: () => import_chunk_7GXXJDR3.makeToyboxLink,
45
+ mapVarDeclsByType: () => import_chunk_7GXXJDR3.mapVarDeclsByType,
46
+ markInvokeClassMethod: () => import_chunk_7GXXJDR3.markInvokeClassMethod,
47
+ parseSdkVersion: () => import_chunk_7GXXJDR3.parseSdkVersion,
48
+ popRootNode: () => import_chunk_7GXXJDR3.popRootNode,
49
+ pushRootNode: () => import_chunk_7GXXJDR3.pushRootNode,
50
+ resolveDiagnostics: () => import_chunk_7GXXJDR3.resolveDiagnostics,
51
+ resolveDiagnosticsMap: () => import_chunk_7GXXJDR3.resolveDiagnosticsMap,
52
+ sameLookupResult: () => import_chunk_7GXXJDR3.sameLookupResult,
53
53
  traverseAst: () => import_chunk_JDC43A3I.traverseAst,
54
- variableDeclarationName: () => import_chunk_7OAMZRC7.variableDeclarationName,
55
- visitReferences: () => import_chunk_7OAMZRC7.visitReferences,
56
- visit_resources: () => import_chunk_7OAMZRC7.visit_resources,
57
- visitorNode: () => import_chunk_7OAMZRC7.visitorNode
54
+ variableDeclarationName: () => import_chunk_7GXXJDR3.variableDeclarationName,
55
+ visitReferences: () => import_chunk_7GXXJDR3.visitReferences,
56
+ visit_resources: () => import_chunk_7GXXJDR3.visit_resources,
57
+ visitorNode: () => import_chunk_7GXXJDR3.visitorNode
58
58
  });
59
59
  module.exports = __toCommonJS(api_exports);
60
- var import_chunk_7OAMZRC7 = require("./chunk-7OAMZRC7.cjs");
60
+ var import_chunk_7GXXJDR3 = require("./chunk-7GXXJDR3.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, import_chunk_7OAMZRC7.init_api)();
64
+ (0, import_chunk_7GXXJDR3.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 chunk_7OAMZRC7_exports = {};
30
- __export(chunk_7OAMZRC7_exports, {
29
+ var chunk_7GXXJDR3_exports = {};
30
+ __export(chunk_7GXXJDR3_exports, {
31
31
  EnumTagsConst: () => EnumTagsConst,
32
32
  LastTypeTag: () => LastTypeTag,
33
33
  ObjectLikeTagsConst: () => ObjectLikeTagsConst,
@@ -138,7 +138,7 @@ __export(chunk_7OAMZRC7_exports, {
138
138
  visitorNode: () => visitorNode,
139
139
  xml_util_exports: () => xml_util_exports
140
140
  });
141
- module.exports = __toCommonJS(chunk_7OAMZRC7_exports);
141
+ module.exports = __toCommonJS(chunk_7GXXJDR3_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");
@@ -8725,7 +8725,7 @@ function subtypeOfValue(pair) {
8725
8725
  case 8192: {
8726
8726
  const asd = pair.avalue;
8727
8727
  const bsd = pair.bvalue;
8728
- return (0, import_chunk_NHZRKHZO.some)(asd, (sna) => (0, import_chunk_NHZRKHZO.some)(bsd, (snb) => sna === snb));
8728
+ return (0, import_chunk_NHZRKHZO.every)(asd, (sna) => (0, import_chunk_NHZRKHZO.some)(bsd, (snb) => sna === snb));
8729
8729
  }
8730
8730
  case 16384: {
8731
8731
  const asd = pair.avalue;
@@ -10588,8 +10588,9 @@ function pushScopedNameType(istate, node, object) {
10588
10588
  if (istate.typeMap) {
10589
10589
  result = istate.typeMap.get(node);
10590
10590
  if (!result && object && node.type === "MemberExpression" && !node.computed) {
10591
- istate.typeMap.set(node.object, object.value);
10592
- const resolved = resolveDottedMember(istate, object.value, node);
10591
+ const objectType = deEnumerate(object.value);
10592
+ istate.typeMap.set(node.object, objectType);
10593
+ const resolved = resolveDottedMember(istate, objectType, node);
10593
10594
  if (resolved) {
10594
10595
  result = resolved.property;
10595
10596
  if (resolved.mayThrow) {
@@ -10944,7 +10945,7 @@ function evaluateNode(istate, node) {
10944
10945
  if (!isLookupCandidate(node)) {
10945
10946
  const property = popIstate(istate, node.property);
10946
10947
  const object = popIstate(istate, node.object);
10947
- const objectType = object.value;
10948
+ const objectType = deEnumerate(object.value);
10948
10949
  let byteArray = false;
10949
10950
  if (objectType.type & 32768 && objectType.value) {
10950
10951
  const odata = getObjectValue(objectType);
@@ -11115,29 +11116,26 @@ function evaluateNode(istate, node) {
11115
11116
  if (isExact(klass.value) && klass.value.type === 16384) {
11116
11117
  obj.value = { klass: klass.value };
11117
11118
  if (istate.checkTypes && klass.value.value) {
11118
- const results = lookupNext(
11119
- istate.state,
11120
- [
11121
- {
11122
- parent: null,
11123
- results: Array.isArray(klass.value.value) ? klass.value.value : [klass.value.value]
11124
- }
11125
- ],
11126
- "decls",
11127
- { type: "Identifier", name: "initialize" }
11119
+ const callees = (0, import_chunk_NHZRKHZO.map)(
11120
+ klass.value.value,
11121
+ (klass2) => klass2.decls?.initialize
11122
+ ).flat().filter(
11123
+ (result) => result?.type === "FunctionDeclaration"
11128
11124
  );
11129
- if (results) {
11130
- const callees = results.flatMap(
11131
- (lookupDef) => lookupDef.results.filter(
11132
- (result) => result.type === "FunctionDeclaration"
11133
- )
11134
- );
11125
+ if (callees.length) {
11135
11126
  checkCallArgs(
11136
11127
  istate,
11137
11128
  node,
11138
11129
  callees,
11139
11130
  args.map(({ value: value2 }) => value2)
11140
11131
  );
11132
+ } else if (args.length) {
11133
+ diagnostic(
11134
+ istate.state,
11135
+ node,
11136
+ `initialize method expected no args, but got ${args.length}`,
11137
+ istate.checkTypes
11138
+ );
11141
11139
  }
11142
11140
  }
11143
11141
  }
@@ -13572,11 +13570,23 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
13572
13570
  function getStateType(blockState, decl) {
13573
13571
  return getStateEntry(blockState, decl).curType;
13574
13572
  }
13575
- function getStateEntry(blockState, decl) {
13573
+ function getStateEntry(blockState, decl, node) {
13576
13574
  if (Array.isArray(decl) || decl.type !== "MemberDecl" && decl.type !== "Unknown") {
13577
13575
  let tsVal = blockState.map.get(decl);
13578
13576
  if (!tsVal) {
13579
- tsVal = { curType: typeConstraint(decl, blockState) };
13577
+ const t = typeConstraint(decl, blockState);
13578
+ if (node?.type === "MemberExpression" && !node.computed) {
13579
+ const baseType = typeMap.get(node.object);
13580
+ if (baseType) {
13581
+ const r = evaluate(istate, node).value;
13582
+ if (subtypeOf(r, t)) {
13583
+ tsVal = { curType: r };
13584
+ }
13585
+ }
13586
+ }
13587
+ if (!tsVal) {
13588
+ tsVal = { curType: t };
13589
+ }
13580
13590
  blockState.map.set(decl, tsVal);
13581
13591
  }
13582
13592
  return tsVal;
@@ -13989,7 +13999,7 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
13989
13999
  break;
13990
14000
  }
13991
14001
  case "ref": {
13992
- const curEntry = getStateEntry(curState, event.decl);
14002
+ const curEntry = getStateEntry(curState, event.decl, event.node);
13993
14003
  typeMap.set(event.node, curEntry.curType);
13994
14004
  nodeEquivs.delete(event.node);
13995
14005
  if (curEntry.equivSet) {
@@ -16923,8 +16933,10 @@ function collectClassInfo(state) {
16923
16933
  }
16924
16934
  function getFileSources(fnMap) {
16925
16935
  return Promise.all(
16926
- Object.entries(fnMap).map(([name, value2]) => {
16927
- return value2.monkeyCSource || fs.readFile(name).then(
16936
+ Object.values(fnMap).map((value2) => {
16937
+ if (value2.monkeyCSource)
16938
+ return value2.monkeyCSource;
16939
+ return fs.readFile(value2.name).then(
16928
16940
  (data) => value2.monkeyCSource = data.toString().replace(/\r\n/g, "\n")
16929
16941
  );
16930
16942
  })
@@ -16934,12 +16946,12 @@ function getFileSources(fnMap) {
16934
16946
  }
16935
16947
  function getFileASTs(fnMap) {
16936
16948
  return getFileSources(fnMap).then(
16937
- () => Object.entries(fnMap).reduce((ok, [name, value2]) => {
16949
+ () => Object.values(fnMap).reduce((ok, value2) => {
16938
16950
  if (!value2.ast && !value2.parserError) {
16939
16951
  const options = {
16940
- filepath: name
16952
+ filepath: value2.name
16941
16953
  };
16942
- if (/\.mss$/i.test(name)) {
16954
+ if (/\.mss$/i.test(value2.name)) {
16943
16955
  options.mss = value2.barrel;
16944
16956
  }
16945
16957
  try {
@@ -17026,12 +17038,12 @@ async function analyze(fnMap, resourcesMap, manifestXML, config, allowParseError
17026
17038
  markApi = false;
17027
17039
  const state = preState;
17028
17040
  await getFileASTs(fnMap);
17029
- Object.entries(fnMap).forEach(([name, value2]) => {
17041
+ Object.values(fnMap).forEach((value2) => {
17030
17042
  const { ast, parserError } = value2;
17031
17043
  if (!ast) {
17032
17044
  if (allowParseErrors)
17033
17045
  return;
17034
- throw parserError || new Error(`Failed to parse ${name}`);
17046
+ throw parserError || new Error(`Failed to parse ${value2.name}`);
17035
17047
  }
17036
17048
  hasTests = false;
17037
17049
  collectNamespaces(ast, state);
@@ -17732,8 +17744,8 @@ async function optimizeMonkeyCHelper(fnMap, resourcesMap, manifestXML, config) {
17732
17744
  }
17733
17745
  const diagnostics = state.diagnostics && await resolveDiagnosticsMap(state.diagnostics);
17734
17746
  if (state.config?.checkBuildPragmas) {
17735
- Object.entries(fnMap).forEach(([name, f]) => {
17736
- pragmaChecker(state, f.ast, diagnostics?.[name]);
17747
+ Object.values(fnMap).forEach((f) => {
17748
+ pragmaChecker(state, f.ast, diagnostics?.[f.name]);
17737
17749
  });
17738
17750
  }
17739
17751
  return {
@@ -18637,6 +18649,9 @@ function visitorNode(node) {
18637
18649
  if (node.type === "BinaryExpression" && node.operator === "has" && node.right.type === "UnaryExpression" && node.right.operator === ":") {
18638
18650
  return node.right.argument;
18639
18651
  }
18652
+ if (node.type === "NewExpression") {
18653
+ return visitorNode(node.callee);
18654
+ }
18640
18655
  return node;
18641
18656
  }
18642
18657
  function visitReferences(state, ast, name, defn, callback, includeDefs = false, filter = null, typeMap = null, findSingleDefinition = false) {
@@ -18724,6 +18739,42 @@ function visitReferences(state, ast, name, defn, callback, includeDefs = false,
18724
18739
  return ["arguments"];
18725
18740
  }
18726
18741
  break;
18742
+ case "NewExpression": {
18743
+ const [name2, results] = lookup2(node.callee, true);
18744
+ if (!results)
18745
+ break;
18746
+ const initializers = /* @__PURE__ */ new Map();
18747
+ results.forEach((result) => {
18748
+ result.results.forEach((klass) => {
18749
+ if (klass.type !== "ClassDeclaration")
18750
+ return;
18751
+ const inits = klass.decls?.["initialize"];
18752
+ inits?.forEach((init) => {
18753
+ if (init.type === "FunctionDeclaration") {
18754
+ const existing = initializers.get(klass);
18755
+ if (existing) {
18756
+ existing.push(init);
18757
+ } else {
18758
+ initializers.set(klass, [init]);
18759
+ }
18760
+ }
18761
+ });
18762
+ });
18763
+ });
18764
+ if (initializers.size) {
18765
+ checkResults(
18766
+ [
18767
+ name2,
18768
+ Array.from(initializers).map(([parent, results2]) => ({
18769
+ parent,
18770
+ results: results2
18771
+ }))
18772
+ ],
18773
+ node
18774
+ );
18775
+ }
18776
+ break;
18777
+ }
18727
18778
  case "Identifier":
18728
18779
  if (!name || node.name === name) {
18729
18780
  return checkResults(lookup2(node), node);
@@ -30029,6 +30080,7 @@ async function fileInfoFromConfig(workspace, buildDir, output, buildConfig, extr
30029
30080
  ).concat(personalityFiles).map((file) => [
30030
30081
  file,
30031
30082
  {
30083
+ name: file,
30032
30084
  output: path4.join(
30033
30085
  output,
30034
30086
  relative_path_no_dotdot(path4.relative(workspace, file))
@@ -30102,7 +30154,9 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
30102
30154
  );
30103
30155
  barrelFnMaps.forEach(
30104
30156
  (barrelFnMap) => Object.entries(barrelFnMap).forEach(([key2, value2]) => {
30105
- if (!(0, import_chunk_JDC43A3I.hasProperty)(fnMap, key2)) {
30157
+ if (fnMap[key2]) {
30158
+ fnMap[key2 + "::" + value2.barrel] = value2;
30159
+ } else {
30106
30160
  fnMap[key2] = value2;
30107
30161
  }
30108
30162
  })
@@ -30130,7 +30184,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
30130
30184
  const opt_time = await (0, import_chunk_NHZRKHZO.first_modified)(
30131
30185
  Object.values(fnMap).map((v) => v.output)
30132
30186
  );
30133
- if (source_time < opt_time && 1723999677373 < opt_time) {
30187
+ if (source_time < opt_time && 1726412336564 < opt_time) {
30134
30188
  return {
30135
30189
  hasTests,
30136
30190
  diagnostics: prevDiagnostics,
@@ -30168,7 +30222,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
30168
30222
  hasTests: hasTests2,
30169
30223
  diagnostics,
30170
30224
  sdkVersion,
30171
- optimizerVersion: "1.1.74",
30225
+ optimizerVersion: "1.1.75",
30172
30226
  ...Object.fromEntries(
30173
30227
  configOptionsToCheck.map((option) => [option, config[option]])
30174
30228
  )
@@ -30233,9 +30287,13 @@ async function getProjectAnalysisHelper(targets, analysis, manifestXML, options)
30233
30287
  (results) => results.reduce((cur, result) => {
30234
30288
  if (!cur)
30235
30289
  return result;
30236
- Object.entries(result.fnMap).forEach(
30237
- ([key, value2]) => cur.fnMap[key] || (cur.fnMap[key] = value2)
30238
- );
30290
+ Object.entries(result.fnMap).forEach(([key, value2]) => {
30291
+ if (cur.fnMap[key]) {
30292
+ cur.fnMap[key + "::" + value2.barrel] = value2;
30293
+ } else {
30294
+ cur.fnMap[key] = value2;
30295
+ }
30296
+ });
30239
30297
  cur.paths.push(...result.paths);
30240
30298
  return cur;
30241
30299
  }, null)
@@ -30283,8 +30341,8 @@ async function getFnMapAnalysis(fnMap, resourcesMap, manifestXML, options) {
30283
30341
  const typeMap = await analyze_module_types(state);
30284
30342
  const diagnostics = state.diagnostics && await resolveDiagnosticsMap(state.diagnostics);
30285
30343
  if (state.config?.checkBuildPragmas) {
30286
- Object.entries(fnMap).forEach(
30287
- ([name, f]) => f.ast && pragmaChecker(state, f.ast, diagnostics?.[name])
30344
+ Object.values(fnMap).forEach(
30345
+ (f) => f.ast && pragmaChecker(state, f.ast, diagnostics?.[f.name])
30288
30346
  );
30289
30347
  }
30290
30348
  return { fnMap, state, typeMap };
@@ -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_7OAMZRC7.StateNodeAttributes,
22
- buildConfigDescription: () => import_chunk_7OAMZRC7.buildConfigDescription,
23
- buildOptimizedProject: () => import_chunk_7OAMZRC7.buildOptimizedProject,
21
+ StateNodeAttributes: () => import_chunk_7GXXJDR3.StateNodeAttributes,
22
+ buildConfigDescription: () => import_chunk_7GXXJDR3.buildConfigDescription,
23
+ buildOptimizedProject: () => import_chunk_7GXXJDR3.buildOptimizedProject,
24
24
  copyRecursiveAsNeeded: () => import_chunk_NHZRKHZO.copyRecursiveAsNeeded,
25
- defaultConfig: () => import_chunk_7OAMZRC7.defaultConfig,
26
- display: () => import_chunk_7OAMZRC7.display,
27
- generateOneConfig: () => import_chunk_7OAMZRC7.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_7OAMZRC7.generateOptimizedProject,
29
- getConfig: () => import_chunk_7OAMZRC7.getConfig,
30
- getFnMapAnalysis: () => import_chunk_7OAMZRC7.getFnMapAnalysis,
31
- getProjectAnalysis: () => import_chunk_7OAMZRC7.getProjectAnalysis,
32
- get_jungle: () => import_chunk_7OAMZRC7.get_jungle,
33
- isErrorWithLocation: () => import_chunk_7OAMZRC7.isErrorWithLocation,
34
- launchSimulator: () => import_chunk_7OAMZRC7.launchSimulator,
35
- manifestProducts: () => import_chunk_7OAMZRC7.manifestProducts,
36
- mctree: () => import_chunk_7OAMZRC7.mctree,
37
- simulateProgram: () => import_chunk_7OAMZRC7.simulateProgram
25
+ defaultConfig: () => import_chunk_7GXXJDR3.defaultConfig,
26
+ display: () => import_chunk_7GXXJDR3.display,
27
+ generateOneConfig: () => import_chunk_7GXXJDR3.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_7GXXJDR3.generateOptimizedProject,
29
+ getConfig: () => import_chunk_7GXXJDR3.getConfig,
30
+ getFnMapAnalysis: () => import_chunk_7GXXJDR3.getFnMapAnalysis,
31
+ getProjectAnalysis: () => import_chunk_7GXXJDR3.getProjectAnalysis,
32
+ get_jungle: () => import_chunk_7GXXJDR3.get_jungle,
33
+ isErrorWithLocation: () => import_chunk_7GXXJDR3.isErrorWithLocation,
34
+ launchSimulator: () => import_chunk_7GXXJDR3.launchSimulator,
35
+ manifestProducts: () => import_chunk_7GXXJDR3.manifestProducts,
36
+ mctree: () => import_chunk_7GXXJDR3.mctree,
37
+ simulateProgram: () => import_chunk_7GXXJDR3.simulateProgram
38
38
  });
39
39
  module.exports = __toCommonJS(optimizer_exports);
40
- var import_chunk_7OAMZRC7 = require("./chunk-7OAMZRC7.cjs");
40
+ var import_chunk_7GXXJDR3 = require("./chunk-7GXXJDR3.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, import_chunk_7OAMZRC7.init_optimizer)();
44
+ (0, import_chunk_7GXXJDR3.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_7OAMZRC7.SectionKinds,
22
- appSupport: () => import_chunk_7OAMZRC7.appSupport,
23
- connectiq: () => import_chunk_7OAMZRC7.connectiq,
24
- getDeviceInfo: () => import_chunk_7OAMZRC7.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_7OAMZRC7.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_7OAMZRC7.getLanguages,
27
- getSdkPath: () => import_chunk_7OAMZRC7.getSdkPath,
28
- isWin: () => import_chunk_7OAMZRC7.isWin,
29
- optimizeProgram: () => import_chunk_7OAMZRC7.optimizeProgram,
30
- readPrg: () => import_chunk_7OAMZRC7.readPrg,
31
- readPrgWithOffsets: () => import_chunk_7OAMZRC7.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_7OAMZRC7.xml_util_exports
21
+ SectionKinds: () => import_chunk_7GXXJDR3.SectionKinds,
22
+ appSupport: () => import_chunk_7GXXJDR3.appSupport,
23
+ connectiq: () => import_chunk_7GXXJDR3.connectiq,
24
+ getDeviceInfo: () => import_chunk_7GXXJDR3.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_7GXXJDR3.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_7GXXJDR3.getLanguages,
27
+ getSdkPath: () => import_chunk_7GXXJDR3.getSdkPath,
28
+ isWin: () => import_chunk_7GXXJDR3.isWin,
29
+ optimizeProgram: () => import_chunk_7GXXJDR3.optimizeProgram,
30
+ readPrg: () => import_chunk_7GXXJDR3.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_7GXXJDR3.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_7GXXJDR3.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_7OAMZRC7 = require("./chunk-7OAMZRC7.cjs");
35
+ var import_chunk_7GXXJDR3 = require("./chunk-7GXXJDR3.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, import_chunk_7OAMZRC7.init_sdk_util)();
39
+ (0, import_chunk_7GXXJDR3.init_sdk_util)();
40
40
  // Annotate the CommonJS export names for ESM import in node:
41
41
  0 && (module.exports = {
42
42
  SectionKinds,
@@ -197,6 +197,7 @@ export type ExcludeAnnotationsMap = {
197
197
  };
198
198
  export type FilesToOptimizeMap = {
199
199
  [key: string]: {
200
+ name: string;
200
201
  output: string;
201
202
  barrel: string;
202
203
  excludeAnnotations: ExcludeAnnotationsMap;
@@ -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_7OAMZRC7 = require("./chunk-7OAMZRC7.cjs");
24
+ var import_chunk_7GXXJDR3 = require("./chunk-7GXXJDR3.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, import_chunk_7OAMZRC7.init_worker_task)();
31
+ (0, import_chunk_7GXXJDR3.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_7OAMZRC7.performTask)(task));
34
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_7GXXJDR3.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.74",
4
+ "version": "1.1.75",
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",