@storm-software/cloudflare-tools 0.63.55 → 0.63.62
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 +56 -0
- package/README.md +1 -2
- package/dist/chunk-2CDSXWFA.js +311 -0
- package/dist/{chunk-Q5XL7K7Z.mjs → chunk-47LTDAIV.mjs} +4 -4
- package/dist/{chunk-MB54NXKO.mjs → chunk-7ZAYEHFL.mjs} +11 -9
- package/dist/{chunk-AOAXSMD4.js → chunk-FULKT5FT.js} +121 -119
- package/dist/{chunk-TOB7OQN4.js → chunk-FVFZRRXE.js} +1 -1
- package/dist/{chunk-BRPTGDS4.mjs → chunk-IANDAPQS.mjs} +1 -1
- package/dist/{chunk-ADVG6LVE.mjs → chunk-LJBM3BJ3.mjs} +650 -14
- package/dist/chunk-MHMPOWJN.js +1370 -0
- package/dist/{chunk-57WTY3UY.js → chunk-NCQM44P3.js} +3 -3
- package/dist/{chunk-HSHWXMVT.mjs → chunk-OULGED23.mjs} +4 -4
- package/dist/{chunk-P45GT4VW.js → chunk-Q5A6EYKA.js} +12 -12
- package/dist/{chunk-X2ML265T.js → chunk-R6LCC4LT.js} +16 -16
- package/dist/{chunk-5GUQUTLT.mjs → chunk-TGT6YRXK.mjs} +1 -1
- package/dist/chunk-V44DYGWX.mjs +311 -0
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-AZSS2TUS.mjs +0 -879
- package/dist/chunk-KDRIR55G.js +0 -879
- package/dist/chunk-UOEUE2GI.js +0 -734
package/dist/chunk-UOEUE2GI.js
DELETED
|
@@ -1,734 +0,0 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkKDRIR55Gjs = require('./chunk-KDRIR55G.js');
|
|
19
|
-
|
|
20
|
-
// ../config-tools/src/create-storm-config.ts
|
|
21
|
-
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
22
|
-
|
|
23
|
-
// ../config-tools/src/config-file/get-config-file.ts
|
|
24
|
-
var _c12 = require('c12');
|
|
25
|
-
|
|
26
|
-
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
27
|
-
const workspacePath = filePath || _chunkKDRIR55Gjs.findWorkspaceRoot.call(void 0, filePath);
|
|
28
|
-
const configs = await Promise.all([
|
|
29
|
-
_c12.loadConfig.call(void 0, {
|
|
30
|
-
cwd: workspacePath,
|
|
31
|
-
packageJson: true,
|
|
32
|
-
name: fileName,
|
|
33
|
-
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
34
|
-
jitiOptions: {
|
|
35
|
-
debug: false,
|
|
36
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkKDRIR55Gjs.joinPaths.call(void 0,
|
|
37
|
-
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
38
|
-
"jiti"
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
...options
|
|
42
|
-
}),
|
|
43
|
-
_c12.loadConfig.call(void 0, {
|
|
44
|
-
cwd: workspacePath,
|
|
45
|
-
packageJson: true,
|
|
46
|
-
name: fileName,
|
|
47
|
-
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
48
|
-
jitiOptions: {
|
|
49
|
-
debug: false,
|
|
50
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkKDRIR55Gjs.joinPaths.call(void 0,
|
|
51
|
-
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
52
|
-
"jiti"
|
|
53
|
-
)
|
|
54
|
-
},
|
|
55
|
-
configFile: fileName,
|
|
56
|
-
...options
|
|
57
|
-
})
|
|
58
|
-
]);
|
|
59
|
-
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
60
|
-
};
|
|
61
|
-
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
62
|
-
const workspacePath = filePath ? filePath : _chunkKDRIR55Gjs.findWorkspaceRoot.call(void 0, filePath);
|
|
63
|
-
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
64
|
-
let config = result.config;
|
|
65
|
-
const configFile = result.configFile;
|
|
66
|
-
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
67
|
-
_chunkKDRIR55Gjs.writeTrace.call(void 0,
|
|
68
|
-
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
69
|
-
{
|
|
70
|
-
logLevel: "all"
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
75
|
-
const results = await Promise.all(
|
|
76
|
-
additionalFileNames.map(
|
|
77
|
-
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
78
|
-
)
|
|
79
|
-
);
|
|
80
|
-
for (const result2 of results) {
|
|
81
|
-
if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
|
|
82
|
-
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
83
|
-
_chunkKDRIR55Gjs.writeTrace.call(void 0,
|
|
84
|
-
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
85
|
-
{
|
|
86
|
-
logLevel: "all"
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (!config || Object.keys(config).length === 0) {
|
|
95
|
-
return void 0;
|
|
96
|
-
}
|
|
97
|
-
config.configFile = configFile;
|
|
98
|
-
return config;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// ../config-tools/src/env/get-env.ts
|
|
102
|
-
var getExtensionEnv = (extensionName) => {
|
|
103
|
-
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
104
|
-
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
105
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
106
|
-
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
107
|
-
).join("");
|
|
108
|
-
if (name) {
|
|
109
|
-
ret[name] = process.env[key];
|
|
110
|
-
}
|
|
111
|
-
return ret;
|
|
112
|
-
}, {});
|
|
113
|
-
};
|
|
114
|
-
var getConfigEnv = () => {
|
|
115
|
-
const prefix = "STORM_";
|
|
116
|
-
let config = {
|
|
117
|
-
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
118
|
-
name: process.env[`${prefix}NAME`] || void 0,
|
|
119
|
-
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
120
|
-
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
121
|
-
bot: {
|
|
122
|
-
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
123
|
-
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
124
|
-
},
|
|
125
|
-
release: {
|
|
126
|
-
banner: process.env[`${prefix}RELEASE_BANNER`] || void 0,
|
|
127
|
-
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
128
|
-
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
129
|
-
},
|
|
130
|
-
error: {
|
|
131
|
-
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
132
|
-
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
133
|
-
},
|
|
134
|
-
socials: {
|
|
135
|
-
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
136
|
-
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
137
|
-
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
138
|
-
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
139
|
-
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
140
|
-
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
141
|
-
},
|
|
142
|
-
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
|
|
143
|
-
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
144
|
-
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
145
|
-
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
146
|
-
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
147
|
-
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
148
|
-
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
149
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
150
|
-
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
151
|
-
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
152
|
-
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
153
|
-
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
154
|
-
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
155
|
-
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
156
|
-
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
157
|
-
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
158
|
-
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
159
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
160
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
161
|
-
directories: {
|
|
162
|
-
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
163
|
-
data: process.env[`${prefix}DATA_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
164
|
-
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
165
|
-
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
166
|
-
log: process.env[`${prefix}LOG_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
167
|
-
build: process.env[`${prefix}BUILD_DIR`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkKDRIR55Gjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
168
|
-
},
|
|
169
|
-
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
170
|
-
mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
171
|
-
// ci:
|
|
172
|
-
// process.env[`${prefix}CI`] !== undefined
|
|
173
|
-
// ? Boolean(
|
|
174
|
-
// process.env[`${prefix}CI`] ??
|
|
175
|
-
// process.env.CI ??
|
|
176
|
-
// process.env.CONTINUOUS_INTEGRATION
|
|
177
|
-
// )
|
|
178
|
-
// : undefined,
|
|
179
|
-
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
180
|
-
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
181
|
-
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
182
|
-
registry: {
|
|
183
|
-
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
184
|
-
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
185
|
-
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
186
|
-
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
187
|
-
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
188
|
-
},
|
|
189
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
190
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
191
|
-
) ? _chunkKDRIR55Gjs.getLogLevelLabel.call(void 0,
|
|
192
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
193
|
-
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
194
|
-
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
195
|
-
};
|
|
196
|
-
const themeNames = Object.keys(process.env).filter(
|
|
197
|
-
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkKDRIR55Gjs.COLOR_KEYS.every(
|
|
198
|
-
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
199
|
-
)
|
|
200
|
-
);
|
|
201
|
-
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
202
|
-
(ret, themeName) => {
|
|
203
|
-
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
204
|
-
return ret;
|
|
205
|
-
},
|
|
206
|
-
{}
|
|
207
|
-
) : getThemeColorConfigEnv(prefix);
|
|
208
|
-
if (config.docs === _chunkKDRIR55Gjs.STORM_DEFAULT_DOCS) {
|
|
209
|
-
if (config.homepage === _chunkKDRIR55Gjs.STORM_DEFAULT_HOMEPAGE) {
|
|
210
|
-
config.docs = `${_chunkKDRIR55Gjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
211
|
-
} else {
|
|
212
|
-
config.docs = `${config.homepage}/docs`;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (config.licensing === _chunkKDRIR55Gjs.STORM_DEFAULT_LICENSING) {
|
|
216
|
-
if (config.homepage === _chunkKDRIR55Gjs.STORM_DEFAULT_HOMEPAGE) {
|
|
217
|
-
config.licensing = `${_chunkKDRIR55Gjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
218
|
-
} else {
|
|
219
|
-
config.licensing = `${config.homepage}/docs`;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
223
|
-
if (serializedConfig) {
|
|
224
|
-
const parsed = JSON.parse(serializedConfig);
|
|
225
|
-
config = {
|
|
226
|
-
...config,
|
|
227
|
-
...parsed,
|
|
228
|
-
colors: { ...config.colors, ...parsed.colors },
|
|
229
|
-
extensions: { ...config.extensions, ...parsed.extensions }
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
return config;
|
|
233
|
-
};
|
|
234
|
-
var getThemeColorConfigEnv = (prefix, theme) => {
|
|
235
|
-
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
236
|
-
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
237
|
-
};
|
|
238
|
-
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
239
|
-
return {
|
|
240
|
-
dark: process.env[`${prefix}DARK`],
|
|
241
|
-
light: process.env[`${prefix}LIGHT`],
|
|
242
|
-
brand: process.env[`${prefix}BRAND`],
|
|
243
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
244
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
245
|
-
link: process.env[`${prefix}LINK`],
|
|
246
|
-
help: process.env[`${prefix}HELP`],
|
|
247
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
248
|
-
info: process.env[`${prefix}INFO`],
|
|
249
|
-
warning: process.env[`${prefix}WARNING`],
|
|
250
|
-
danger: process.env[`${prefix}DANGER`],
|
|
251
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
252
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
253
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
257
|
-
return {
|
|
258
|
-
light: getBaseThemeColorConfigEnv(
|
|
259
|
-
`${prefix}_LIGHT_`
|
|
260
|
-
),
|
|
261
|
-
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
262
|
-
};
|
|
263
|
-
};
|
|
264
|
-
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
265
|
-
return {
|
|
266
|
-
foreground: process.env[`${prefix}FOREGROUND`],
|
|
267
|
-
background: process.env[`${prefix}BACKGROUND`],
|
|
268
|
-
brand: process.env[`${prefix}BRAND`],
|
|
269
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
270
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
271
|
-
link: process.env[`${prefix}LINK`],
|
|
272
|
-
help: process.env[`${prefix}HELP`],
|
|
273
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
274
|
-
info: process.env[`${prefix}INFO`],
|
|
275
|
-
warning: process.env[`${prefix}WARNING`],
|
|
276
|
-
danger: process.env[`${prefix}DANGER`],
|
|
277
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
278
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
279
|
-
negative: process.env[`${prefix}NEGATIVE`]
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
// ../config-tools/src/env/set-env.ts
|
|
284
|
-
var setExtensionEnv = (extensionName, extension) => {
|
|
285
|
-
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
286
|
-
if (extension[key]) {
|
|
287
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _7 => _7.replace, 'call', _8 => _8(
|
|
288
|
-
/([A-Z])+/g,
|
|
289
|
-
(input) => input ? _optionalChain([input, 'access', _9 => _9[0], 'optionalAccess', _10 => _10.toUpperCase, 'call', _11 => _11()]) + input.slice(1) : ""
|
|
290
|
-
), 'access', _12 => _12.split, 'call', _13 => _13(/(?=[A-Z])|[.\-\s_]/), 'access', _14 => _14.map, 'call', _15 => _15((x) => x.toLowerCase())]), () => ( []));
|
|
291
|
-
let extensionKey;
|
|
292
|
-
if (result.length === 0) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
if (result.length === 1) {
|
|
296
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _16 => _16[0], 'optionalAccess', _17 => _17.toUpperCase, 'call', _18 => _18()]), () => ( ""));
|
|
297
|
-
} else {
|
|
298
|
-
extensionKey = result.reduce((ret, part) => {
|
|
299
|
-
return `${ret}_${part.toLowerCase()}`;
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
var setConfigEnv = (config) => {
|
|
307
|
-
const prefix = "STORM_";
|
|
308
|
-
if (config.extends) {
|
|
309
|
-
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
310
|
-
}
|
|
311
|
-
if (config.name) {
|
|
312
|
-
process.env[`${prefix}NAME`] = config.name;
|
|
313
|
-
}
|
|
314
|
-
if (config.namespace) {
|
|
315
|
-
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
316
|
-
}
|
|
317
|
-
if (config.owner) {
|
|
318
|
-
process.env[`${prefix}OWNER`] = config.owner;
|
|
319
|
-
}
|
|
320
|
-
if (config.bot) {
|
|
321
|
-
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
322
|
-
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
323
|
-
}
|
|
324
|
-
if (config.error) {
|
|
325
|
-
process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
|
|
326
|
-
process.env[`${prefix}ERROR_URL`] = config.error.url;
|
|
327
|
-
}
|
|
328
|
-
if (config.release) {
|
|
329
|
-
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
|
|
330
|
-
process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
|
|
331
|
-
process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
|
|
332
|
-
}
|
|
333
|
-
if (config.socials) {
|
|
334
|
-
if (config.socials.twitter) {
|
|
335
|
-
process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
|
|
336
|
-
}
|
|
337
|
-
if (config.socials.discord) {
|
|
338
|
-
process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
|
|
339
|
-
}
|
|
340
|
-
if (config.socials.telegram) {
|
|
341
|
-
process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
|
|
342
|
-
}
|
|
343
|
-
if (config.socials.slack) {
|
|
344
|
-
process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
|
|
345
|
-
}
|
|
346
|
-
if (config.socials.medium) {
|
|
347
|
-
process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
|
|
348
|
-
}
|
|
349
|
-
if (config.socials.github) {
|
|
350
|
-
process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
if (config.organization) {
|
|
354
|
-
if (typeof config.organization === "string") {
|
|
355
|
-
process.env[`${prefix}ORG`] = config.organization;
|
|
356
|
-
process.env[`${prefix}ORG_NAME`] = config.organization;
|
|
357
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
358
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
|
|
359
|
-
} else {
|
|
360
|
-
process.env[`${prefix}ORG`] = config.organization.name;
|
|
361
|
-
process.env[`${prefix}ORG_NAME`] = config.organization.name;
|
|
362
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization.name;
|
|
363
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
|
|
364
|
-
if (config.organization.url) {
|
|
365
|
-
process.env[`${prefix}ORG_URL`] = config.organization.url;
|
|
366
|
-
process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
|
|
367
|
-
}
|
|
368
|
-
if (config.organization.description) {
|
|
369
|
-
process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
|
|
370
|
-
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
|
|
371
|
-
}
|
|
372
|
-
if (config.organization.logo) {
|
|
373
|
-
process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
|
|
374
|
-
process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
|
|
375
|
-
}
|
|
376
|
-
if (config.organization.icon) {
|
|
377
|
-
process.env[`${prefix}ORG_ICON`] = config.organization.icon;
|
|
378
|
-
process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (config.packageManager) {
|
|
383
|
-
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
384
|
-
}
|
|
385
|
-
if (config.license) {
|
|
386
|
-
process.env[`${prefix}LICENSE`] = config.license;
|
|
387
|
-
}
|
|
388
|
-
if (config.homepage) {
|
|
389
|
-
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
390
|
-
}
|
|
391
|
-
if (config.docs) {
|
|
392
|
-
process.env[`${prefix}DOCS`] = config.docs;
|
|
393
|
-
}
|
|
394
|
-
if (config.portal) {
|
|
395
|
-
process.env[`${prefix}PORTAL`] = config.portal;
|
|
396
|
-
}
|
|
397
|
-
if (config.licensing) {
|
|
398
|
-
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
399
|
-
}
|
|
400
|
-
if (config.contact) {
|
|
401
|
-
process.env[`${prefix}CONTACT`] = config.contact;
|
|
402
|
-
}
|
|
403
|
-
if (config.support) {
|
|
404
|
-
process.env[`${prefix}SUPPORT`] = config.support;
|
|
405
|
-
}
|
|
406
|
-
if (config.timezone) {
|
|
407
|
-
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
408
|
-
process.env.TZ = config.timezone;
|
|
409
|
-
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
410
|
-
}
|
|
411
|
-
if (config.locale) {
|
|
412
|
-
process.env[`${prefix}LOCALE`] = config.locale;
|
|
413
|
-
process.env.LOCALE = config.locale;
|
|
414
|
-
process.env.DEFAULT_LOCALE = config.locale;
|
|
415
|
-
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
416
|
-
}
|
|
417
|
-
if (config.configFile) {
|
|
418
|
-
process.env[`${prefix}CONFIG_FILE`] = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.configFile);
|
|
419
|
-
}
|
|
420
|
-
if (config.workspaceRoot) {
|
|
421
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
422
|
-
process.env.NX_WORKSPACE_ROOT = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
423
|
-
process.env.NX_WORKSPACE_ROOT_PATH = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
424
|
-
}
|
|
425
|
-
if (config.directories) {
|
|
426
|
-
if (!config.skipCache && config.directories.cache) {
|
|
427
|
-
process.env[`${prefix}CACHE_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0,
|
|
428
|
-
config.directories.cache
|
|
429
|
-
);
|
|
430
|
-
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
431
|
-
}
|
|
432
|
-
if (config.directories.data) {
|
|
433
|
-
process.env[`${prefix}DATA_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.directories.data);
|
|
434
|
-
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
435
|
-
}
|
|
436
|
-
if (config.directories.config) {
|
|
437
|
-
process.env[`${prefix}CONFIG_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0,
|
|
438
|
-
config.directories.config
|
|
439
|
-
);
|
|
440
|
-
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
441
|
-
}
|
|
442
|
-
if (config.directories.temp) {
|
|
443
|
-
process.env[`${prefix}TEMP_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.directories.temp);
|
|
444
|
-
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
445
|
-
}
|
|
446
|
-
if (config.directories.log) {
|
|
447
|
-
process.env[`${prefix}LOG_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0, config.directories.log);
|
|
448
|
-
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
449
|
-
}
|
|
450
|
-
if (config.directories.build) {
|
|
451
|
-
process.env[`${prefix}BUILD_DIR`] = _chunkKDRIR55Gjs.correctPaths.call(void 0,
|
|
452
|
-
config.directories.build
|
|
453
|
-
);
|
|
454
|
-
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (config.skipCache !== void 0) {
|
|
458
|
-
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
459
|
-
if (config.skipCache) {
|
|
460
|
-
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
461
|
-
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
if (config.mode) {
|
|
465
|
-
process.env[`${prefix}MODE`] = config.mode;
|
|
466
|
-
process.env.NODE_ENV = config.mode;
|
|
467
|
-
process.env.ENVIRONMENT = config.mode;
|
|
468
|
-
}
|
|
469
|
-
if (_optionalChain([config, 'access', _19 => _19.colors, 'optionalAccess', _20 => _20.base, 'optionalAccess', _21 => _21.light]) || _optionalChain([config, 'access', _22 => _22.colors, 'optionalAccess', _23 => _23.base, 'optionalAccess', _24 => _24.dark])) {
|
|
470
|
-
for (const key of Object.keys(config.colors)) {
|
|
471
|
-
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
472
|
-
}
|
|
473
|
-
} else {
|
|
474
|
-
setThemeColorConfigEnv(
|
|
475
|
-
`${prefix}COLOR_`,
|
|
476
|
-
config.colors
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
if (config.repository) {
|
|
480
|
-
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
481
|
-
}
|
|
482
|
-
if (config.branch) {
|
|
483
|
-
process.env[`${prefix}BRANCH`] = config.branch;
|
|
484
|
-
}
|
|
485
|
-
if (config.preid) {
|
|
486
|
-
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
487
|
-
}
|
|
488
|
-
if (config.registry) {
|
|
489
|
-
if (config.registry.github) {
|
|
490
|
-
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
491
|
-
}
|
|
492
|
-
if (config.registry.npm) {
|
|
493
|
-
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
494
|
-
}
|
|
495
|
-
if (config.registry.cargo) {
|
|
496
|
-
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
497
|
-
}
|
|
498
|
-
if (config.registry.cyclone) {
|
|
499
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
500
|
-
config.registry.cyclone
|
|
501
|
-
);
|
|
502
|
-
}
|
|
503
|
-
if (config.registry.container) {
|
|
504
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
505
|
-
config.registry.container
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
if (config.logLevel) {
|
|
510
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
511
|
-
process.env.LOG_LEVEL = String(config.logLevel);
|
|
512
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
513
|
-
_chunkKDRIR55Gjs.getLogLevel.call(void 0, config.logLevel) >= _chunkKDRIR55Gjs.LogLevel.DEBUG ? true : false
|
|
514
|
-
);
|
|
515
|
-
process.env.RUST_BACKTRACE = _chunkKDRIR55Gjs.getLogLevel.call(void 0, config.logLevel) >= _chunkKDRIR55Gjs.LogLevel.DEBUG ? "full" : "none";
|
|
516
|
-
}
|
|
517
|
-
if (config.skipConfigLogging !== void 0) {
|
|
518
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
519
|
-
config.skipConfigLogging
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
523
|
-
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
524
|
-
if (config.extensions[key] && Object.keys(config.extensions[key])) {
|
|
525
|
-
setExtensionEnv(key, config.extensions[key]);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
var setThemeColorConfigEnv = (prefix, config) => {
|
|
530
|
-
return _optionalChain([config, 'optionalAccess', _25 => _25.light, 'optionalAccess', _26 => _26.brand]) || _optionalChain([config, 'optionalAccess', _27 => _27.dark, 'optionalAccess', _28 => _28.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
531
|
-
};
|
|
532
|
-
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
533
|
-
if (config.dark) {
|
|
534
|
-
process.env[`${prefix}DARK`] = config.dark;
|
|
535
|
-
}
|
|
536
|
-
if (config.light) {
|
|
537
|
-
process.env[`${prefix}LIGHT`] = config.light;
|
|
538
|
-
}
|
|
539
|
-
if (config.brand) {
|
|
540
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
541
|
-
}
|
|
542
|
-
if (config.alternate) {
|
|
543
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
544
|
-
}
|
|
545
|
-
if (config.accent) {
|
|
546
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
547
|
-
}
|
|
548
|
-
if (config.link) {
|
|
549
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
550
|
-
}
|
|
551
|
-
if (config.help) {
|
|
552
|
-
process.env[`${prefix}HELP`] = config.help;
|
|
553
|
-
}
|
|
554
|
-
if (config.success) {
|
|
555
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
556
|
-
}
|
|
557
|
-
if (config.info) {
|
|
558
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
559
|
-
}
|
|
560
|
-
if (config.warning) {
|
|
561
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
562
|
-
}
|
|
563
|
-
if (config.danger) {
|
|
564
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
565
|
-
}
|
|
566
|
-
if (config.fatal) {
|
|
567
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
568
|
-
}
|
|
569
|
-
if (config.positive) {
|
|
570
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
571
|
-
}
|
|
572
|
-
if (config.negative) {
|
|
573
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
577
|
-
return {
|
|
578
|
-
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
579
|
-
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
580
|
-
};
|
|
581
|
-
};
|
|
582
|
-
var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
583
|
-
if (config.foreground) {
|
|
584
|
-
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
585
|
-
}
|
|
586
|
-
if (config.background) {
|
|
587
|
-
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
588
|
-
}
|
|
589
|
-
if (config.brand) {
|
|
590
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
591
|
-
}
|
|
592
|
-
if (config.alternate) {
|
|
593
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
594
|
-
}
|
|
595
|
-
if (config.accent) {
|
|
596
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
597
|
-
}
|
|
598
|
-
if (config.link) {
|
|
599
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
600
|
-
}
|
|
601
|
-
if (config.help) {
|
|
602
|
-
process.env[`${prefix}HELP`] = config.help;
|
|
603
|
-
}
|
|
604
|
-
if (config.success) {
|
|
605
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
606
|
-
}
|
|
607
|
-
if (config.info) {
|
|
608
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
609
|
-
}
|
|
610
|
-
if (config.warning) {
|
|
611
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
612
|
-
}
|
|
613
|
-
if (config.danger) {
|
|
614
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
615
|
-
}
|
|
616
|
-
if (config.fatal) {
|
|
617
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
618
|
-
}
|
|
619
|
-
if (config.positive) {
|
|
620
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
621
|
-
}
|
|
622
|
-
if (config.negative) {
|
|
623
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
624
|
-
}
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
// ../config-tools/src/create-storm-config.ts
|
|
628
|
-
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
629
|
-
var _static_cache = void 0;
|
|
630
|
-
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
631
|
-
let result;
|
|
632
|
-
if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
633
|
-
let _workspaceRoot = workspaceRoot;
|
|
634
|
-
if (!_workspaceRoot) {
|
|
635
|
-
_workspaceRoot = _chunkKDRIR55Gjs.findWorkspaceRoot.call(void 0, );
|
|
636
|
-
}
|
|
637
|
-
const configEnv = getConfigEnv();
|
|
638
|
-
const configFile = await getConfigFile(_workspaceRoot);
|
|
639
|
-
if (!configFile) {
|
|
640
|
-
if (!skipLogs) {
|
|
641
|
-
_chunkKDRIR55Gjs.writeWarning.call(void 0,
|
|
642
|
-
"No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
|
|
643
|
-
{ logLevel: "all" }
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
|
-
if (useDefault === false) {
|
|
647
|
-
return void 0;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
const defaultConfig = await _chunkKDRIR55Gjs.getPackageJsonConfig.call(void 0, _workspaceRoot);
|
|
651
|
-
const configInput = _defu2.default.call(void 0,
|
|
652
|
-
configEnv,
|
|
653
|
-
configFile,
|
|
654
|
-
defaultConfig
|
|
655
|
-
);
|
|
656
|
-
try {
|
|
657
|
-
result = _chunkKDRIR55Gjs.applyDefaultConfig.call(void 0,
|
|
658
|
-
await _chunkKDRIR55Gjs.stormWorkspaceConfigSchema.parseAsync(configInput)
|
|
659
|
-
);
|
|
660
|
-
result.workspaceRoot ??= _workspaceRoot;
|
|
661
|
-
} catch (error) {
|
|
662
|
-
throw new Error(
|
|
663
|
-
`Failed to parse Storm Workspace configuration${_optionalChain([error, 'optionalAccess', _31 => _31.message]) ? `: ${error.message}` : ""}
|
|
664
|
-
|
|
665
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${_chunkKDRIR55Gjs.formatLogMessage.call(void 0,
|
|
666
|
-
configInput
|
|
667
|
-
)}`,
|
|
668
|
-
{
|
|
669
|
-
cause: error
|
|
670
|
-
}
|
|
671
|
-
);
|
|
672
|
-
}
|
|
673
|
-
} else {
|
|
674
|
-
result = _static_cache.data;
|
|
675
|
-
}
|
|
676
|
-
if (schema && extensionName) {
|
|
677
|
-
result.extensions = {
|
|
678
|
-
...result.extensions,
|
|
679
|
-
[extensionName]: createConfigExtension(extensionName, schema)
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
_static_cache = {
|
|
683
|
-
timestamp: Date.now(),
|
|
684
|
-
data: result
|
|
685
|
-
};
|
|
686
|
-
return result;
|
|
687
|
-
};
|
|
688
|
-
var createConfigExtension = (extensionName, schema) => {
|
|
689
|
-
const extension_cache_key = { extensionName };
|
|
690
|
-
if (_extension_cache.has(extension_cache_key)) {
|
|
691
|
-
return _extension_cache.get(extension_cache_key);
|
|
692
|
-
}
|
|
693
|
-
let extension = getExtensionEnv(extensionName);
|
|
694
|
-
if (schema) {
|
|
695
|
-
extension = schema.parse(extension);
|
|
696
|
-
}
|
|
697
|
-
_extension_cache.set(extension_cache_key, extension);
|
|
698
|
-
return extension;
|
|
699
|
-
};
|
|
700
|
-
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
701
|
-
const config = await createStormWorkspaceConfig(
|
|
702
|
-
void 0,
|
|
703
|
-
void 0,
|
|
704
|
-
workspaceRoot,
|
|
705
|
-
skipLogs,
|
|
706
|
-
true
|
|
707
|
-
);
|
|
708
|
-
setConfigEnv(config);
|
|
709
|
-
if (!skipLogs && !config.skipConfigLogging) {
|
|
710
|
-
_chunkKDRIR55Gjs.writeTrace.call(void 0,
|
|
711
|
-
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
712
|
-
${_chunkKDRIR55Gjs.formatLogMessage.call(void 0, config)}`,
|
|
713
|
-
config
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
return config;
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
// ../config-tools/src/get-config.ts
|
|
720
|
-
var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
721
|
-
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
722
|
-
};
|
|
723
|
-
var getWorkspaceConfig = (skipLogs = true, options = {}) => {
|
|
724
|
-
let workspaceRoot = options.workspaceRoot;
|
|
725
|
-
if (!workspaceRoot) {
|
|
726
|
-
workspaceRoot = _chunkKDRIR55Gjs.findWorkspaceRoot.call(void 0, options.cwd);
|
|
727
|
-
}
|
|
728
|
-
return getConfig(workspaceRoot, skipLogs);
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
exports.getConfig = getConfig; exports.getWorkspaceConfig = getWorkspaceConfig;
|