@markw65/monkeyc-optimizer 1.1.63 → 1.1.64
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 +6 -0
- package/README.md +5 -4
- package/build/api.cjs +34 -34
- package/build/{chunk-Y2ZRISYL.cjs → chunk-VZBYW6QS.cjs} +326 -20
- package/build/optimizer.cjs +18 -16
- package/build/sdk-util.cjs +14 -14
- package/build/src/build-config.d.ts +83 -0
- package/build/src/optimizer-types.d.ts +2 -49
- package/build/src/optimizer.d.ts +2 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.64
|
|
6
|
+
|
|
7
|
+
- Pull all relevent config options from any found settings files
|
|
8
|
+
- Look for a .code-workspace file, starting from the project folder and working upwards. Pull settings from it if found.
|
|
9
|
+
- Update the example code in the README to fix some nits.
|
|
10
|
+
|
|
5
11
|
### 1.1.63
|
|
6
12
|
|
|
7
13
|
- Fixes #31 again, after the fix for #35 broke it
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@ See [Change Log](CHANGELOG.md)
|
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
19
|
-
First you will need to [install nodejs/npm](https://nodejs.org/en/download).
|
|
19
|
+
First you will need to [install nodejs/npm](https://nodejs.org/en/download). Note that you need node 16.17.1 or later, preferably 18.20.3 or later
|
|
20
20
|
|
|
21
21
|
Then you can install the package. From the directory where you want to use it:
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```sh
|
|
24
24
|
npm install -D @markw65/monkeyc-optimizer
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -31,7 +31,8 @@ import { buildOptimizedProject, getConfig } from "@markw65/monkeyc-optimizer";
|
|
|
31
31
|
import { optimizeProgram } from "@markw65/monkeyc-optimizer/sdk-util.js";
|
|
32
32
|
import * as path from "node:path";
|
|
33
33
|
|
|
34
|
-
const
|
|
34
|
+
const cwd = process.cwd();
|
|
35
|
+
const jungleFiles = path.resolve(cwd, process.argv[2]);
|
|
35
36
|
const workspace = path.dirname(jungleFiles);
|
|
36
37
|
|
|
37
38
|
getConfig({
|
|
@@ -48,7 +49,7 @@ getConfig({
|
|
|
48
49
|
// Defaults to bin. Relative paths are relative to workspace
|
|
49
50
|
buildDir: "bin",
|
|
50
51
|
// Where to put the files generated by the source-to-source optimizer
|
|
51
|
-
// Defaults to
|
|
52
|
+
// Defaults to `${buildDir}/optimized`. Relative paths are relative to workspace
|
|
52
53
|
outputPath: "bin/optimized",
|
|
53
54
|
// Semi-colon separated list of jungle files
|
|
54
55
|
jungleFiles,
|
package/build/api.cjs
CHANGED
|
@@ -18,47 +18,47 @@ 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: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_VZBYW6QS.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_VZBYW6QS.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_VZBYW6QS.createDocumentationMap,
|
|
24
|
+
diagnostic: () => import_chunk_VZBYW6QS.diagnostic,
|
|
25
|
+
diagnosticHelper: () => import_chunk_VZBYW6QS.diagnosticHelper,
|
|
26
|
+
findNamesInScope: () => import_chunk_VZBYW6QS.findNamesInScope,
|
|
27
|
+
findUsingForNode: () => import_chunk_VZBYW6QS.findUsingForNode,
|
|
28
|
+
formatAst: () => import_chunk_VZBYW6QS.formatAst,
|
|
29
|
+
formatAstLongLines: () => import_chunk_VZBYW6QS.formatAstLongLines,
|
|
30
|
+
formatScopedName: () => import_chunk_VZBYW6QS.formatScopedName,
|
|
31
|
+
getApiFunctionInfo: () => import_chunk_VZBYW6QS.getApiFunctionInfo,
|
|
32
|
+
getApiMapping: () => import_chunk_VZBYW6QS.getApiMapping,
|
|
33
|
+
getSuperClasses: () => import_chunk_VZBYW6QS.getSuperClasses,
|
|
34
34
|
hasProperty: () => import_chunk_MBTLUWXR.hasProperty,
|
|
35
|
-
isClassVariable: () =>
|
|
36
|
-
isLocal: () =>
|
|
37
|
-
isLookupCandidate: () =>
|
|
38
|
-
isStateNode: () =>
|
|
39
|
-
lookupByFullName: () =>
|
|
40
|
-
lookupNext: () =>
|
|
41
|
-
lookupResultContains: () =>
|
|
42
|
-
lookupWithType: () =>
|
|
43
|
-
makeToyboxLink: () =>
|
|
44
|
-
mapVarDeclsByType: () =>
|
|
45
|
-
markInvokeClassMethod: () =>
|
|
46
|
-
parseSdkVersion: () =>
|
|
47
|
-
resolveDiagnostics: () =>
|
|
48
|
-
resolveDiagnosticsMap: () =>
|
|
49
|
-
sameLookupResult: () =>
|
|
35
|
+
isClassVariable: () => import_chunk_VZBYW6QS.isClassVariable,
|
|
36
|
+
isLocal: () => import_chunk_VZBYW6QS.isLocal,
|
|
37
|
+
isLookupCandidate: () => import_chunk_VZBYW6QS.isLookupCandidate,
|
|
38
|
+
isStateNode: () => import_chunk_VZBYW6QS.isStateNode,
|
|
39
|
+
lookupByFullName: () => import_chunk_VZBYW6QS.lookupByFullName,
|
|
40
|
+
lookupNext: () => import_chunk_VZBYW6QS.lookupNext,
|
|
41
|
+
lookupResultContains: () => import_chunk_VZBYW6QS.lookupResultContains,
|
|
42
|
+
lookupWithType: () => import_chunk_VZBYW6QS.lookupWithType,
|
|
43
|
+
makeToyboxLink: () => import_chunk_VZBYW6QS.makeToyboxLink,
|
|
44
|
+
mapVarDeclsByType: () => import_chunk_VZBYW6QS.mapVarDeclsByType,
|
|
45
|
+
markInvokeClassMethod: () => import_chunk_VZBYW6QS.markInvokeClassMethod,
|
|
46
|
+
parseSdkVersion: () => import_chunk_VZBYW6QS.parseSdkVersion,
|
|
47
|
+
resolveDiagnostics: () => import_chunk_VZBYW6QS.resolveDiagnostics,
|
|
48
|
+
resolveDiagnosticsMap: () => import_chunk_VZBYW6QS.resolveDiagnosticsMap,
|
|
49
|
+
sameLookupResult: () => import_chunk_VZBYW6QS.sameLookupResult,
|
|
50
50
|
traverseAst: () => import_chunk_MBTLUWXR.traverseAst,
|
|
51
|
-
variableDeclarationName: () =>
|
|
52
|
-
visitReferences: () =>
|
|
53
|
-
visit_resources: () =>
|
|
54
|
-
visitorNode: () =>
|
|
51
|
+
variableDeclarationName: () => import_chunk_VZBYW6QS.variableDeclarationName,
|
|
52
|
+
visitReferences: () => import_chunk_VZBYW6QS.visitReferences,
|
|
53
|
+
visit_resources: () => import_chunk_VZBYW6QS.visit_resources,
|
|
54
|
+
visitorNode: () => import_chunk_VZBYW6QS.visitorNode
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(api_exports);
|
|
57
|
-
var
|
|
57
|
+
var import_chunk_VZBYW6QS = require("./chunk-VZBYW6QS.cjs");
|
|
58
58
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
59
59
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
60
60
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
61
|
-
(0,
|
|
61
|
+
(0, import_chunk_VZBYW6QS.init_api)();
|
|
62
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
63
63
|
0 && (module.exports = {
|
|
64
64
|
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_VZBYW6QS_exports = {};
|
|
30
|
+
__export(chunk_VZBYW6QS_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -37,6 +37,7 @@ __export(chunk_Y2ZRISYL_exports, {
|
|
|
37
37
|
TruthyTypes: () => TruthyTypes,
|
|
38
38
|
analyze: () => analyze,
|
|
39
39
|
appSupport: () => appSupport,
|
|
40
|
+
buildConfigDescription: () => buildConfigDescription,
|
|
40
41
|
buildOptimizedProject: () => buildOptimizedProject,
|
|
41
42
|
checkCompilerVersion: () => checkCompilerVersion,
|
|
42
43
|
collectNamespaces: () => collectNamespaces,
|
|
@@ -133,7 +134,7 @@ __export(chunk_Y2ZRISYL_exports, {
|
|
|
133
134
|
visitorNode: () => visitorNode,
|
|
134
135
|
xml_util_exports: () => xml_util_exports
|
|
135
136
|
});
|
|
136
|
-
module.exports = __toCommonJS(
|
|
137
|
+
module.exports = __toCommonJS(chunk_VZBYW6QS_exports);
|
|
137
138
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
138
139
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
139
140
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -5560,10 +5561,289 @@ var init_function_info = (0, import_chunk_ABYVSU2C.__esm)({
|
|
|
5560
5561
|
(0, import_chunk_MBTLUWXR.init_ast)();
|
|
5561
5562
|
}
|
|
5562
5563
|
});
|
|
5564
|
+
var buildConfigDescription;
|
|
5565
|
+
var init_build_config = (0, import_chunk_ABYVSU2C.__esm)({
|
|
5566
|
+
"src/build-config.ts"() {
|
|
5567
|
+
"use strict";
|
|
5568
|
+
buildConfigDescription = [
|
|
5569
|
+
{
|
|
5570
|
+
title: "Optimizer",
|
|
5571
|
+
type: "object",
|
|
5572
|
+
properties: {
|
|
5573
|
+
outputPath: {
|
|
5574
|
+
type: "string",
|
|
5575
|
+
description: "Path to where the optimized project should be generated.",
|
|
5576
|
+
default: "bin/optimized",
|
|
5577
|
+
scope: "resource"
|
|
5578
|
+
},
|
|
5579
|
+
extraExcludes: {
|
|
5580
|
+
type: "string",
|
|
5581
|
+
markdownDescription: "[Semicolon separated list of excludeAnnotations to add or remove](https://github.com/markw65/monkeyc-optimizer/wiki/The-extraExcludes-Option)",
|
|
5582
|
+
default: "",
|
|
5583
|
+
scope: "resource"
|
|
5584
|
+
},
|
|
5585
|
+
ignoredExcludeAnnotations: {
|
|
5586
|
+
type: "string",
|
|
5587
|
+
description: "Semicolon separated list of excludeAnnotations to ignore, or `*' to ignore all",
|
|
5588
|
+
default: "",
|
|
5589
|
+
scope: "resource"
|
|
5590
|
+
},
|
|
5591
|
+
ignoredAnnotations: {
|
|
5592
|
+
type: "string",
|
|
5593
|
+
description: "Semicolon separated list of annotations to ignore, or `*' to ignore all",
|
|
5594
|
+
default: "",
|
|
5595
|
+
scope: "resource"
|
|
5596
|
+
},
|
|
5597
|
+
ignoredSourcePaths: {
|
|
5598
|
+
type: "string",
|
|
5599
|
+
description: "Regex of source paths to ignore.",
|
|
5600
|
+
default: "",
|
|
5601
|
+
scope: "resource"
|
|
5602
|
+
},
|
|
5603
|
+
typeCheckLevel: {
|
|
5604
|
+
type: "string",
|
|
5605
|
+
description: "Unless set to 'Default', overrides the corresponding `monkeyC' setting.",
|
|
5606
|
+
taskDescription: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5607
|
+
launchDescription: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5608
|
+
default: "Off",
|
|
5609
|
+
enum: ["Off", "Default", "Gradual", "Informative", "Strict"],
|
|
5610
|
+
enumDescriptions: [
|
|
5611
|
+
"Disable type checking",
|
|
5612
|
+
"Inherit the Garmin Extension's typeCheckLevel",
|
|
5613
|
+
"Type match failures are marked as errors, but ambiguity is ignored",
|
|
5614
|
+
"Type match failures are marked as errors, and ambiguity is marked as a warning",
|
|
5615
|
+
"Type match failures and ambiguity are marked as errors"
|
|
5616
|
+
],
|
|
5617
|
+
scope: "resource"
|
|
5618
|
+
},
|
|
5619
|
+
checkInvalidSymbols: {
|
|
5620
|
+
type: "string",
|
|
5621
|
+
description: "Whether to check for invalid symbols, and how to report them",
|
|
5622
|
+
enum: ["OFF", "INFO", "WARNING", "ERROR"],
|
|
5623
|
+
enumDescriptions: [
|
|
5624
|
+
"Disable checking",
|
|
5625
|
+
"Generate INFO level diagnostics",
|
|
5626
|
+
"Generate WARNING level diagnostics",
|
|
5627
|
+
"Generate ERROR level diagnostics"
|
|
5628
|
+
],
|
|
5629
|
+
default: "WARNING",
|
|
5630
|
+
scope: "resource"
|
|
5631
|
+
},
|
|
5632
|
+
checkTypes: {
|
|
5633
|
+
type: "string",
|
|
5634
|
+
description: "Whether to check for type related issues, and how to report them",
|
|
5635
|
+
enum: ["OFF", "INFO", "WARNING", "ERROR"],
|
|
5636
|
+
enumDescriptions: [
|
|
5637
|
+
"Disable checking",
|
|
5638
|
+
"Generate INFO level diagnostics",
|
|
5639
|
+
"Generate WARNING level diagnostics",
|
|
5640
|
+
"Generate ERROR level diagnostics"
|
|
5641
|
+
],
|
|
5642
|
+
default: "WARNING",
|
|
5643
|
+
scope: "resource"
|
|
5644
|
+
},
|
|
5645
|
+
trustDeclaredTypes: {
|
|
5646
|
+
order: 10,
|
|
5647
|
+
type: "boolean",
|
|
5648
|
+
markdownDescription: "[Whether to rely on type declarations when optimizing](https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis#trust-declared-types)",
|
|
5649
|
+
default: true,
|
|
5650
|
+
scope: "resource"
|
|
5651
|
+
},
|
|
5652
|
+
propagateTypes: {
|
|
5653
|
+
order: 11,
|
|
5654
|
+
type: "boolean",
|
|
5655
|
+
markdownDescription: "[Whether to propagate type information, or process it locally](https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis#propagate-types)",
|
|
5656
|
+
default: true,
|
|
5657
|
+
scope: "resource"
|
|
5658
|
+
},
|
|
5659
|
+
sizeBasedPRE: {
|
|
5660
|
+
order: 11,
|
|
5661
|
+
type: "boolean",
|
|
5662
|
+
markdownDescription: "[Whether to enable the size based partial redundancy pass](https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis#size-based-pre)",
|
|
5663
|
+
default: true,
|
|
5664
|
+
scope: "resource"
|
|
5665
|
+
},
|
|
5666
|
+
minimizeLocals: {
|
|
5667
|
+
order: 12,
|
|
5668
|
+
type: "boolean",
|
|
5669
|
+
markdownDescription: "[Whether to enable the minimize locals pass](https://github.com/markw65/monkeyc-optimizer/wiki/Local-variable-elimination#minimize-locals)",
|
|
5670
|
+
default: true,
|
|
5671
|
+
scope: "resource"
|
|
5672
|
+
},
|
|
5673
|
+
singleUseCopyProp: {
|
|
5674
|
+
order: 12,
|
|
5675
|
+
type: "boolean",
|
|
5676
|
+
markdownDescription: "[Whether to enable the single use copy propagation pass](https://github.com/markw65/monkeyc-optimizer/wiki/Local-variable-elimination#single-use-copy-propagation)",
|
|
5677
|
+
default: true,
|
|
5678
|
+
scope: "resource"
|
|
5679
|
+
},
|
|
5680
|
+
minimizeModules: {
|
|
5681
|
+
order: 12,
|
|
5682
|
+
type: "boolean",
|
|
5683
|
+
markdownDescription: "[Whether to enable the minimize modules pass](https://github.com/markw65/monkeyc-optimizer/wiki/Optimizing-module-imports#minimize-modules)",
|
|
5684
|
+
default: true,
|
|
5685
|
+
scope: "resource"
|
|
5686
|
+
},
|
|
5687
|
+
iterateOptimizer: {
|
|
5688
|
+
order: 12,
|
|
5689
|
+
type: "boolean",
|
|
5690
|
+
description: "Whether to keep running the optimizer pass until it makes no further changes (may be slow)",
|
|
5691
|
+
default: false,
|
|
5692
|
+
scope: "resource"
|
|
5693
|
+
},
|
|
5694
|
+
enforceStatic: {
|
|
5695
|
+
type: "string",
|
|
5696
|
+
description: "Whether to perform lookups in static methods as if they were invoked statically",
|
|
5697
|
+
enum: ["NO", "YES"],
|
|
5698
|
+
enumDescriptions: [
|
|
5699
|
+
"Assume static functions may be invoked non-statically",
|
|
5700
|
+
"Assume static functions will always be invoked statically"
|
|
5701
|
+
],
|
|
5702
|
+
default: "YES",
|
|
5703
|
+
scope: "resource"
|
|
5704
|
+
},
|
|
5705
|
+
compilerLookupRules: {
|
|
5706
|
+
type: "string",
|
|
5707
|
+
description: "Whether to perform lookups as compiler1, compiler2, or based on the currently selected sdk",
|
|
5708
|
+
enum: ["COMPILER1", "COMPILER2", "DEFAULT"],
|
|
5709
|
+
enumDescriptions: [
|
|
5710
|
+
"Match compiler1's behavior when performing lookups",
|
|
5711
|
+
"Match compiler2's behavior when performing lookups",
|
|
5712
|
+
"Match the currently selected compiler's behavior"
|
|
5713
|
+
],
|
|
5714
|
+
default: "DEFAULT",
|
|
5715
|
+
scope: "resource"
|
|
5716
|
+
},
|
|
5717
|
+
checkCompilerLookupRules: {
|
|
5718
|
+
type: "string",
|
|
5719
|
+
description: "Whether to report differences in your code's behavior between compiler1 and compiler2",
|
|
5720
|
+
enum: ["OFF", "INFO", "WARNING", "ERROR"],
|
|
5721
|
+
enumDescriptions: [
|
|
5722
|
+
"Disable checking",
|
|
5723
|
+
"Generate INFO level diagnostics",
|
|
5724
|
+
"Generate WARNING level diagnostics",
|
|
5725
|
+
"Generate ERROR level diagnostics"
|
|
5726
|
+
],
|
|
5727
|
+
default: "WARNING",
|
|
5728
|
+
scope: "resource"
|
|
5729
|
+
},
|
|
5730
|
+
useLocalOptimizer: {
|
|
5731
|
+
type: "boolean",
|
|
5732
|
+
description: "Whether to use a locally installed @markw65/monkeyc-optimizer for builds",
|
|
5733
|
+
default: true,
|
|
5734
|
+
scope: "resource"
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5737
|
+
},
|
|
5738
|
+
{
|
|
5739
|
+
title: "Post Build Optimizer",
|
|
5740
|
+
type: "object",
|
|
5741
|
+
properties: {
|
|
5742
|
+
postBuildOptimizer: {
|
|
5743
|
+
title: "Enable",
|
|
5744
|
+
order: 0,
|
|
5745
|
+
type: "boolean",
|
|
5746
|
+
description: "Whether to enable the post build optimizer",
|
|
5747
|
+
default: false,
|
|
5748
|
+
scope: "resource"
|
|
5749
|
+
},
|
|
5750
|
+
removeArgc: {
|
|
5751
|
+
order: 1,
|
|
5752
|
+
type: "boolean",
|
|
5753
|
+
markdownDescription: "[Whether to remove argc bytecodes](https://github.com/markw65/monkeyc-optimizer/wiki/Post-Build-Optimizer#remove-argc). Does not apply to exports",
|
|
5754
|
+
default: false,
|
|
5755
|
+
scope: "resource"
|
|
5756
|
+
},
|
|
5757
|
+
allowForbiddenOpts: {
|
|
5758
|
+
order: 2,
|
|
5759
|
+
type: "boolean",
|
|
5760
|
+
markdownDescription: "[Whether to perform optimizations no longer allowed on the app store](https://github.com/markw65/monkeyc-optimizer/wiki/Post-Build-Optimizer#allow-forbidden-optimizations). Always false for exports",
|
|
5761
|
+
default: false,
|
|
5762
|
+
scope: "resource"
|
|
5763
|
+
},
|
|
5764
|
+
postBuildPRE: {
|
|
5765
|
+
order: 3,
|
|
5766
|
+
type: "boolean",
|
|
5767
|
+
markdownDescription: "Post Build Size based PRE [similar to the source-to-source pass](https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis#size-based-pre)",
|
|
5768
|
+
default: true,
|
|
5769
|
+
scope: "resource"
|
|
5770
|
+
}
|
|
5771
|
+
}
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
title: "OnlyTasks",
|
|
5775
|
+
type: "object",
|
|
5776
|
+
properties: {
|
|
5777
|
+
device: {
|
|
5778
|
+
type: "string",
|
|
5779
|
+
taskDescription: "The device to build for. The special value `export' will do an iq build into bin/export, and the value `choose' will let you pick the device from a list",
|
|
5780
|
+
launchDescription: "Device to run or 'choose' or '${command:GetTargetDevice}' to choose a new device each run.",
|
|
5781
|
+
scope: "tasks_launch"
|
|
5782
|
+
},
|
|
5783
|
+
releaseBuild: {
|
|
5784
|
+
type: "boolean",
|
|
5785
|
+
taskDescription: "Is this a release build.",
|
|
5786
|
+
launchDescription: "Run a release build.",
|
|
5787
|
+
scope: "tasks_launch"
|
|
5788
|
+
},
|
|
5789
|
+
runTests: {
|
|
5790
|
+
type: "boolean",
|
|
5791
|
+
description: "run test cases.",
|
|
5792
|
+
default: false,
|
|
5793
|
+
scope: "launch"
|
|
5794
|
+
},
|
|
5795
|
+
jungleFiles: {
|
|
5796
|
+
type: "string",
|
|
5797
|
+
description: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5798
|
+
scope: "tasks_launch"
|
|
5799
|
+
},
|
|
5800
|
+
developerKeyPath: {
|
|
5801
|
+
type: "string",
|
|
5802
|
+
description: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5803
|
+
scope: "tasks_launch"
|
|
5804
|
+
},
|
|
5805
|
+
optimizationLevel: {
|
|
5806
|
+
type: "string",
|
|
5807
|
+
description: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5808
|
+
enum: ["None", "Basic", "Fast", "Slow"],
|
|
5809
|
+
enumDescriptions: [
|
|
5810
|
+
"No optimization",
|
|
5811
|
+
"Basic optimizations for building in debug",
|
|
5812
|
+
"Fast optimizations for building in release",
|
|
5813
|
+
"Slow optimizations that need more time"
|
|
5814
|
+
],
|
|
5815
|
+
scope: "tasks_launch"
|
|
5816
|
+
},
|
|
5817
|
+
compilerOptions: {
|
|
5818
|
+
type: "string",
|
|
5819
|
+
description: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5820
|
+
scope: "tasks_launch"
|
|
5821
|
+
},
|
|
5822
|
+
compilerWarnings: {
|
|
5823
|
+
type: "boolean",
|
|
5824
|
+
description: "If present, overrides the corresponding `monkeyC' setting.",
|
|
5825
|
+
scope: "tasks_launch"
|
|
5826
|
+
},
|
|
5827
|
+
simulatorBuild: {
|
|
5828
|
+
type: "boolean",
|
|
5829
|
+
description: "Is this build for the simulator.",
|
|
5830
|
+
scope: "tasks"
|
|
5831
|
+
},
|
|
5832
|
+
testBuild: {
|
|
5833
|
+
type: "boolean",
|
|
5834
|
+
description: "Is this a test build.",
|
|
5835
|
+
scope: "tasks"
|
|
5836
|
+
}
|
|
5837
|
+
}
|
|
5838
|
+
}
|
|
5839
|
+
];
|
|
5840
|
+
}
|
|
5841
|
+
});
|
|
5563
5842
|
var StateNodeAttributes;
|
|
5564
5843
|
var init_optimizer_types = (0, import_chunk_ABYVSU2C.__esm)({
|
|
5565
5844
|
"src/optimizer-types.ts"() {
|
|
5566
5845
|
"use strict";
|
|
5846
|
+
init_build_config();
|
|
5567
5847
|
StateNodeAttributes = /* @__PURE__ */ ((StateNodeAttributes2) => {
|
|
5568
5848
|
StateNodeAttributes2[StateNodeAttributes2["NONE"] = 0] = "NONE";
|
|
5569
5849
|
StateNodeAttributes2[StateNodeAttributes2["PUBLIC"] = 1] = "PUBLIC";
|
|
@@ -28677,32 +28957,56 @@ async function getVSCodeSettings(path7) {
|
|
|
28677
28957
|
return {};
|
|
28678
28958
|
}
|
|
28679
28959
|
}
|
|
28960
|
+
async function getCodeWorkspaceSettings(folder) {
|
|
28961
|
+
let curDir = folder;
|
|
28962
|
+
try {
|
|
28963
|
+
while (curDir) {
|
|
28964
|
+
const code_workspaces = await (0, import_chunk_SG7ODKRM.globa)(
|
|
28965
|
+
path4.resolve(curDir, "*.code-workspace"),
|
|
28966
|
+
{ onlyFiles: true }
|
|
28967
|
+
);
|
|
28968
|
+
if (code_workspaces.length === 1) {
|
|
28969
|
+
const contents = await fs6.readFile(code_workspaces[0], "utf-8");
|
|
28970
|
+
const code_workspace = JSON.parse(contents);
|
|
28971
|
+
if (Array.isArray(code_workspace.folders) && code_workspace.settings && code_workspace.folders.some(
|
|
28972
|
+
(workspace) => path4.resolve(curDir, workspace.path) === folder
|
|
28973
|
+
)) {
|
|
28974
|
+
return code_workspace.settings;
|
|
28975
|
+
}
|
|
28976
|
+
break;
|
|
28977
|
+
}
|
|
28978
|
+
if (code_workspaces.length > 1)
|
|
28979
|
+
break;
|
|
28980
|
+
const next = path4.dirname(curDir);
|
|
28981
|
+
if (next === curDir)
|
|
28982
|
+
break;
|
|
28983
|
+
curDir = next;
|
|
28984
|
+
}
|
|
28985
|
+
} catch (ex) {
|
|
28986
|
+
}
|
|
28987
|
+
return {};
|
|
28988
|
+
}
|
|
28680
28989
|
function isErrorWithLocation(e) {
|
|
28681
28990
|
return (0, import_chunk_MBTLUWXR.hasProperty)(e, "location");
|
|
28682
28991
|
}
|
|
28683
28992
|
function getConfig(options) {
|
|
28684
28993
|
const config = { ...defaultConfig, ...options || {} };
|
|
28685
|
-
|
|
28686
|
-
|
|
28687
|
-
|
|
28688
|
-
|
|
28689
|
-
"optimizationLevel",
|
|
28690
|
-
"compilerOptions",
|
|
28691
|
-
"compilerWarnings",
|
|
28692
|
-
"ignoredExcludeAnnotations",
|
|
28693
|
-
"ignoredAnnotations",
|
|
28694
|
-
"ignoredSourcePaths"
|
|
28695
|
-
].reduce((promise, key) => {
|
|
28994
|
+
const defaults = buildConfigDescription.flatMap(
|
|
28995
|
+
(desc) => Object.entries(desc.properties)
|
|
28996
|
+
);
|
|
28997
|
+
return defaults.reduce((promise, [key, info]) => {
|
|
28696
28998
|
if (key in config)
|
|
28697
28999
|
return promise;
|
|
28698
29000
|
return promise.then(
|
|
28699
29001
|
(v) => v || getVSCodeSettings(`${appSupport}/Code/User/settings.json`).then(
|
|
28700
|
-
(globals) =>
|
|
28701
|
-
|
|
28702
|
-
|
|
29002
|
+
(globals) => getCodeWorkspaceSettings(config.workspace).then(
|
|
29003
|
+
(workspace) => getVSCodeSettings(
|
|
29004
|
+
`${config.workspace ?? "."}/.vscode/settings.json`
|
|
29005
|
+
).then((locals) => ({ ...globals, ...workspace, ...locals }))
|
|
29006
|
+
)
|
|
28703
29007
|
)
|
|
28704
29008
|
).then((settings) => {
|
|
28705
|
-
const value2 = settings[`
|
|
29009
|
+
const value2 = settings[`prettierMonkeyC.${key}`] ?? settings[`monkeyC.${key}`] ?? info.default;
|
|
28706
29010
|
if (value2 !== void 0) {
|
|
28707
29011
|
config[key] = value2;
|
|
28708
29012
|
}
|
|
@@ -29218,7 +29522,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29218
29522
|
const opt_time = await (0, import_chunk_SG7ODKRM.first_modified)(
|
|
29219
29523
|
Object.values(fnMap).map((v) => v.output)
|
|
29220
29524
|
);
|
|
29221
|
-
if (source_time < opt_time &&
|
|
29525
|
+
if (source_time < opt_time && 1717017718374 < opt_time) {
|
|
29222
29526
|
return {
|
|
29223
29527
|
hasTests,
|
|
29224
29528
|
diagnostics: prevDiagnostics,
|
|
@@ -29257,7 +29561,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29257
29561
|
hasTests: hasTests2,
|
|
29258
29562
|
diagnostics,
|
|
29259
29563
|
sdkVersion,
|
|
29260
|
-
optimizerVersion: "1.1.
|
|
29564
|
+
optimizerVersion: "1.1.64",
|
|
29261
29565
|
...Object.fromEntries(
|
|
29262
29566
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
29263
29567
|
)
|
|
@@ -29408,6 +29712,7 @@ var init_optimizer = (0, import_chunk_ABYVSU2C.__esm)({
|
|
|
29408
29712
|
"src/optimizer.ts"() {
|
|
29409
29713
|
init_api();
|
|
29410
29714
|
init_build();
|
|
29715
|
+
init_build_config();
|
|
29411
29716
|
init_jungles();
|
|
29412
29717
|
init_launch();
|
|
29413
29718
|
init_manifest();
|
|
@@ -30105,6 +30410,7 @@ var init_sdk_util = (0, import_chunk_ABYVSU2C.__esm)({
|
|
|
30105
30410
|
TruthyTypes,
|
|
30106
30411
|
analyze,
|
|
30107
30412
|
appSupport,
|
|
30413
|
+
buildConfigDescription,
|
|
30108
30414
|
buildOptimizedProject,
|
|
30109
30415
|
checkCompilerVersion,
|
|
30110
30416
|
collectNamespaces,
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,31 +18,33 @@ 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
|
-
|
|
21
|
+
StateNodeAttributes: () => import_chunk_VZBYW6QS.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_VZBYW6QS.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_VZBYW6QS.buildOptimizedProject,
|
|
23
24
|
copyRecursiveAsNeeded: () => import_chunk_SG7ODKRM.copyRecursiveAsNeeded,
|
|
24
|
-
defaultConfig: () =>
|
|
25
|
-
display: () =>
|
|
26
|
-
generateOneConfig: () =>
|
|
27
|
-
generateOptimizedProject: () =>
|
|
28
|
-
getConfig: () =>
|
|
29
|
-
getProjectAnalysis: () =>
|
|
30
|
-
get_jungle: () =>
|
|
31
|
-
isErrorWithLocation: () =>
|
|
32
|
-
launchSimulator: () =>
|
|
33
|
-
manifestProducts: () =>
|
|
34
|
-
mctree: () =>
|
|
35
|
-
simulateProgram: () =>
|
|
25
|
+
defaultConfig: () => import_chunk_VZBYW6QS.defaultConfig,
|
|
26
|
+
display: () => import_chunk_VZBYW6QS.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_VZBYW6QS.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_VZBYW6QS.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_VZBYW6QS.getConfig,
|
|
30
|
+
getProjectAnalysis: () => import_chunk_VZBYW6QS.getProjectAnalysis,
|
|
31
|
+
get_jungle: () => import_chunk_VZBYW6QS.get_jungle,
|
|
32
|
+
isErrorWithLocation: () => import_chunk_VZBYW6QS.isErrorWithLocation,
|
|
33
|
+
launchSimulator: () => import_chunk_VZBYW6QS.launchSimulator,
|
|
34
|
+
manifestProducts: () => import_chunk_VZBYW6QS.manifestProducts,
|
|
35
|
+
mctree: () => import_chunk_VZBYW6QS.mctree,
|
|
36
|
+
simulateProgram: () => import_chunk_VZBYW6QS.simulateProgram
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(optimizer_exports);
|
|
38
|
-
var
|
|
39
|
+
var import_chunk_VZBYW6QS = require("./chunk-VZBYW6QS.cjs");
|
|
39
40
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
40
41
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
41
42
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
42
|
-
(0,
|
|
43
|
+
(0, import_chunk_VZBYW6QS.init_optimizer)();
|
|
43
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
45
|
0 && (module.exports = {
|
|
45
46
|
StateNodeAttributes,
|
|
47
|
+
buildConfigDescription,
|
|
46
48
|
buildOptimizedProject,
|
|
47
49
|
copyRecursiveAsNeeded,
|
|
48
50
|
defaultConfig,
|
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_VZBYW6QS.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_VZBYW6QS.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_VZBYW6QS.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_VZBYW6QS.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_VZBYW6QS.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_VZBYW6QS.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_VZBYW6QS.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_VZBYW6QS.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_VZBYW6QS.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_VZBYW6QS.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_VZBYW6QS.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_VZBYW6QS.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_VZBYW6QS = require("./chunk-VZBYW6QS.cjs");
|
|
36
36
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.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_VZBYW6QS.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type DiagnosticType = "ERROR" | "WARNING" | "INFO";
|
|
2
|
+
export type LookupRules = "COMPILER1" | "COMPILER2" | "DEFAULT";
|
|
3
|
+
export type EnforceStatic = "YES" | "NO";
|
|
4
|
+
export type BuildConfig = {
|
|
5
|
+
workspace?: string;
|
|
6
|
+
jungleFiles?: string;
|
|
7
|
+
developerKeyPath?: string;
|
|
8
|
+
typeCheckLevel?: "Off" | "Default" | "Gradual" | "Informative" | "Strict";
|
|
9
|
+
optimizationLevel?: "None" | "Basic" | "Fast" | "Slow";
|
|
10
|
+
compilerOptions?: string;
|
|
11
|
+
compilerWarnings?: boolean;
|
|
12
|
+
simulatorBuild?: boolean;
|
|
13
|
+
releaseBuild?: boolean;
|
|
14
|
+
testBuild?: boolean;
|
|
15
|
+
products?: string[];
|
|
16
|
+
buildDir?: string;
|
|
17
|
+
outputPath?: string;
|
|
18
|
+
program?: string;
|
|
19
|
+
skipOptimization?: boolean;
|
|
20
|
+
checkManifest?: boolean;
|
|
21
|
+
device?: string;
|
|
22
|
+
extraExcludes?: string;
|
|
23
|
+
ignoredExcludeAnnotations?: string;
|
|
24
|
+
ignoredAnnotations?: string;
|
|
25
|
+
ignoredSourcePaths?: string;
|
|
26
|
+
returnCommand?: boolean;
|
|
27
|
+
checkBuildPragmas?: boolean;
|
|
28
|
+
checkInvalidSymbols?: DiagnosticType | "OFF";
|
|
29
|
+
checkCompilerLookupRules?: DiagnosticType | "OFF";
|
|
30
|
+
compilerLookupRules?: LookupRules;
|
|
31
|
+
enforceStatic?: EnforceStatic;
|
|
32
|
+
sizeBasedPRE?: boolean | string;
|
|
33
|
+
prettier?: Record<string, unknown>;
|
|
34
|
+
extensionVersion?: string;
|
|
35
|
+
useLocalOptimizer?: boolean;
|
|
36
|
+
propagateTypes?: boolean;
|
|
37
|
+
trustDeclaredTypes?: boolean;
|
|
38
|
+
minimizeLocals?: boolean;
|
|
39
|
+
minimizeModules?: boolean;
|
|
40
|
+
postBuildOptimizer?: boolean;
|
|
41
|
+
singleUseCopyProp?: boolean;
|
|
42
|
+
iterateOptimizer?: boolean;
|
|
43
|
+
covarianceWarnings?: boolean;
|
|
44
|
+
checkTypes?: DiagnosticType | "OFF";
|
|
45
|
+
removeArgc?: boolean;
|
|
46
|
+
postBuildPRE?: boolean;
|
|
47
|
+
allowForbiddenOpts?: boolean;
|
|
48
|
+
runTests?: boolean;
|
|
49
|
+
};
|
|
50
|
+
interface BuildConfigEntryBase {
|
|
51
|
+
title?: string;
|
|
52
|
+
type: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
taskDescription?: string;
|
|
55
|
+
launchDescription?: string;
|
|
56
|
+
markdownDescription?: string;
|
|
57
|
+
order?: number;
|
|
58
|
+
scope: "application" | "machine" | "machine-overridable" | "window" | "resource" | "tasks" | "launch" | "tasks_launch" | "language-overridable";
|
|
59
|
+
}
|
|
60
|
+
interface BuildConfigEntryBoolean extends BuildConfigEntryBase {
|
|
61
|
+
type: "boolean";
|
|
62
|
+
default?: boolean;
|
|
63
|
+
}
|
|
64
|
+
interface BuildConfigEntryString extends BuildConfigEntryBase {
|
|
65
|
+
type: "string";
|
|
66
|
+
default?: string;
|
|
67
|
+
}
|
|
68
|
+
interface BuildConfigEntryEnum<V> extends BuildConfigEntryBase {
|
|
69
|
+
type: "string";
|
|
70
|
+
default?: string;
|
|
71
|
+
enum: readonly V[];
|
|
72
|
+
enumDescriptions?: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
type BuildConfigEntry<V> = boolean extends V ? BuildConfigEntryBoolean : [V] extends [string] ? [string] extends [V] ? BuildConfigEntryString : BuildConfigEntryEnum<V> : never;
|
|
75
|
+
type BuildConfigDescription = {
|
|
76
|
+
title: string;
|
|
77
|
+
type: "object";
|
|
78
|
+
properties: {
|
|
79
|
+
[K in keyof BuildConfig]?: BuildConfigEntry<NonNullable<BuildConfig[K]>>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const buildConfigDescription: readonly BuildConfigDescription[];
|
|
83
|
+
export {};
|
|
@@ -1,54 +1,8 @@
|
|
|
1
1
|
import { mctree } from "@markw65/prettier-plugin-monkeyc";
|
|
2
|
+
import { BuildConfig, DiagnosticType, LookupRules } from "./build-config";
|
|
2
3
|
import { xmlUtil } from "./sdk-util";
|
|
3
4
|
import { ExactOrUnion } from "./type-flow/types";
|
|
4
|
-
export
|
|
5
|
-
export type LookupRules = "COMPILER1" | "COMPILER2" | "DEFAULT";
|
|
6
|
-
export type EnforceStatic = "YES" | "NO";
|
|
7
|
-
export type BuildConfig = {
|
|
8
|
-
workspace?: string;
|
|
9
|
-
jungleFiles?: string;
|
|
10
|
-
developerKeyPath?: string;
|
|
11
|
-
typeCheckLevel?: string;
|
|
12
|
-
optimizationLevel?: string;
|
|
13
|
-
compilerOptions?: string;
|
|
14
|
-
compilerWarnings?: boolean;
|
|
15
|
-
simulatorBuild?: boolean;
|
|
16
|
-
releaseBuild?: boolean;
|
|
17
|
-
testBuild?: boolean;
|
|
18
|
-
products?: string[];
|
|
19
|
-
buildDir?: string;
|
|
20
|
-
outputPath?: string;
|
|
21
|
-
program?: string;
|
|
22
|
-
skipOptimization?: boolean;
|
|
23
|
-
checkManifest?: boolean;
|
|
24
|
-
device?: string;
|
|
25
|
-
extraExcludes?: string;
|
|
26
|
-
ignoredExcludeAnnotations?: string;
|
|
27
|
-
ignoredAnnotations?: string;
|
|
28
|
-
ignoredSourcePaths?: string;
|
|
29
|
-
returnCommand?: boolean;
|
|
30
|
-
checkBuildPragmas?: boolean;
|
|
31
|
-
checkInvalidSymbols?: DiagnosticType | "OFF";
|
|
32
|
-
checkCompilerLookupRules?: DiagnosticType | "OFF";
|
|
33
|
-
compilerLookupRules?: LookupRules;
|
|
34
|
-
enforceStatic?: EnforceStatic;
|
|
35
|
-
sizeBasedPRE?: boolean | string;
|
|
36
|
-
prettier?: Record<string, unknown>;
|
|
37
|
-
extensionVersion?: string;
|
|
38
|
-
useLocalOptimizer?: boolean;
|
|
39
|
-
propagateTypes?: boolean;
|
|
40
|
-
trustDeclaredTypes?: boolean;
|
|
41
|
-
minimizeLocals?: boolean;
|
|
42
|
-
minimizeModules?: boolean;
|
|
43
|
-
postBuildOptimizer?: boolean;
|
|
44
|
-
singleUseCopyProp?: boolean;
|
|
45
|
-
iterateOptimizer?: boolean;
|
|
46
|
-
covarianceWarnings?: boolean;
|
|
47
|
-
checkTypes?: DiagnosticType | "OFF";
|
|
48
|
-
removeArgc?: boolean;
|
|
49
|
-
postBuildPRE?: boolean;
|
|
50
|
-
allowForbiddenOpts?: boolean;
|
|
51
|
-
};
|
|
5
|
+
export { BuildConfig, DiagnosticType };
|
|
52
6
|
export type StateNodeDecl = StateNode | mctree.EnumStringMember | mctree.TypedIdentifier;
|
|
53
7
|
export type StateNodeDecls = {
|
|
54
8
|
[key: string]: StateNodeDecl[];
|
|
@@ -250,4 +204,3 @@ export type FilesToOptimizeMap = {
|
|
|
250
204
|
hasTests?: boolean;
|
|
251
205
|
};
|
|
252
206
|
};
|
|
253
|
-
export {};
|
package/build/src/optimizer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mctree } from "@markw65/prettier-plugin-monkeyc";
|
|
2
|
+
import { buildConfigDescription } from "./build-config";
|
|
2
3
|
import { JungleBuildDependencies, JungleError, JungleQualifier, JungleResourceMap, ResolvedJungle, Target, get_jungle } from "./jungles";
|
|
3
4
|
import { launchSimulator, simulateProgram } from "./launch";
|
|
4
5
|
import { manifestProducts } from "./manifest";
|
|
@@ -8,7 +9,7 @@ import { TypeMap } from "./type-flow/interp";
|
|
|
8
9
|
import { copyRecursiveAsNeeded } from "./util";
|
|
9
10
|
export * from "./optimizer-types";
|
|
10
11
|
export { ExactOrUnion, display } from "./type-flow/types";
|
|
11
|
-
export { JungleBuildDependencies, JungleError, JungleResourceMap, ResolvedJungle, TypeMap, copyRecursiveAsNeeded, get_jungle, launchSimulator, manifestProducts, mctree, simulateProgram, };
|
|
12
|
+
export { JungleBuildDependencies, JungleError, JungleResourceMap, ResolvedJungle, TypeMap, buildConfigDescription, copyRecursiveAsNeeded, get_jungle, launchSimulator, manifestProducts, mctree, simulateProgram, };
|
|
12
13
|
export declare const defaultConfig: {
|
|
13
14
|
outputPath: string;
|
|
14
15
|
workspace: string;
|
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_VZBYW6QS = require("./chunk-VZBYW6QS.cjs");
|
|
25
25
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.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_VZBYW6QS.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_VZBYW6QS.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED