@storm-software/cloudflare-tools 0.71.90 → 0.71.91
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-P42MQNVF.mjs → chunk-536H3WK5.mjs} +18 -1
- package/dist/{chunk-IH7USDLX.js → chunk-COUZEHRU.js} +18 -18
- package/dist/{chunk-52X4GPEN.mjs → chunk-EXZP5MWY.mjs} +28 -7
- package/dist/{chunk-QWSTQIUA.js → chunk-GBAVURC4.js} +51 -34
- package/dist/{chunk-MDOQR5IS.js → chunk-GG5WUYIL.js} +4 -4
- package/dist/{chunk-6JVDTXHT.js → chunk-JCQYTCUM.js} +5 -5
- package/dist/{chunk-YIXC7QU5.mjs → chunk-KM2LU3WU.mjs} +4 -4
- package/dist/{chunk-S2GBNGKD.js → chunk-LZPNL75H.js} +13 -13
- package/dist/{chunk-3SX7VAO7.mjs → chunk-P53OIJC5.mjs} +10 -10
- package/dist/{chunk-2KWRE5Y5.js → chunk-PVCPJUY2.js} +28 -7
- package/dist/{chunk-E7SXH3BE.js → chunk-QY2K3DFK.js} +168 -168
- package/dist/{chunk-YQIWTBN7.mjs → chunk-RQTOQ3CF.mjs} +3 -3
- package/dist/chunk-UTKIVUDT.js +266 -0
- package/dist/chunk-WDNXEDWS.js +231 -0
- package/dist/chunk-XFZ2V7ZD.mjs +269 -0
- package/dist/chunk-XVKPJL76.mjs +231 -0
- package/dist/{chunk-C6CPSE5U.mjs → chunk-YQSDJFL7.mjs} +3 -3
- package/dist/{chunk-OPXJUL5V.mjs → chunk-Z7TZ4UY6.mjs} +1 -1
- 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 +5 -5
|
@@ -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.71.
|
|
10
|
+
version: "0.71.90",
|
|
11
11
|
private: false,
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
keywords: [
|
|
@@ -156,9 +156,9 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
156
156
|
"@nx/js": "catalog:",
|
|
157
157
|
"@nx/node": "catalog:",
|
|
158
158
|
"@nx/web": "catalog:",
|
|
159
|
-
"@storm-software/config": "1.135.
|
|
160
|
-
"@storm-software/config-tools": "1.189.
|
|
161
|
-
"@storm-software/workspace-tools": "1.295.
|
|
159
|
+
"@storm-software/config": "1.135.41",
|
|
160
|
+
"@storm-software/config-tools": "1.189.40",
|
|
161
|
+
"@storm-software/workspace-tools": "1.295.16",
|
|
162
162
|
nx: "catalog:",
|
|
163
163
|
tsup: "catalog:",
|
|
164
164
|
wrangler: ">=3.58.0"
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPVCPJUY2js = require('./chunk-PVCPJUY2.js');
|
|
7
7
|
|
|
8
8
|
// src/utils/r2-bucket-helpers.ts
|
|
9
9
|
var _libstorage = require('@aws-sdk/lib-storage');
|
|
10
10
|
var _crypto = require('crypto');
|
|
11
11
|
var _prettybytes = require('pretty-bytes'); var _prettybytes2 = _interopRequireDefault(_prettybytes);
|
|
12
12
|
async function uploadFile(client, bucketName, bucketPath, fileName, version, fileContent, contentType = "application/octet-stream", isDryRun = false) {
|
|
13
|
-
const key = _optionalChain([(!_optionalChain([bucketPath, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]) || _optionalChain([bucketPath, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]) === "/" ? fileName :
|
|
14
|
-
|
|
13
|
+
const key = _optionalChain([(!_optionalChain([bucketPath, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]) || _optionalChain([bucketPath, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]) === "/" ? fileName : _chunkPVCPJUY2js.joinPaths.call(void 0, bucketPath.trim(), fileName)), 'optionalAccess', _5 => _5.replace, 'call', _6 => _6(/^\/+/g, "")]) || "";
|
|
14
|
+
_chunkPVCPJUY2js.writeDebug.call(void 0,
|
|
15
15
|
`Uploading ${key} (content-type: ${contentType}, size: ${_prettybytes2.default.call(void 0,
|
|
16
16
|
Buffer.byteLength(fileContent, getEncoding(contentType))
|
|
17
17
|
)}) to the ${bucketName} R2 bucket`
|
|
@@ -33,10 +33,10 @@ async function uploadFile(client, bucketName, bucketPath, fileName, version, fil
|
|
|
33
33
|
});
|
|
34
34
|
await upload.done();
|
|
35
35
|
} else {
|
|
36
|
-
|
|
36
|
+
_chunkPVCPJUY2js.writeWarning.call(void 0, "[Dry run]: Skipping upload to the R2 bucket.");
|
|
37
37
|
}
|
|
38
38
|
} catch (error) {
|
|
39
|
-
|
|
39
|
+
_chunkPVCPJUY2js.writeError.call(void 0, `Failed to upload ${key} to the ${bucketName} R2 bucket.`);
|
|
40
40
|
throw error;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -7,7 +7,7 @@ var require_package = __commonJS({
|
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
8
|
module.exports = {
|
|
9
9
|
name: "@storm-software/cloudflare-tools",
|
|
10
|
-
version: "0.71.
|
|
10
|
+
version: "0.71.90",
|
|
11
11
|
private: false,
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
keywords: [
|
|
@@ -156,9 +156,9 @@ var require_package = __commonJS({
|
|
|
156
156
|
"@nx/js": "catalog:",
|
|
157
157
|
"@nx/node": "catalog:",
|
|
158
158
|
"@nx/web": "catalog:",
|
|
159
|
-
"@storm-software/config": "1.135.
|
|
160
|
-
"@storm-software/config-tools": "1.189.
|
|
161
|
-
"@storm-software/workspace-tools": "1.295.
|
|
159
|
+
"@storm-software/config": "1.135.41",
|
|
160
|
+
"@storm-software/config-tools": "1.189.40",
|
|
161
|
+
"@storm-software/workspace-tools": "1.295.16",
|
|
162
162
|
nx: "catalog:",
|
|
163
163
|
tsup: "catalog:",
|
|
164
164
|
wrangler: ">=3.58.0"
|
|
@@ -1,10 +1,10 @@
|
|
|
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 _chunkGG5WUYILjs = require('./chunk-GG5WUYIL.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkGBAVURC4js = require('./chunk-GBAVURC4.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ var _chunkQWSTQIUAjs = require('./chunk-QWSTQIUA.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkPVCPJUY2js = require('./chunk-PVCPJUY2.js');
|
|
17
17
|
|
|
18
18
|
// src/generators/worker/generator.ts
|
|
19
19
|
|
|
@@ -46,23 +46,23 @@ var vitestScript = `"test": "vitest run"`;
|
|
|
46
46
|
|
|
47
47
|
// src/generators/worker/generator.ts
|
|
48
48
|
async function applicationGenerator(tree, schema) {
|
|
49
|
-
const stopwatch =
|
|
49
|
+
const stopwatch = _chunkPVCPJUY2js.getStopwatch.call(void 0, "Storm Worker generator");
|
|
50
50
|
let config;
|
|
51
51
|
try {
|
|
52
|
-
const workspaceRoot =
|
|
53
|
-
config = await
|
|
54
|
-
|
|
55
|
-
`${
|
|
52
|
+
const workspaceRoot = _chunkGBAVURC4js.findWorkspaceRoot.call(void 0, );
|
|
53
|
+
config = await _chunkGBAVURC4js.getConfig.call(void 0, workspaceRoot);
|
|
54
|
+
_chunkPVCPJUY2js.writeInfo.call(void 0,
|
|
55
|
+
`${_chunkPVCPJUY2js.brandIcon.call(void 0, config)} Running the Storm Worker generator...
|
|
56
56
|
|
|
57
57
|
`,
|
|
58
58
|
config
|
|
59
59
|
);
|
|
60
|
-
|
|
60
|
+
_chunkPVCPJUY2js.writeDebug.call(void 0,
|
|
61
61
|
`Loading the Storm Config from environment variables and storm.json file...
|
|
62
62
|
- workspaceRoot: ${workspaceRoot}`,
|
|
63
63
|
config
|
|
64
64
|
);
|
|
65
|
-
|
|
65
|
+
_chunkPVCPJUY2js.writeTrace.call(void 0,
|
|
66
66
|
`Loaded Storm config into env:
|
|
67
67
|
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
|
|
68
68
|
config
|
|
@@ -70,7 +70,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
70
70
|
const options = await normalizeOptions(tree, schema, config);
|
|
71
71
|
const tasks = [];
|
|
72
72
|
tasks.push(
|
|
73
|
-
await
|
|
73
|
+
await _chunkGG5WUYILjs.generator_default.call(void 0, tree, {
|
|
74
74
|
...options,
|
|
75
75
|
skipFormat: true
|
|
76
76
|
})
|
|
@@ -138,11 +138,11 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
138
138
|
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
139
139
|
} catch (error) {
|
|
140
140
|
return () => {
|
|
141
|
-
|
|
141
|
+
_chunkPVCPJUY2js.writeFatal.call(void 0,
|
|
142
142
|
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
143
143
|
config
|
|
144
144
|
);
|
|
145
|
-
|
|
145
|
+
_chunkPVCPJUY2js.writeError.call(void 0,
|
|
146
146
|
`An exception was thrown in the generator's process
|
|
147
147
|
- Details: ${error.message}
|
|
148
148
|
- Stacktrace: ${error.stack}`,
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createHttpHandler
|
|
3
|
-
} from "./chunk-SWYYMID7.mjs";
|
|
4
|
-
import {
|
|
5
|
-
getEncoding,
|
|
6
|
-
getInternalDependencies,
|
|
7
|
-
uploadFile
|
|
8
|
-
} from "./chunk-OPXJUL5V.mjs";
|
|
9
1
|
import {
|
|
10
2
|
createCliOptions,
|
|
11
3
|
getPackageInfo
|
|
@@ -13,7 +5,15 @@ import {
|
|
|
13
5
|
import {
|
|
14
6
|
findWorkspaceRoot,
|
|
15
7
|
getConfig
|
|
16
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-536H3WK5.mjs";
|
|
9
|
+
import {
|
|
10
|
+
createHttpHandler
|
|
11
|
+
} from "./chunk-SWYYMID7.mjs";
|
|
12
|
+
import {
|
|
13
|
+
getEncoding,
|
|
14
|
+
getInternalDependencies,
|
|
15
|
+
uploadFile
|
|
16
|
+
} from "./chunk-Z7TZ4UY6.mjs";
|
|
17
17
|
import {
|
|
18
18
|
correctPaths,
|
|
19
19
|
joinPaths,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
writeSuccess,
|
|
22
22
|
writeTrace,
|
|
23
23
|
writeWarning
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-EXZP5MWY.mjs";
|
|
25
25
|
|
|
26
26
|
// src/executors/r2-upload-publish/executor.ts
|
|
27
27
|
import {
|
|
@@ -9,6 +9,7 @@ var LogLevel = {
|
|
|
9
9
|
WARN: 30,
|
|
10
10
|
SUCCESS: 35,
|
|
11
11
|
INFO: 40,
|
|
12
|
+
PERFORMANCE: 50,
|
|
12
13
|
DEBUG: 60,
|
|
13
14
|
TRACE: 70,
|
|
14
15
|
ALL: 100
|
|
@@ -20,6 +21,7 @@ var LogLevelLabel = {
|
|
|
20
21
|
WARN: "warn",
|
|
21
22
|
SUCCESS: "success",
|
|
22
23
|
INFO: "info",
|
|
24
|
+
PERFORMANCE: "performance",
|
|
23
25
|
DEBUG: "debug",
|
|
24
26
|
TRACE: "trace",
|
|
25
27
|
ALL: "all"
|
|
@@ -39,6 +41,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
39
41
|
warning: "#e3b341",
|
|
40
42
|
danger: "#D8314A",
|
|
41
43
|
fatal: "#51070f",
|
|
44
|
+
performance: "#83ff83",
|
|
42
45
|
link: "#3fa6ff",
|
|
43
46
|
positive: "#22c55e",
|
|
44
47
|
negative: "#dc2626",
|
|
@@ -56,6 +59,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
56
59
|
warning: "#f3d371",
|
|
57
60
|
danger: "#D8314A",
|
|
58
61
|
fatal: "#a40e26",
|
|
62
|
+
performance: "#00ff00",
|
|
59
63
|
link: "#3fa6ff",
|
|
60
64
|
positive: "#22c55e",
|
|
61
65
|
negative: "#dc2626",
|
|
@@ -143,6 +147,7 @@ var CONSOLE_ICONS = {
|
|
|
143
147
|
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
144
148
|
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
145
149
|
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
150
|
+
[LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
|
|
146
151
|
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
147
152
|
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
148
153
|
[LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
|
|
@@ -163,6 +168,8 @@ var getLogLevel = (label) => {
|
|
|
163
168
|
return LogLevel.TRACE;
|
|
164
169
|
case "debug":
|
|
165
170
|
return LogLevel.DEBUG;
|
|
171
|
+
case "performance":
|
|
172
|
+
return LogLevel.PERFORMANCE;
|
|
166
173
|
case "info":
|
|
167
174
|
return LogLevel.INFO;
|
|
168
175
|
case "warn":
|
|
@@ -187,6 +194,9 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
|
187
194
|
if (logLevel >= LogLevel.DEBUG) {
|
|
188
195
|
return LogLevelLabel.DEBUG;
|
|
189
196
|
}
|
|
197
|
+
if (logLevel >= LogLevel.PERFORMANCE) {
|
|
198
|
+
return LogLevelLabel.PERFORMANCE;
|
|
199
|
+
}
|
|
190
200
|
if (logLevel >= LogLevel.INFO) {
|
|
191
201
|
return LogLevelLabel.INFO;
|
|
192
202
|
}
|
|
@@ -274,6 +284,19 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
|
274
284
|
)(
|
|
275
285
|
`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
|
|
276
286
|
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
287
|
+
`
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) {
|
|
292
|
+
return (message) => {
|
|
293
|
+
console.debug(
|
|
294
|
+
`
|
|
295
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
296
|
+
_nullishCoalesce(colors.performance, () => ( DEFAULT_COLOR_CONFIG.dark.performance))
|
|
297
|
+
)(
|
|
298
|
+
`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
|
|
299
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
277
300
|
`
|
|
278
301
|
);
|
|
279
302
|
};
|
|
@@ -319,18 +342,16 @@ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
|
319
342
|
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
320
343
|
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
321
344
|
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
345
|
+
var writePerformance = (message, config) => getLogFn(LogLevel.PERFORMANCE, config)(message);
|
|
322
346
|
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
323
347
|
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
324
348
|
var getStopwatch = (name) => {
|
|
325
349
|
const start = /* @__PURE__ */ new Date();
|
|
326
350
|
return () => {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
includeSeconds: true
|
|
332
|
-
}
|
|
333
|
-
)} to complete`
|
|
351
|
+
writePerformance(
|
|
352
|
+
`The${name ? ` ${name}` : ""} process took ${_formatDistanceToNow.formatDistanceToNow.call(void 0, start, {
|
|
353
|
+
includeSeconds: true
|
|
354
|
+
})} to complete`
|
|
334
355
|
);
|
|
335
356
|
};
|
|
336
357
|
};
|