@storm-software/cloudflare-tools 0.71.127 → 0.71.129
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 +22 -0
- package/README.md +1 -1
- package/dist/{chunk-DSR44HMJ.mjs → chunk-76H47SWR.mjs} +4 -4
- package/dist/{chunk-5HN6RBOZ.js → chunk-7BUGSZXF.js} +4 -4
- package/dist/{chunk-Q24LTSOU.js → chunk-ALA5P6Y4.js} +17 -13
- package/dist/{chunk-4QGEP2VP.mjs → chunk-IHY5UHHO.mjs} +17 -13
- package/dist/{chunk-2CZOOK2P.js → chunk-JHW56Y57.js} +2 -2
- package/dist/chunk-OHTWRQBA.mjs +231 -0
- package/dist/chunk-OZ7D2VVK.js +231 -0
- package/dist/{chunk-IYKKDOAL.mjs → chunk-YIDEGEJ2.mjs} +1 -1
- package/dist/executors.js +4 -4
- package/dist/executors.mjs +4 -4
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.js +9 -9
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +1 -1
- package/dist/src/executors/cloudflare-publish/executor.mjs +1 -1
- package/dist/src/executors/r2-upload-publish/executor.js +3 -3
- package/dist/src/executors/r2-upload-publish/executor.mjs +2 -2
- package/dist/src/executors/serve/executor.js +2 -2
- package/dist/src/executors/serve/executor.mjs +1 -1
- 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 +3 -3
- package/dist/src/generators/worker/generator.mjs +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Cloudflare Tools
|
|
4
4
|
|
|
5
|
+
## [0.71.128](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.128) (04/14/2026)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace's `README.md` files ([7d41882b7](https://github.com/storm-software/storm-ops/commit/7d41882b7))
|
|
10
|
+
|
|
11
|
+
### Updated Dependencies
|
|
12
|
+
|
|
13
|
+
- Updated **workspace-tools** to **v1.295.54**
|
|
14
|
+
|
|
15
|
+
## [0.71.127](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.127) (04/14/2026)
|
|
16
|
+
|
|
17
|
+
### Miscellaneous
|
|
18
|
+
|
|
19
|
+
- **monorepo:** Update workspace packages' dependencies ([3a2b8a77e](https://github.com/storm-software/storm-ops/commit/3a2b8a77e))
|
|
20
|
+
|
|
21
|
+
### Updated Dependencies
|
|
22
|
+
|
|
23
|
+
- Updated **workspace-tools** to **v1.295.53**
|
|
24
|
+
- Updated **config-tools** to **v1.189.77**
|
|
25
|
+
- Updated **config** to **v1.137.31**
|
|
26
|
+
|
|
5
27
|
## [0.71.126](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.126) (04/13/2026)
|
|
6
28
|
|
|
7
29
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -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.128",
|
|
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.137.
|
|
160
|
-
"@storm-software/config-tools": "1.189.
|
|
161
|
-
"@storm-software/workspace-tools": "1.295.
|
|
159
|
+
"@storm-software/config": "1.137.31",
|
|
160
|
+
"@storm-software/config-tools": "1.189.77",
|
|
161
|
+
"@storm-software/workspace-tools": "1.295.54",
|
|
162
162
|
nx: "catalog:",
|
|
163
163
|
tsup: "catalog:",
|
|
164
164
|
wrangler: ">=3.58.0"
|
|
@@ -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.128",
|
|
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.137.
|
|
160
|
-
"@storm-software/config-tools": "1.189.
|
|
161
|
-
"@storm-software/workspace-tools": "1.295.
|
|
159
|
+
"@storm-software/config": "1.137.31",
|
|
160
|
+
"@storm-software/config-tools": "1.189.77",
|
|
161
|
+
"@storm-software/workspace-tools": "1.295.54",
|
|
162
162
|
nx: "catalog:",
|
|
163
163
|
tsup: "catalog:",
|
|
164
164
|
wrangler: ">=3.58.0"
|
|
@@ -244,7 +244,9 @@ var buildCargoCommand = (baseCommand, options, context) => {
|
|
|
244
244
|
args.push(`+${options.toolchain}`);
|
|
245
245
|
}
|
|
246
246
|
args.push(baseCommand);
|
|
247
|
-
for (const [key, value] of Object.entries(options)
|
|
247
|
+
for (const [key, value] of Object.entries(options).filter(
|
|
248
|
+
([key2]) => key2 && key2 !== "_"
|
|
249
|
+
)) {
|
|
248
250
|
if (key === "toolchain" || key === "release" || INVALID_CARGO_ARGS.includes(key)) {
|
|
249
251
|
continue;
|
|
250
252
|
}
|
|
@@ -254,7 +256,7 @@ var buildCargoCommand = (baseCommand, options, context) => {
|
|
|
254
256
|
}
|
|
255
257
|
} else if (Array.isArray(value)) {
|
|
256
258
|
for (const item of value) {
|
|
257
|
-
args.push(`--${key}`, item);
|
|
259
|
+
args.push(`--${key}`, String(item));
|
|
258
260
|
}
|
|
259
261
|
} else {
|
|
260
262
|
args.push(`--${key}`, String(value));
|
|
@@ -303,7 +305,7 @@ function cargoCommandSync(args = "", options) {
|
|
|
303
305
|
};
|
|
304
306
|
} catch (e) {
|
|
305
307
|
return {
|
|
306
|
-
output: e,
|
|
308
|
+
output: e.message,
|
|
307
309
|
success: false
|
|
308
310
|
};
|
|
309
311
|
}
|
|
@@ -1209,7 +1211,7 @@ async function napiExecutor(options, context, config) {
|
|
|
1209
1211
|
"The Napi Build process failed because the project could not be found in the project graph. Please run this command from a workspace root directory."
|
|
1210
1212
|
);
|
|
1211
1213
|
}
|
|
1212
|
-
const projectRoot = _optionalChain([context, 'access', _85 => _85.projectGraph, 'optionalAccess', _86 => _86.nodes, 'access', _87 => _87[_nullishCoalesce(context.projectName, () => ( ""))], '
|
|
1214
|
+
const projectRoot = _optionalChain([context, 'access', _85 => _85.projectGraph, 'optionalAccess', _86 => _86.nodes, 'access', _87 => _87[_nullishCoalesce(context.projectName, () => ( ""))], 'optionalAccess', _88 => _88.data, 'access', _89 => _89.root]);
|
|
1213
1215
|
const packageJson = _chunkRIBK362Wjs.joinPaths.call(void 0, _nullishCoalesce(projectRoot, () => ( ".")), "package.json");
|
|
1214
1216
|
if (!_fileutils.fileExists.call(void 0, packageJson)) {
|
|
1215
1217
|
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
@@ -1223,27 +1225,29 @@ async function napiExecutor(options, context, config) {
|
|
|
1223
1225
|
if (options.cwd) {
|
|
1224
1226
|
normalizedOptions.cwd = _chunkRIBK362Wjs.correctPaths.call(void 0, options.cwd);
|
|
1225
1227
|
} else {
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
config.workspaceRoot,
|
|
1229
|
-
projectRoot || "."
|
|
1228
|
+
const absoluteProjectRoot = _chunkRIBK362Wjs.correctPaths.call(void 0,
|
|
1229
|
+
_chunkRIBK362Wjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot || ".")
|
|
1230
1230
|
);
|
|
1231
|
+
normalizedOptions.cwd = absoluteProjectRoot;
|
|
1231
1232
|
if (normalizedOptions.outputDir) {
|
|
1232
1233
|
normalizedOptions.outputDir = _chunkRIBK362Wjs.relative.call(void 0,
|
|
1233
|
-
|
|
1234
|
+
normalizedOptions.cwd,
|
|
1234
1235
|
_chunkRIBK362Wjs.correctPaths.call(void 0,
|
|
1235
1236
|
_chunkRIBK362Wjs.isAbsolute.call(void 0, normalizedOptions.outputDir) ? normalizedOptions.outputDir : _chunkRIBK362Wjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.outputDir)
|
|
1236
1237
|
)
|
|
1237
1238
|
);
|
|
1238
1239
|
}
|
|
1239
1240
|
if (normalizedOptions.packageJsonPath) {
|
|
1240
|
-
normalizedOptions.packageJsonPath = _chunkRIBK362Wjs.
|
|
1241
|
-
|
|
1241
|
+
normalizedOptions.packageJsonPath = _chunkRIBK362Wjs.relative.call(void 0,
|
|
1242
|
+
normalizedOptions.cwd,
|
|
1243
|
+
_chunkRIBK362Wjs.correctPaths.call(void 0,
|
|
1244
|
+
_chunkRIBK362Wjs.isAbsolute.call(void 0, normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : _chunkRIBK362Wjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.packageJsonPath)
|
|
1245
|
+
)
|
|
1242
1246
|
);
|
|
1243
1247
|
}
|
|
1244
1248
|
if (normalizedOptions.configPath) {
|
|
1245
1249
|
normalizedOptions.configPath = _chunkRIBK362Wjs.relative.call(void 0,
|
|
1246
|
-
|
|
1250
|
+
normalizedOptions.cwd,
|
|
1247
1251
|
_chunkRIBK362Wjs.correctPaths.call(void 0,
|
|
1248
1252
|
_chunkRIBK362Wjs.isAbsolute.call(void 0, normalizedOptions.configPath) ? normalizedOptions.configPath : _chunkRIBK362Wjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.configPath)
|
|
1249
1253
|
)
|
|
@@ -1251,7 +1255,7 @@ async function napiExecutor(options, context, config) {
|
|
|
1251
1255
|
}
|
|
1252
1256
|
if (normalizedOptions.manifestPath) {
|
|
1253
1257
|
normalizedOptions.manifestPath = _chunkRIBK362Wjs.relative.call(void 0,
|
|
1254
|
-
|
|
1258
|
+
normalizedOptions.cwd,
|
|
1255
1259
|
_chunkRIBK362Wjs.correctPaths.call(void 0,
|
|
1256
1260
|
_chunkRIBK362Wjs.isAbsolute.call(void 0, normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : _chunkRIBK362Wjs.joinPaths.call(void 0, config.workspaceRoot, normalizedOptions.manifestPath)
|
|
1257
1261
|
)
|
|
@@ -247,7 +247,9 @@ var buildCargoCommand = (baseCommand, options, context) => {
|
|
|
247
247
|
args.push(`+${options.toolchain}`);
|
|
248
248
|
}
|
|
249
249
|
args.push(baseCommand);
|
|
250
|
-
for (const [key, value] of Object.entries(options)
|
|
250
|
+
for (const [key, value] of Object.entries(options).filter(
|
|
251
|
+
([key2]) => key2 && key2 !== "_"
|
|
252
|
+
)) {
|
|
251
253
|
if (key === "toolchain" || key === "release" || INVALID_CARGO_ARGS.includes(key)) {
|
|
252
254
|
continue;
|
|
253
255
|
}
|
|
@@ -257,7 +259,7 @@ var buildCargoCommand = (baseCommand, options, context) => {
|
|
|
257
259
|
}
|
|
258
260
|
} else if (Array.isArray(value)) {
|
|
259
261
|
for (const item of value) {
|
|
260
|
-
args.push(`--${key}`, item);
|
|
262
|
+
args.push(`--${key}`, String(item));
|
|
261
263
|
}
|
|
262
264
|
} else {
|
|
263
265
|
args.push(`--${key}`, String(value));
|
|
@@ -306,7 +308,7 @@ function cargoCommandSync(args = "", options) {
|
|
|
306
308
|
};
|
|
307
309
|
} catch (e) {
|
|
308
310
|
return {
|
|
309
|
-
output: e,
|
|
311
|
+
output: e.message,
|
|
310
312
|
success: false
|
|
311
313
|
};
|
|
312
314
|
}
|
|
@@ -1212,7 +1214,7 @@ async function napiExecutor(options, context, config) {
|
|
|
1212
1214
|
"The Napi Build process failed because the project could not be found in the project graph. Please run this command from a workspace root directory."
|
|
1213
1215
|
);
|
|
1214
1216
|
}
|
|
1215
|
-
const projectRoot = context.projectGraph?.nodes[context.projectName ?? ""]
|
|
1217
|
+
const projectRoot = context.projectGraph?.nodes[context.projectName ?? ""]?.data.root;
|
|
1216
1218
|
const packageJson = joinPaths(projectRoot ?? ".", "package.json");
|
|
1217
1219
|
if (!fileExists(packageJson)) {
|
|
1218
1220
|
throw new Error(`Could not find package.json at ${packageJson}`);
|
|
@@ -1226,27 +1228,29 @@ async function napiExecutor(options, context, config) {
|
|
|
1226
1228
|
if (options.cwd) {
|
|
1227
1229
|
normalizedOptions.cwd = correctPaths(options.cwd);
|
|
1228
1230
|
} else {
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
config.workspaceRoot,
|
|
1232
|
-
projectRoot || "."
|
|
1231
|
+
const absoluteProjectRoot = correctPaths(
|
|
1232
|
+
joinPaths(config.workspaceRoot, projectRoot || ".")
|
|
1233
1233
|
);
|
|
1234
|
+
normalizedOptions.cwd = absoluteProjectRoot;
|
|
1234
1235
|
if (normalizedOptions.outputDir) {
|
|
1235
1236
|
normalizedOptions.outputDir = relative(
|
|
1236
|
-
|
|
1237
|
+
normalizedOptions.cwd,
|
|
1237
1238
|
correctPaths(
|
|
1238
1239
|
isAbsolute(normalizedOptions.outputDir) ? normalizedOptions.outputDir : joinPaths(config.workspaceRoot, normalizedOptions.outputDir)
|
|
1239
1240
|
)
|
|
1240
1241
|
);
|
|
1241
1242
|
}
|
|
1242
1243
|
if (normalizedOptions.packageJsonPath) {
|
|
1243
|
-
normalizedOptions.packageJsonPath =
|
|
1244
|
-
|
|
1244
|
+
normalizedOptions.packageJsonPath = relative(
|
|
1245
|
+
normalizedOptions.cwd,
|
|
1246
|
+
correctPaths(
|
|
1247
|
+
isAbsolute(normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : joinPaths(config.workspaceRoot, normalizedOptions.packageJsonPath)
|
|
1248
|
+
)
|
|
1245
1249
|
);
|
|
1246
1250
|
}
|
|
1247
1251
|
if (normalizedOptions.configPath) {
|
|
1248
1252
|
normalizedOptions.configPath = relative(
|
|
1249
|
-
|
|
1253
|
+
normalizedOptions.cwd,
|
|
1250
1254
|
correctPaths(
|
|
1251
1255
|
isAbsolute(normalizedOptions.configPath) ? normalizedOptions.configPath : joinPaths(config.workspaceRoot, normalizedOptions.configPath)
|
|
1252
1256
|
)
|
|
@@ -1254,7 +1258,7 @@ async function napiExecutor(options, context, config) {
|
|
|
1254
1258
|
}
|
|
1255
1259
|
if (normalizedOptions.manifestPath) {
|
|
1256
1260
|
normalizedOptions.manifestPath = relative(
|
|
1257
|
-
|
|
1261
|
+
normalizedOptions.cwd,
|
|
1258
1262
|
correctPaths(
|
|
1259
1263
|
isAbsolute(normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : joinPaths(config.workspaceRoot, normalizedOptions.manifestPath)
|
|
1260
1264
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunk7BUGSZXFjs = require('./chunk-7BUGSZXF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -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 _chunk7BUGSZXFjs.generator_default.call(void 0, tree, {
|
|
74
74
|
...options,
|
|
75
75
|
skipFormat: true
|
|
76
76
|
})
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEncoding,
|
|
3
|
+
getInternalDependencies,
|
|
4
|
+
uploadFile
|
|
5
|
+
} from "./chunk-M3VAGNJQ.mjs";
|
|
6
|
+
import {
|
|
7
|
+
createCliOptions,
|
|
8
|
+
getPackageInfo
|
|
9
|
+
} from "./chunk-3MAI3FU2.mjs";
|
|
10
|
+
import {
|
|
11
|
+
findWorkspaceRoot,
|
|
12
|
+
getConfig
|
|
13
|
+
} from "./chunk-5QM4JUN3.mjs";
|
|
14
|
+
import {
|
|
15
|
+
correctPaths,
|
|
16
|
+
joinPaths,
|
|
17
|
+
writeDebug,
|
|
18
|
+
writeSuccess,
|
|
19
|
+
writeTrace,
|
|
20
|
+
writeWarning
|
|
21
|
+
} from "./chunk-ZDABHOZ2.mjs";
|
|
22
|
+
import {
|
|
23
|
+
createHttpHandler
|
|
24
|
+
} from "./chunk-SWYYMID7.mjs";
|
|
25
|
+
|
|
26
|
+
// src/executors/r2-upload-publish/executor.ts
|
|
27
|
+
import {
|
|
28
|
+
DeleteObjectsCommand,
|
|
29
|
+
ListObjectsCommand,
|
|
30
|
+
S3Client
|
|
31
|
+
} from "@aws-sdk/client-s3";
|
|
32
|
+
import {
|
|
33
|
+
createProjectGraphAsync,
|
|
34
|
+
readCachedProjectGraph
|
|
35
|
+
} from "@nx/devkit";
|
|
36
|
+
import { glob } from "glob";
|
|
37
|
+
import mime from "mime-types";
|
|
38
|
+
import { execSync } from "node:child_process";
|
|
39
|
+
import { statSync } from "node:fs";
|
|
40
|
+
import { readFile } from "node:fs/promises";
|
|
41
|
+
async function runExecutor(options, context) {
|
|
42
|
+
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
43
|
+
if (!context.projectName) {
|
|
44
|
+
throw new Error("The executor requires a projectName.");
|
|
45
|
+
}
|
|
46
|
+
if (!options.path) {
|
|
47
|
+
throw new Error("The executor requires the `path` option to upload.");
|
|
48
|
+
}
|
|
49
|
+
console.info(
|
|
50
|
+
`\u{1F680} Running Storm Cloudflare Publish executor on the ${context.projectName} worker`
|
|
51
|
+
);
|
|
52
|
+
if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
|
|
53
|
+
throw new Error("The executor requires projectsConfigurations.");
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
57
|
+
const config = await getConfig(workspaceRoot);
|
|
58
|
+
const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
|
|
59
|
+
const projectDetails = getPackageInfo(
|
|
60
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
61
|
+
);
|
|
62
|
+
const bucketId = options.bucketId;
|
|
63
|
+
const bucketPath = options.bucketPath || "/";
|
|
64
|
+
if (!bucketId) {
|
|
65
|
+
throw new Error("The executor requires a bucketId.");
|
|
66
|
+
}
|
|
67
|
+
const args = createCliOptions({ ...options });
|
|
68
|
+
if (isDryRun) {
|
|
69
|
+
args.push("--dry-run");
|
|
70
|
+
}
|
|
71
|
+
const cloudflareAccountId = process.env.CLOUDFLARE_ACCOUNT_ID || process.env.STORM_BOT_CLOUDFLARE_ACCOUNT;
|
|
72
|
+
if (!options?.registry && !cloudflareAccountId) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
"The registry option and `CLOUDFLARE_ACCOUNT_ID` (or `STORM_BOT_CLOUDFLARE_ACCOUNT`) environment variable are not set. Please set one of these values to upload to the Cloudflare R2 bucket."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
if (!process.env.STORM_BOT_ACCESS_KEY_ID && !process.env.ACCESS_KEY_ID && !process.env.CLOUDFLARE_ACCESS_KEY_ID && !process.env.AWS_ACCESS_KEY_ID || !process.env.STORM_BOT_SECRET_ACCESS_KEY && !process.env.CLOUDFLARE_SECRET_ACCESS_KEY && !process.env.SECRET_ACCESS_KEY && !process.env.AWS_SECRET_ACCESS_KEY) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
"The `ACCESS_KEY_ID` (or `STORM_BOT_ACCESS_KEY_ID`) and `SECRET_ACCESS_KEY` (or `STORM_BOT_SECRET_ACCESS_KEY`) environment variables are not set. Please set these environment variables to upload to the Cloudflare R2 bucket."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const registry = options?.registry ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
|
|
83
|
+
let projectGraph;
|
|
84
|
+
try {
|
|
85
|
+
projectGraph = readCachedProjectGraph();
|
|
86
|
+
} catch {
|
|
87
|
+
await createProjectGraphAsync();
|
|
88
|
+
projectGraph = readCachedProjectGraph();
|
|
89
|
+
}
|
|
90
|
+
if (!projectGraph) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
"The executor failed because the project graph is not available. Please run the build command again."
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
writeDebug(
|
|
96
|
+
`Publishing ${context.projectName} to the ${bucketId} R2 Bucket (at ${registry})`
|
|
97
|
+
);
|
|
98
|
+
const client = new S3Client({
|
|
99
|
+
region: "auto",
|
|
100
|
+
endpoint: registry,
|
|
101
|
+
credentials: {
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
103
|
+
accessKeyId: process.env.STORM_BOT_ACCESS_KEY_ID || process.env.CLOUDFLARE_ACCESS_KEY_ID || process.env.AWS_ACCESS_KEY_ID || process.env.ACCESS_KEY_ID,
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
105
|
+
secretAccessKey: process.env.STORM_BOT_SECRET_ACCESS_KEY || process.env.CLOUDFLARE_SECRET_ACCESS_KEY || process.env.AWS_SECRET_ACCESS_KEY || process.env.SECRET_ACCESS_KEY
|
|
106
|
+
},
|
|
107
|
+
requestHandler: createHttpHandler()
|
|
108
|
+
});
|
|
109
|
+
const version = projectDetails?.content?.version;
|
|
110
|
+
if (version) {
|
|
111
|
+
writeDebug(`Starting upload version ${version}`);
|
|
112
|
+
}
|
|
113
|
+
const basePath = options.path;
|
|
114
|
+
const files = await glob(joinPaths(basePath, "**/*"), {
|
|
115
|
+
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
116
|
+
});
|
|
117
|
+
const internalDependencies = await getInternalDependencies(
|
|
118
|
+
context.projectName,
|
|
119
|
+
projectGraph
|
|
120
|
+
);
|
|
121
|
+
const dependencies = internalDependencies.filter(
|
|
122
|
+
(projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")
|
|
123
|
+
).reduce((ret, dep) => {
|
|
124
|
+
if (!ret[dep.name]) {
|
|
125
|
+
ret[dep.name] = "latest";
|
|
126
|
+
}
|
|
127
|
+
return ret;
|
|
128
|
+
}, projectDetails?.content.dependencies ?? {});
|
|
129
|
+
const release = options.tag ?? execSync("npm config get tag").toString().trim();
|
|
130
|
+
if (options.clean === true) {
|
|
131
|
+
writeDebug(`Clearing out existing items in ${bucketPath}`);
|
|
132
|
+
if (!isDryRun) {
|
|
133
|
+
const response = await client.send(
|
|
134
|
+
new ListObjectsCommand({
|
|
135
|
+
Bucket: bucketId,
|
|
136
|
+
Prefix: !bucketPath || bucketPath === "/" ? void 0 : bucketPath
|
|
137
|
+
})
|
|
138
|
+
);
|
|
139
|
+
if (response?.Contents && response.Contents.length > 0) {
|
|
140
|
+
writeTrace(
|
|
141
|
+
`Deleting the following existing items from the R2 bucket path ${bucketPath}: ${response.Contents.map((item) => item.Key).join(", ")}`
|
|
142
|
+
);
|
|
143
|
+
await client.send(
|
|
144
|
+
new DeleteObjectsCommand({
|
|
145
|
+
Bucket: bucketId,
|
|
146
|
+
Delete: {
|
|
147
|
+
Objects: response.Contents.map((item) => ({
|
|
148
|
+
Key: item.Key
|
|
149
|
+
})),
|
|
150
|
+
Quiet: false
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
} else {
|
|
155
|
+
writeDebug(
|
|
156
|
+
`No existing items to delete in the R2 bucket path ${bucketPath}`
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
writeWarning("[Dry run]: Skipping R2 bucket clean.");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (options.writeMetaJson === true) {
|
|
164
|
+
const meta = {
|
|
165
|
+
name: context.projectName,
|
|
166
|
+
version,
|
|
167
|
+
release,
|
|
168
|
+
description: projectDetails?.content?.description,
|
|
169
|
+
tags: projectDetails?.content?.keywords,
|
|
170
|
+
dependencies,
|
|
171
|
+
devDependencies: null,
|
|
172
|
+
internalDependencies: internalDependencies.filter(
|
|
173
|
+
(projectNode) => projectNode.data.tags && projectNode.data.tags.some(
|
|
174
|
+
(tag) => tag.toLowerCase() === "component"
|
|
175
|
+
)
|
|
176
|
+
).map((dep) => dep.name)
|
|
177
|
+
};
|
|
178
|
+
if (projectDetails?.type === "package.json") {
|
|
179
|
+
meta.devDependencies = projectDetails?.content?.devDependencies;
|
|
180
|
+
}
|
|
181
|
+
await uploadFile(
|
|
182
|
+
client,
|
|
183
|
+
bucketId,
|
|
184
|
+
bucketPath,
|
|
185
|
+
"meta.json",
|
|
186
|
+
version,
|
|
187
|
+
JSON.stringify(meta),
|
|
188
|
+
"application/json",
|
|
189
|
+
isDryRun
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
await Promise.all(
|
|
193
|
+
files.map(async (file) => {
|
|
194
|
+
if (statSync(file, {
|
|
195
|
+
throwIfNoEntry: false
|
|
196
|
+
})?.isFile()) {
|
|
197
|
+
const name = correctPaths(file).replace(correctPaths(basePath), "");
|
|
198
|
+
const type = mime.lookup(name) || "application/octet-stream";
|
|
199
|
+
await uploadFile(
|
|
200
|
+
client,
|
|
201
|
+
bucketId,
|
|
202
|
+
bucketPath,
|
|
203
|
+
name,
|
|
204
|
+
version,
|
|
205
|
+
await readFile(file, getEncoding(type)),
|
|
206
|
+
type,
|
|
207
|
+
isDryRun
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
writeSuccess(
|
|
213
|
+
`Successfully uploaded the ${projectName} project to the Cloudflare R2 bucket.`,
|
|
214
|
+
config
|
|
215
|
+
);
|
|
216
|
+
return {
|
|
217
|
+
success: true
|
|
218
|
+
};
|
|
219
|
+
} catch (error) {
|
|
220
|
+
console.error("Failed to publish to Cloudflare R2 bucket");
|
|
221
|
+
console.error(error);
|
|
222
|
+
console.log("");
|
|
223
|
+
return {
|
|
224
|
+
success: false
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export {
|
|
230
|
+
runExecutor
|
|
231
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
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
|
+
var _chunkSIS5VQAUjs = require('./chunk-SIS5VQAU.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkN7FW365Qjs = require('./chunk-N7FW365Q.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkOEP2XBU4js = require('./chunk-OEP2XBU4.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkRIBK362Wjs = require('./chunk-RIBK362W.js');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkKUGEZPUOjs = require('./chunk-KUGEZPUO.js');
|
|
25
|
+
|
|
26
|
+
// src/executors/r2-upload-publish/executor.ts
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _clients3 = require('@aws-sdk/client-s3');
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var _devkit = require('@nx/devkit');
|
|
36
|
+
var _glob = require('glob');
|
|
37
|
+
var _mimetypes = require('mime-types'); var _mimetypes2 = _interopRequireDefault(_mimetypes);
|
|
38
|
+
var _child_process = require('child_process');
|
|
39
|
+
var _fs = require('fs');
|
|
40
|
+
var _promises = require('fs/promises');
|
|
41
|
+
async function runExecutor(options, context) {
|
|
42
|
+
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
43
|
+
if (!context.projectName) {
|
|
44
|
+
throw new Error("The executor requires a projectName.");
|
|
45
|
+
}
|
|
46
|
+
if (!options.path) {
|
|
47
|
+
throw new Error("The executor requires the `path` option to upload.");
|
|
48
|
+
}
|
|
49
|
+
console.info(
|
|
50
|
+
`\u{1F680} Running Storm Cloudflare Publish executor on the ${context.projectName} worker`
|
|
51
|
+
);
|
|
52
|
+
if (!context.projectName || !_optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _3 => _3.projectsConfigurations, 'access', _4 => _4.projects, 'access', _5 => _5[context.projectName], 'optionalAccess', _6 => _6.root])) {
|
|
53
|
+
throw new Error("The executor requires projectsConfigurations.");
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const workspaceRoot = _chunkOEP2XBU4js.findWorkspaceRoot.call(void 0, );
|
|
57
|
+
const config = await _chunkOEP2XBU4js.getConfig.call(void 0, workspaceRoot);
|
|
58
|
+
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.name]), () => ( context.projectName));
|
|
59
|
+
const projectDetails = _chunkN7FW365Qjs.getPackageInfo.call(void 0,
|
|
60
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
61
|
+
);
|
|
62
|
+
const bucketId = options.bucketId;
|
|
63
|
+
const bucketPath = options.bucketPath || "/";
|
|
64
|
+
if (!bucketId) {
|
|
65
|
+
throw new Error("The executor requires a bucketId.");
|
|
66
|
+
}
|
|
67
|
+
const args = _chunkN7FW365Qjs.createCliOptions.call(void 0, { ...options });
|
|
68
|
+
if (isDryRun) {
|
|
69
|
+
args.push("--dry-run");
|
|
70
|
+
}
|
|
71
|
+
const cloudflareAccountId = process.env.CLOUDFLARE_ACCOUNT_ID || process.env.STORM_BOT_CLOUDFLARE_ACCOUNT;
|
|
72
|
+
if (!_optionalChain([options, 'optionalAccess', _11 => _11.registry]) && !cloudflareAccountId) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
"The registry option and `CLOUDFLARE_ACCOUNT_ID` (or `STORM_BOT_CLOUDFLARE_ACCOUNT`) environment variable are not set. Please set one of these values to upload to the Cloudflare R2 bucket."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
if (!process.env.STORM_BOT_ACCESS_KEY_ID && !process.env.ACCESS_KEY_ID && !process.env.CLOUDFLARE_ACCESS_KEY_ID && !process.env.AWS_ACCESS_KEY_ID || !process.env.STORM_BOT_SECRET_ACCESS_KEY && !process.env.CLOUDFLARE_SECRET_ACCESS_KEY && !process.env.SECRET_ACCESS_KEY && !process.env.AWS_SECRET_ACCESS_KEY) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
"The `ACCESS_KEY_ID` (or `STORM_BOT_ACCESS_KEY_ID`) and `SECRET_ACCESS_KEY` (or `STORM_BOT_SECRET_ACCESS_KEY`) environment variables are not set. Please set these environment variables to upload to the Cloudflare R2 bucket."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const registry = _optionalChain([options, 'optionalAccess', _12 => _12.registry]) ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
|
|
83
|
+
let projectGraph;
|
|
84
|
+
try {
|
|
85
|
+
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
86
|
+
} catch (e) {
|
|
87
|
+
await _devkit.createProjectGraphAsync.call(void 0, );
|
|
88
|
+
projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
89
|
+
}
|
|
90
|
+
if (!projectGraph) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
"The executor failed because the project graph is not available. Please run the build command again."
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
_chunkRIBK362Wjs.writeDebug.call(void 0,
|
|
96
|
+
`Publishing ${context.projectName} to the ${bucketId} R2 Bucket (at ${registry})`
|
|
97
|
+
);
|
|
98
|
+
const client = new (0, _clients3.S3Client)({
|
|
99
|
+
region: "auto",
|
|
100
|
+
endpoint: registry,
|
|
101
|
+
credentials: {
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
103
|
+
accessKeyId: process.env.STORM_BOT_ACCESS_KEY_ID || process.env.CLOUDFLARE_ACCESS_KEY_ID || process.env.AWS_ACCESS_KEY_ID || process.env.ACCESS_KEY_ID,
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
105
|
+
secretAccessKey: process.env.STORM_BOT_SECRET_ACCESS_KEY || process.env.CLOUDFLARE_SECRET_ACCESS_KEY || process.env.AWS_SECRET_ACCESS_KEY || process.env.SECRET_ACCESS_KEY
|
|
106
|
+
},
|
|
107
|
+
requestHandler: _chunkKUGEZPUOjs.createHttpHandler.call(void 0, )
|
|
108
|
+
});
|
|
109
|
+
const version = _optionalChain([projectDetails, 'optionalAccess', _13 => _13.content, 'optionalAccess', _14 => _14.version]);
|
|
110
|
+
if (version) {
|
|
111
|
+
_chunkRIBK362Wjs.writeDebug.call(void 0, `Starting upload version ${version}`);
|
|
112
|
+
}
|
|
113
|
+
const basePath = options.path;
|
|
114
|
+
const files = await _glob.glob.call(void 0, _chunkRIBK362Wjs.joinPaths.call(void 0, basePath, "**/*"), {
|
|
115
|
+
ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
|
|
116
|
+
});
|
|
117
|
+
const internalDependencies = await _chunkSIS5VQAUjs.getInternalDependencies.call(void 0,
|
|
118
|
+
context.projectName,
|
|
119
|
+
projectGraph
|
|
120
|
+
);
|
|
121
|
+
const dependencies = internalDependencies.filter(
|
|
122
|
+
(projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")
|
|
123
|
+
).reduce((ret, dep) => {
|
|
124
|
+
if (!ret[dep.name]) {
|
|
125
|
+
ret[dep.name] = "latest";
|
|
126
|
+
}
|
|
127
|
+
return ret;
|
|
128
|
+
}, _nullishCoalesce(_optionalChain([projectDetails, 'optionalAccess', _15 => _15.content, 'access', _16 => _16.dependencies]), () => ( {})));
|
|
129
|
+
const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
|
|
130
|
+
if (options.clean === true) {
|
|
131
|
+
_chunkRIBK362Wjs.writeDebug.call(void 0, `Clearing out existing items in ${bucketPath}`);
|
|
132
|
+
if (!isDryRun) {
|
|
133
|
+
const response = await client.send(
|
|
134
|
+
new (0, _clients3.ListObjectsCommand)({
|
|
135
|
+
Bucket: bucketId,
|
|
136
|
+
Prefix: !bucketPath || bucketPath === "/" ? void 0 : bucketPath
|
|
137
|
+
})
|
|
138
|
+
);
|
|
139
|
+
if (_optionalChain([response, 'optionalAccess', _17 => _17.Contents]) && response.Contents.length > 0) {
|
|
140
|
+
_chunkRIBK362Wjs.writeTrace.call(void 0,
|
|
141
|
+
`Deleting the following existing items from the R2 bucket path ${bucketPath}: ${response.Contents.map((item) => item.Key).join(", ")}`
|
|
142
|
+
);
|
|
143
|
+
await client.send(
|
|
144
|
+
new (0, _clients3.DeleteObjectsCommand)({
|
|
145
|
+
Bucket: bucketId,
|
|
146
|
+
Delete: {
|
|
147
|
+
Objects: response.Contents.map((item) => ({
|
|
148
|
+
Key: item.Key
|
|
149
|
+
})),
|
|
150
|
+
Quiet: false
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
} else {
|
|
155
|
+
_chunkRIBK362Wjs.writeDebug.call(void 0,
|
|
156
|
+
`No existing items to delete in the R2 bucket path ${bucketPath}`
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
_chunkRIBK362Wjs.writeWarning.call(void 0, "[Dry run]: Skipping R2 bucket clean.");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (options.writeMetaJson === true) {
|
|
164
|
+
const meta = {
|
|
165
|
+
name: context.projectName,
|
|
166
|
+
version,
|
|
167
|
+
release,
|
|
168
|
+
description: _optionalChain([projectDetails, 'optionalAccess', _18 => _18.content, 'optionalAccess', _19 => _19.description]),
|
|
169
|
+
tags: _optionalChain([projectDetails, 'optionalAccess', _20 => _20.content, 'optionalAccess', _21 => _21.keywords]),
|
|
170
|
+
dependencies,
|
|
171
|
+
devDependencies: null,
|
|
172
|
+
internalDependencies: internalDependencies.filter(
|
|
173
|
+
(projectNode) => projectNode.data.tags && projectNode.data.tags.some(
|
|
174
|
+
(tag) => tag.toLowerCase() === "component"
|
|
175
|
+
)
|
|
176
|
+
).map((dep) => dep.name)
|
|
177
|
+
};
|
|
178
|
+
if (_optionalChain([projectDetails, 'optionalAccess', _22 => _22.type]) === "package.json") {
|
|
179
|
+
meta.devDependencies = _optionalChain([projectDetails, 'optionalAccess', _23 => _23.content, 'optionalAccess', _24 => _24.devDependencies]);
|
|
180
|
+
}
|
|
181
|
+
await _chunkSIS5VQAUjs.uploadFile.call(void 0,
|
|
182
|
+
client,
|
|
183
|
+
bucketId,
|
|
184
|
+
bucketPath,
|
|
185
|
+
"meta.json",
|
|
186
|
+
version,
|
|
187
|
+
JSON.stringify(meta),
|
|
188
|
+
"application/json",
|
|
189
|
+
isDryRun
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
await Promise.all(
|
|
193
|
+
files.map(async (file) => {
|
|
194
|
+
if (_optionalChain([_fs.statSync.call(void 0, file, {
|
|
195
|
+
throwIfNoEntry: false
|
|
196
|
+
}), 'optionalAccess', _25 => _25.isFile, 'call', _26 => _26()])) {
|
|
197
|
+
const name = _chunkRIBK362Wjs.correctPaths.call(void 0, file).replace(_chunkRIBK362Wjs.correctPaths.call(void 0, basePath), "");
|
|
198
|
+
const type = _mimetypes2.default.lookup(name) || "application/octet-stream";
|
|
199
|
+
await _chunkSIS5VQAUjs.uploadFile.call(void 0,
|
|
200
|
+
client,
|
|
201
|
+
bucketId,
|
|
202
|
+
bucketPath,
|
|
203
|
+
name,
|
|
204
|
+
version,
|
|
205
|
+
await _promises.readFile.call(void 0, file, _chunkSIS5VQAUjs.getEncoding.call(void 0, type)),
|
|
206
|
+
type,
|
|
207
|
+
isDryRun
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
_chunkRIBK362Wjs.writeSuccess.call(void 0,
|
|
213
|
+
`Successfully uploaded the ${projectName} project to the Cloudflare R2 bucket.`,
|
|
214
|
+
config
|
|
215
|
+
);
|
|
216
|
+
return {
|
|
217
|
+
success: true
|
|
218
|
+
};
|
|
219
|
+
} catch (error) {
|
|
220
|
+
console.error("Failed to publish to Cloudflare R2 bucket");
|
|
221
|
+
console.error(error);
|
|
222
|
+
console.log("");
|
|
223
|
+
return {
|
|
224
|
+
success: false
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
exports.runExecutor = runExecutor;
|
package/dist/executors.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";require('./chunk-XO66D74Z.js');
|
|
2
|
-
require('./chunk-FKBCEMBX.js');
|
|
3
|
-
require('./chunk-KUGEZPUO.js');
|
|
4
|
-
require('./chunk-SIS5VQAU.js');
|
|
5
2
|
require('./chunk-QBD2OGUY.js');
|
|
6
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-OZ7D2VVK.js');
|
|
4
|
+
require('./chunk-SIS5VQAU.js');
|
|
5
|
+
require('./chunk-ALA5P6Y4.js');
|
|
7
6
|
require('./chunk-N7FW365Q.js');
|
|
8
7
|
require('./chunk-OEP2XBU4.js');
|
|
9
8
|
require('./chunk-RIBK362W.js');
|
|
9
|
+
require('./chunk-KUGEZPUO.js');
|
|
10
10
|
require('./chunk-MCKGQKYU.js');
|
package/dist/executors.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./chunk-YSCEY447.mjs";
|
|
2
|
-
import "./chunk-B6RWRHGX.mjs";
|
|
3
|
-
import "./chunk-SWYYMID7.mjs";
|
|
4
|
-
import "./chunk-M3VAGNJQ.mjs";
|
|
5
2
|
import "./chunk-R5VXASXL.mjs";
|
|
6
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-OHTWRQBA.mjs";
|
|
4
|
+
import "./chunk-M3VAGNJQ.mjs";
|
|
5
|
+
import "./chunk-IHY5UHHO.mjs";
|
|
7
6
|
import "./chunk-3MAI3FU2.mjs";
|
|
8
7
|
import "./chunk-5QM4JUN3.mjs";
|
|
9
8
|
import "./chunk-ZDABHOZ2.mjs";
|
|
9
|
+
import "./chunk-SWYYMID7.mjs";
|
|
10
10
|
import "./chunk-HS6L6NAM.mjs";
|
package/dist/generators.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkJHW56Y57js = require('./chunk-JHW56Y57.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk7BUGSZXFjs = require('./chunk-7BUGSZXF.js');
|
|
10
10
|
require('./chunk-OEP2XBU4.js');
|
|
11
11
|
require('./chunk-RIBK362W.js');
|
|
12
12
|
require('./chunk-MCKGQKYU.js');
|
|
@@ -15,4 +15,4 @@ require('./chunk-MCKGQKYU.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.applicationGenerator =
|
|
18
|
+
exports.applicationGenerator = _chunkJHW56Y57js.applicationGenerator; exports.applicationSchematic = _chunkJHW56Y57js.applicationSchematic; exports.initGenerator = _chunk7BUGSZXFjs.initGenerator; exports.initSchematic = _chunk7BUGSZXFjs.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YIDEGEJ2.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-76H47SWR.mjs";
|
|
10
10
|
import "./chunk-5QM4JUN3.mjs";
|
|
11
11
|
import "./chunk-ZDABHOZ2.mjs";
|
|
12
12
|
import "./chunk-HS6L6NAM.mjs";
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-
|
|
2
|
-
require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-CVGPWUNP.js');
|
|
2
|
+
require('./chunk-XO66D74Z.js');
|
|
3
3
|
require('./chunk-DHBG5ASJ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJHW56Y57js = require('./chunk-JHW56Y57.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
11
|
+
var _chunk7BUGSZXFjs = require('./chunk-7BUGSZXF.js');
|
|
12
|
+
require('./chunk-QBD2OGUY.js');
|
|
13
|
+
require('./chunk-OZ7D2VVK.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _chunkSIS5VQAUjs = require('./chunk-SIS5VQAU.js');
|
|
20
|
-
require('./chunk-
|
|
21
|
-
require('./chunk-Q24LTSOU.js');
|
|
20
|
+
require('./chunk-ALA5P6Y4.js');
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
var _chunkN7FW365Qjs = require('./chunk-N7FW365Q.js');
|
|
26
25
|
require('./chunk-OEP2XBU4.js');
|
|
27
26
|
require('./chunk-RIBK362W.js');
|
|
27
|
+
require('./chunk-KUGEZPUO.js');
|
|
28
28
|
require('./chunk-MCKGQKYU.js');
|
|
29
29
|
|
|
30
30
|
// src/plugins/index.ts
|
|
@@ -160,4 +160,4 @@ function createPackageJson(projectJsonPath, workspaceRoot) {
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
|
|
163
|
-
exports.applicationGenerator =
|
|
163
|
+
exports.applicationGenerator = _chunkJHW56Y57js.applicationGenerator; exports.applicationSchematic = _chunkJHW56Y57js.applicationSchematic; exports.createNodesV2 = createNodesV2; exports.getEncoding = _chunkSIS5VQAUjs.getEncoding; exports.getInternalDependencies = _chunkSIS5VQAUjs.getInternalDependencies; exports.initGenerator = _chunk7BUGSZXFjs.initGenerator; exports.initSchematic = _chunk7BUGSZXFjs.initSchematic; exports.isTextFile = _chunkSIS5VQAUjs.isTextFile; exports.name = name; exports.uploadFile = _chunkSIS5VQAUjs.uploadFile;
|
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
+
import "./chunk-7Z5PILRU.mjs";
|
|
1
2
|
import "./chunk-YSCEY447.mjs";
|
|
2
|
-
import "./chunk-B6RWRHGX.mjs";
|
|
3
3
|
import "./chunk-3J7KBHMJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
applicationGenerator,
|
|
6
6
|
applicationSchematic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YIDEGEJ2.mjs";
|
|
8
8
|
import {
|
|
9
9
|
initGenerator,
|
|
10
10
|
initSchematic
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-76H47SWR.mjs";
|
|
12
|
+
import "./chunk-R5VXASXL.mjs";
|
|
13
|
+
import "./chunk-OHTWRQBA.mjs";
|
|
14
14
|
import {
|
|
15
15
|
getEncoding,
|
|
16
16
|
getInternalDependencies,
|
|
17
17
|
isTextFile,
|
|
18
18
|
uploadFile
|
|
19
19
|
} from "./chunk-M3VAGNJQ.mjs";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-4QGEP2VP.mjs";
|
|
20
|
+
import "./chunk-IHY5UHHO.mjs";
|
|
22
21
|
import {
|
|
23
22
|
ProjectTagConstants,
|
|
24
23
|
addProjectTag
|
|
25
24
|
} from "./chunk-3MAI3FU2.mjs";
|
|
26
25
|
import "./chunk-5QM4JUN3.mjs";
|
|
27
26
|
import "./chunk-ZDABHOZ2.mjs";
|
|
27
|
+
import "./chunk-SWYYMID7.mjs";
|
|
28
28
|
import "./chunk-HS6L6NAM.mjs";
|
|
29
29
|
|
|
30
30
|
// src/plugins/index.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
var _chunkQBD2OGUYjs = require('../../../chunk-QBD2OGUY.js');
|
|
4
|
-
require('../../../chunk-
|
|
4
|
+
require('../../../chunk-ALA5P6Y4.js');
|
|
5
5
|
require('../../../chunk-N7FW365Q.js');
|
|
6
6
|
require('../../../chunk-OEP2XBU4.js');
|
|
7
7
|
require('../../../chunk-RIBK362W.js');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../../chunk-KUGEZPUO.js');
|
|
3
|
+
var _chunkOZ7D2VVKjs = require('../../../chunk-OZ7D2VVK.js');
|
|
5
4
|
require('../../../chunk-SIS5VQAU.js');
|
|
6
5
|
require('../../../chunk-N7FW365Q.js');
|
|
7
6
|
require('../../../chunk-OEP2XBU4.js');
|
|
8
7
|
require('../../../chunk-RIBK362W.js');
|
|
8
|
+
require('../../../chunk-KUGEZPUO.js');
|
|
9
9
|
require('../../../chunk-MCKGQKYU.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.default =
|
|
12
|
+
exports.default = _chunkOZ7D2VVKjs.runExecutor;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-SWYYMID7.mjs";
|
|
3
|
+
} from "../../../chunk-OHTWRQBA.mjs";
|
|
5
4
|
import "../../../chunk-M3VAGNJQ.mjs";
|
|
6
5
|
import "../../../chunk-3MAI3FU2.mjs";
|
|
7
6
|
import "../../../chunk-5QM4JUN3.mjs";
|
|
8
7
|
import "../../../chunk-ZDABHOZ2.mjs";
|
|
8
|
+
import "../../../chunk-SWYYMID7.mjs";
|
|
9
9
|
import "../../../chunk-HS6L6NAM.mjs";
|
|
10
10
|
export {
|
|
11
11
|
runExecutor as default
|
|
@@ -1,6 +1,6 @@
|
|
|
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 _chunkALA5P6Y4js = require('../../../chunk-ALA5P6Y4.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkN7FW365Qjs = require('../../../chunk-N7FW365Q.js');
|
|
@@ -55,7 +55,7 @@ async function* serveExecutor(options, context) {
|
|
|
55
55
|
success: true
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
var executor_default =
|
|
58
|
+
var executor_default = _chunkALA5P6Y4js.withRunExecutor.call(void 0,
|
|
59
59
|
"Cloudflare Serve executor",
|
|
60
60
|
serveExecutor,
|
|
61
61
|
{
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk7BUGSZXFjs = require('../../../chunk-7BUGSZXF.js');
|
|
6
6
|
require('../../../chunk-MCKGQKYU.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = _chunk7BUGSZXFjs.generator_default; exports.initGenerator = _chunk7BUGSZXFjs.initGenerator; exports.initSchematic = _chunk7BUGSZXFjs.initSchematic;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../../chunk-
|
|
5
|
+
var _chunkJHW56Y57js = require('../../../chunk-JHW56Y57.js');
|
|
6
|
+
require('../../../chunk-7BUGSZXF.js');
|
|
7
7
|
require('../../../chunk-OEP2XBU4.js');
|
|
8
8
|
require('../../../chunk-RIBK362W.js');
|
|
9
9
|
require('../../../chunk-MCKGQKYU.js');
|
|
@@ -11,4 +11,4 @@ require('../../../chunk-MCKGQKYU.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.applicationGenerator =
|
|
14
|
+
exports.applicationGenerator = _chunkJHW56Y57js.applicationGenerator; exports.applicationSchematic = _chunkJHW56Y57js.applicationSchematic; exports.default = _chunkJHW56Y57js.generator_default;
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
applicationGenerator,
|
|
3
3
|
applicationSchematic,
|
|
4
4
|
generator_default
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
5
|
+
} from "../../../chunk-YIDEGEJ2.mjs";
|
|
6
|
+
import "../../../chunk-76H47SWR.mjs";
|
|
7
7
|
import "../../../chunk-5QM4JUN3.mjs";
|
|
8
8
|
import "../../../chunk-ZDABHOZ2.mjs";
|
|
9
9
|
import "../../../chunk-HS6L6NAM.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/cloudflare-tools",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.129",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
6
6
|
"keywords": [
|
|
@@ -137,9 +137,9 @@
|
|
|
137
137
|
"@nx/js": "22.6.0",
|
|
138
138
|
"@nx/node": "22.5.1",
|
|
139
139
|
"@nx/web": "22.5.1",
|
|
140
|
-
"@storm-software/config": "1.137.
|
|
141
|
-
"@storm-software/config-tools": "1.189.
|
|
142
|
-
"@storm-software/workspace-tools": "1.295.
|
|
140
|
+
"@storm-software/config": "1.137.31",
|
|
141
|
+
"@storm-software/config-tools": "1.189.77",
|
|
142
|
+
"@storm-software/workspace-tools": "1.295.54",
|
|
143
143
|
"nx": "22.6.0",
|
|
144
144
|
"tsup": "8.4.0",
|
|
145
145
|
"wrangler": ">=3.58.0"
|
|
@@ -155,5 +155,5 @@
|
|
|
155
155
|
"publishConfig": { "access": "public" },
|
|
156
156
|
"executors": "./executors.json",
|
|
157
157
|
"generators": "./generators.json",
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "e41ccf3321407c1ccb6c1a16c4aff7f6172d8b0c"
|
|
159
159
|
}
|