@storm-software/cloudflare-tools 0.55.64 → 0.55.66

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 (46) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-HBBHWDJS.mjs → chunk-2FAHL7XD.mjs} +11 -3
  4. package/dist/{chunk-CI3G746G.mjs → chunk-3RLBM7SP.mjs} +1 -1
  5. package/dist/{chunk-H3FNUUB5.js → chunk-4O3YATGZ.js} +289 -1157
  6. package/dist/{chunk-4FV3KOBI.mjs → chunk-4XAH2R5U.mjs} +9 -7
  7. package/dist/{chunk-RGBGVGWZ.mjs → chunk-5VCVZQT4.mjs} +2 -2
  8. package/dist/{chunk-MLJ3OSJX.js → chunk-6B5PUF7X.js} +24 -18
  9. package/dist/{chunk-PG2M24AG.mjs → chunk-AMOQ2QRI.mjs} +210 -1078
  10. package/dist/{chunk-ZYEYSCDM.js → chunk-ENYRBMQC.js} +12 -12
  11. package/dist/{chunk-VQLLSEHB.mjs → chunk-IEYD3WT2.mjs} +1 -1
  12. package/dist/{chunk-ITJMNVMG.mjs → chunk-IGW2CIUT.mjs} +2 -2
  13. package/dist/{chunk-XFPT4O23.js → chunk-IVLCYFXD.js} +50 -42
  14. package/dist/{chunk-SSSAGTTW.mjs → chunk-LEJPLULT.mjs} +1 -6
  15. package/dist/{chunk-UBEHQVYS.js → chunk-QGRENI3O.js} +3 -3
  16. package/dist/{chunk-6RVDU4NC.mjs → chunk-QWFEAV3X.mjs} +4 -4
  17. package/dist/{chunk-EGSNPA63.js → chunk-U4CFTRNN.js} +8 -6
  18. package/dist/{chunk-TEEOPHLZ.js → chunk-V7LBWOVV.js} +1 -6
  19. package/dist/{chunk-C3CWFFYT.mjs → chunk-W2PVKWMH.mjs} +14 -8
  20. package/dist/executors.js +5 -5
  21. package/dist/executors.mjs +8 -8
  22. package/dist/generators.js +5 -5
  23. package/dist/generators.mjs +5 -5
  24. package/dist/index.js +8 -8
  25. package/dist/index.mjs +10 -10
  26. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  27. package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
  28. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  29. package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
  30. package/dist/src/executors/serve/executor.d.mts +2 -1300
  31. package/dist/src/executors/serve/executor.d.ts +2 -1300
  32. package/dist/src/executors/serve/executor.js +4 -4
  33. package/dist/src/executors/serve/executor.mjs +5 -5
  34. package/dist/src/generators/init/generator.js +2 -2
  35. package/dist/src/generators/init/generator.mjs +2 -2
  36. package/dist/src/generators/worker/generator.js +5 -5
  37. package/dist/src/generators/worker/generator.mjs +5 -5
  38. package/dist/src/utils/index.js +3 -3
  39. package/dist/src/utils/index.mjs +3 -3
  40. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  41. package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
  42. package/dist/tsup.config.d.mts +3 -3
  43. package/dist/tsup.config.d.ts +3 -3
  44. package/dist/tsup.config.js +2 -1
  45. package/dist/tsup.config.mjs +3 -2
  46. package/package.json +8 -9
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  __commonJS,
3
3
  __name
4
- } from "./chunk-VQLLSEHB.mjs";
4
+ } from "./chunk-IEYD3WT2.mjs";
5
5
 
6
6
  // package.json
7
7
  var require_package = __commonJS({
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@storm-software/cloudflare-tools",
11
- version: "0.55.64",
11
+ version: "0.55.66",
12
12
  description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
13
13
  repository: {
14
14
  type: "github",
@@ -134,10 +134,14 @@ var require_package = __commonJS({
134
134
  ],
135
135
  peerDependencies: {
136
136
  "@nx/devkit": "catalog:",
137
+ "@nx/js": "catalog:",
137
138
  "@nx/node": "catalog:",
138
139
  "@nx/web": "catalog:",
139
- "@nx/webpack": "catalog:",
140
+ "@storm-software/config": "1.113.5",
141
+ "@storm-software/config-tools": "1.163.5",
142
+ "@storm-software/workspace-tools": "1.267.0",
140
143
  nx: "catalog:",
144
+ tsup: "catalog:",
141
145
  wrangler: ">=3.58.0"
142
146
  },
143
147
  peerDependenciesMeta: {
@@ -162,9 +166,7 @@ var require_package = __commonJS({
162
166
  },
163
167
  dependencies: {
164
168
  "@aws-sdk/client-s3": "3.47.0",
165
- c12: "catalog:",
166
- glob: "catalog:",
167
- "jest-resolve": "29.7.0"
169
+ glob: "catalog:"
168
170
  },
169
171
  devDependencies: {
170
172
  "@nx/devkit": "catalog:",
@@ -174,7 +176,7 @@ var require_package = __commonJS({
174
176
  nx: "catalog:",
175
177
  tsup: "catalog:",
176
178
  untyped: "catalog:",
177
- wrangler: ">=3.58.0"
179
+ wrangler: "^4.13.2"
178
180
  },
179
181
  publishConfig: {
180
182
  access: "public"
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createCliOptions
3
- } from "./chunk-CI3G746G.mjs";
3
+ } from "./chunk-3RLBM7SP.mjs";
4
4
  import {
5
5
  __name,
6
6
  __require
7
- } from "./chunk-VQLLSEHB.mjs";
7
+ } from "./chunk-IEYD3WT2.mjs";
8
8
 
9
9
  // src/executors/cloudflare-publish/executor.ts
10
10
  import { joinPathFragments } from "@nx/devkit";
@@ -1,21 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkUBEHQVYSjs = require('./chunk-UBEHQVYS.js');
4
+ var _chunkQGRENI3Ojs = require('./chunk-QGRENI3O.js');
5
5
 
6
6
 
7
7
 
8
8
  var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
9
9
 
10
10
 
11
- var _chunkXFPT4O23js = require('./chunk-XFPT4O23.js');
11
+ var _chunkIVLCYFXDjs = require('./chunk-IVLCYFXD.js');
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunkTEEOPHLZjs = require('./chunk-TEEOPHLZ.js');
18
+ var _chunkV7LBWOVVjs = require('./chunk-V7LBWOVV.js');
19
19
 
20
20
 
21
21
  var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
@@ -36,8 +36,8 @@ async function runExecutor(options, context) {
36
36
  throw new Error("The executor requires projectsConfigurations.");
37
37
  }
38
38
  try {
39
- const workspaceRoot = _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
40
- const config = await _chunkXFPT4O23js.getConfig.call(void 0, workspaceRoot);
39
+ const workspaceRoot = _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
40
+ const config = await _chunkIVLCYFXDjs.getConfig.call(void 0, workspaceRoot);
41
41
  const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
42
42
  const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
43
43
  const projectDetails = _chunkVTHBMY4Bjs.getPackageInfo.call(void 0, context.projectsConfigurations.projects[context.projectName]);
@@ -58,11 +58,17 @@ async function runExecutor(options, context) {
58
58
  throw new Error("The AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables are not set. Please set these environment variables to upload to the Cyclone Registry.");
59
59
  }
60
60
  const endpoint = _optionalChain([options, 'optionalAccess', _17 => _17.registry]) ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
61
- const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
61
+ let projectGraph;
62
+ try {
63
+ projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
64
+ } catch (e) {
65
+ await _devkit.createProjectGraphAsync.call(void 0, );
66
+ projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
67
+ }
62
68
  if (!projectGraph) {
63
- throw new Error("No project graph found in cache");
69
+ throw new Error("The executor failed because the project graph is not available. Please run the build command again.");
64
70
  }
65
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
71
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
66
72
  const s3Client = new (0, _clients3.S3)({
67
73
  region: "auto",
68
74
  endpoint,
@@ -72,12 +78,12 @@ async function runExecutor(options, context) {
72
78
  }
73
79
  });
74
80
  const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
75
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `Generated component version: ${version}`);
81
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `Generated component version: ${version}`);
76
82
  const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
77
83
  ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
78
84
  });
79
85
  const projectPath = `registry/${context.projectName}`;
80
- const internalDependencies = await _chunkUBEHQVYSjs.getInternalDependencies.call(void 0, context.projectName, projectGraph);
86
+ const internalDependencies = await _chunkQGRENI3Ojs.getInternalDependencies.call(void 0, context.projectName, projectGraph);
81
87
  const dependencies = internalDependencies.filter((projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")).reduce((ret, dep) => {
82
88
  if (!ret[dep.name]) {
83
89
  ret[dep.name] = "latest";
@@ -85,14 +91,14 @@ async function runExecutor(options, context) {
85
91
  return ret;
86
92
  }, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
87
93
  const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
88
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
94
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
89
95
  if (!isDryRun) {
90
96
  const response = await s3Client.listObjects({
91
97
  Bucket: options.bucketId,
92
98
  Prefix: projectPath
93
99
  });
94
100
  if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
95
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
101
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
96
102
  await Promise.all(response.Contents.map((item) => s3Client.deleteObjects({
97
103
  Bucket: options.bucketId,
98
104
  Delete: {
@@ -105,10 +111,10 @@ async function runExecutor(options, context) {
105
111
  }
106
112
  })));
107
113
  } else {
108
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
114
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
109
115
  }
110
116
  } else {
111
- _chunkTEEOPHLZjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
117
+ _chunkV7LBWOVVjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
112
118
  }
113
119
  const meta = {
114
120
  name: context.projectName,
@@ -124,16 +130,16 @@ async function runExecutor(options, context) {
124
130
  meta.devDependencies = projectDetails.content.devDependencies;
125
131
  }
126
132
  const metaJson = JSON.stringify(meta);
127
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `Generating meta.json file:
133
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `Generating meta.json file:
128
134
  ${metaJson}`);
129
- await _chunkUBEHQVYSjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
135
+ await _chunkQGRENI3Ojs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
130
136
  await Promise.all(files.map((file) => {
131
137
  const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
132
138
  return _promises.readFile.call(void 0, file, {
133
139
  encoding: "utf8"
134
- }).then((fileContent) => _chunkUBEHQVYSjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
140
+ }).then((fileContent) => _chunkQGRENI3Ojs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
135
141
  }));
136
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
142
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
137
143
  return {
138
144
  success: true
139
145
  };