@storm-software/cloudflare-tools 0.71.2 → 0.71.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -2
  3. package/dist/{chunk-7ESZB4KW.mjs → chunk-4EEXR4IG.mjs} +10 -11
  4. package/dist/chunk-5CMG7SUH.mjs +43 -0
  5. package/dist/{chunk-VHMJXOF4.js → chunk-BAINZIOH.js} +24 -25
  6. package/dist/{chunk-W5IPHIXB.js → chunk-EKIV24FH.js} +165 -165
  7. package/dist/{chunk-5YJKWRBZ.mjs → chunk-KSI6XHC2.mjs} +3 -3
  8. package/dist/{chunk-TUJUSMGX.mjs → chunk-MDAZ6JEL.mjs} +4 -4
  9. package/dist/{chunk-C6B32MBV.mjs → chunk-NYGOCQMG.mjs} +6 -6
  10. package/dist/{chunk-HQWL5NAU.js → chunk-ODODTGMB.js} +12 -12
  11. package/dist/{chunk-PTTJW7MW.mjs → chunk-SGTAZO2Q.mjs} +3 -171
  12. package/dist/{chunk-NEODNLL5.js → chunk-TP74CGBA.js} +4 -4
  13. package/dist/{chunk-6MATO2MJ.mjs → chunk-TPNHSNNZ.mjs} +171 -1
  14. package/dist/{chunk-FFOLWRMA.js → chunk-UAKLE2QO.js} +11 -12
  15. package/dist/{chunk-EQXEFXCV.js → chunk-VKMAYBQX.js} +48 -216
  16. package/dist/{chunk-4BWM53AA.js → chunk-Z2WQB55R.js} +171 -1
  17. package/dist/executors.d.mts +1 -1
  18. package/dist/executors.d.ts +1 -1
  19. package/dist/executors.js +5 -5
  20. package/dist/executors.mjs +5 -5
  21. package/dist/generators.js +5 -5
  22. package/dist/generators.mjs +4 -4
  23. package/dist/index.d.mts +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +8 -8
  26. package/dist/index.mjs +7 -7
  27. package/dist/{schema.d-elsO8UQp.d.mts → schema.d-Dcq3Apw7.d.mts} +2 -2
  28. package/dist/{schema.d-elsO8UQp.d.ts → schema.d-Dcq3Apw7.d.ts} +2 -2
  29. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  30. package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
  31. package/dist/src/executors/r2-upload-publish/executor.d.mts +1 -1
  32. package/dist/src/executors/r2-upload-publish/executor.d.ts +1 -1
  33. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  34. package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
  35. package/dist/src/executors/r2-upload-publish/schema.d.ts +2 -2
  36. package/dist/src/executors/r2-upload-publish/schema.json +2 -2
  37. package/dist/src/executors/serve/executor.js +4 -4
  38. package/dist/src/executors/serve/executor.mjs +3 -3
  39. package/dist/src/generators/init/generator.js +2 -2
  40. package/dist/src/generators/init/generator.mjs +1 -1
  41. package/dist/src/generators/worker/generator.js +5 -5
  42. package/dist/src/generators/worker/generator.mjs +4 -4
  43. package/dist/src/utils/index.js +3 -3
  44. package/dist/src/utils/index.mjs +2 -2
  45. package/dist/src/utils/r2-bucket-helpers.d.mts +21 -2
  46. package/dist/src/utils/r2-bucket-helpers.d.ts +21 -2
  47. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  48. package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
  49. package/docs/api/executors/r2-upload-publish/schema.md +2 -2
  50. package/package.json +5 -5
  51. package/dist/chunk-5N2NVDKX.mjs +0 -44
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog for Storm Ops - Cloudflare Tools
4
4
 
5
+ ## [0.71.3](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.3) (12/05/2025)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **monorepo:** Update Nx packages to v22.1.3
10
+ ([3d5e53580](https://github.com/storm-software/storm-ops/commit/3d5e53580))
11
+
12
+ ### Bug Fixes
13
+
14
+ - **cloudflare-tools:** Resolve issue with usage of invalid bucket path
15
+ ([722dfa6df](https://github.com/storm-software/storm-ops/commit/722dfa6df))
16
+
17
+ ## [0.71.2](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.2) (12/05/2025)
18
+
19
+ ### Miscellaneous
20
+
21
+ - **monorepo:** Update Nx packages to v22.1.3
22
+ ([3d5e53580](https://github.com/storm-software/storm-ops/commit/3d5e53580))
23
+
24
+ ### Updated Dependencies
25
+
26
+ - Updated **workspace-tools** to **v1.293.23**
27
+ - Updated **config-tools** to **v1.188.53**
28
+ - Updated **config** to **v1.134.53**
29
+
5
30
  ## [0.71.1](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.71.1) (12/04/2025)
6
31
 
7
32
  ### Miscellaneous
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
- [![Version](https://img.shields.io/badge/version-0.70.49-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.70.50-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -46,7 +46,6 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
46
46
 
47
47
  <!-- START doctoc -->
48
48
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
49
-
50
49
  ## Table of Contents
51
50
 
52
51
  - [Storm Cloudflare Tools](#storm-cloudflare-tools)
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getInternalDependencies,
3
3
  r2UploadFile
4
- } from "./chunk-5N2NVDKX.mjs";
4
+ } from "./chunk-5CMG7SUH.mjs";
5
5
  import {
6
6
  createCliOptions,
7
7
  getPackageInfo
@@ -9,19 +9,20 @@ import {
9
9
  import {
10
10
  findWorkspaceRoot,
11
11
  getConfig
12
- } from "./chunk-PTTJW7MW.mjs";
12
+ } from "./chunk-SGTAZO2Q.mjs";
13
13
  import {
14
+ correctPaths,
15
+ joinPaths,
14
16
  writeDebug,
15
17
  writeSuccess,
16
18
  writeTrace,
17
19
  writeWarning
18
- } from "./chunk-6MATO2MJ.mjs";
20
+ } from "./chunk-TPNHSNNZ.mjs";
19
21
 
20
22
  // src/executors/r2-upload-publish/executor.ts
21
23
  import { S3 } from "@aws-sdk/client-s3";
22
24
  import {
23
25
  createProjectGraphAsync,
24
- joinPathFragments,
25
26
  readCachedProjectGraph
26
27
  } from "@nx/devkit";
27
28
  import { glob } from "glob";
@@ -95,12 +96,10 @@ async function runExecutor(options, context) {
95
96
  if (version) {
96
97
  writeDebug(`Starting upload version ${version}`);
97
98
  }
98
- const files = await glob(
99
- joinPathFragments(options.path || sourceRoot, "**/*"),
100
- {
101
- ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
102
- }
103
- );
99
+ const basePath = options.path || sourceRoot;
100
+ const files = await glob(joinPaths(basePath, "**/*"), {
101
+ ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
102
+ });
104
103
  const internalDependencies = await getInternalDependencies(
105
104
  context.projectName,
106
105
  projectGraph
@@ -183,7 +182,7 @@ ${metaJson}`);
183
182
  }
184
183
  await Promise.all(
185
184
  files.map(async (file) => {
186
- const name = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
185
+ const name = correctPaths(file).replace(correctPaths(basePath), "");
187
186
  const type = mime.lookup(name) || "application/octet-stream";
188
187
  writeTrace(`Uploading file: ${name} (content-type: ${type})`);
189
188
  await r2UploadFile(
@@ -0,0 +1,43 @@
1
+ import {
2
+ joinPaths,
3
+ writeDebug,
4
+ writeWarning
5
+ } from "./chunk-TPNHSNNZ.mjs";
6
+
7
+ // src/utils/r2-bucket-helpers.ts
8
+ import { createHash } from "node:crypto";
9
+ async function r2UploadFile(client, bucketName, bucketPath, fileName, version, fileContent, contentType = "application/octet-stream", isDryRun = false) {
10
+ writeDebug(`Uploading file: ${joinPaths(bucketPath, fileName)}`);
11
+ if (!isDryRun) {
12
+ await client.putObject({
13
+ Bucket: bucketName,
14
+ Key: joinPaths(bucketPath, fileName),
15
+ Body: fileContent,
16
+ ContentType: contentType,
17
+ Metadata: {
18
+ version,
19
+ checksum: createHash("sha256").update(fileContent).digest("base64")
20
+ }
21
+ });
22
+ } else {
23
+ writeWarning("[Dry run]: Skipping upload to the R2 bucket.");
24
+ }
25
+ }
26
+ function getInternalDependencies(projectName, graph) {
27
+ const allDeps = graph.dependencies[projectName] ?? [];
28
+ return Array.from(
29
+ allDeps.reduce(
30
+ (acc, node) => {
31
+ const found = graph.nodes[node.target];
32
+ if (found) acc.push(found);
33
+ return acc;
34
+ },
35
+ []
36
+ )
37
+ );
38
+ }
39
+
40
+ export {
41
+ r2UploadFile,
42
+ getInternalDependencies
43
+ };
@@ -1,7 +1,7 @@
1
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
2
 
3
3
 
4
- var _chunkFFOLWRMAjs = require('./chunk-FFOLWRMA.js');
4
+ var _chunkUAKLE2QOjs = require('./chunk-UAKLE2QO.js');
5
5
 
6
6
 
7
7
 
@@ -9,20 +9,21 @@ var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkEQXEFXCVjs = require('./chunk-EQXEFXCV.js');
12
+ var _chunkVKMAYBQXjs = require('./chunk-VKMAYBQX.js');
13
13
 
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunk4BWM53AAjs = require('./chunk-4BWM53AA.js');
18
+
19
+
20
+ var _chunkZ2WQB55Rjs = require('./chunk-Z2WQB55R.js');
19
21
 
20
22
  // src/executors/r2-upload-publish/executor.ts
21
23
  var _clients3 = require('@aws-sdk/client-s3');
22
24
 
23
25
 
24
26
 
25
-
26
27
  var _devkit = require('@nx/devkit');
27
28
  var _glob = require('glob');
28
29
  var _mimetypes = require('mime-types'); var _mimetypes2 = _interopRequireDefault(_mimetypes);
@@ -40,8 +41,8 @@ async function runExecutor(options, context) {
40
41
  throw new Error("The executor requires projectsConfigurations.");
41
42
  }
42
43
  try {
43
- const workspaceRoot = _chunkEQXEFXCVjs.findWorkspaceRoot.call(void 0, );
44
- const config = await _chunkEQXEFXCVjs.getConfig.call(void 0, workspaceRoot);
44
+ const workspaceRoot = _chunkVKMAYBQXjs.findWorkspaceRoot.call(void 0, );
45
+ const config = await _chunkVKMAYBQXjs.getConfig.call(void 0, workspaceRoot);
45
46
  const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
46
47
  const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
47
48
  const projectDetails = _chunkNU34IEWNjs.getPackageInfo.call(void 0,
@@ -80,7 +81,7 @@ async function runExecutor(options, context) {
80
81
  "The executor failed because the project graph is not available. Please run the build command again."
81
82
  );
82
83
  }
83
- _chunk4BWM53AAjs.writeDebug.call(void 0,
84
+ _chunkZ2WQB55Rjs.writeDebug.call(void 0,
84
85
  `Publishing ${context.projectName} to the ${bucketId} R2 Bucket (at ${registry})`
85
86
  );
86
87
  const client = new (0, _clients3.S3)({
@@ -93,15 +94,13 @@ async function runExecutor(options, context) {
93
94
  });
94
95
  const version = _optionalChain([projectDetails, 'optionalAccess', _17 => _17.content, 'optionalAccess', _18 => _18.version]);
95
96
  if (version) {
96
- _chunk4BWM53AAjs.writeDebug.call(void 0, `Starting upload version ${version}`);
97
+ _chunkZ2WQB55Rjs.writeDebug.call(void 0, `Starting upload version ${version}`);
97
98
  }
98
- const files = await _glob.glob.call(void 0,
99
- _devkit.joinPathFragments.call(void 0, options.path || sourceRoot, "**/*"),
100
- {
101
- ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
102
- }
103
- );
104
- const internalDependencies = await _chunkFFOLWRMAjs.getInternalDependencies.call(void 0,
99
+ const basePath = options.path || sourceRoot;
100
+ const files = await _glob.glob.call(void 0, _chunkZ2WQB55Rjs.joinPaths.call(void 0, basePath, "**/*"), {
101
+ ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
102
+ });
103
+ const internalDependencies = await _chunkUAKLE2QOjs.getInternalDependencies.call(void 0,
105
104
  context.projectName,
106
105
  projectGraph
107
106
  );
@@ -115,14 +114,14 @@ async function runExecutor(options, context) {
115
114
  }, _nullishCoalesce(_optionalChain([projectDetails, 'optionalAccess', _19 => _19.content, 'access', _20 => _20.dependencies]), () => ( {})));
116
115
  const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
117
116
  if (options.clean === true) {
118
- _chunk4BWM53AAjs.writeDebug.call(void 0, `Clearing out existing items in ${bucketPath}`);
117
+ _chunkZ2WQB55Rjs.writeDebug.call(void 0, `Clearing out existing items in ${bucketPath}`);
119
118
  if (!isDryRun) {
120
119
  const response = await client.listObjects({
121
120
  Bucket: bucketId,
122
121
  Prefix: bucketPath
123
122
  });
124
123
  if (_optionalChain([response, 'optionalAccess', _21 => _21.Contents]) && response.Contents.length > 0) {
125
- _chunk4BWM53AAjs.writeTrace.call(void 0,
124
+ _chunkZ2WQB55Rjs.writeTrace.call(void 0,
126
125
  `Deleting the following existing items from the R2 bucket path ${bucketPath}: ${response.Contents.map((item) => item.Key).join(", ")}`
127
126
  );
128
127
  await Promise.all(
@@ -141,12 +140,12 @@ async function runExecutor(options, context) {
141
140
  )
142
141
  );
143
142
  } else {
144
- _chunk4BWM53AAjs.writeDebug.call(void 0,
143
+ _chunkZ2WQB55Rjs.writeDebug.call(void 0,
145
144
  `No existing items to delete in the R2 bucket path ${bucketPath}`
146
145
  );
147
146
  }
148
147
  } else {
149
- _chunk4BWM53AAjs.writeWarning.call(void 0, "[Dry run]: Skipping R2 bucket clean.");
148
+ _chunkZ2WQB55Rjs.writeWarning.call(void 0, "[Dry run]: Skipping R2 bucket clean.");
150
149
  }
151
150
  }
152
151
  if (options.writeMetaJson === true) {
@@ -168,9 +167,9 @@ async function runExecutor(options, context) {
168
167
  meta.devDependencies = _optionalChain([projectDetails, 'optionalAccess', _27 => _27.content, 'optionalAccess', _28 => _28.devDependencies]);
169
168
  }
170
169
  const metaJson = JSON.stringify(meta);
171
- _chunk4BWM53AAjs.writeTrace.call(void 0, `Generating meta.json file:
170
+ _chunkZ2WQB55Rjs.writeTrace.call(void 0, `Generating meta.json file:
172
171
  ${metaJson}`);
173
- await _chunkFFOLWRMAjs.r2UploadFile.call(void 0,
172
+ await _chunkUAKLE2QOjs.r2UploadFile.call(void 0,
174
173
  client,
175
174
  bucketId,
176
175
  bucketPath,
@@ -183,10 +182,10 @@ ${metaJson}`);
183
182
  }
184
183
  await Promise.all(
185
184
  files.map(async (file) => {
186
- const name = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
185
+ const name = _chunkZ2WQB55Rjs.correctPaths.call(void 0, file).replace(_chunkZ2WQB55Rjs.correctPaths.call(void 0, basePath), "");
187
186
  const type = _mimetypes2.default.lookup(name) || "application/octet-stream";
188
- _chunk4BWM53AAjs.writeTrace.call(void 0, `Uploading file: ${name} (content-type: ${type})`);
189
- await _chunkFFOLWRMAjs.r2UploadFile.call(void 0,
187
+ _chunkZ2WQB55Rjs.writeTrace.call(void 0, `Uploading file: ${name} (content-type: ${type})`);
188
+ await _chunkUAKLE2QOjs.r2UploadFile.call(void 0,
190
189
  client,
191
190
  bucketId,
192
191
  bucketPath,
@@ -198,7 +197,7 @@ ${metaJson}`);
198
197
  );
199
198
  })
200
199
  );
201
- _chunk4BWM53AAjs.writeSuccess.call(void 0,
200
+ _chunkZ2WQB55Rjs.writeSuccess.call(void 0,
202
201
  `Successfully uploaded the ${projectName} project to the Cloudflare R2 bucket.`,
203
202
  config
204
203
  );