@storm-software/terraform-tools 0.46.0 → 0.47.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 +26 -0
- package/dist/chunk-23KFTIT2.mjs +0 -0
- package/dist/chunk-3GQAWCBQ.js +13 -0
- package/dist/chunk-463AGI5I.mjs +10 -0
- package/dist/chunk-53WQJQ5K.js +10 -0
- package/dist/chunk-6GLEQENV.mjs +10 -0
- package/dist/chunk-AOTMRUKU.js +53 -0
- package/dist/chunk-CA7S5MOH.mjs +0 -0
- package/dist/chunk-E7SPQEPH.js +1 -0
- package/dist/chunk-EAPOMBKY.mjs +10 -0
- package/dist/chunk-EL25IDXP.mjs +93 -0
- package/dist/chunk-GUQOEBFW.js +1 -0
- package/dist/chunk-HYHKZPRR.mjs +0 -0
- package/dist/chunk-ILC773N2.js +93 -0
- package/dist/chunk-JNBNKAGF.js +1288 -0
- package/dist/chunk-MW3JRZ4N.js +10 -0
- package/dist/chunk-N2YKXZ5R.js +1 -0
- package/dist/chunk-NEISKBUA.mjs +10 -0
- package/dist/chunk-SCRXKTPS.js +10 -0
- package/dist/chunk-SH7NPG4K.mjs +1288 -0
- package/dist/chunk-SIQ2JL7E.js +10 -0
- package/dist/chunk-W4CCHPMY.mjs +3934 -0
- package/dist/chunk-WKVEHDC2.mjs +53 -0
- package/dist/chunk-XUV4U54K.mjs +21 -0
- package/dist/chunk-YLTIJRR5.js +3933 -0
- package/dist/executors.d.mts +20 -0
- package/dist/executors.d.ts +20 -0
- package/dist/executors.js +8 -0
- package/dist/executors.mjs +8 -0
- package/dist/generators.d.mts +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +9 -0
- package/dist/generators.mjs +9 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +23 -0
- package/dist/index.mjs +23 -0
- package/dist/schema.d-DRCBZob5.d.mts +3 -0
- package/dist/schema.d-DRCBZob5.d.ts +3 -0
- package/dist/src/base/base-terraform-executor.untyped.d.mts +5 -0
- package/dist/src/base/base-terraform-executor.untyped.d.ts +5 -0
- package/dist/src/base/base-terraform-executor.untyped.js +7 -0
- package/dist/src/base/base-terraform-executor.untyped.mjs +7 -0
- package/dist/src/base/index.d.mts +7 -0
- package/dist/src/base/index.d.ts +7 -0
- package/dist/src/base/index.js +13 -0
- package/dist/src/base/index.mjs +13 -0
- package/dist/src/base/terraform-executor.d.mts +1301 -0
- package/dist/src/base/terraform-executor.d.ts +1301 -0
- package/dist/src/base/terraform-executor.js +8 -0
- package/dist/src/base/terraform-executor.mjs +8 -0
- package/dist/src/executors/apply/executor.d.mts +11 -0
- package/dist/src/executors/apply/executor.d.ts +11 -0
- package/dist/src/executors/apply/executor.js +9 -0
- package/dist/src/executors/apply/executor.mjs +9 -0
- package/dist/src/executors/apply/schema.d.ts +5 -0
- package/dist/src/executors/apply/schema.json +21 -0
- package/dist/src/executors/destroy/executor.d.mts +11 -0
- package/dist/src/executors/destroy/executor.d.ts +11 -0
- package/dist/src/executors/destroy/executor.js +9 -0
- package/dist/src/executors/destroy/executor.mjs +9 -0
- package/dist/src/executors/destroy/schema.d.ts +5 -0
- package/dist/src/executors/destroy/schema.json +16 -0
- package/dist/src/executors/output/executor.d.mts +8 -0
- package/dist/src/executors/output/executor.d.ts +8 -0
- package/dist/src/executors/output/executor.js +9 -0
- package/dist/src/executors/output/executor.mjs +9 -0
- package/dist/src/executors/output/schema.d.ts +1 -0
- package/dist/src/executors/output/schema.json +10 -0
- package/dist/src/executors/plan/executor.d.mts +11 -0
- package/dist/src/executors/plan/executor.d.ts +11 -0
- package/dist/src/executors/plan/executor.js +9 -0
- package/dist/src/executors/plan/executor.mjs +9 -0
- package/dist/src/executors/plan/schema.d.ts +5 -0
- package/dist/src/executors/plan/schema.json +16 -0
- package/dist/src/generators/init/init.d.mts +2 -0
- package/dist/src/generators/init/init.d.ts +2 -0
- package/dist/src/generators/init/init.js +10 -0
- package/dist/src/generators/init/init.mjs +10 -0
- package/dist/src/generators/init/schema.d.ts +3 -0
- package/dist/src/generators/init/schema.json +16 -0
- package/dist/tsup.config.d.mts +5 -0
- package/dist/tsup.config.d.ts +5 -0
- package/dist/tsup.config.js +39 -0
- package/dist/tsup.config.mjs +39 -0
- package/package.json +1 -1
- /package/dist/src/base/{base-terraform-executor.d.ts → base-terraform-executor.schema.d.ts} +0 -0
- /package/docs/api/base/{base-terraform-executor.md → base-terraform-executor.schema.md} +0 -0
|
@@ -0,0 +1,1288 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
4
|
+
|
|
5
|
+
// ../config-tools/src/utilities/run.ts
|
|
6
|
+
var _child_process = require('child_process');
|
|
7
|
+
var LARGE_BUFFER = 1024 * 1e6;
|
|
8
|
+
var run = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
|
|
9
|
+
return _child_process.execSync.call(void 0, command, {
|
|
10
|
+
cwd,
|
|
11
|
+
env: {
|
|
12
|
+
...process.env,
|
|
13
|
+
...env,
|
|
14
|
+
CLICOLOR: "true",
|
|
15
|
+
FORCE_COLOR: "true"
|
|
16
|
+
},
|
|
17
|
+
windowsHide: true,
|
|
18
|
+
stdio,
|
|
19
|
+
maxBuffer: LARGE_BUFFER,
|
|
20
|
+
killSignal: "SIGTERM"
|
|
21
|
+
});
|
|
22
|
+
}, "run");
|
|
23
|
+
|
|
24
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
25
|
+
var _c12 = require('c12');
|
|
26
|
+
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
27
|
+
|
|
28
|
+
// ../config-tools/src/types.ts
|
|
29
|
+
var LogLevel = {
|
|
30
|
+
SILENT: 0,
|
|
31
|
+
FATAL: 10,
|
|
32
|
+
ERROR: 20,
|
|
33
|
+
WARN: 30,
|
|
34
|
+
SUCCESS: 35,
|
|
35
|
+
INFO: 40,
|
|
36
|
+
DEBUG: 60,
|
|
37
|
+
TRACE: 70,
|
|
38
|
+
ALL: 100
|
|
39
|
+
};
|
|
40
|
+
var LogLevelLabel = {
|
|
41
|
+
SILENT: "silent",
|
|
42
|
+
FATAL: "fatal",
|
|
43
|
+
ERROR: "error",
|
|
44
|
+
WARN: "warn",
|
|
45
|
+
SUCCESS: "success",
|
|
46
|
+
INFO: "info",
|
|
47
|
+
DEBUG: "debug",
|
|
48
|
+
TRACE: "trace",
|
|
49
|
+
ALL: "all"
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// ../config/src/constants.ts
|
|
53
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
54
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
55
|
+
var STORM_DEFAULT_LICENSING = "https://license.stormsoftware.com";
|
|
56
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
57
|
+
|
|
58
|
+
// ../config/src/schema.ts
|
|
59
|
+
var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
|
|
60
|
+
var DarkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
|
|
61
|
+
var LightColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
|
|
62
|
+
var BrandColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
|
|
63
|
+
var AlternateColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
|
|
64
|
+
var AccentColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
|
|
65
|
+
var LinkColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
|
|
66
|
+
var HelpColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
|
|
67
|
+
var SuccessColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
|
|
68
|
+
var InfoColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
|
|
69
|
+
var WarningColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
|
|
70
|
+
var DangerColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
|
|
71
|
+
var FatalColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
|
|
72
|
+
var PositiveColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
|
|
73
|
+
var NegativeColorSchema = _zod2.default.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
|
|
74
|
+
var DarkThemeColorConfigSchema = _zod2.default.object({
|
|
75
|
+
foreground: LightColorSchema,
|
|
76
|
+
background: DarkColorSchema,
|
|
77
|
+
brand: BrandColorSchema,
|
|
78
|
+
alternate: AlternateColorSchema,
|
|
79
|
+
accent: AccentColorSchema,
|
|
80
|
+
link: LinkColorSchema,
|
|
81
|
+
help: HelpColorSchema,
|
|
82
|
+
success: SuccessColorSchema,
|
|
83
|
+
info: InfoColorSchema,
|
|
84
|
+
warning: WarningColorSchema,
|
|
85
|
+
danger: DangerColorSchema,
|
|
86
|
+
fatal: FatalColorSchema,
|
|
87
|
+
positive: PositiveColorSchema,
|
|
88
|
+
negative: NegativeColorSchema
|
|
89
|
+
});
|
|
90
|
+
var LightThemeColorConfigSchema = _zod2.default.object({
|
|
91
|
+
foreground: DarkColorSchema,
|
|
92
|
+
background: LightColorSchema,
|
|
93
|
+
brand: BrandColorSchema,
|
|
94
|
+
alternate: AlternateColorSchema,
|
|
95
|
+
accent: AccentColorSchema,
|
|
96
|
+
link: LinkColorSchema,
|
|
97
|
+
help: HelpColorSchema,
|
|
98
|
+
success: SuccessColorSchema,
|
|
99
|
+
info: InfoColorSchema,
|
|
100
|
+
warning: WarningColorSchema,
|
|
101
|
+
danger: DangerColorSchema,
|
|
102
|
+
fatal: FatalColorSchema,
|
|
103
|
+
positive: PositiveColorSchema,
|
|
104
|
+
negative: NegativeColorSchema
|
|
105
|
+
});
|
|
106
|
+
var MultiThemeColorConfigSchema = _zod2.default.object({
|
|
107
|
+
dark: DarkThemeColorConfigSchema,
|
|
108
|
+
light: LightThemeColorConfigSchema
|
|
109
|
+
});
|
|
110
|
+
var SingleThemeColorConfigSchema = _zod2.default.object({
|
|
111
|
+
dark: DarkColorSchema,
|
|
112
|
+
light: LightColorSchema,
|
|
113
|
+
brand: BrandColorSchema,
|
|
114
|
+
alternate: AlternateColorSchema,
|
|
115
|
+
accent: AccentColorSchema,
|
|
116
|
+
link: LinkColorSchema,
|
|
117
|
+
help: HelpColorSchema,
|
|
118
|
+
success: SuccessColorSchema,
|
|
119
|
+
info: InfoColorSchema,
|
|
120
|
+
warning: WarningColorSchema,
|
|
121
|
+
danger: DangerColorSchema,
|
|
122
|
+
fatal: FatalColorSchema,
|
|
123
|
+
positive: PositiveColorSchema,
|
|
124
|
+
negative: NegativeColorSchema
|
|
125
|
+
});
|
|
126
|
+
var RegistryUrlConfigSchema = _zod2.default.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
|
|
127
|
+
var RegistryConfigSchema = _zod2.default.object({
|
|
128
|
+
github: RegistryUrlConfigSchema,
|
|
129
|
+
npm: RegistryUrlConfigSchema,
|
|
130
|
+
cargo: RegistryUrlConfigSchema,
|
|
131
|
+
cyclone: RegistryUrlConfigSchema,
|
|
132
|
+
container: RegistryUrlConfigSchema
|
|
133
|
+
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
134
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(MultiThemeColorConfigSchema).describe("Colors used for various workspace elements");
|
|
135
|
+
var ColorConfigMapSchema = _zod2.default.union([
|
|
136
|
+
_zod2.default.object({
|
|
137
|
+
"base": ColorConfigSchema
|
|
138
|
+
}),
|
|
139
|
+
_zod2.default.record(_zod2.default.string(), ColorConfigSchema)
|
|
140
|
+
]);
|
|
141
|
+
var WorkspaceBotConfigSchema = _zod2.default.object({
|
|
142
|
+
name: _zod2.default.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
|
|
143
|
+
email: _zod2.default.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
144
|
+
}).describe("The workspace's bot user's config used to automated various operations tasks");
|
|
145
|
+
var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
146
|
+
cache: _zod2.default.string().trim().optional().describe("The directory used to store the environment's cached file data"),
|
|
147
|
+
data: _zod2.default.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
148
|
+
config: _zod2.default.string().trim().optional().describe("The directory used to store the environment's configuration files"),
|
|
149
|
+
temp: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
150
|
+
log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
151
|
+
build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
152
|
+
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
153
|
+
var StormConfigSchema = _zod2.default.object({
|
|
154
|
+
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
155
|
+
extends: _zod2.default.string().trim().optional().describe("The path to a base JSON file to use as a configuration preset file"),
|
|
156
|
+
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
157
|
+
namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
158
|
+
organization: _zod2.default.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
159
|
+
repository: _zod2.default.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
160
|
+
license: _zod2.default.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
161
|
+
homepage: _zod2.default.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
|
|
162
|
+
docs: _zod2.default.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
|
|
163
|
+
licensing: _zod2.default.string().trim().url().default(STORM_DEFAULT_LICENSING).describe("The base licensing site for the workspace"),
|
|
164
|
+
branch: _zod2.default.string().trim().default("main").describe("The branch of the workspace"),
|
|
165
|
+
preid: _zod2.default.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
166
|
+
owner: _zod2.default.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
167
|
+
bot: WorkspaceBotConfigSchema,
|
|
168
|
+
env: _zod2.default.enum([
|
|
169
|
+
"development",
|
|
170
|
+
"staging",
|
|
171
|
+
"production"
|
|
172
|
+
]).default("production").describe("The current runtime environment name for the package"),
|
|
173
|
+
workspaceRoot: _zod2.default.string().trim().default("").describe("The root directory of the workspace"),
|
|
174
|
+
externalPackagePatterns: _zod2.default.array(_zod2.default.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
|
|
175
|
+
skipCache: _zod2.default.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
176
|
+
directories: WorkspaceDirectoryConfigSchema,
|
|
177
|
+
packageManager: _zod2.default.enum([
|
|
178
|
+
"npm",
|
|
179
|
+
"yarn",
|
|
180
|
+
"pnpm",
|
|
181
|
+
"bun"
|
|
182
|
+
]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
|
|
183
|
+
timezone: _zod2.default.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
184
|
+
locale: _zod2.default.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
185
|
+
logLevel: _zod2.default.enum([
|
|
186
|
+
"silent",
|
|
187
|
+
"fatal",
|
|
188
|
+
"error",
|
|
189
|
+
"warn",
|
|
190
|
+
"success",
|
|
191
|
+
"info",
|
|
192
|
+
"debug",
|
|
193
|
+
"trace",
|
|
194
|
+
"all"
|
|
195
|
+
]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
|
|
196
|
+
registry: RegistryConfigSchema,
|
|
197
|
+
configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
198
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
199
|
+
extensions: _zod2.default.record(_zod2.default.any()).optional().default({}).describe("Configuration of each used extension")
|
|
200
|
+
}).describe("Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo.");
|
|
201
|
+
|
|
202
|
+
// ../config/src/types.ts
|
|
203
|
+
var COLOR_KEYS = [
|
|
204
|
+
"dark",
|
|
205
|
+
"light",
|
|
206
|
+
"base",
|
|
207
|
+
"brand",
|
|
208
|
+
"alternate",
|
|
209
|
+
"accent",
|
|
210
|
+
"link",
|
|
211
|
+
"success",
|
|
212
|
+
"help",
|
|
213
|
+
"info",
|
|
214
|
+
"warning",
|
|
215
|
+
"danger",
|
|
216
|
+
"fatal",
|
|
217
|
+
"positive",
|
|
218
|
+
"negative"
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
222
|
+
var _fs = require('fs');
|
|
223
|
+
var _path = require('path');
|
|
224
|
+
|
|
225
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
226
|
+
var _devkit = require('@nx/devkit');
|
|
227
|
+
var correctPaths = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (path) => {
|
|
228
|
+
if (!path) {
|
|
229
|
+
return "";
|
|
230
|
+
}
|
|
231
|
+
if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
|
|
232
|
+
path = `C:${path}`;
|
|
233
|
+
}
|
|
234
|
+
return path.replaceAll("\\", "/");
|
|
235
|
+
}, "correctPaths");
|
|
236
|
+
var joinPaths = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (...paths) => {
|
|
237
|
+
if (!paths || paths.length === 0) {
|
|
238
|
+
return "";
|
|
239
|
+
}
|
|
240
|
+
return correctPaths(_devkit.joinPathFragments.call(void 0, ...paths.map((path) => correctPaths(path))));
|
|
241
|
+
}, "joinPaths");
|
|
242
|
+
|
|
243
|
+
// ../config-tools/src/utilities/find-up.ts
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
247
|
+
var depth = 0;
|
|
248
|
+
function findFolderUp(startPath, endFileNames) {
|
|
249
|
+
const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
|
|
250
|
+
if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
|
|
251
|
+
return _startPath;
|
|
252
|
+
}
|
|
253
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
254
|
+
const parent = _path.join.call(void 0, _startPath, "..");
|
|
255
|
+
return findFolderUp(parent, endFileNames);
|
|
256
|
+
}
|
|
257
|
+
return void 0;
|
|
258
|
+
}
|
|
259
|
+
_chunk3GQAWCBQjs.__name.call(void 0, findFolderUp, "findFolderUp");
|
|
260
|
+
|
|
261
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
262
|
+
var rootFiles = [
|
|
263
|
+
"storm.json",
|
|
264
|
+
"storm.json",
|
|
265
|
+
"storm.yaml",
|
|
266
|
+
"storm.yml",
|
|
267
|
+
"storm.js",
|
|
268
|
+
"storm.ts",
|
|
269
|
+
".storm.json",
|
|
270
|
+
".storm.yaml",
|
|
271
|
+
".storm.yml",
|
|
272
|
+
".storm.js",
|
|
273
|
+
".storm.ts",
|
|
274
|
+
"lerna.json",
|
|
275
|
+
"nx.json",
|
|
276
|
+
"turbo.json",
|
|
277
|
+
"npm-workspace.json",
|
|
278
|
+
"yarn-workspace.json",
|
|
279
|
+
"pnpm-workspace.json",
|
|
280
|
+
"npm-workspace.yaml",
|
|
281
|
+
"yarn-workspace.yaml",
|
|
282
|
+
"pnpm-workspace.yaml",
|
|
283
|
+
"npm-workspace.yml",
|
|
284
|
+
"yarn-workspace.yml",
|
|
285
|
+
"pnpm-workspace.yml",
|
|
286
|
+
"npm-lock.json",
|
|
287
|
+
"yarn-lock.json",
|
|
288
|
+
"pnpm-lock.json",
|
|
289
|
+
"npm-lock.yaml",
|
|
290
|
+
"yarn-lock.yaml",
|
|
291
|
+
"pnpm-lock.yaml",
|
|
292
|
+
"npm-lock.yml",
|
|
293
|
+
"yarn-lock.yml",
|
|
294
|
+
"pnpm-lock.yml",
|
|
295
|
+
"bun.lockb"
|
|
296
|
+
];
|
|
297
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
298
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
299
|
+
return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
300
|
+
}
|
|
301
|
+
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
302
|
+
}
|
|
303
|
+
_chunk3GQAWCBQjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
304
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
305
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
306
|
+
if (!result) {
|
|
307
|
+
throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
|
|
308
|
+
${rootFiles.join("\n")}
|
|
309
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
|
|
310
|
+
}
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
_chunk3GQAWCBQjs.__name.call(void 0, findWorkspaceRoot, "findWorkspaceRoot");
|
|
314
|
+
|
|
315
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
316
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
317
|
+
"light": {
|
|
318
|
+
"background": "#fafafa",
|
|
319
|
+
"foreground": "#1d1e22",
|
|
320
|
+
"brand": "#1fb2a6",
|
|
321
|
+
"alternate": "#db2777",
|
|
322
|
+
"help": "#5C4EE5",
|
|
323
|
+
"success": "#087f5b",
|
|
324
|
+
"info": "#0550ae",
|
|
325
|
+
"warning": "#e3b341",
|
|
326
|
+
"danger": "#D8314A",
|
|
327
|
+
"positive": "#22c55e",
|
|
328
|
+
"negative": "#dc2626"
|
|
329
|
+
},
|
|
330
|
+
"dark": {
|
|
331
|
+
"background": "#1d1e22",
|
|
332
|
+
"foreground": "#cbd5e1",
|
|
333
|
+
"brand": "#2dd4bf",
|
|
334
|
+
"alternate": "#db2777",
|
|
335
|
+
"help": "#818cf8",
|
|
336
|
+
"success": "#10b981",
|
|
337
|
+
"info": "#58a6ff",
|
|
338
|
+
"warning": "#f3d371",
|
|
339
|
+
"danger": "#D8314A",
|
|
340
|
+
"positive": "#22c55e",
|
|
341
|
+
"negative": "#dc2626"
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
var getDefaultConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (root) => {
|
|
345
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
346
|
+
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
347
|
+
let name;
|
|
348
|
+
let namespace;
|
|
349
|
+
let repository;
|
|
350
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
351
|
+
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
352
|
+
const file = _fs.readFileSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"), {
|
|
353
|
+
encoding: "utf8"
|
|
354
|
+
});
|
|
355
|
+
if (file) {
|
|
356
|
+
const packageJson = JSON.parse(file);
|
|
357
|
+
if (packageJson.name) {
|
|
358
|
+
name = packageJson.name;
|
|
359
|
+
}
|
|
360
|
+
if (packageJson.namespace) {
|
|
361
|
+
namespace = packageJson.namespace;
|
|
362
|
+
}
|
|
363
|
+
if (_optionalChain([packageJson, 'access', _2 => _2.repository, 'optionalAccess', _3 => _3.url])) {
|
|
364
|
+
repository = _optionalChain([packageJson, 'access', _4 => _4.repository, 'optionalAccess', _5 => _5.url]);
|
|
365
|
+
}
|
|
366
|
+
if (packageJson.license) {
|
|
367
|
+
license = packageJson.license;
|
|
368
|
+
}
|
|
369
|
+
if (packageJson.homepage) {
|
|
370
|
+
homepage = packageJson.homepage;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
workspaceRoot,
|
|
376
|
+
name,
|
|
377
|
+
namespace,
|
|
378
|
+
repository,
|
|
379
|
+
license,
|
|
380
|
+
homepage,
|
|
381
|
+
docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
|
|
382
|
+
licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
|
|
383
|
+
};
|
|
384
|
+
}, "getDefaultConfig");
|
|
385
|
+
|
|
386
|
+
// ../config-tools/src/logger/chalk.ts
|
|
387
|
+
var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
|
|
388
|
+
var chalkDefault = {
|
|
389
|
+
hex: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
390
|
+
bgHex: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (_) => ({
|
|
391
|
+
whiteBright: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
392
|
+
}), "bgHex"),
|
|
393
|
+
whiteBright: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "whiteBright"),
|
|
394
|
+
gray: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "gray"),
|
|
395
|
+
bold: {
|
|
396
|
+
hex: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
397
|
+
bgHex: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (_) => ({
|
|
398
|
+
whiteBright: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
399
|
+
}), "bgHex"),
|
|
400
|
+
whiteBright: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
401
|
+
},
|
|
402
|
+
dim: {
|
|
403
|
+
hex: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
404
|
+
gray: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message) => message, "gray")
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
var getChalk = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
|
|
408
|
+
let _chalk = _chalk3.default;
|
|
409
|
+
if (!_optionalChain([_chalk, 'optionalAccess', _6 => _6.hex]) || !_optionalChain([_chalk, 'optionalAccess', _7 => _7.bold, 'optionalAccess', _8 => _8.hex]) || !_optionalChain([_chalk, 'optionalAccess', _9 => _9.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _10 => _10.whiteBright])) {
|
|
410
|
+
_chalk = chalkDefault;
|
|
411
|
+
}
|
|
412
|
+
return _chalk;
|
|
413
|
+
}, "getChalk");
|
|
414
|
+
|
|
415
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
416
|
+
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
417
|
+
function isUnicodeSupported() {
|
|
418
|
+
const { env } = _process2.default;
|
|
419
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
420
|
+
if (_process2.default.platform !== "win32") {
|
|
421
|
+
return TERM !== "linux";
|
|
422
|
+
}
|
|
423
|
+
return Boolean(env.WT_SESSION) || // Windows Terminal
|
|
424
|
+
Boolean(env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
425
|
+
env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
426
|
+
TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
427
|
+
}
|
|
428
|
+
_chunk3GQAWCBQjs.__name.call(void 0, isUnicodeSupported, "isUnicodeSupported");
|
|
429
|
+
|
|
430
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
431
|
+
var useIcon = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
|
|
432
|
+
var CONSOLE_ICONS = {
|
|
433
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
434
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
435
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
436
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
437
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
438
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
439
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
440
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
444
|
+
var formatTimestamp = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (date = /* @__PURE__ */ new Date()) => {
|
|
445
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
446
|
+
}, "formatTimestamp");
|
|
447
|
+
|
|
448
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
449
|
+
var getLogLevel = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (label) => {
|
|
450
|
+
switch (label) {
|
|
451
|
+
case "all":
|
|
452
|
+
return LogLevel.ALL;
|
|
453
|
+
case "trace":
|
|
454
|
+
return LogLevel.TRACE;
|
|
455
|
+
case "debug":
|
|
456
|
+
return LogLevel.DEBUG;
|
|
457
|
+
case "info":
|
|
458
|
+
return LogLevel.INFO;
|
|
459
|
+
case "warn":
|
|
460
|
+
return LogLevel.WARN;
|
|
461
|
+
case "error":
|
|
462
|
+
return LogLevel.ERROR;
|
|
463
|
+
case "fatal":
|
|
464
|
+
return LogLevel.FATAL;
|
|
465
|
+
case "silent":
|
|
466
|
+
return LogLevel.SILENT;
|
|
467
|
+
default:
|
|
468
|
+
return LogLevel.INFO;
|
|
469
|
+
}
|
|
470
|
+
}, "getLogLevel");
|
|
471
|
+
var getLogLevelLabel = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (logLevel = LogLevel.INFO) => {
|
|
472
|
+
if (logLevel >= LogLevel.ALL) {
|
|
473
|
+
return LogLevelLabel.ALL;
|
|
474
|
+
}
|
|
475
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
476
|
+
return LogLevelLabel.TRACE;
|
|
477
|
+
}
|
|
478
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
479
|
+
return LogLevelLabel.DEBUG;
|
|
480
|
+
}
|
|
481
|
+
if (logLevel >= LogLevel.INFO) {
|
|
482
|
+
return LogLevelLabel.INFO;
|
|
483
|
+
}
|
|
484
|
+
if (logLevel >= LogLevel.WARN) {
|
|
485
|
+
return LogLevelLabel.WARN;
|
|
486
|
+
}
|
|
487
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
488
|
+
return LogLevelLabel.ERROR;
|
|
489
|
+
}
|
|
490
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
491
|
+
return LogLevelLabel.FATAL;
|
|
492
|
+
}
|
|
493
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
494
|
+
return LogLevelLabel.SILENT;
|
|
495
|
+
}
|
|
496
|
+
return LogLevelLabel.INFO;
|
|
497
|
+
}, "getLogLevelLabel");
|
|
498
|
+
var isVerbose = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (label = LogLevelLabel.SILENT) => {
|
|
499
|
+
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
500
|
+
return logLevel >= LogLevel.DEBUG;
|
|
501
|
+
}, "isVerbose");
|
|
502
|
+
|
|
503
|
+
// ../config-tools/src/logger/console.ts
|
|
504
|
+
var getLogFn = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}) => {
|
|
505
|
+
const _chalk = getChalk();
|
|
506
|
+
const colors = !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12.dark]) && !_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14["base"]]) && !_optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16["base"], 'optionalAccess', _17 => _17.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _18 => _18.colors, 'optionalAccess', _19 => _19.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"], 'optionalAccess', _22 => _22.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24["base"]]) ? _optionalChain([config, 'access', _25 => _25.colors, 'optionalAccess', _26 => _26["base"]]) : DEFAULT_COLOR_CONFIG;
|
|
507
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
508
|
+
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
509
|
+
return (_) => {
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
513
|
+
return (message) => {
|
|
514
|
+
console.error(`
|
|
515
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
516
|
+
`);
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
520
|
+
return (message) => {
|
|
521
|
+
console.error(`
|
|
522
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
523
|
+
`);
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
527
|
+
return (message) => {
|
|
528
|
+
console.warn(`
|
|
529
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
530
|
+
`);
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
534
|
+
return (message) => {
|
|
535
|
+
console.info(`
|
|
536
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
537
|
+
`);
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
541
|
+
return (message) => {
|
|
542
|
+
console.info(`
|
|
543
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
544
|
+
`);
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
548
|
+
return (message) => {
|
|
549
|
+
console.debug(`
|
|
550
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
551
|
+
`);
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
return (message) => {
|
|
555
|
+
console.log(`
|
|
556
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
557
|
+
`);
|
|
558
|
+
};
|
|
559
|
+
}, "getLogFn");
|
|
560
|
+
var writeFatal = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
|
|
561
|
+
var writeError = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
|
|
562
|
+
var writeWarning = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
|
|
563
|
+
var writeInfo = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
|
|
564
|
+
var writeSuccess = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
565
|
+
var writeDebug = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
566
|
+
var writeTrace = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
567
|
+
var writeSystem = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
568
|
+
var getStopwatch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name) => {
|
|
569
|
+
const start = process.hrtime();
|
|
570
|
+
return () => {
|
|
571
|
+
const end = process.hrtime(start);
|
|
572
|
+
console.info(`
|
|
573
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
|
|
574
|
+
|
|
575
|
+
`);
|
|
576
|
+
};
|
|
577
|
+
}, "getStopwatch");
|
|
578
|
+
var MAX_DEPTH = 4;
|
|
579
|
+
var formatLogMessage = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (message, options = {}, depth2 = 0) => {
|
|
580
|
+
if (depth2 > MAX_DEPTH) {
|
|
581
|
+
return "<max depth>";
|
|
582
|
+
}
|
|
583
|
+
const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
|
|
584
|
+
const skip = _nullishCoalesce(options.skip, () => ( []));
|
|
585
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
586
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
587
|
+
prefix: `${prefix}-`,
|
|
588
|
+
skip
|
|
589
|
+
}, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
590
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
591
|
+
prefix: `${prefix}-`,
|
|
592
|
+
skip
|
|
593
|
+
}, depth2 + 1) : message[key]}`).join("\n")}` : message;
|
|
594
|
+
}, "formatLogMessage");
|
|
595
|
+
var _isFunction = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) => {
|
|
596
|
+
try {
|
|
597
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _27 => _27.constructor]) && _optionalChain([value, 'optionalAccess', _28 => _28.call]) && _optionalChain([value, 'optionalAccess', _29 => _29.apply]));
|
|
598
|
+
} catch (e) {
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
}, "_isFunction");
|
|
602
|
+
|
|
603
|
+
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
604
|
+
var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (option, tokenizerOptions) => {
|
|
605
|
+
let result = option;
|
|
606
|
+
if (!result) {
|
|
607
|
+
return result;
|
|
608
|
+
}
|
|
609
|
+
if (tokenizerOptions) {
|
|
610
|
+
const optionKeys = Object.keys(tokenizerOptions);
|
|
611
|
+
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
612
|
+
for (const optionKey of optionKeys) {
|
|
613
|
+
if (result.includes(`{${optionKey}}`)) {
|
|
614
|
+
result = result.replaceAll(`{${optionKey}}`, _nullishCoalesce(_optionalChain([tokenizerOptions, 'access', _30 => _30.config, 'optionalAccess', _31 => _31[optionKey]]), () => ( "")));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (tokenizerOptions.config) {
|
|
620
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
621
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
622
|
+
for (const configKey of configKeys) {
|
|
623
|
+
if (result.includes(`{${configKey}}`)) {
|
|
624
|
+
result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if (result.includes("{workspaceRoot}")) {
|
|
630
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _optionalChain([tokenizerOptions, 'access', _32 => _32.config, 'optionalAccess', _33 => _33.workspaceRoot]))), () => ( findWorkspaceRoot())));
|
|
631
|
+
}
|
|
632
|
+
return result;
|
|
633
|
+
}, "applyWorkspaceBaseTokens");
|
|
634
|
+
var applyWorkspaceTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config, tokenizerFn) => {
|
|
635
|
+
if (!options) {
|
|
636
|
+
return {};
|
|
637
|
+
}
|
|
638
|
+
const result = {};
|
|
639
|
+
for (const option of Object.keys(options)) {
|
|
640
|
+
if (typeof options[option] === "string") {
|
|
641
|
+
result[option] = await Promise.resolve(tokenizerFn(options[option], config));
|
|
642
|
+
} else if (Array.isArray(options[option])) {
|
|
643
|
+
result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, config)) : item));
|
|
644
|
+
} else if (typeof options[option] === "object") {
|
|
645
|
+
result[option] = await applyWorkspaceTokens(options[option], config, tokenizerFn);
|
|
646
|
+
} else {
|
|
647
|
+
result[option] = options[option];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return result;
|
|
651
|
+
}, "applyWorkspaceTokens");
|
|
652
|
+
|
|
653
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
654
|
+
var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
655
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
656
|
+
let config = _c12.loadConfig.call(void 0, {
|
|
657
|
+
cwd: workspacePath,
|
|
658
|
+
packageJson: true,
|
|
659
|
+
name: fileName,
|
|
660
|
+
envName: _optionalChain([fileName, 'optionalAccess', _34 => _34.toUpperCase, 'call', _35 => _35()]),
|
|
661
|
+
jitiOptions: {
|
|
662
|
+
debug: false,
|
|
663
|
+
cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
|
|
664
|
+
},
|
|
665
|
+
...options
|
|
666
|
+
});
|
|
667
|
+
if (!config || Object.keys(config).length === 0) {
|
|
668
|
+
config = _c12.loadConfig.call(void 0, {
|
|
669
|
+
cwd: workspacePath,
|
|
670
|
+
packageJson: true,
|
|
671
|
+
name: fileName,
|
|
672
|
+
envName: _optionalChain([fileName, 'optionalAccess', _36 => _36.toUpperCase, 'call', _37 => _37()]),
|
|
673
|
+
jitiOptions: {
|
|
674
|
+
debug: false,
|
|
675
|
+
cache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache", "storm")
|
|
676
|
+
},
|
|
677
|
+
configFile: fileName,
|
|
678
|
+
...options
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
return config;
|
|
682
|
+
}, "getConfigFileByName");
|
|
683
|
+
var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
684
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
685
|
+
const result = await getConfigFileByName("storm", workspacePath);
|
|
686
|
+
let config = result.config;
|
|
687
|
+
const configFile = result.configFile;
|
|
688
|
+
if (config && configFile && Object.keys(config).length > 0) {
|
|
689
|
+
writeSystem(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
690
|
+
logLevel: "all"
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
694
|
+
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
695
|
+
for (const result2 of results) {
|
|
696
|
+
if (_optionalChain([result2, 'optionalAccess', _38 => _38.config]) && _optionalChain([result2, 'optionalAccess', _39 => _39.configFile]) && Object.keys(result2.config).length > 0) {
|
|
697
|
+
writeSystem(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
698
|
+
logLevel: "all"
|
|
699
|
+
});
|
|
700
|
+
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
if (!config) {
|
|
705
|
+
return void 0;
|
|
706
|
+
}
|
|
707
|
+
config.configFile = configFile;
|
|
708
|
+
return config;
|
|
709
|
+
}, "getConfigFile");
|
|
710
|
+
|
|
711
|
+
// ../config-tools/src/create-storm-config.ts
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
// ../config-tools/src/env/get-env.ts
|
|
715
|
+
var getConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
|
|
716
|
+
const prefix = "STORM_";
|
|
717
|
+
let config = {
|
|
718
|
+
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
719
|
+
name: process.env[`${prefix}NAME`] || void 0,
|
|
720
|
+
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
721
|
+
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
722
|
+
bot: {
|
|
723
|
+
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
724
|
+
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
725
|
+
},
|
|
726
|
+
organization: process.env[`${prefix}ORGANIZATION`] || void 0,
|
|
727
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
728
|
+
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
729
|
+
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
730
|
+
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
731
|
+
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
732
|
+
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
733
|
+
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
734
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
735
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
736
|
+
directories: {
|
|
737
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
738
|
+
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
739
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
740
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
741
|
+
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
742
|
+
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
743
|
+
},
|
|
744
|
+
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
745
|
+
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
746
|
+
// ci:
|
|
747
|
+
// process.env[`${prefix}CI`] !== undefined
|
|
748
|
+
// ? Boolean(
|
|
749
|
+
// process.env[`${prefix}CI`] ??
|
|
750
|
+
// process.env.CI ??
|
|
751
|
+
// process.env.CONTINUOUS_INTEGRATION
|
|
752
|
+
// )
|
|
753
|
+
// : undefined,
|
|
754
|
+
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
755
|
+
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
756
|
+
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
757
|
+
externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
|
|
758
|
+
registry: {
|
|
759
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
760
|
+
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
761
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
762
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
763
|
+
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
764
|
+
},
|
|
765
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
766
|
+
};
|
|
767
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
768
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
769
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
770
|
+
return ret;
|
|
771
|
+
}, {}) : getThemeColorConfigEnv(prefix);
|
|
772
|
+
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
773
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
774
|
+
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
775
|
+
} else {
|
|
776
|
+
config.docs = `${config.homepage}/docs`;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if (config.licensing === STORM_DEFAULT_LICENSING) {
|
|
780
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
781
|
+
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
782
|
+
} else {
|
|
783
|
+
config.licensing = `${config.homepage}/docs`;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
787
|
+
if (serializedConfig) {
|
|
788
|
+
const parsed = JSON.parse(serializedConfig);
|
|
789
|
+
config = {
|
|
790
|
+
...config,
|
|
791
|
+
...parsed,
|
|
792
|
+
colors: {
|
|
793
|
+
...config.colors,
|
|
794
|
+
...parsed.colors
|
|
795
|
+
},
|
|
796
|
+
extensions: {
|
|
797
|
+
...config.extensions,
|
|
798
|
+
...parsed.extensions
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
return config;
|
|
803
|
+
}, "getConfigEnv");
|
|
804
|
+
var getThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, theme) => {
|
|
805
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
806
|
+
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
807
|
+
}, "getThemeColorConfigEnv");
|
|
808
|
+
var getSingleThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix) => {
|
|
809
|
+
return {
|
|
810
|
+
dark: process.env[`${prefix}DARK`],
|
|
811
|
+
light: process.env[`${prefix}LIGHT`],
|
|
812
|
+
brand: process.env[`${prefix}BRAND`],
|
|
813
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
814
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
815
|
+
link: process.env[`${prefix}LINK`],
|
|
816
|
+
help: process.env[`${prefix}HELP`],
|
|
817
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
818
|
+
info: process.env[`${prefix}INFO`],
|
|
819
|
+
warning: process.env[`${prefix}WARNING`],
|
|
820
|
+
danger: process.env[`${prefix}DANGER`],
|
|
821
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
822
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
823
|
+
negative: process.env[`${prefix}NEGATIVE`]
|
|
824
|
+
};
|
|
825
|
+
}, "getSingleThemeColorConfigEnv");
|
|
826
|
+
var getMultiThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix) => {
|
|
827
|
+
return {
|
|
828
|
+
light: getBaseThemeColorConfigEnv(`${prefix}_LIGHT_`),
|
|
829
|
+
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
830
|
+
};
|
|
831
|
+
}, "getMultiThemeColorConfigEnv");
|
|
832
|
+
var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix) => {
|
|
833
|
+
return {
|
|
834
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
835
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
836
|
+
brand: process.env[`${prefix}BRAND`],
|
|
837
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
838
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
839
|
+
link: process.env[`${prefix}LINK`],
|
|
840
|
+
help: process.env[`${prefix}HELP`],
|
|
841
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
842
|
+
info: process.env[`${prefix}INFO`],
|
|
843
|
+
warning: process.env[`${prefix}WARNING`],
|
|
844
|
+
danger: process.env[`${prefix}DANGER`],
|
|
845
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
846
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
847
|
+
negative: process.env[`${prefix}NEGATIVE`]
|
|
848
|
+
};
|
|
849
|
+
}, "getBaseThemeColorConfigEnv");
|
|
850
|
+
|
|
851
|
+
// ../config-tools/src/env/set-env.ts
|
|
852
|
+
var setExtensionEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (extensionName, extension) => {
|
|
853
|
+
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
854
|
+
if (extension[key]) {
|
|
855
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _40 => _40.replace, 'call', _41 => _41(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _42 => _42[0], 'optionalAccess', _43 => _43.toUpperCase, 'call', _44 => _44()]) + input.slice(1) : ""), 'access', _45 => _45.split, 'call', _46 => _46(/(?=[A-Z])|[.\-\s_]/), 'access', _47 => _47.map, 'call', _48 => _48((x) => x.toLowerCase())]), () => ( []));
|
|
856
|
+
let extensionKey;
|
|
857
|
+
if (result.length === 0) {
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
if (result.length === 1) {
|
|
861
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _49 => _49[0], 'optionalAccess', _50 => _50.toUpperCase, 'call', _51 => _51()]), () => ( ""));
|
|
862
|
+
} else {
|
|
863
|
+
extensionKey = result.reduce((ret, part) => {
|
|
864
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}, "setExtensionEnv");
|
|
871
|
+
var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config) => {
|
|
872
|
+
const prefix = "STORM_";
|
|
873
|
+
if (config.extends) {
|
|
874
|
+
process.env[`${prefix}EXTENDS`] = config.extends;
|
|
875
|
+
}
|
|
876
|
+
if (config.name) {
|
|
877
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
878
|
+
}
|
|
879
|
+
if (config.namespace) {
|
|
880
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
881
|
+
}
|
|
882
|
+
if (config.owner) {
|
|
883
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
884
|
+
}
|
|
885
|
+
if (config.bot) {
|
|
886
|
+
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
887
|
+
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
888
|
+
}
|
|
889
|
+
if (config.organization) {
|
|
890
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
891
|
+
}
|
|
892
|
+
if (config.packageManager) {
|
|
893
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
894
|
+
}
|
|
895
|
+
if (config.license) {
|
|
896
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
897
|
+
}
|
|
898
|
+
if (config.homepage) {
|
|
899
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
900
|
+
}
|
|
901
|
+
if (config.docs) {
|
|
902
|
+
process.env[`${prefix}DOCS`] = config.docs;
|
|
903
|
+
}
|
|
904
|
+
if (config.licensing) {
|
|
905
|
+
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
906
|
+
}
|
|
907
|
+
if (config.timezone) {
|
|
908
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
909
|
+
process.env.TZ = config.timezone;
|
|
910
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
911
|
+
}
|
|
912
|
+
if (config.locale) {
|
|
913
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
914
|
+
process.env.LOCALE = config.locale;
|
|
915
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
916
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
917
|
+
}
|
|
918
|
+
if (config.configFile) {
|
|
919
|
+
process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
|
|
920
|
+
}
|
|
921
|
+
if (config.workspaceRoot) {
|
|
922
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
923
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
924
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
925
|
+
}
|
|
926
|
+
if (config.directories) {
|
|
927
|
+
if (!config.skipCache && config.directories.cache) {
|
|
928
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
|
|
929
|
+
}
|
|
930
|
+
if (config.directories.data) {
|
|
931
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
932
|
+
}
|
|
933
|
+
if (config.directories.config) {
|
|
934
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
|
|
935
|
+
}
|
|
936
|
+
if (config.directories.temp) {
|
|
937
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
938
|
+
}
|
|
939
|
+
if (config.directories.log) {
|
|
940
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
941
|
+
}
|
|
942
|
+
if (config.directories.build) {
|
|
943
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
if (config.skipCache !== void 0) {
|
|
947
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
948
|
+
if (config.skipCache) {
|
|
949
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
950
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (config.env) {
|
|
954
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
955
|
+
process.env.NODE_ENV = config.env;
|
|
956
|
+
process.env.ENVIRONMENT = config.env;
|
|
957
|
+
}
|
|
958
|
+
if (_optionalChain([config, 'access', _52 => _52.colors, 'optionalAccess', _53 => _53.base, 'optionalAccess', _54 => _54.light]) || _optionalChain([config, 'access', _55 => _55.colors, 'optionalAccess', _56 => _56.base, 'optionalAccess', _57 => _57.dark])) {
|
|
959
|
+
for (const key of Object.keys(config.colors)) {
|
|
960
|
+
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
961
|
+
}
|
|
962
|
+
} else {
|
|
963
|
+
setThemeColorConfigEnv(`${prefix}COLOR_`, config.colors);
|
|
964
|
+
}
|
|
965
|
+
if (config.repository) {
|
|
966
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
967
|
+
}
|
|
968
|
+
if (config.branch) {
|
|
969
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
970
|
+
}
|
|
971
|
+
if (config.preid) {
|
|
972
|
+
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
973
|
+
}
|
|
974
|
+
if (config.externalPackagePatterns) {
|
|
975
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(config.externalPackagePatterns);
|
|
976
|
+
}
|
|
977
|
+
if (config.registry) {
|
|
978
|
+
if (config.registry.github) {
|
|
979
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
980
|
+
}
|
|
981
|
+
if (config.registry.npm) {
|
|
982
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
983
|
+
}
|
|
984
|
+
if (config.registry.cargo) {
|
|
985
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
986
|
+
}
|
|
987
|
+
if (config.registry.cyclone) {
|
|
988
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
|
|
989
|
+
}
|
|
990
|
+
if (config.registry.container) {
|
|
991
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.cyclone);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
if (config.logLevel) {
|
|
995
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
996
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
997
|
+
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
998
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
999
|
+
}
|
|
1000
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
1001
|
+
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
1002
|
+
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
1003
|
+
}
|
|
1004
|
+
}, "setConfigEnv");
|
|
1005
|
+
var setThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1006
|
+
return _optionalChain([config, 'optionalAccess', _58 => _58.light, 'optionalAccess', _59 => _59.brand]) || _optionalChain([config, 'optionalAccess', _60 => _60.dark, 'optionalAccess', _61 => _61.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
1007
|
+
}, "setThemeColorConfigEnv");
|
|
1008
|
+
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1009
|
+
if (config.dark) {
|
|
1010
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
1011
|
+
}
|
|
1012
|
+
if (config.light) {
|
|
1013
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
1014
|
+
}
|
|
1015
|
+
if (config.brand) {
|
|
1016
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
1017
|
+
}
|
|
1018
|
+
if (config.alternate) {
|
|
1019
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
1020
|
+
}
|
|
1021
|
+
if (config.accent) {
|
|
1022
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
1023
|
+
}
|
|
1024
|
+
if (config.link) {
|
|
1025
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
1026
|
+
}
|
|
1027
|
+
if (config.help) {
|
|
1028
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
1029
|
+
}
|
|
1030
|
+
if (config.success) {
|
|
1031
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
1032
|
+
}
|
|
1033
|
+
if (config.info) {
|
|
1034
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
1035
|
+
}
|
|
1036
|
+
if (config.warning) {
|
|
1037
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
1038
|
+
}
|
|
1039
|
+
if (config.danger) {
|
|
1040
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
1041
|
+
}
|
|
1042
|
+
if (config.fatal) {
|
|
1043
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
1044
|
+
}
|
|
1045
|
+
if (config.positive) {
|
|
1046
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
1047
|
+
}
|
|
1048
|
+
if (config.negative) {
|
|
1049
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1050
|
+
}
|
|
1051
|
+
}, "setSingleThemeColorConfigEnv");
|
|
1052
|
+
var setMultiThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1053
|
+
return {
|
|
1054
|
+
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
1055
|
+
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
1056
|
+
};
|
|
1057
|
+
}, "setMultiThemeColorConfigEnv");
|
|
1058
|
+
var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (prefix, config) => {
|
|
1059
|
+
if (config.foreground) {
|
|
1060
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
1061
|
+
}
|
|
1062
|
+
if (config.background) {
|
|
1063
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
1064
|
+
}
|
|
1065
|
+
if (config.brand) {
|
|
1066
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
1067
|
+
}
|
|
1068
|
+
if (config.alternate) {
|
|
1069
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
1070
|
+
}
|
|
1071
|
+
if (config.accent) {
|
|
1072
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
1073
|
+
}
|
|
1074
|
+
if (config.link) {
|
|
1075
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
1076
|
+
}
|
|
1077
|
+
if (config.help) {
|
|
1078
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
1079
|
+
}
|
|
1080
|
+
if (config.success) {
|
|
1081
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
1082
|
+
}
|
|
1083
|
+
if (config.info) {
|
|
1084
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
1085
|
+
}
|
|
1086
|
+
if (config.warning) {
|
|
1087
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
1088
|
+
}
|
|
1089
|
+
if (config.danger) {
|
|
1090
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
1091
|
+
}
|
|
1092
|
+
if (config.fatal) {
|
|
1093
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
1094
|
+
}
|
|
1095
|
+
if (config.positive) {
|
|
1096
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
1097
|
+
}
|
|
1098
|
+
if (config.negative) {
|
|
1099
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1100
|
+
}
|
|
1101
|
+
}, "setBaseThemeColorConfigEnv");
|
|
1102
|
+
|
|
1103
|
+
// ../config-tools/src/create-storm-config.ts
|
|
1104
|
+
var _static_cache = void 0;
|
|
1105
|
+
var loadStormConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot) => {
|
|
1106
|
+
let config = {};
|
|
1107
|
+
if (_optionalChain([_static_cache, 'optionalAccess', _62 => _62.data]) && _optionalChain([_static_cache, 'optionalAccess', _63 => _63.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
|
|
1108
|
+
writeTrace(`Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
|
|
1109
|
+
return _static_cache.data;
|
|
1110
|
+
}
|
|
1111
|
+
let _workspaceRoot = workspaceRoot;
|
|
1112
|
+
if (!_workspaceRoot) {
|
|
1113
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
1114
|
+
}
|
|
1115
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
1116
|
+
if (!configFile) {
|
|
1117
|
+
writeWarning("No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
1118
|
+
logLevel: "all"
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
config = _defu2.default.call(void 0, getConfigEnv(), configFile, getDefaultConfig(_workspaceRoot));
|
|
1122
|
+
setConfigEnv(config);
|
|
1123
|
+
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
1124
|
+
${formatLogMessage(config)}`, config);
|
|
1125
|
+
return config;
|
|
1126
|
+
}, "loadStormConfig");
|
|
1127
|
+
|
|
1128
|
+
// ../workspace-tools/src/utils/apply-workspace-tokens.ts
|
|
1129
|
+
var applyWorkspaceExecutorTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (option, tokenizerOptions) => {
|
|
1130
|
+
let result = option;
|
|
1131
|
+
if (!result) {
|
|
1132
|
+
return result;
|
|
1133
|
+
}
|
|
1134
|
+
let projectName;
|
|
1135
|
+
let projectRoot;
|
|
1136
|
+
let sourceRoot;
|
|
1137
|
+
if (_optionalChain([tokenizerOptions, 'optionalAccess', _64 => _64.projectName])) {
|
|
1138
|
+
const context = tokenizerOptions;
|
|
1139
|
+
projectName = context.projectName;
|
|
1140
|
+
projectRoot = context.root;
|
|
1141
|
+
sourceRoot = context.sourceRoot;
|
|
1142
|
+
} else {
|
|
1143
|
+
const projectConfig = tokenizerOptions;
|
|
1144
|
+
projectRoot = projectConfig.root;
|
|
1145
|
+
if (projectConfig.name) {
|
|
1146
|
+
projectName = projectConfig.name;
|
|
1147
|
+
}
|
|
1148
|
+
if (projectConfig.sourceRoot) {
|
|
1149
|
+
sourceRoot = projectConfig.sourceRoot;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
if (tokenizerOptions.config) {
|
|
1153
|
+
const configKeys = Object.keys(tokenizerOptions.config);
|
|
1154
|
+
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
1155
|
+
for (const configKey of configKeys) {
|
|
1156
|
+
if (result.includes(`{${configKey}}`)) {
|
|
1157
|
+
result = result.replaceAll(`{${configKey}}`, tokenizerOptions.config[configKey]);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
if (result.includes("{projectName}")) {
|
|
1163
|
+
result = result.replaceAll("{projectName}", projectName);
|
|
1164
|
+
}
|
|
1165
|
+
if (result.includes("{projectRoot}")) {
|
|
1166
|
+
result = result.replaceAll("{projectRoot}", projectRoot);
|
|
1167
|
+
}
|
|
1168
|
+
if (result.includes("{sourceRoot}")) {
|
|
1169
|
+
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
1170
|
+
}
|
|
1171
|
+
if (result.includes("{workspaceRoot}")) {
|
|
1172
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( findWorkspaceRoot())));
|
|
1173
|
+
}
|
|
1174
|
+
return result;
|
|
1175
|
+
}, "applyWorkspaceExecutorTokens");
|
|
1176
|
+
|
|
1177
|
+
// ../workspace-tools/src/base/base-executor.ts
|
|
1178
|
+
var withRunExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
1179
|
+
const stopwatch = getStopwatch(name);
|
|
1180
|
+
let options = _options;
|
|
1181
|
+
let config = {};
|
|
1182
|
+
try {
|
|
1183
|
+
writeInfo(`\u26A1 Running the ${name} executor...
|
|
1184
|
+
`, config);
|
|
1185
|
+
if (!_optionalChain([context, 'access', _65 => _65.projectsConfigurations, 'optionalAccess', _66 => _66.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1186
|
+
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1187
|
+
}
|
|
1188
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
1189
|
+
const projectRoot = _nullishCoalesce(_optionalChain([context, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'access', _69 => _69[context.projectName], 'optionalAccess', _70 => _70.root]), () => ( workspaceRoot));
|
|
1190
|
+
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'access', _73 => _73[context.projectName], 'optionalAccess', _74 => _74.sourceRoot]), () => ( workspaceRoot));
|
|
1191
|
+
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'access', _77 => _77[context.projectName], 'optionalAccess', _78 => _78.name]), () => ( context.projectName));
|
|
1192
|
+
config.workspaceRoot = workspaceRoot;
|
|
1193
|
+
if (!executorOptions.skipReadingConfig) {
|
|
1194
|
+
writeTrace(`Loading the Storm Config from environment variables and storm.config.js file...
|
|
1195
|
+
- workspaceRoot: ${workspaceRoot}
|
|
1196
|
+
- projectRoot: ${projectRoot}
|
|
1197
|
+
- sourceRoot: ${sourceRoot}
|
|
1198
|
+
- projectName: ${projectName}
|
|
1199
|
+
`, config);
|
|
1200
|
+
config = await loadStormConfig(workspaceRoot);
|
|
1201
|
+
}
|
|
1202
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _79 => _79.hooks, 'optionalAccess', _80 => _80.applyDefaultOptions])) {
|
|
1203
|
+
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
1204
|
+
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
1205
|
+
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
1206
|
+
}
|
|
1207
|
+
writeTrace(`Executor schema options \u2699\uFE0F
|
|
1208
|
+
${Object.keys(options).map((key) => ` - ${key}=${_isFunction2(options[key]) ? "<function>" : JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
1209
|
+
const tokenized = await applyWorkspaceTokens(options, {
|
|
1210
|
+
config,
|
|
1211
|
+
workspaceRoot,
|
|
1212
|
+
projectRoot,
|
|
1213
|
+
sourceRoot,
|
|
1214
|
+
projectName,
|
|
1215
|
+
...context.projectsConfigurations.projects[context.projectName],
|
|
1216
|
+
...executorOptions
|
|
1217
|
+
}, applyWorkspaceExecutorTokens);
|
|
1218
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _81 => _81.hooks, 'optionalAccess', _82 => _82.preProcess])) {
|
|
1219
|
+
writeDebug("Running the preProcess hook...", config);
|
|
1220
|
+
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
1221
|
+
writeDebug("Completed the preProcess hook", config);
|
|
1222
|
+
}
|
|
1223
|
+
const ret = executorFn(tokenized, context, config);
|
|
1224
|
+
if (_isFunction2(_optionalChain([ret, 'optionalAccess', _83 => _83.next]))) {
|
|
1225
|
+
const asyncGen = ret;
|
|
1226
|
+
for await (const iter of asyncGen) {
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
const result = await Promise.resolve(ret);
|
|
1230
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _84 => _84.error, 'optionalAccess', _85 => _85.message]) && typeof _optionalChain([result, 'optionalAccess', _86 => _86.error, 'optionalAccess', _87 => _87.message]) === "string" && _optionalChain([result, 'optionalAccess', _88 => _88.error, 'optionalAccess', _89 => _89.name]) && typeof _optionalChain([result, 'optionalAccess', _90 => _90.error, 'optionalAccess', _91 => _91.name]) === "string")) {
|
|
1231
|
+
writeTrace(`Failure determined by the ${name} executor
|
|
1232
|
+
${formatLogMessage(result)}`, config);
|
|
1233
|
+
console.error(result);
|
|
1234
|
+
throw new Error(`The ${name} executor failed to run`, {
|
|
1235
|
+
cause: _optionalChain([result, 'optionalAccess', _92 => _92.error])
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _93 => _93.hooks, 'optionalAccess', _94 => _94.postProcess])) {
|
|
1239
|
+
writeDebug("Running the postProcess hook...", config);
|
|
1240
|
+
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
1241
|
+
writeDebug("Completed the postProcess hook", config);
|
|
1242
|
+
}
|
|
1243
|
+
writeSuccess(`Completed running the ${name} task executor!
|
|
1244
|
+
`, config);
|
|
1245
|
+
return {
|
|
1246
|
+
success: true
|
|
1247
|
+
};
|
|
1248
|
+
} catch (error) {
|
|
1249
|
+
writeFatal("A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
1250
|
+
writeError(`An exception was thrown in the executor's process
|
|
1251
|
+
- Details: ${error.message}
|
|
1252
|
+
- Stacktrace: ${error.stack}`, config);
|
|
1253
|
+
return {
|
|
1254
|
+
success: false
|
|
1255
|
+
};
|
|
1256
|
+
} finally {
|
|
1257
|
+
stopwatch();
|
|
1258
|
+
}
|
|
1259
|
+
}, "withRunExecutor");
|
|
1260
|
+
var _isFunction2 = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) => {
|
|
1261
|
+
try {
|
|
1262
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _95 => _95.constructor]) && _optionalChain([value, 'optionalAccess', _96 => _96.call]) && _optionalChain([value, 'optionalAccess', _97 => _97.apply]));
|
|
1263
|
+
} catch (e) {
|
|
1264
|
+
return false;
|
|
1265
|
+
}
|
|
1266
|
+
}, "_isFunction");
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
exports.LogLevelLabel = LogLevelLabel; exports.StormConfigSchema = StormConfigSchema; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.isVerbose = isVerbose; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.getStopwatch = getStopwatch; exports.applyWorkspaceBaseTokens = applyWorkspaceBaseTokens; exports.applyWorkspaceTokens = applyWorkspaceTokens; exports.run = run; exports.loadStormConfig = loadStormConfig; exports.withRunExecutor = withRunExecutor;
|