@storm-software/cloudflare-tools 0.62.6 → 0.62.8
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 +14 -0
- package/README.md +1 -1
- package/dist/{chunk-RIUVF72K.js → chunk-2HJQOPBD.js} +3 -3
- package/dist/{chunk-TO7L7DYQ.mjs → chunk-3TFLSE7F.mjs} +3 -3
- package/dist/{chunk-2SPHXGUN.mjs → chunk-5M3ADTI2.mjs} +3 -3
- package/dist/{chunk-DPAEOWHQ.mjs → chunk-73HZYEA4.mjs} +1 -1
- package/dist/{chunk-GPAI4NHQ.mjs → chunk-7H2K6PT4.mjs} +12 -5
- package/dist/{chunk-FL2QPQC4.mjs → chunk-AP3T36HW.mjs} +3 -3
- package/dist/{chunk-FF4AKPZG.js → chunk-AWHPIG26.js} +115 -115
- package/dist/{chunk-T3FNKVYU.js → chunk-CQHN27WT.js} +12 -12
- package/dist/{chunk-4P2T735E.js → chunk-DUKBFCWK.js} +2 -2
- package/dist/{chunk-MV24QW26.mjs → chunk-GOL5LHR6.mjs} +52 -15
- package/dist/{chunk-FABNT5TZ.mjs → chunk-JHXH6ZN3.mjs} +1 -1
- package/dist/{chunk-4HW7MBJR.mjs → chunk-LM76YNUF.mjs} +4 -4
- package/dist/{chunk-HBASMEU5.js → chunk-OL65RB72.js} +50 -43
- package/dist/{chunk-FUSFC5AM.js → chunk-Q6WFFOSW.js} +16 -16
- package/dist/{chunk-VPZXQH7S.mjs → chunk-SBZ7AXJK.mjs} +1 -1
- package/dist/{chunk-PZ5CI56F.js → chunk-SQUJ3SXL.js} +55 -18
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +7 -7
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +5 -5
- package/dist/index.js +8 -8
- package/dist/index.mjs +9 -9
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +5 -5
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +5 -5
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +4 -4
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +5 -5
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
- package/dist/tsup.config.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDUKBFCWKjs = require('./chunk-DUKBFCWK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkOL65RB72js = require('./chunk-OL65RB72.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ var _chunkHBASMEU5js = require('./chunk-HBASMEU5.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkSQUJ3SXLjs = require('./chunk-SQUJ3SXL.js');
|
|
16
16
|
|
|
17
17
|
// src/generators/worker/generator.ts
|
|
18
18
|
|
|
@@ -45,20 +45,20 @@ var vitestScript = `"test": "vitest run"`;
|
|
|
45
45
|
|
|
46
46
|
// src/generators/worker/generator.ts
|
|
47
47
|
async function applicationGenerator(tree, schema) {
|
|
48
|
-
const stopwatch =
|
|
48
|
+
const stopwatch = _chunkSQUJ3SXLjs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
49
49
|
let config;
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
_chunkSQUJ3SXLjs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
52
52
|
|
|
53
53
|
`, config);
|
|
54
|
-
const workspaceRoot =
|
|
55
|
-
|
|
54
|
+
const workspaceRoot = _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, );
|
|
55
|
+
_chunkSQUJ3SXLjs.writeDebug.call(void 0,
|
|
56
56
|
`Loading the Storm Config from environment variables and storm.json file...
|
|
57
57
|
- workspaceRoot: ${workspaceRoot}`,
|
|
58
58
|
config
|
|
59
59
|
);
|
|
60
|
-
config = await
|
|
61
|
-
|
|
60
|
+
config = await _chunkOL65RB72js.getConfig.call(void 0, workspaceRoot);
|
|
61
|
+
_chunkSQUJ3SXLjs.writeTrace.call(void 0,
|
|
62
62
|
`Loaded Storm config into env:
|
|
63
63
|
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
|
|
64
64
|
config
|
|
@@ -66,7 +66,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
66
66
|
const options = await normalizeOptions(tree, schema, config);
|
|
67
67
|
const tasks = [];
|
|
68
68
|
tasks.push(
|
|
69
|
-
await
|
|
69
|
+
await _chunkDUKBFCWKjs.generator_default.call(void 0, tree, {
|
|
70
70
|
...options,
|
|
71
71
|
skipFormat: true
|
|
72
72
|
})
|
|
@@ -134,11 +134,11 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
134
134
|
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
135
135
|
} catch (error) {
|
|
136
136
|
return () => {
|
|
137
|
-
|
|
137
|
+
_chunkSQUJ3SXLjs.writeFatal.call(void 0,
|
|
138
138
|
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
139
139
|
config
|
|
140
140
|
);
|
|
141
|
-
|
|
141
|
+
_chunkSQUJ3SXLjs.writeError.call(void 0,
|
|
142
142
|
`An exception was thrown in the generator's process
|
|
143
143
|
- Details: ${error.message}
|
|
144
144
|
- Stacktrace: ${error.stack}`,
|
|
@@ -7,7 +7,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
8
|
module.exports = {
|
|
9
9
|
name: "@storm-software/cloudflare-tools",
|
|
10
|
-
version: "0.62.
|
|
10
|
+
version: "0.62.7",
|
|
11
11
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
12
12
|
repository: {
|
|
13
13
|
type: "github",
|
|
@@ -175,7 +175,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
175
175
|
nx: "catalog:",
|
|
176
176
|
tsup: "catalog:",
|
|
177
177
|
untyped: "catalog:",
|
|
178
|
-
wrangler: "^4.
|
|
178
|
+
wrangler: "^4.15.2"
|
|
179
179
|
},
|
|
180
180
|
publishConfig: {
|
|
181
181
|
access: "public"
|
|
@@ -243,10 +243,10 @@ var LogLevelLabel = {
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
// ../config/src/constants.ts
|
|
246
|
-
var STORM_DEFAULT_DOCS = "https://
|
|
246
|
+
var STORM_DEFAULT_DOCS = "https://stormsoftware.com/docs";
|
|
247
247
|
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
248
248
|
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
249
|
-
var STORM_DEFAULT_LICENSING = "https://
|
|
249
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
250
250
|
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
251
251
|
var STORM_DEFAULT_RELEASE_BANNER = "https://public.storm-cdn.com/brand-banner.png";
|
|
252
252
|
var STORM_DEFAULT_ACCOUNT_TWITTER = "StormSoftwareHQ";
|
|
@@ -420,10 +420,13 @@ var stormWorkspaceConfigSchema = z.object({
|
|
|
420
420
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
421
421
|
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
422
422
|
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
423
|
-
homepage: z.string().trim().url().
|
|
424
|
-
docs: z.string().trim().url().
|
|
425
|
-
licensing: z.string().trim().url().
|
|
426
|
-
contact: z.string().trim().url().
|
|
423
|
+
homepage: z.string().trim().url().optional().describe("The homepage of the workspace"),
|
|
424
|
+
docs: z.string().trim().url().optional().describe("The documentation site for the workspace"),
|
|
425
|
+
licensing: z.string().trim().url().optional().describe("The licensing site for the workspace"),
|
|
426
|
+
contact: z.string().trim().url().optional().describe("The contact site for the workspace"),
|
|
427
|
+
support: z.string().trim().url().optional().describe(
|
|
428
|
+
"The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
429
|
+
),
|
|
427
430
|
branch: z.string().trim().default("main").describe("The branch of the workspace"),
|
|
428
431
|
preid: z.string().optional().describe("A tag specifying the version pre-release identifier"),
|
|
429
432
|
owner: z.string().trim().default("@storm-software/admin").describe("The owner of the package"),
|
|
@@ -522,9 +525,10 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
522
525
|
negative: "#dc2626"
|
|
523
526
|
}
|
|
524
527
|
};
|
|
525
|
-
|
|
528
|
+
async function getPackageJsonConfig(root) {
|
|
526
529
|
let license = STORM_DEFAULT_LICENSE;
|
|
527
|
-
let homepage =
|
|
530
|
+
let homepage = void 0;
|
|
531
|
+
let support = void 0;
|
|
528
532
|
let name = void 0;
|
|
529
533
|
let namespace = void 0;
|
|
530
534
|
let repository = void 0;
|
|
@@ -555,6 +559,13 @@ var getDefaultConfig = async (root) => {
|
|
|
555
559
|
if (packageJson.homepage) {
|
|
556
560
|
homepage = packageJson.homepage;
|
|
557
561
|
}
|
|
562
|
+
if (packageJson.bugs) {
|
|
563
|
+
if (typeof packageJson.bugs === "string") {
|
|
564
|
+
support = packageJson.bugs;
|
|
565
|
+
} else if (packageJson.bugs.url) {
|
|
566
|
+
support = packageJson.bugs.url;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
558
569
|
}
|
|
559
570
|
}
|
|
560
571
|
return {
|
|
@@ -564,13 +575,38 @@ var getDefaultConfig = async (root) => {
|
|
|
564
575
|
repository,
|
|
565
576
|
license,
|
|
566
577
|
homepage,
|
|
567
|
-
|
|
568
|
-
licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`,
|
|
569
|
-
error: {
|
|
570
|
-
url: `${homepage || STORM_DEFAULT_HOMEPAGE}/errors`
|
|
571
|
-
}
|
|
578
|
+
support
|
|
572
579
|
};
|
|
573
|
-
}
|
|
580
|
+
}
|
|
581
|
+
function applyDefaultConfig(config) {
|
|
582
|
+
if (!config.support && config.contact) {
|
|
583
|
+
config.support = config.contact;
|
|
584
|
+
}
|
|
585
|
+
if (!config.contact && config.support) {
|
|
586
|
+
config.contact = config.support;
|
|
587
|
+
}
|
|
588
|
+
if (config.homepage) {
|
|
589
|
+
if (!config.docs) {
|
|
590
|
+
config.docs = `${config.homepage}/docs`;
|
|
591
|
+
}
|
|
592
|
+
if (!config.license) {
|
|
593
|
+
config.license = `${config.homepage}/license`;
|
|
594
|
+
}
|
|
595
|
+
if (!config.support) {
|
|
596
|
+
config.support = `${config.homepage}/support`;
|
|
597
|
+
}
|
|
598
|
+
if (!config.contact) {
|
|
599
|
+
config.contact = `${config.homepage}/contact`;
|
|
600
|
+
}
|
|
601
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
602
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
603
|
+
if (config.homepage) {
|
|
604
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return config;
|
|
609
|
+
}
|
|
574
610
|
|
|
575
611
|
// ../config-tools/src/logger/chalk.ts
|
|
576
612
|
import chalk from "chalk";
|
|
@@ -815,7 +851,8 @@ export {
|
|
|
815
851
|
correctPaths,
|
|
816
852
|
joinPaths,
|
|
817
853
|
findWorkspaceRoot,
|
|
818
|
-
|
|
854
|
+
getPackageJsonConfig,
|
|
855
|
+
applyDefaultConfig,
|
|
819
856
|
getLogLevel,
|
|
820
857
|
getLogLevelLabel,
|
|
821
858
|
writeFatal,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generator_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3TFLSE7F.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7H2K6PT4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
findWorkspaceRoot,
|
|
9
9
|
getStopwatch,
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
writeFatal,
|
|
13
13
|
writeInfo,
|
|
14
14
|
writeTrace
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GOL5LHR6.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__dirname
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-73HZYEA4.mjs";
|
|
19
19
|
|
|
20
20
|
// src/generators/worker/generator.ts
|
|
21
21
|
import {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
var _chunkSQUJ3SXLjs = require('./chunk-SQUJ3SXL.js');
|
|
18
19
|
|
|
19
20
|
// ../config-tools/src/create-storm-config.ts
|
|
20
21
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
@@ -23,7 +24,7 @@ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
|
23
24
|
var _c12 = require('c12');
|
|
24
25
|
|
|
25
26
|
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
26
|
-
const workspacePath = filePath ||
|
|
27
|
+
const workspacePath = filePath || _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, filePath);
|
|
27
28
|
const configs = await Promise.all([
|
|
28
29
|
_c12.loadConfig.call(void 0, {
|
|
29
30
|
cwd: workspacePath,
|
|
@@ -32,7 +33,7 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
32
33
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
33
34
|
jitiOptions: {
|
|
34
35
|
debug: false,
|
|
35
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
36
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkSQUJ3SXLjs.joinPaths.call(void 0,
|
|
36
37
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
37
38
|
"jiti"
|
|
38
39
|
)
|
|
@@ -46,7 +47,7 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
46
47
|
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
47
48
|
jitiOptions: {
|
|
48
49
|
debug: false,
|
|
49
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
50
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkSQUJ3SXLjs.joinPaths.call(void 0,
|
|
50
51
|
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
51
52
|
"jiti"
|
|
52
53
|
)
|
|
@@ -58,12 +59,12 @@ var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
|
58
59
|
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
59
60
|
};
|
|
60
61
|
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
61
|
-
const workspacePath = filePath ? filePath :
|
|
62
|
+
const workspacePath = filePath ? filePath : _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, filePath);
|
|
62
63
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
63
64
|
let config = result.config;
|
|
64
65
|
const configFile = result.configFile;
|
|
65
66
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
66
|
-
|
|
67
|
+
_chunkSQUJ3SXLjs.writeTrace.call(void 0,
|
|
67
68
|
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
68
69
|
{
|
|
69
70
|
logLevel: "all"
|
|
@@ -79,7 +80,7 @@ var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
|
79
80
|
for (const result2 of results) {
|
|
80
81
|
if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
|
|
81
82
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
82
|
-
|
|
83
|
+
_chunkSQUJ3SXLjs.writeTrace.call(void 0,
|
|
83
84
|
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
84
85
|
{
|
|
85
86
|
logLevel: "all"
|
|
@@ -145,17 +146,18 @@ var getConfigEnv = () => {
|
|
|
145
146
|
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
146
147
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
147
148
|
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
149
|
+
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
148
150
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
149
151
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
150
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
151
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
152
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
153
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
152
154
|
directories: {
|
|
153
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
154
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
155
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
156
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
157
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
158
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
155
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
156
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
157
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
158
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
159
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
160
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkSQUJ3SXLjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
159
161
|
},
|
|
160
162
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
161
163
|
mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -180,13 +182,13 @@ var getConfigEnv = () => {
|
|
|
180
182
|
},
|
|
181
183
|
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
182
184
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
183
|
-
) ?
|
|
185
|
+
) ? _chunkSQUJ3SXLjs.getLogLevelLabel.call(void 0,
|
|
184
186
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
185
187
|
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
186
188
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
187
189
|
};
|
|
188
190
|
const themeNames = Object.keys(process.env).filter(
|
|
189
|
-
(envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
191
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkSQUJ3SXLjs.COLOR_KEYS.every(
|
|
190
192
|
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
191
193
|
)
|
|
192
194
|
);
|
|
@@ -197,16 +199,16 @@ var getConfigEnv = () => {
|
|
|
197
199
|
},
|
|
198
200
|
{}
|
|
199
201
|
) : getThemeColorConfigEnv(prefix);
|
|
200
|
-
if (config.docs ===
|
|
201
|
-
if (config.homepage ===
|
|
202
|
-
config.docs = `${
|
|
202
|
+
if (config.docs === _chunkSQUJ3SXLjs.STORM_DEFAULT_DOCS) {
|
|
203
|
+
if (config.homepage === _chunkSQUJ3SXLjs.STORM_DEFAULT_HOMEPAGE) {
|
|
204
|
+
config.docs = `${_chunkSQUJ3SXLjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
203
205
|
} else {
|
|
204
206
|
config.docs = `${config.homepage}/docs`;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
|
-
if (config.licensing ===
|
|
208
|
-
if (config.homepage ===
|
|
209
|
-
config.licensing = `${
|
|
209
|
+
if (config.licensing === _chunkSQUJ3SXLjs.STORM_DEFAULT_LICENSING) {
|
|
210
|
+
if (config.homepage === _chunkSQUJ3SXLjs.STORM_DEFAULT_HOMEPAGE) {
|
|
211
|
+
config.licensing = `${_chunkSQUJ3SXLjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
210
212
|
} else {
|
|
211
213
|
config.licensing = `${config.homepage}/docs`;
|
|
212
214
|
}
|
|
@@ -363,6 +365,9 @@ var setConfigEnv = (config) => {
|
|
|
363
365
|
if (config.contact) {
|
|
364
366
|
process.env[`${prefix}CONTACT`] = config.contact;
|
|
365
367
|
}
|
|
368
|
+
if (config.support) {
|
|
369
|
+
process.env[`${prefix}SUPPORT`] = config.support;
|
|
370
|
+
}
|
|
366
371
|
if (config.timezone) {
|
|
367
372
|
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
368
373
|
process.env.TZ = config.timezone;
|
|
@@ -375,40 +380,40 @@ var setConfigEnv = (config) => {
|
|
|
375
380
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
376
381
|
}
|
|
377
382
|
if (config.configFile) {
|
|
378
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
383
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.configFile);
|
|
379
384
|
}
|
|
380
385
|
if (config.workspaceRoot) {
|
|
381
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
382
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
383
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
386
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
387
|
+
process.env.NX_WORKSPACE_ROOT = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
388
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
384
389
|
}
|
|
385
390
|
if (config.directories) {
|
|
386
391
|
if (!config.skipCache && config.directories.cache) {
|
|
387
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
392
|
+
process.env[`${prefix}CACHE_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0,
|
|
388
393
|
config.directories.cache
|
|
389
394
|
);
|
|
390
395
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
391
396
|
}
|
|
392
397
|
if (config.directories.data) {
|
|
393
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
398
|
+
process.env[`${prefix}DATA_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.directories.data);
|
|
394
399
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
395
400
|
}
|
|
396
401
|
if (config.directories.config) {
|
|
397
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
402
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0,
|
|
398
403
|
config.directories.config
|
|
399
404
|
);
|
|
400
405
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
401
406
|
}
|
|
402
407
|
if (config.directories.temp) {
|
|
403
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
408
|
+
process.env[`${prefix}TEMP_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.directories.temp);
|
|
404
409
|
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
405
410
|
}
|
|
406
411
|
if (config.directories.log) {
|
|
407
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
412
|
+
process.env[`${prefix}LOG_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0, config.directories.log);
|
|
408
413
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
409
414
|
}
|
|
410
415
|
if (config.directories.build) {
|
|
411
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
416
|
+
process.env[`${prefix}BUILD_DIR`] = _chunkSQUJ3SXLjs.correctPaths.call(void 0,
|
|
412
417
|
config.directories.build
|
|
413
418
|
);
|
|
414
419
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
@@ -475,9 +480,9 @@ var setConfigEnv = (config) => {
|
|
|
475
480
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
476
481
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
477
482
|
process.env.NX_VERBOSE_LOGGING = String(
|
|
478
|
-
|
|
483
|
+
_chunkSQUJ3SXLjs.getLogLevel.call(void 0, config.logLevel) >= _chunkSQUJ3SXLjs.LogLevel.DEBUG ? true : false
|
|
479
484
|
);
|
|
480
|
-
process.env.RUST_BACKTRACE =
|
|
485
|
+
process.env.RUST_BACKTRACE = _chunkSQUJ3SXLjs.getLogLevel.call(void 0, config.logLevel) >= _chunkSQUJ3SXLjs.LogLevel.DEBUG ? "full" : "none";
|
|
481
486
|
}
|
|
482
487
|
if (config.skipConfigLogging !== void 0) {
|
|
483
488
|
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
@@ -597,13 +602,13 @@ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, sk
|
|
|
597
602
|
if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
598
603
|
let _workspaceRoot = workspaceRoot;
|
|
599
604
|
if (!_workspaceRoot) {
|
|
600
|
-
_workspaceRoot =
|
|
605
|
+
_workspaceRoot = _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, );
|
|
601
606
|
}
|
|
602
607
|
const configEnv = getConfigEnv();
|
|
603
608
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
604
609
|
if (!configFile) {
|
|
605
610
|
if (!skipLogs) {
|
|
606
|
-
|
|
611
|
+
_chunkSQUJ3SXLjs.writeWarning.call(void 0,
|
|
607
612
|
"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",
|
|
608
613
|
{ logLevel: "all" }
|
|
609
614
|
);
|
|
@@ -612,9 +617,11 @@ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, sk
|
|
|
612
617
|
return void 0;
|
|
613
618
|
}
|
|
614
619
|
}
|
|
615
|
-
const defaultConfig = await
|
|
616
|
-
result =
|
|
617
|
-
|
|
620
|
+
const defaultConfig = await _chunkSQUJ3SXLjs.getPackageJsonConfig.call(void 0, _workspaceRoot);
|
|
621
|
+
result = _chunkSQUJ3SXLjs.applyDefaultConfig.call(void 0,
|
|
622
|
+
await _chunkSQUJ3SXLjs.stormWorkspaceConfigSchema.parseAsync(
|
|
623
|
+
_defu2.default.call(void 0, configEnv, configFile, defaultConfig)
|
|
624
|
+
)
|
|
618
625
|
);
|
|
619
626
|
result.workspaceRoot ??= _workspaceRoot;
|
|
620
627
|
} else {
|
|
@@ -654,9 +661,9 @@ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
|
654
661
|
);
|
|
655
662
|
setConfigEnv(config);
|
|
656
663
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
657
|
-
|
|
664
|
+
_chunkSQUJ3SXLjs.writeTrace.call(void 0,
|
|
658
665
|
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
659
|
-
${
|
|
666
|
+
${_chunkSQUJ3SXLjs.formatLogMessage.call(void 0, config)}`,
|
|
660
667
|
config
|
|
661
668
|
);
|
|
662
669
|
}
|
|
@@ -670,7 +677,7 @@ var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
|
670
677
|
var getWorkspaceConfig = (skipLogs = false, options = {}) => {
|
|
671
678
|
let workspaceRoot = options.workspaceRoot;
|
|
672
679
|
if (!workspaceRoot) {
|
|
673
|
-
workspaceRoot =
|
|
680
|
+
workspaceRoot = _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, options.cwd);
|
|
674
681
|
}
|
|
675
682
|
return getConfig(workspaceRoot, skipLogs);
|
|
676
683
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2HJQOPBDjs = require('./chunk-2HJQOPBD.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkKTFMIXUNjs = require('./chunk-KTFMIXUN.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkOL65RB72js = require('./chunk-OL65RB72.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkSQUJ3SXLjs = require('./chunk-SQUJ3SXL.js');
|
|
19
19
|
|
|
20
20
|
// src/executors/r2-upload-publish/executor.ts
|
|
21
21
|
var _clients3 = require('@aws-sdk/client-s3');
|
|
@@ -39,8 +39,8 @@ async function runExecutor(options, context) {
|
|
|
39
39
|
throw new Error("The executor requires projectsConfigurations.");
|
|
40
40
|
}
|
|
41
41
|
try {
|
|
42
|
-
const workspaceRoot =
|
|
43
|
-
const config = await
|
|
42
|
+
const workspaceRoot = _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, );
|
|
43
|
+
const config = await _chunkOL65RB72js.getConfig.call(void 0, workspaceRoot);
|
|
44
44
|
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
45
45
|
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
46
46
|
const projectDetails = _chunkKTFMIXUNjs.getPackageInfo.call(void 0,
|
|
@@ -79,7 +79,7 @@ async function runExecutor(options, context) {
|
|
|
79
79
|
"The executor failed because the project graph is not available. Please run the build command again."
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
_chunkSQUJ3SXLjs.writeInfo.call(void 0,
|
|
83
83
|
`Publishing ${context.projectName} to the Storm Registry at ${endpoint}`
|
|
84
84
|
);
|
|
85
85
|
const s3Client = new (0, _clients3.S3)({
|
|
@@ -91,12 +91,12 @@ async function runExecutor(options, context) {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
|
|
94
|
-
|
|
94
|
+
_chunkSQUJ3SXLjs.writeInfo.call(void 0, `Generated component version: ${version}`);
|
|
95
95
|
const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
|
|
96
96
|
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
97
97
|
});
|
|
98
98
|
const projectPath = `registry/${context.projectName}`;
|
|
99
|
-
const internalDependencies = await
|
|
99
|
+
const internalDependencies = await _chunk2HJQOPBDjs.getInternalDependencies.call(void 0,
|
|
100
100
|
context.projectName,
|
|
101
101
|
projectGraph
|
|
102
102
|
);
|
|
@@ -109,14 +109,14 @@ async function runExecutor(options, context) {
|
|
|
109
109
|
return ret;
|
|
110
110
|
}, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
|
|
111
111
|
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
112
|
-
|
|
112
|
+
_chunkSQUJ3SXLjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
|
|
113
113
|
if (!isDryRun) {
|
|
114
114
|
const response = await s3Client.listObjects({
|
|
115
115
|
Bucket: options.bucketId,
|
|
116
116
|
Prefix: projectPath
|
|
117
117
|
});
|
|
118
118
|
if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
|
|
119
|
-
|
|
119
|
+
_chunkSQUJ3SXLjs.writeDebug.call(void 0,
|
|
120
120
|
`Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`
|
|
121
121
|
);
|
|
122
122
|
await Promise.all(
|
|
@@ -135,12 +135,12 @@ async function runExecutor(options, context) {
|
|
|
135
135
|
)
|
|
136
136
|
);
|
|
137
137
|
} else {
|
|
138
|
-
|
|
138
|
+
_chunkSQUJ3SXLjs.writeDebug.call(void 0,
|
|
139
139
|
`No existing items to delete in the component registry path ${projectPath}`
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
} else {
|
|
143
|
-
|
|
143
|
+
_chunkSQUJ3SXLjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
144
144
|
}
|
|
145
145
|
const meta = {
|
|
146
146
|
name: context.projectName,
|
|
@@ -158,9 +158,9 @@ async function runExecutor(options, context) {
|
|
|
158
158
|
meta.devDependencies = projectDetails.content.devDependencies;
|
|
159
159
|
}
|
|
160
160
|
const metaJson = JSON.stringify(meta);
|
|
161
|
-
|
|
161
|
+
_chunkSQUJ3SXLjs.writeInfo.call(void 0, `Generating meta.json file:
|
|
162
162
|
${metaJson}`);
|
|
163
|
-
await
|
|
163
|
+
await _chunk2HJQOPBDjs.r2UploadFile.call(void 0,
|
|
164
164
|
s3Client,
|
|
165
165
|
options.bucketId,
|
|
166
166
|
projectPath,
|
|
@@ -174,7 +174,7 @@ ${metaJson}`);
|
|
|
174
174
|
files.map((file) => {
|
|
175
175
|
const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
|
|
176
176
|
return _promises.readFile.call(void 0, file, { encoding: "utf8" }).then(
|
|
177
|
-
(fileContent) =>
|
|
177
|
+
(fileContent) => _chunk2HJQOPBDjs.r2UploadFile.call(void 0,
|
|
178
178
|
s3Client,
|
|
179
179
|
options.bucketId,
|
|
180
180
|
projectPath,
|
|
@@ -187,7 +187,7 @@ ${metaJson}`);
|
|
|
187
187
|
);
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
_chunkSQUJ3SXLjs.writeSuccess.call(void 0,
|
|
191
191
|
`Successfully uploaded the ${projectName} component to the Cyclone Registry`,
|
|
192
192
|
config
|
|
193
193
|
);
|