@storm-software/cloudflare-tools 0.71.235 → 0.71.242
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 +78 -0
- package/README.md +1 -1
- package/dist/{chunk-MIPARIGF.mjs → chunk-3GUCTXXT.mjs} +3 -3
- package/dist/{chunk-7BBXRCAA.mjs → chunk-4HEOMMTX.mjs} +3 -3
- package/dist/{chunk-TXSHBEGN.js → chunk-7NFFNXFN.js} +12 -12
- package/dist/{chunk-2S4EPFWW.js → chunk-AF4CHUYX.js} +5 -5
- package/dist/{chunk-62X6T4SY.js → chunk-BASIQFOW.js} +6 -6
- package/dist/{chunk-7Z3A2OAB.mjs → chunk-BGMLQBUW.mjs} +1 -1
- package/dist/{chunk-5MAMLVMV.mjs → chunk-BJQFVPGK.mjs} +3 -1
- package/dist/{chunk-3E2GFJMN.mjs → chunk-E2KDBKFZ.mjs} +8 -8
- package/dist/{chunk-YWFXWCTG.mjs → chunk-EI77CIK7.mjs} +1 -1
- package/dist/chunk-FLA2SYPV.js +231 -0
- package/dist/{chunk-IZL2M4L5.js → chunk-GLKR5BOA.js} +5 -5
- package/dist/{chunk-FXP4SY7V.js → chunk-GRVOVEJP.js} +5 -5
- package/dist/{chunk-WYBCLRR7.mjs → chunk-KNN4W7QC.mjs} +2 -2
- package/dist/{chunk-IZGBGYWL.mjs → chunk-MVEHOKMY.mjs} +2 -2
- package/dist/{chunk-GHTZXW75.js → chunk-TMHLSIZ5.js} +1 -1
- package/dist/chunk-WTWLKDV7.mjs +231 -0
- package/dist/{chunk-67JJGDCQ.mjs → chunk-YCOA7IKG.mjs} +6 -6
- package/dist/{chunk-PGTHXO6M.js → chunk-YRUROEEP.js} +3 -1
- package/dist/executors.js +3 -3
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +4 -4
- package/dist/generators.mjs +4 -4
- package/dist/index.js +6 -6
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +2 -2
- package/dist/src/executors/cloudflare-publish/executor.mjs +4 -4
- package/dist/src/executors/r2-upload-publish/executor.js +3 -3
- package/dist/src/executors/r2-upload-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/untyped.mjs +1 -1
- package/dist/src/executors/serve/executor.js +3 -3
- 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 +2 -2
- package/dist/src/generators/worker/generator.js +4 -4
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/plugins/index.mjs +1 -1
- package/dist/src/utils/http-handler.mjs +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/dist/src/utils/r2-bucket-helpers.mjs +1 -1
- package/package.json +9 -9
|
@@ -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.241",
|
|
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: [
|
|
@@ -160,9 +160,9 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
160
160
|
module: "dist/index.mjs",
|
|
161
161
|
typings: "dist/index.d.ts",
|
|
162
162
|
dependencies: {
|
|
163
|
-
"@aws-sdk/client-s3": "^3.
|
|
164
|
-
"@aws-sdk/lib-storage": "^3.
|
|
165
|
-
"@smithy/node-http-handler": "^4.9.
|
|
163
|
+
"@aws-sdk/client-s3": "^3.1085.0",
|
|
164
|
+
"@aws-sdk/lib-storage": "^3.1085.0",
|
|
165
|
+
"@smithy/node-http-handler": "^4.9.5",
|
|
166
166
|
"@storm-software/config": "workspace:*",
|
|
167
167
|
"@storm-software/config-tools": "workspace:*",
|
|
168
168
|
"@storm-software/workspace-tools": "workspace:*",
|
|
@@ -176,7 +176,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
|
176
176
|
"@nx/node": "catalog:",
|
|
177
177
|
"@nx/web": "catalog:",
|
|
178
178
|
"@nx/webpack": "catalog:",
|
|
179
|
-
"@smithy/protocol-http": "^5.5.
|
|
179
|
+
"@smithy/protocol-http": "^5.5.8",
|
|
180
180
|
nx: "catalog:",
|
|
181
181
|
tsup: "catalog:",
|
|
182
182
|
untyped: "catalog:",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getWorkspaceConfig,
|
|
8
8
|
schemaRegistry,
|
|
9
9
|
workspaceConfigSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BJQFVPGK.mjs";
|
|
11
11
|
import {
|
|
12
12
|
ProjectTagConstants,
|
|
13
13
|
addProjectTag
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./chunk-K4H5ZMYA.mjs";
|
|
31
31
|
import {
|
|
32
32
|
__dirname
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-EI77CIK7.mjs";
|
|
34
34
|
|
|
35
35
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
36
36
|
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__commonJS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EI77CIK7.mjs";
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
6
|
var require_package = __commonJS({
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
|
-
module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.
|
|
8
|
+
module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.242", private: false, description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.", keywords: ["monorepo", "open-system", "storm", "storm-ops", "storm-stack", "stormstack", "sullivanpj"], homepage: "https://stormsoftware.com", bugs: "https://github.com/storm-software/storm-ops/issues", repository: { type: "github", url: "https://github.com/storm-software/storm-ops.git", directory: "packages/cloudflare-tools" }, license: "Apache-2.0", author: { name: "Storm Software", email: "contact@stormsoftware.com", url: "https://stormsoftware.com" }, exports: { "./package.json": "./package.json", "./docs/*": "./docs/*", "./migrations.json": "./migrations.json", "./executors.json": "./executors.json", "./executors/*/schema.json": "./dist/src/executors/*/schema.json", "./generators.json": "./generators.json", "./generators/*/schema.json": "./dist/src/generators/*/schema.json", ".": { import: { types: "./dist/index.d.mts", default: "./dist/index.mjs" }, require: { types: "./dist/index.d.ts", default: "./dist/index.js" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./index": { import: { types: "./dist/index.d.mts", default: "./dist/index.mjs" }, require: { types: "./dist/index.d.ts", default: "./dist/index.js" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./executors": { import: { types: "./dist/executors.d.mts", default: "./dist/executors.mjs" }, require: { types: "./dist/executors.d.ts", default: "./dist/executors.js" }, default: { types: "./dist/executors.d.ts", default: "./dist/executors.js" } }, "./executors/*": { import: { types: "./dist/src/executors/*.d.mts", default: "./dist/src/executors/*.mjs" }, require: { types: "./dist/src/executors/*.d.ts", default: "./dist/src/executors/*.js" }, default: { types: "./dist/src/executors/*.d.ts", default: "./dist/src/executors/*.js" } }, "./generators": { import: { types: "./dist/generators.d.mts", default: "./dist/generators.mjs" }, require: { types: "./dist/generators.d.ts", default: "./dist/generators.js" }, default: { types: "./dist/generators.d.ts", default: "./dist/generators.js" } }, "./generators/*": { import: { types: "./dist/src/generators/*.d.mts", default: "./dist/src/generators/*.mjs" }, require: { types: "./dist/src/generators/*.d.ts", default: "./dist/src/generators/*.js" }, default: { types: "./dist/src/generators/*.d.ts", default: "./dist/src/generators/*.js" } }, "./utils": { import: { types: "./dist/src/utils/index.d.mts", default: "./dist/src/utils/index.mjs" }, require: { types: "./dist/src/utils/index.d.ts", default: "./dist/src/utils/index.js" }, default: { types: "./dist/src/utils/index.d.ts", default: "./dist/src/utils/index.js" } }, "./utils/*": { import: { types: "./dist/src/utils/*.d.mts", default: "./dist/src/utils/*.mjs" }, require: { types: "./dist/src/utils/*.d.ts", default: "./dist/src/utils/*.js" }, default: { types: "./dist/src/utils/*.d.ts", default: "./dist/src/utils/*.js" } }, "./executors/*/executor.js": "./dist/src/executors/*/executor.js", "./generators/*/generator.js": "./dist/src/generators/*/generator.js", "./plugin": "./dist/src/plugins/index.js" }, main: "dist/index.js", module: "dist/index.mjs", typings: "dist/index.d.ts", dependencies: { "@aws-sdk/client-s3": "^3.1085.0", "@aws-sdk/lib-storage": "^3.1085.0", "@smithy/node-http-handler": "^4.9.5", "@storm-software/config": "workspace:*", "@storm-software/config-tools": "workspace:*", "@storm-software/workspace-tools": "workspace:*", defu: "catalog:", glob: "catalog:", "mime-types": "^3.0.2", "pretty-bytes": "^7.1.0" }, devDependencies: { "@nx/devkit": "catalog:", "@nx/node": "catalog:", "@nx/web": "catalog:", "@nx/webpack": "catalog:", "@smithy/protocol-http": "^5.5.8", nx: "catalog:", tsup: "catalog:", untyped: "catalog:", wrangler: "^4.110.0" }, peerDependencies: { nx: ">=22.7.1", wrangler: ">=3.58.0" }, peerDependenciesMeta: { nx: { optional: false }, wrangler: { optional: false } }, publishConfig: { access: "public" }, executors: "./executors.json", generators: "./generators.json" };
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _chunkMCKGQKYUjs = require('./chunk-MCKGQKYU.js');
|
|
|
5
5
|
// package.json
|
|
6
6
|
var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
|
|
7
7
|
"package.json"(exports, module) {
|
|
8
|
-
module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.
|
|
8
|
+
module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.242", private: false, description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.", keywords: ["monorepo", "open-system", "storm", "storm-ops", "storm-stack", "stormstack", "sullivanpj"], homepage: "https://stormsoftware.com", bugs: "https://github.com/storm-software/storm-ops/issues", repository: { type: "github", url: "https://github.com/storm-software/storm-ops.git", directory: "packages/cloudflare-tools" }, license: "Apache-2.0", author: { name: "Storm Software", email: "contact@stormsoftware.com", url: "https://stormsoftware.com" }, exports: { "./package.json": "./package.json", "./docs/*": "./docs/*", "./migrations.json": "./migrations.json", "./executors.json": "./executors.json", "./executors/*/schema.json": "./dist/src/executors/*/schema.json", "./generators.json": "./generators.json", "./generators/*/schema.json": "./dist/src/generators/*/schema.json", ".": { import: { types: "./dist/index.d.mts", default: "./dist/index.mjs" }, require: { types: "./dist/index.d.ts", default: "./dist/index.js" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./index": { import: { types: "./dist/index.d.mts", default: "./dist/index.mjs" }, require: { types: "./dist/index.d.ts", default: "./dist/index.js" }, default: { types: "./dist/index.d.ts", default: "./dist/index.js" } }, "./executors": { import: { types: "./dist/executors.d.mts", default: "./dist/executors.mjs" }, require: { types: "./dist/executors.d.ts", default: "./dist/executors.js" }, default: { types: "./dist/executors.d.ts", default: "./dist/executors.js" } }, "./executors/*": { import: { types: "./dist/src/executors/*.d.mts", default: "./dist/src/executors/*.mjs" }, require: { types: "./dist/src/executors/*.d.ts", default: "./dist/src/executors/*.js" }, default: { types: "./dist/src/executors/*.d.ts", default: "./dist/src/executors/*.js" } }, "./generators": { import: { types: "./dist/generators.d.mts", default: "./dist/generators.mjs" }, require: { types: "./dist/generators.d.ts", default: "./dist/generators.js" }, default: { types: "./dist/generators.d.ts", default: "./dist/generators.js" } }, "./generators/*": { import: { types: "./dist/src/generators/*.d.mts", default: "./dist/src/generators/*.mjs" }, require: { types: "./dist/src/generators/*.d.ts", default: "./dist/src/generators/*.js" }, default: { types: "./dist/src/generators/*.d.ts", default: "./dist/src/generators/*.js" } }, "./utils": { import: { types: "./dist/src/utils/index.d.mts", default: "./dist/src/utils/index.mjs" }, require: { types: "./dist/src/utils/index.d.ts", default: "./dist/src/utils/index.js" }, default: { types: "./dist/src/utils/index.d.ts", default: "./dist/src/utils/index.js" } }, "./utils/*": { import: { types: "./dist/src/utils/*.d.mts", default: "./dist/src/utils/*.mjs" }, require: { types: "./dist/src/utils/*.d.ts", default: "./dist/src/utils/*.js" }, default: { types: "./dist/src/utils/*.d.ts", default: "./dist/src/utils/*.js" } }, "./executors/*/executor.js": "./dist/src/executors/*/executor.js", "./generators/*/generator.js": "./dist/src/generators/*/generator.js", "./plugin": "./dist/src/plugins/index.js" }, main: "dist/index.js", module: "dist/index.mjs", typings: "dist/index.d.ts", dependencies: { "@aws-sdk/client-s3": "^3.1085.0", "@aws-sdk/lib-storage": "^3.1085.0", "@smithy/node-http-handler": "^4.9.5", "@storm-software/config": "workspace:*", "@storm-software/config-tools": "workspace:*", "@storm-software/workspace-tools": "workspace:*", defu: "catalog:", glob: "catalog:", "mime-types": "^3.0.2", "pretty-bytes": "^7.1.0" }, devDependencies: { "@nx/devkit": "catalog:", "@nx/node": "catalog:", "@nx/web": "catalog:", "@nx/webpack": "catalog:", "@smithy/protocol-http": "^5.5.8", nx: "catalog:", tsup: "catalog:", untyped: "catalog:", wrangler: "^4.110.0" }, peerDependencies: { nx: ">=22.7.1", wrangler: ">=3.58.0" }, peerDependenciesMeta: { nx: { optional: false }, wrangler: { optional: false } }, publishConfig: { access: "public" }, executors: "./executors.json", generators: "./generators.json" };
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHttpHandler
|
|
3
|
+
} from "./chunk-SWYYMID7.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getEncoding,
|
|
6
|
+
getInternalDependencies,
|
|
7
|
+
uploadFile
|
|
8
|
+
} from "./chunk-BY7MA3SM.mjs";
|
|
9
|
+
import {
|
|
10
|
+
createCliOptions,
|
|
11
|
+
getPackageInfo
|
|
12
|
+
} from "./chunk-ZXLMDNFQ.mjs";
|
|
13
|
+
import {
|
|
14
|
+
findWorkspaceRoot,
|
|
15
|
+
getConfig
|
|
16
|
+
} from "./chunk-BJQFVPGK.mjs";
|
|
17
|
+
import {
|
|
18
|
+
correctPaths,
|
|
19
|
+
joinPaths,
|
|
20
|
+
writeDebug,
|
|
21
|
+
writeSuccess,
|
|
22
|
+
writeTrace,
|
|
23
|
+
writeWarning
|
|
24
|
+
} from "./chunk-K4H5ZMYA.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
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__commonJS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EI77CIK7.mjs";
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
6
|
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.241",
|
|
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: [
|
|
@@ -160,9 +160,9 @@ var require_package = __commonJS({
|
|
|
160
160
|
module: "dist/index.mjs",
|
|
161
161
|
typings: "dist/index.d.ts",
|
|
162
162
|
dependencies: {
|
|
163
|
-
"@aws-sdk/client-s3": "^3.
|
|
164
|
-
"@aws-sdk/lib-storage": "^3.
|
|
165
|
-
"@smithy/node-http-handler": "^4.9.
|
|
163
|
+
"@aws-sdk/client-s3": "^3.1085.0",
|
|
164
|
+
"@aws-sdk/lib-storage": "^3.1085.0",
|
|
165
|
+
"@smithy/node-http-handler": "^4.9.5",
|
|
166
166
|
"@storm-software/config": "workspace:*",
|
|
167
167
|
"@storm-software/config-tools": "workspace:*",
|
|
168
168
|
"@storm-software/workspace-tools": "workspace:*",
|
|
@@ -176,7 +176,7 @@ var require_package = __commonJS({
|
|
|
176
176
|
"@nx/node": "catalog:",
|
|
177
177
|
"@nx/web": "catalog:",
|
|
178
178
|
"@nx/webpack": "catalog:",
|
|
179
|
-
"@smithy/protocol-http": "^5.5.
|
|
179
|
+
"@smithy/protocol-http": "^5.5.8",
|
|
180
180
|
nx: "catalog:",
|
|
181
181
|
tsup: "catalog:",
|
|
182
182
|
untyped: "catalog:",
|
package/dist/executors.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";require('./chunk-XO66D74Z.js');
|
|
2
|
-
require('./chunk-
|
|
2
|
+
require('./chunk-FLA2SYPV.js');
|
|
3
3
|
require('./chunk-KUGEZPUO.js');
|
|
4
4
|
require('./chunk-CLCKX6UN.js');
|
|
5
5
|
require('./chunk-HNDXHX7M.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-7NFFNXFN.js');
|
|
7
7
|
require('./chunk-NCVDTA5M.js');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-YRUROEEP.js');
|
|
9
9
|
require('./chunk-FBLD25X4.js');
|
|
10
10
|
require('./chunk-AWKQRM2H.js');
|
|
11
11
|
require('./chunk-MCKGQKYU.js');
|
package/dist/executors.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./chunk-YSCEY447.mjs";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-WTWLKDV7.mjs";
|
|
3
3
|
import "./chunk-SWYYMID7.mjs";
|
|
4
4
|
import "./chunk-BY7MA3SM.mjs";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-BGMLQBUW.mjs";
|
|
6
|
+
import "./chunk-KNN4W7QC.mjs";
|
|
7
7
|
import "./chunk-ZXLMDNFQ.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BJQFVPGK.mjs";
|
|
9
9
|
import "./chunk-CSTZEHUP.mjs";
|
|
10
10
|
import "./chunk-K4H5ZMYA.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-EI77CIK7.mjs";
|
package/dist/generators.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkGLKR5BOAjs = require('./chunk-GLKR5BOA.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('./chunk-
|
|
9
|
+
var _chunkTMHLSIZ5js = require('./chunk-TMHLSIZ5.js');
|
|
10
|
+
require('./chunk-YRUROEEP.js');
|
|
11
11
|
require('./chunk-AWKQRM2H.js');
|
|
12
12
|
require('./chunk-MCKGQKYU.js');
|
|
13
13
|
|
|
@@ -15,4 +15,4 @@ require('./chunk-MCKGQKYU.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.applicationGenerator =
|
|
18
|
+
exports.applicationGenerator = _chunkGLKR5BOAjs.applicationGenerator; exports.applicationSchematic = _chunkGLKR5BOAjs.applicationSchematic; exports.initGenerator = _chunkTMHLSIZ5js.initGenerator; exports.initSchematic = _chunkTMHLSIZ5js.initSchematic;
|
package/dist/generators.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import "./chunk-3J7KBHMJ.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
applicationGenerator,
|
|
4
4
|
applicationSchematic
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4HEOMMTX.mjs";
|
|
6
6
|
import {
|
|
7
7
|
initGenerator,
|
|
8
8
|
initSchematic
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-MVEHOKMY.mjs";
|
|
10
|
+
import "./chunk-BJQFVPGK.mjs";
|
|
11
11
|
import "./chunk-K4H5ZMYA.mjs";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-EI77CIK7.mjs";
|
|
13
13
|
export {
|
|
14
14
|
applicationGenerator,
|
|
15
15
|
applicationSchematic,
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-XO66D74Z.js');
|
|
2
|
-
require('./chunk-
|
|
2
|
+
require('./chunk-FLA2SYPV.js');
|
|
3
3
|
require('./chunk-DHBG5ASJ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkGLKR5BOAjs = require('./chunk-GLKR5BOA.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkTMHLSIZ5js = require('./chunk-TMHLSIZ5.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -22,9 +22,9 @@ require('./chunk-CVGPWUNP.js');
|
|
|
22
22
|
|
|
23
23
|
var _chunkCLCKX6UNjs = require('./chunk-CLCKX6UN.js');
|
|
24
24
|
require('./chunk-HNDXHX7M.js');
|
|
25
|
-
require('./chunk-
|
|
25
|
+
require('./chunk-7NFFNXFN.js');
|
|
26
26
|
require('./chunk-NCVDTA5M.js');
|
|
27
|
-
require('./chunk-
|
|
27
|
+
require('./chunk-YRUROEEP.js');
|
|
28
28
|
require('./chunk-FBLD25X4.js');
|
|
29
29
|
require('./chunk-AWKQRM2H.js');
|
|
30
30
|
require('./chunk-MCKGQKYU.js');
|
|
@@ -39,4 +39,4 @@ require('./chunk-MCKGQKYU.js');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.applicationGenerator =
|
|
42
|
+
exports.applicationGenerator = _chunkGLKR5BOAjs.applicationGenerator; exports.applicationSchematic = _chunkGLKR5BOAjs.applicationSchematic; exports.createNodesV2 = _chunkVJLWHQ5Bjs.createNodesV2; exports.getEncoding = _chunkCLCKX6UNjs.getEncoding; exports.getInternalDependencies = _chunkCLCKX6UNjs.getInternalDependencies; exports.initGenerator = _chunkTMHLSIZ5js.initGenerator; exports.initSchematic = _chunkTMHLSIZ5js.initSchematic; exports.isTextFile = _chunkCLCKX6UNjs.isTextFile; exports.name = _chunkVJLWHQ5Bjs.name; exports.uploadFile = _chunkCLCKX6UNjs.uploadFile;
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "./chunk-YSCEY447.mjs";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-WTWLKDV7.mjs";
|
|
3
3
|
import "./chunk-3J7KBHMJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
applicationGenerator,
|
|
6
6
|
applicationSchematic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4HEOMMTX.mjs";
|
|
8
8
|
import {
|
|
9
9
|
initGenerator,
|
|
10
10
|
initSchematic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MVEHOKMY.mjs";
|
|
12
12
|
import {
|
|
13
13
|
createNodesV2,
|
|
14
14
|
name
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
isTextFile,
|
|
22
22
|
uploadFile
|
|
23
23
|
} from "./chunk-BY7MA3SM.mjs";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-BGMLQBUW.mjs";
|
|
25
|
+
import "./chunk-KNN4W7QC.mjs";
|
|
26
26
|
import "./chunk-ZXLMDNFQ.mjs";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-BJQFVPGK.mjs";
|
|
28
28
|
import "./chunk-CSTZEHUP.mjs";
|
|
29
29
|
import "./chunk-K4H5ZMYA.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-EI77CIK7.mjs";
|
|
31
31
|
export {
|
|
32
32
|
applicationGenerator,
|
|
33
33
|
applicationSchematic,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
var _chunkHNDXHX7Mjs = require('../../../chunk-HNDXHX7M.js');
|
|
4
|
-
require('../../../chunk-
|
|
4
|
+
require('../../../chunk-7NFFNXFN.js');
|
|
5
5
|
require('../../../chunk-NCVDTA5M.js');
|
|
6
|
-
require('../../../chunk-
|
|
6
|
+
require('../../../chunk-YRUROEEP.js');
|
|
7
7
|
require('../../../chunk-FBLD25X4.js');
|
|
8
8
|
require('../../../chunk-AWKQRM2H.js');
|
|
9
9
|
require('../../../chunk-MCKGQKYU.js');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
3
|
+
} from "../../../chunk-BGMLQBUW.mjs";
|
|
4
|
+
import "../../../chunk-KNN4W7QC.mjs";
|
|
5
5
|
import "../../../chunk-ZXLMDNFQ.mjs";
|
|
6
|
-
import "../../../chunk-
|
|
6
|
+
import "../../../chunk-BJQFVPGK.mjs";
|
|
7
7
|
import "../../../chunk-CSTZEHUP.mjs";
|
|
8
8
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-EI77CIK7.mjs";
|
|
10
10
|
export {
|
|
11
11
|
runExecutor as default
|
|
12
12
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFLA2SYPVjs = require('../../../chunk-FLA2SYPV.js');
|
|
4
4
|
require('../../../chunk-KUGEZPUO.js');
|
|
5
5
|
require('../../../chunk-CLCKX6UN.js');
|
|
6
6
|
require('../../../chunk-NCVDTA5M.js');
|
|
7
|
-
require('../../../chunk-
|
|
7
|
+
require('../../../chunk-YRUROEEP.js');
|
|
8
8
|
require('../../../chunk-FBLD25X4.js');
|
|
9
9
|
require('../../../chunk-AWKQRM2H.js');
|
|
10
10
|
require('../../../chunk-MCKGQKYU.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.default =
|
|
13
|
+
exports.default = _chunkFLA2SYPVjs.runExecutor;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runExecutor
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-WTWLKDV7.mjs";
|
|
4
4
|
import "../../../chunk-SWYYMID7.mjs";
|
|
5
5
|
import "../../../chunk-BY7MA3SM.mjs";
|
|
6
6
|
import "../../../chunk-ZXLMDNFQ.mjs";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-BJQFVPGK.mjs";
|
|
8
8
|
import "../../../chunk-CSTZEHUP.mjs";
|
|
9
9
|
import "../../../chunk-K4H5ZMYA.mjs";
|
|
10
|
-
import "../../../chunk-
|
|
10
|
+
import "../../../chunk-EI77CIK7.mjs";
|
|
11
11
|
export {
|
|
12
12
|
runExecutor as default
|
|
13
13
|
};
|