@storm-software/cloudflare-tools 0.54.2 → 0.54.4
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 +12 -0
- package/README.md +1 -1
- package/dist/{chunk-KVL4WOIH.mjs → chunk-23YXGFBU.mjs} +1 -1
- package/dist/{chunk-ZPVFJJMY.js → chunk-4FP3SZAK.js} +12 -12
- package/dist/{chunk-H63GI4CR.js → chunk-BM5BCBD5.js} +3 -3
- package/dist/{chunk-6OLSW63F.mjs → chunk-CYTUL65E.mjs} +1 -1
- package/dist/{chunk-THKJZT32.js → chunk-DFG3KJWS.js} +119 -70
- package/dist/{chunk-6H63LE3D.mjs → chunk-DQHMNZ47.mjs} +88 -39
- package/dist/{chunk-W6YNIJQD.js → chunk-ILLCSSWN.js} +20 -17
- package/dist/{chunk-3D3WO4IH.mjs → chunk-IXEWBCGZ.mjs} +17 -14
- package/dist/{chunk-U6QKP7CG.js → chunk-LXXVBXFM.js} +16 -16
- package/dist/{chunk-WL2BHAOY.js → chunk-PR2M4S7F.js} +1 -1
- package/dist/{chunk-H43VNU3H.js → chunk-TDFLX6AI.js} +211 -248
- package/dist/{chunk-UJORUWGK.mjs → chunk-WG5F7OJK.mjs} +5 -5
- package/dist/{chunk-BGWUN6JU.mjs → chunk-XIDK2YZE.mjs} +5 -5
- package/dist/{chunk-CU5DCV52.mjs → chunk-YBA7ROY5.mjs} +35 -72
- 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.d.mts +3 -3
- package/dist/src/executors/serve/executor.d.ts +3 -3
- 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 +1 -1
|
@@ -205,6 +205,8 @@ var ColorConfigMapSchema = _zod2.default.union([
|
|
|
205
205
|
}),
|
|
206
206
|
_zod2.default.record(_zod2.default.string(), ColorConfigSchema)
|
|
207
207
|
]);
|
|
208
|
+
var ExtendsItemSchema = _zod2.default.string().trim().describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
209
|
+
var ExtendsSchema = ExtendsItemSchema.or(_zod2.default.array(ExtendsItemSchema)).describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
208
210
|
var WorkspaceBotConfigSchema = _zod2.default.object({
|
|
209
211
|
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)"),
|
|
210
212
|
email: _zod2.default.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
@@ -219,11 +221,11 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
219
221
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
220
222
|
var StormConfigSchema = _zod2.default.object({
|
|
221
223
|
$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"),
|
|
222
|
-
extends:
|
|
224
|
+
extends: ExtendsSchema.optional(),
|
|
223
225
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
224
226
|
namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
225
227
|
organization: _zod2.default.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
226
|
-
repository: _zod2.default.string().trim().
|
|
228
|
+
repository: _zod2.default.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
227
229
|
license: _zod2.default.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
228
230
|
homepage: _zod2.default.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
|
|
229
231
|
docs: _zod2.default.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
|
|
@@ -287,6 +289,7 @@ var COLOR_KEYS = [
|
|
|
287
289
|
|
|
288
290
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
289
291
|
|
|
292
|
+
var _promises = require('fs/promises');
|
|
290
293
|
|
|
291
294
|
var DEFAULT_COLOR_CONFIG = {
|
|
292
295
|
"light": {
|
|
@@ -316,17 +319,15 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
316
319
|
"negative": "#dc2626"
|
|
317
320
|
}
|
|
318
321
|
};
|
|
319
|
-
var getDefaultConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (root) => {
|
|
322
|
+
var getDefaultConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (root) => {
|
|
320
323
|
let license = STORM_DEFAULT_LICENSE;
|
|
321
324
|
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
322
|
-
let name;
|
|
323
|
-
let namespace;
|
|
324
|
-
let repository;
|
|
325
|
+
let name = void 0;
|
|
326
|
+
let namespace = void 0;
|
|
327
|
+
let repository = void 0;
|
|
325
328
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
326
329
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, workspaceRoot, "package.json"))) {
|
|
327
|
-
const file =
|
|
328
|
-
encoding: "utf8"
|
|
329
|
-
});
|
|
330
|
+
const file = await _promises.readFile.call(void 0, joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
330
331
|
if (file) {
|
|
331
332
|
const packageJson = JSON.parse(file);
|
|
332
333
|
if (packageJson.name) {
|
|
@@ -335,8 +336,12 @@ var getDefaultConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (roo
|
|
|
335
336
|
if (packageJson.namespace) {
|
|
336
337
|
namespace = packageJson.namespace;
|
|
337
338
|
}
|
|
338
|
-
if (
|
|
339
|
-
|
|
339
|
+
if (packageJson.repository) {
|
|
340
|
+
if (typeof packageJson.repository === "string") {
|
|
341
|
+
repository = packageJson.repository;
|
|
342
|
+
} else if (packageJson.repository.url) {
|
|
343
|
+
repository = packageJson.repository.url;
|
|
344
|
+
}
|
|
340
345
|
}
|
|
341
346
|
if (packageJson.license) {
|
|
342
347
|
license = packageJson.license;
|
|
@@ -381,7 +386,7 @@ var chalkDefault = {
|
|
|
381
386
|
};
|
|
382
387
|
var getChalk = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, () => {
|
|
383
388
|
let _chalk = _chalk3.default;
|
|
384
|
-
if (!_optionalChain([_chalk, 'optionalAccess',
|
|
389
|
+
if (!_optionalChain([_chalk, 'optionalAccess', _2 => _2.hex]) || !_optionalChain([_chalk, 'optionalAccess', _3 => _3.bold, 'optionalAccess', _4 => _4.hex]) || !_optionalChain([_chalk, 'optionalAccess', _5 => _5.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _6 => _6.whiteBright])) {
|
|
385
390
|
_chalk = chalkDefault;
|
|
386
391
|
}
|
|
387
392
|
return _chalk;
|
|
@@ -477,7 +482,7 @@ var isVerbose = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (label = Lo
|
|
|
477
482
|
|
|
478
483
|
// ../config-tools/src/logger/console.ts
|
|
479
484
|
var getLogFn = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
480
|
-
const colors = !_optionalChain([config, 'access',
|
|
485
|
+
const colors = !_optionalChain([config, 'access', _7 => _7.colors, 'optionalAccess', _8 => _8.dark]) && !_optionalChain([config, 'access', _9 => _9.colors, 'optionalAccess', _10 => _10["base"]]) && !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12["base"], 'optionalAccess', _13 => _13.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _14 => _14.colors, 'optionalAccess', _15 => _15.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17["base"], 'optionalAccess', _18 => _18.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _19 => _19.colors, 'optionalAccess', _20 => _20["base"]]) ? _optionalChain([config, 'access', _21 => _21.colors, 'optionalAccess', _22 => _22["base"]]) : DEFAULT_COLOR_CONFIG;
|
|
481
486
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
482
487
|
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
483
488
|
return (_) => {
|
|
@@ -545,7 +550,6 @@ var writeInfo = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, c
|
|
|
545
550
|
var writeSuccess = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
546
551
|
var writeDebug = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
547
552
|
var writeTrace = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
548
|
-
var writeSystem = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
549
553
|
var getStopwatch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name) => {
|
|
550
554
|
const start = process.hrtime();
|
|
551
555
|
return () => {
|
|
@@ -575,7 +579,7 @@ ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${pre
|
|
|
575
579
|
}, "formatLogMessage");
|
|
576
580
|
var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) => {
|
|
577
581
|
try {
|
|
578
|
-
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess',
|
|
582
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _23 => _23.constructor]) && _optionalChain([value, 'optionalAccess', _24 => _24.call]) && _optionalChain([value, 'optionalAccess', _25 => _25.apply]));
|
|
579
583
|
} catch (e) {
|
|
580
584
|
return false;
|
|
581
585
|
}
|
|
@@ -604,5 +608,4 @@ var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) =
|
|
|
604
608
|
|
|
605
609
|
|
|
606
610
|
|
|
607
|
-
|
|
608
|
-
exports.LogLevel = LogLevel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.StormConfigSchema = StormConfigSchema; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; 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.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;
|
|
611
|
+
exports.LogLevel = LogLevel; exports.STORM_DEFAULT_DOCS = STORM_DEFAULT_DOCS; exports.STORM_DEFAULT_HOMEPAGE = STORM_DEFAULT_HOMEPAGE; exports.STORM_DEFAULT_LICENSING = STORM_DEFAULT_LICENSING; exports.StormConfigSchema = StormConfigSchema; exports.COLOR_KEYS = COLOR_KEYS; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; 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.formatLogMessage = formatLogMessage;
|
|
@@ -205,6 +205,8 @@ var ColorConfigMapSchema = z.union([
|
|
|
205
205
|
}),
|
|
206
206
|
z.record(z.string(), ColorConfigSchema)
|
|
207
207
|
]);
|
|
208
|
+
var ExtendsItemSchema = z.string().trim().describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
209
|
+
var ExtendsSchema = ExtendsItemSchema.or(z.array(ExtendsItemSchema)).describe("The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration.");
|
|
208
210
|
var WorkspaceBotConfigSchema = z.object({
|
|
209
211
|
name: z.string().trim().default("Stormie-Bot").describe("The workspace bot user's name (this is the bot that will be used to perform various tasks)"),
|
|
210
212
|
email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
@@ -219,11 +221,11 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
219
221
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
220
222
|
var StormConfigSchema = z.object({
|
|
221
223
|
$schema: z.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"),
|
|
222
|
-
extends:
|
|
224
|
+
extends: ExtendsSchema.optional(),
|
|
223
225
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
224
226
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
225
227
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
226
|
-
repository: z.string().trim().
|
|
228
|
+
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
227
229
|
license: z.string().trim().default("Apache-2.0").describe("The license type of the package"),
|
|
228
230
|
homepage: z.string().trim().url().default(STORM_DEFAULT_HOMEPAGE).describe("The homepage of the workspace"),
|
|
229
231
|
docs: z.string().trim().url().default(STORM_DEFAULT_DOCS).describe("The base documentation site for the workspace"),
|
|
@@ -286,7 +288,8 @@ var COLOR_KEYS = [
|
|
|
286
288
|
];
|
|
287
289
|
|
|
288
290
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
289
|
-
import { existsSync as existsSync2
|
|
291
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
292
|
+
import { readFile } from "node:fs/promises";
|
|
290
293
|
import { join as join2 } from "node:path";
|
|
291
294
|
var DEFAULT_COLOR_CONFIG = {
|
|
292
295
|
"light": {
|
|
@@ -316,17 +319,15 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
316
319
|
"negative": "#dc2626"
|
|
317
320
|
}
|
|
318
321
|
};
|
|
319
|
-
var getDefaultConfig = /* @__PURE__ */ __name((root) => {
|
|
322
|
+
var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
320
323
|
let license = STORM_DEFAULT_LICENSE;
|
|
321
324
|
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
322
|
-
let name;
|
|
323
|
-
let namespace;
|
|
324
|
-
let repository;
|
|
325
|
+
let name = void 0;
|
|
326
|
+
let namespace = void 0;
|
|
327
|
+
let repository = void 0;
|
|
325
328
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
326
329
|
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
327
|
-
const file =
|
|
328
|
-
encoding: "utf8"
|
|
329
|
-
});
|
|
330
|
+
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
330
331
|
if (file) {
|
|
331
332
|
const packageJson = JSON.parse(file);
|
|
332
333
|
if (packageJson.name) {
|
|
@@ -335,8 +336,12 @@ var getDefaultConfig = /* @__PURE__ */ __name((root) => {
|
|
|
335
336
|
if (packageJson.namespace) {
|
|
336
337
|
namespace = packageJson.namespace;
|
|
337
338
|
}
|
|
338
|
-
if (packageJson.repository
|
|
339
|
-
|
|
339
|
+
if (packageJson.repository) {
|
|
340
|
+
if (typeof packageJson.repository === "string") {
|
|
341
|
+
repository = packageJson.repository;
|
|
342
|
+
} else if (packageJson.repository.url) {
|
|
343
|
+
repository = packageJson.repository.url;
|
|
344
|
+
}
|
|
340
345
|
}
|
|
341
346
|
if (packageJson.license) {
|
|
342
347
|
license = packageJson.license;
|
|
@@ -545,7 +550,6 @@ var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.IN
|
|
|
545
550
|
var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
546
551
|
var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
547
552
|
var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
548
|
-
var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
549
553
|
var getStopwatch = /* @__PURE__ */ __name((name) => {
|
|
550
554
|
const start = process.hrtime();
|
|
551
555
|
return () => {
|
|
@@ -602,7 +606,6 @@ export {
|
|
|
602
606
|
writeSuccess,
|
|
603
607
|
writeDebug,
|
|
604
608
|
writeTrace,
|
|
605
|
-
writeSystem,
|
|
606
609
|
getStopwatch,
|
|
607
610
|
formatLogMessage
|
|
608
611
|
};
|
|
@@ -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 _chunkBM5BCBD5js = require('./chunk-BM5BCBD5.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkDFG3KJWSjs = require('./chunk-DFG3KJWS.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkILLCSSWNjs = require('./chunk-ILLCSSWN.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
@@ -36,8 +36,8 @@ async function runExecutor(options, context) {
|
|
|
36
36
|
throw new Error("The executor requires projectsConfigurations.");
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
|
-
const workspaceRoot =
|
|
40
|
-
const config = await
|
|
39
|
+
const workspaceRoot = _chunkILLCSSWNjs.findWorkspaceRoot.call(void 0, );
|
|
40
|
+
const config = await _chunkDFG3KJWSjs.getConfig.call(void 0, workspaceRoot);
|
|
41
41
|
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
42
42
|
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
43
43
|
const projectDetails = _chunkVTHBMY4Bjs.getPackageInfo.call(void 0, context.projectsConfigurations.projects[context.projectName]);
|
|
@@ -62,7 +62,7 @@ async function runExecutor(options, context) {
|
|
|
62
62
|
if (!projectGraph) {
|
|
63
63
|
throw new Error("No project graph found in cache");
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
_chunkILLCSSWNjs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
|
|
66
66
|
const s3Client = new (0, _clients3.S3)({
|
|
67
67
|
region: "auto",
|
|
68
68
|
endpoint,
|
|
@@ -72,12 +72,12 @@ async function runExecutor(options, context) {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
|
|
75
|
-
|
|
75
|
+
_chunkILLCSSWNjs.writeInfo.call(void 0, `Generated component version: ${version}`);
|
|
76
76
|
const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
|
|
77
77
|
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
78
78
|
});
|
|
79
79
|
const projectPath = `registry/${context.projectName}`;
|
|
80
|
-
const internalDependencies = await
|
|
80
|
+
const internalDependencies = await _chunkBM5BCBD5js.getInternalDependencies.call(void 0, context.projectName, projectGraph);
|
|
81
81
|
const dependencies = internalDependencies.filter((projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")).reduce((ret, dep) => {
|
|
82
82
|
if (!ret[dep.name]) {
|
|
83
83
|
ret[dep.name] = "latest";
|
|
@@ -85,14 +85,14 @@ async function runExecutor(options, context) {
|
|
|
85
85
|
return ret;
|
|
86
86
|
}, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
|
|
87
87
|
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
88
|
-
|
|
88
|
+
_chunkILLCSSWNjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
|
|
89
89
|
if (!isDryRun) {
|
|
90
90
|
const response = await s3Client.listObjects({
|
|
91
91
|
Bucket: options.bucketId,
|
|
92
92
|
Prefix: projectPath
|
|
93
93
|
});
|
|
94
94
|
if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
|
|
95
|
-
|
|
95
|
+
_chunkILLCSSWNjs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
|
|
96
96
|
await Promise.all(response.Contents.map((item) => s3Client.deleteObjects({
|
|
97
97
|
Bucket: options.bucketId,
|
|
98
98
|
Delete: {
|
|
@@ -105,10 +105,10 @@ async function runExecutor(options, context) {
|
|
|
105
105
|
}
|
|
106
106
|
})));
|
|
107
107
|
} else {
|
|
108
|
-
|
|
108
|
+
_chunkILLCSSWNjs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
|
|
109
109
|
}
|
|
110
110
|
} else {
|
|
111
|
-
|
|
111
|
+
_chunkILLCSSWNjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
|
|
112
112
|
}
|
|
113
113
|
const meta = {
|
|
114
114
|
name: context.projectName,
|
|
@@ -124,16 +124,16 @@ async function runExecutor(options, context) {
|
|
|
124
124
|
meta.devDependencies = projectDetails.content.devDependencies;
|
|
125
125
|
}
|
|
126
126
|
const metaJson = JSON.stringify(meta);
|
|
127
|
-
|
|
127
|
+
_chunkILLCSSWNjs.writeInfo.call(void 0, `Generating meta.json file:
|
|
128
128
|
${metaJson}`);
|
|
129
|
-
await
|
|
129
|
+
await _chunkBM5BCBD5js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
|
|
130
130
|
await Promise.all(files.map((file) => {
|
|
131
131
|
const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
|
|
132
132
|
return _promises.readFile.call(void 0, file, {
|
|
133
133
|
encoding: "utf8"
|
|
134
|
-
}).then((fileContent) =>
|
|
134
|
+
}).then((fileContent) => _chunkBM5BCBD5js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
|
|
135
135
|
}));
|
|
136
|
-
|
|
136
|
+
_chunkILLCSSWNjs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
|
|
137
137
|
return {
|
|
138
138
|
success: true
|
|
139
139
|
};
|
|
@@ -8,7 +8,7 @@ var require_package = _chunkJ5SB6L2Ljs.__commonJS.call(void 0, {
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@storm-software/cloudflare-tools",
|
|
11
|
-
version: "0.54.
|
|
11
|
+
version: "0.54.4",
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
repository: {
|
|
14
14
|
type: "github",
|