@storm-software/terraform-tools 0.53.0 → 0.53.1
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 +11 -0
- package/README.md +1 -1
- package/dist/{chunk-NMB6NAZ4.mjs → chunk-42WVFPO6.mjs} +17 -17
- package/dist/{chunk-CJ2BQVRU.js → chunk-6D4LV6X2.js} +3 -3
- package/dist/{chunk-XEE74WQC.mjs → chunk-D6CRGFE3.mjs} +1 -1
- package/dist/{chunk-G32UYXGQ.mjs → chunk-EMIZUK4F.mjs} +1 -1
- package/dist/{chunk-FULLEJHI.js → chunk-FLEOXRFA.js} +2 -2
- package/dist/{chunk-B6ANLUY3.js → chunk-GEMICIUF.js} +2 -2
- package/dist/{chunk-D2YGB72L.mjs → chunk-IMGISWCA.mjs} +1 -1
- package/dist/{chunk-EFLSH2FU.js → chunk-JEBWKJI3.js} +2 -2
- package/dist/{chunk-3O6YOFSC.mjs → chunk-KBT4UFBN.mjs} +1 -1
- package/dist/{chunk-YT7RFZEY.js → chunk-MJMNVCOX.js} +2 -2
- package/dist/{chunk-BW5TMV3C.js → chunk-TQAFH5OJ.js} +33 -33
- package/dist/{chunk-3HOUHXFA.js → chunk-WGRRG2DY.js} +177 -177
- package/dist/{chunk-QTJWW3IT.mjs → chunk-ZOKR7XCK.mjs} +14 -14
- package/dist/{chunk-E6E5A5MU.mjs → chunk-ZTLSR2U3.mjs} +1 -1
- package/dist/executors.js +6 -6
- package/dist/executors.mjs +6 -6
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +2 -2
- package/dist/src/base/terraform-executor.js +3 -3
- package/dist/src/base/terraform-executor.mjs +2 -2
- package/dist/src/executors/apply/executor.js +4 -4
- package/dist/src/executors/apply/executor.mjs +3 -3
- package/dist/src/executors/destroy/executor.js +4 -4
- package/dist/src/executors/destroy/executor.mjs +3 -3
- package/dist/src/executors/output/executor.js +4 -4
- package/dist/src/executors/output/executor.mjs +3 -3
- package/dist/src/executors/plan/executor.js +4 -4
- package/dist/src/executors/plan/executor.mjs +3 -3
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.53.1 (2025-01-22)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **config-tools:** Resolved issue applying entire token parameters object ([5ccf3881](https://github.com/storm-software/storm-ops/commit/5ccf3881))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated workspace-tools to 1.239.2
|
|
10
|
+
- Updated workspace-tools to 1.239.2
|
|
11
|
+
|
|
1
12
|
## 0.53.0 (2025-01-22)
|
|
2
13
|
|
|
3
14
|
### Features
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -607,51 +607,51 @@ var _isFunction = /* @__PURE__ */ __name((value) => {
|
|
|
607
607
|
}, "_isFunction");
|
|
608
608
|
|
|
609
609
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
610
|
-
var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option,
|
|
610
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams) => {
|
|
611
611
|
let result = option;
|
|
612
612
|
if (!result) {
|
|
613
613
|
return result;
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
616
|
-
const optionKeys = Object.keys(
|
|
615
|
+
if (tokenParams) {
|
|
616
|
+
const optionKeys = Object.keys(tokenParams);
|
|
617
617
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
618
618
|
for (const optionKey of optionKeys) {
|
|
619
619
|
if (result.includes(`{${optionKey}}`)) {
|
|
620
|
-
result = result.replaceAll(`{${optionKey}}`,
|
|
620
|
+
result = result.replaceAll(`{${optionKey}}`, tokenParams?.[optionKey] || "");
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
if (
|
|
626
|
-
const configKeys = Object.keys(
|
|
625
|
+
if (tokenParams.config) {
|
|
626
|
+
const configKeys = Object.keys(tokenParams.config);
|
|
627
627
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
628
628
|
for (const configKey of configKeys) {
|
|
629
629
|
if (result.includes(`{${configKey}}`)) {
|
|
630
|
-
result = result.replaceAll(`{${configKey}}`,
|
|
630
|
+
result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
if (result.includes("{workspaceRoot}")) {
|
|
636
|
-
result = result.replaceAll("{workspaceRoot}",
|
|
636
|
+
result = result.replaceAll("{workspaceRoot}", tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot());
|
|
637
637
|
}
|
|
638
638
|
return result;
|
|
639
639
|
}, "applyWorkspaceBaseTokens");
|
|
640
|
-
var applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option,
|
|
641
|
-
return applyWorkspaceBaseTokens(option,
|
|
640
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option, tokenParams) => {
|
|
641
|
+
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
642
642
|
}, "applyWorkspaceProjectTokens");
|
|
643
|
-
var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options,
|
|
643
|
+
var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, tokenParams, tokenizerFn) => {
|
|
644
644
|
if (!options) {
|
|
645
645
|
return {};
|
|
646
646
|
}
|
|
647
647
|
const result = {};
|
|
648
648
|
for (const option of Object.keys(options)) {
|
|
649
649
|
if (typeof options[option] === "string") {
|
|
650
|
-
result[option] = await Promise.resolve(tokenizerFn(options[option],
|
|
650
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
|
|
651
651
|
} else if (Array.isArray(options[option])) {
|
|
652
|
-
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item,
|
|
652
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
|
|
653
653
|
} else if (typeof options[option] === "object") {
|
|
654
|
-
result[option] = await applyWorkspaceTokens(options[option],
|
|
654
|
+
result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
|
|
655
655
|
} else {
|
|
656
656
|
result[option] = options[option];
|
|
657
657
|
}
|
|
@@ -1146,8 +1146,8 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
|
|
|
1146
1146
|
}
|
|
1147
1147
|
const workspaceRoot = findWorkspaceRoot();
|
|
1148
1148
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot;
|
|
1149
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || workspaceRoot;
|
|
1150
|
-
const projectName = context.
|
|
1149
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot;
|
|
1150
|
+
const projectName = context.projectName;
|
|
1151
1151
|
config.workspaceRoot = workspaceRoot;
|
|
1152
1152
|
writeInfo(`
|
|
1153
1153
|
\u26A1 Running the ${name} executor for ${projectName}
|
|
@@ -1175,7 +1175,7 @@ ${formatLogMessage(options)}
|
|
|
1175
1175
|
sourceRoot,
|
|
1176
1176
|
projectName,
|
|
1177
1177
|
config
|
|
1178
|
-
},
|
|
1178
|
+
}, config, context.projectsConfigurations.projects[context.projectName]), applyWorkspaceProjectTokens);
|
|
1179
1179
|
writeTrace(`Executor schema tokenized options \u2699\uFE0F
|
|
1180
1180
|
${formatLogMessage(tokenized)}
|
|
1181
1181
|
`, config);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTQAFH5OJjs = require('./chunk-TQAFH5OJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -9,7 +9,7 @@ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
|
9
9
|
// src/base/terraform-executor.ts
|
|
10
10
|
var _shelljs = require('shelljs');
|
|
11
11
|
var withTerraformExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (command, executorOptions = {}) => async (_options, context) => {
|
|
12
|
-
return
|
|
12
|
+
return _chunkTQAFH5OJjs.withRunExecutor.call(void 0, `Terraform \`${command}\` Command Executor`, async (options, context2, config) => {
|
|
13
13
|
if (!_shelljs.which.call(void 0, "tofu") || !_shelljs.which.call(void 0, "terraform")) {
|
|
14
14
|
throw new Error("Both OpenTofu and Terraform are not installed. Please install one of the two before running this executor.");
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ var withTerraformExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0,
|
|
|
21
21
|
if (typeof jsonBackendConfig === "string") {
|
|
22
22
|
jsonBackendConfig = JSON.parse(jsonBackendConfig);
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
_chunkTQAFH5OJjs.run.call(void 0, config, [
|
|
25
25
|
"terragrunt",
|
|
26
26
|
command,
|
|
27
27
|
...jsonBackendConfig.map((config2) => `-backend-config="${config2.key}=${config2.name}"`),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6D4LV6X2js = require('./chunk-6D4LV6X2.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/apply/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunk6D4LV6X2js.withTerraformExecutor.call(void 0, "apply");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6D4LV6X2js = require('./chunk-6D4LV6X2.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/destroy/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunk6D4LV6X2js.withTerraformExecutor.call(void 0, "destroy");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6D4LV6X2js = require('./chunk-6D4LV6X2.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/output/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunk6D4LV6X2js.withTerraformExecutor.call(void 0, "output");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk6D4LV6X2js = require('./chunk-6D4LV6X2.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/plan/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunk6D4LV6X2js.withTerraformExecutor.call(void 0, "plan");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -607,51 +607,51 @@ var _isFunction = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) =
|
|
|
607
607
|
}, "_isFunction");
|
|
608
608
|
|
|
609
609
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
610
|
-
var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (option,
|
|
610
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (option, tokenParams) => {
|
|
611
611
|
let result = option;
|
|
612
612
|
if (!result) {
|
|
613
613
|
return result;
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
616
|
-
const optionKeys = Object.keys(
|
|
615
|
+
if (tokenParams) {
|
|
616
|
+
const optionKeys = Object.keys(tokenParams);
|
|
617
617
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
618
618
|
for (const optionKey of optionKeys) {
|
|
619
619
|
if (result.includes(`{${optionKey}}`)) {
|
|
620
|
-
result = result.replaceAll(`{${optionKey}}`,
|
|
620
|
+
result = result.replaceAll(`{${optionKey}}`, _optionalChain([tokenParams, 'optionalAccess', _30 => _30[optionKey]]) || "");
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
if (
|
|
626
|
-
const configKeys = Object.keys(
|
|
625
|
+
if (tokenParams.config) {
|
|
626
|
+
const configKeys = Object.keys(tokenParams.config);
|
|
627
627
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
628
628
|
for (const configKey of configKeys) {
|
|
629
629
|
if (result.includes(`{${configKey}}`)) {
|
|
630
|
-
result = result.replaceAll(`{${configKey}}`,
|
|
630
|
+
result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
if (result.includes("{workspaceRoot}")) {
|
|
636
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(
|
|
636
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _31 => _31.config, 'optionalAccess', _32 => _32.workspaceRoot]))), () => ( findWorkspaceRoot())));
|
|
637
637
|
}
|
|
638
638
|
return result;
|
|
639
639
|
}, "applyWorkspaceBaseTokens");
|
|
640
|
-
var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (option,
|
|
641
|
-
return applyWorkspaceBaseTokens(option,
|
|
640
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (option, tokenParams) => {
|
|
641
|
+
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
642
642
|
}, "applyWorkspaceProjectTokens");
|
|
643
|
-
var applyWorkspaceTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options,
|
|
643
|
+
var applyWorkspaceTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, tokenParams, tokenizerFn) => {
|
|
644
644
|
if (!options) {
|
|
645
645
|
return {};
|
|
646
646
|
}
|
|
647
647
|
const result = {};
|
|
648
648
|
for (const option of Object.keys(options)) {
|
|
649
649
|
if (typeof options[option] === "string") {
|
|
650
|
-
result[option] = await Promise.resolve(tokenizerFn(options[option],
|
|
650
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
|
|
651
651
|
} else if (Array.isArray(options[option])) {
|
|
652
|
-
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item,
|
|
652
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
|
|
653
653
|
} else if (typeof options[option] === "object") {
|
|
654
|
-
result[option] = await applyWorkspaceTokens(options[option],
|
|
654
|
+
result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
|
|
655
655
|
} else {
|
|
656
656
|
result[option] = options[option];
|
|
657
657
|
}
|
|
@@ -666,7 +666,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, a
|
|
|
666
666
|
cwd: workspacePath,
|
|
667
667
|
packageJson: true,
|
|
668
668
|
name: fileName,
|
|
669
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
669
|
+
envName: _optionalChain([fileName, 'optionalAccess', _33 => _33.toUpperCase, 'call', _34 => _34()]),
|
|
670
670
|
jitiOptions: {
|
|
671
671
|
debug: false,
|
|
672
672
|
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
@@ -678,7 +678,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, a
|
|
|
678
678
|
cwd: workspacePath,
|
|
679
679
|
packageJson: true,
|
|
680
680
|
name: fileName,
|
|
681
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
681
|
+
envName: _optionalChain([fileName, 'optionalAccess', _35 => _35.toUpperCase, 'call', _36 => _36()]),
|
|
682
682
|
jitiOptions: {
|
|
683
683
|
debug: false,
|
|
684
684
|
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
@@ -702,7 +702,7 @@ var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (
|
|
|
702
702
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
703
703
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
704
704
|
for (const result2 of results) {
|
|
705
|
-
if (_optionalChain([result2, 'optionalAccess',
|
|
705
|
+
if (_optionalChain([result2, 'optionalAccess', _37 => _37.config]) && _optionalChain([result2, 'optionalAccess', _38 => _38.configFile]) && Object.keys(result2.config).length > 0) {
|
|
706
706
|
writeSystem(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
707
707
|
logLevel: "all"
|
|
708
708
|
});
|
|
@@ -861,13 +861,13 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(vo
|
|
|
861
861
|
var setExtensionEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (extensionName, extension) => {
|
|
862
862
|
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
863
863
|
if (extension[key]) {
|
|
864
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
864
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _39 => _39.replace, 'call', _40 => _40(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _41 => _41[0], 'optionalAccess', _42 => _42.toUpperCase, 'call', _43 => _43()]) + input.slice(1) : ""), 'access', _44 => _44.split, 'call', _45 => _45(/(?=[A-Z])|[.\-\s_]/), 'access', _46 => _46.map, 'call', _47 => _47((x) => x.toLowerCase())]), () => ( []));
|
|
865
865
|
let extensionKey;
|
|
866
866
|
if (result.length === 0) {
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
869
|
if (result.length === 1) {
|
|
870
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access',
|
|
870
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _48 => _48[0], 'optionalAccess', _49 => _49.toUpperCase, 'call', _50 => _50()]), () => ( ""));
|
|
871
871
|
} else {
|
|
872
872
|
extensionKey = result.reduce((ret, part) => {
|
|
873
873
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -964,7 +964,7 @@ var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config)
|
|
|
964
964
|
process.env.NODE_ENV = config.env;
|
|
965
965
|
process.env.ENVIRONMENT = config.env;
|
|
966
966
|
}
|
|
967
|
-
if (_optionalChain([config, 'access',
|
|
967
|
+
if (_optionalChain([config, 'access', _51 => _51.colors, 'optionalAccess', _52 => _52.base, 'optionalAccess', _53 => _53.light]) || _optionalChain([config, 'access', _54 => _54.colors, 'optionalAccess', _55 => _55.base, 'optionalAccess', _56 => _56.dark])) {
|
|
968
968
|
for (const key of Object.keys(config.colors)) {
|
|
969
969
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
970
970
|
}
|
|
@@ -1012,7 +1012,7 @@ var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config)
|
|
|
1012
1012
|
}
|
|
1013
1013
|
}, "setConfigEnv");
|
|
1014
1014
|
var setThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1015
|
-
return _optionalChain([config, 'optionalAccess',
|
|
1015
|
+
return _optionalChain([config, 'optionalAccess', _57 => _57.light, 'optionalAccess', _58 => _58.brand]) || _optionalChain([config, 'optionalAccess', _59 => _59.dark, 'optionalAccess', _60 => _60.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
1016
1016
|
}, "setThemeColorConfigEnv");
|
|
1017
1017
|
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1018
1018
|
if (config.dark) {
|
|
@@ -1113,7 +1113,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(vo
|
|
|
1113
1113
|
var _static_cache = void 0;
|
|
1114
1114
|
var loadStormConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot) => {
|
|
1115
1115
|
let config = {};
|
|
1116
|
-
if (_optionalChain([_static_cache, 'optionalAccess',
|
|
1116
|
+
if (_optionalChain([_static_cache, 'optionalAccess', _61 => _61.data]) && _optionalChain([_static_cache, 'optionalAccess', _62 => _62.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
|
|
1117
1117
|
writeTrace(`Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
|
|
1118
1118
|
return _static_cache.data;
|
|
1119
1119
|
}
|
|
@@ -1141,13 +1141,13 @@ var withRunExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name
|
|
|
1141
1141
|
let options = _options;
|
|
1142
1142
|
let config = {};
|
|
1143
1143
|
try {
|
|
1144
|
-
if (!_optionalChain([context, 'access',
|
|
1144
|
+
if (!_optionalChain([context, 'access', _63 => _63.projectsConfigurations, 'optionalAccess', _64 => _64.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1145
1145
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1146
1146
|
}
|
|
1147
1147
|
const workspaceRoot = findWorkspaceRoot();
|
|
1148
1148
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot;
|
|
1149
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || workspaceRoot;
|
|
1150
|
-
const projectName = context.
|
|
1149
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot;
|
|
1150
|
+
const projectName = context.projectName;
|
|
1151
1151
|
config.workspaceRoot = workspaceRoot;
|
|
1152
1152
|
writeInfo(`
|
|
1153
1153
|
\u26A1 Running the ${name} executor for ${projectName}
|
|
@@ -1161,7 +1161,7 @@ var withRunExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name
|
|
|
1161
1161
|
`, config);
|
|
1162
1162
|
config = await loadStormConfig(workspaceRoot);
|
|
1163
1163
|
}
|
|
1164
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
1164
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _65 => _65.hooks, 'optionalAccess', _66 => _66.applyDefaultOptions])) {
|
|
1165
1165
|
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
1166
1166
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
1167
1167
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
@@ -1175,31 +1175,31 @@ ${formatLogMessage(options)}
|
|
|
1175
1175
|
sourceRoot,
|
|
1176
1176
|
projectName,
|
|
1177
1177
|
config
|
|
1178
|
-
},
|
|
1178
|
+
}, config, context.projectsConfigurations.projects[context.projectName]), applyWorkspaceProjectTokens);
|
|
1179
1179
|
writeTrace(`Executor schema tokenized options \u2699\uFE0F
|
|
1180
1180
|
${formatLogMessage(tokenized)}
|
|
1181
1181
|
`, config);
|
|
1182
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
1182
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _67 => _67.hooks, 'optionalAccess', _68 => _68.preProcess])) {
|
|
1183
1183
|
writeDebug("Running the preProcess hook...", config);
|
|
1184
1184
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
1185
1185
|
writeDebug("Completed the preProcess hook", config);
|
|
1186
1186
|
}
|
|
1187
1187
|
const ret = executorFn(tokenized, context, config);
|
|
1188
|
-
if (_isFunction2(_optionalChain([ret, 'optionalAccess',
|
|
1188
|
+
if (_isFunction2(_optionalChain([ret, 'optionalAccess', _69 => _69.next]))) {
|
|
1189
1189
|
const asyncGen = ret;
|
|
1190
1190
|
for await (const iter of asyncGen) {
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
1193
|
const result = await Promise.resolve(ret);
|
|
1194
|
-
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess',
|
|
1194
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _70 => _70.error, 'optionalAccess', _71 => _71.message]) && typeof _optionalChain([result, 'optionalAccess', _72 => _72.error, 'optionalAccess', _73 => _73.message]) === "string" && _optionalChain([result, 'optionalAccess', _74 => _74.error, 'optionalAccess', _75 => _75.name]) && typeof _optionalChain([result, 'optionalAccess', _76 => _76.error, 'optionalAccess', _77 => _77.name]) === "string")) {
|
|
1195
1195
|
writeTrace(`Failure determined by the ${name} executor
|
|
1196
1196
|
${formatLogMessage(result)}`, config);
|
|
1197
1197
|
console.error(result);
|
|
1198
1198
|
throw new Error(`The ${name} executor failed to run`, {
|
|
1199
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1199
|
+
cause: _optionalChain([result, 'optionalAccess', _78 => _78.error])
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
if (_optionalChain([executorOptions, 'optionalAccess',
|
|
1202
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _79 => _79.hooks, 'optionalAccess', _80 => _80.postProcess])) {
|
|
1203
1203
|
writeDebug("Running the postProcess hook...", config);
|
|
1204
1204
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
1205
1205
|
writeDebug("Completed the postProcess hook", config);
|
|
@@ -1223,7 +1223,7 @@ ${formatLogMessage(result)}`, config);
|
|
|
1223
1223
|
}, "withRunExecutor");
|
|
1224
1224
|
var _isFunction2 = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) => {
|
|
1225
1225
|
try {
|
|
1226
|
-
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess',
|
|
1226
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _81 => _81.constructor]) && _optionalChain([value, 'optionalAccess', _82 => _82.call]) && _optionalChain([value, 'optionalAccess', _83 => _83.apply]));
|
|
1227
1227
|
} catch (e) {
|
|
1228
1228
|
return false;
|
|
1229
1229
|
}
|