@storm-software/cloudflare-tools 0.63.12 → 0.63.14

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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  # Changelog for Storm Ops - Cloudflare Tools
4
4
 
5
+ ## [0.63.13](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.63.13) (2025-06-05)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **monorepo:** Regenerate README markdown files
10
+
11
+ ## [0.63.12](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.63.12) (2025-06-05)
12
+
13
+ ### Miscellaneous
14
+
15
+ - **monorepo:** Regenerate README markdown files
16
+
5
17
  ## [0.63.11](https://github.com/storm-software/storm-ops/releases/tag/cloudflare-tools%400.63.11) (2025-06-05)
6
18
 
7
19
  ### Miscellaneous
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.63.10-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)
24
+ [![Version](https://img.shields.io/badge/version-0.63.12-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)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -0,0 +1,209 @@
1
+ import {
2
+ createCliOptions,
3
+ getPackageInfo
4
+ } from "./chunk-RH2IXKSC.mjs";
5
+ import {
6
+ getInternalDependencies,
7
+ r2UploadFile
8
+ } from "./chunk-JHXH6ZN3.mjs";
9
+ import {
10
+ getConfig
11
+ } from "./chunk-7H2K6PT4.mjs";
12
+ import {
13
+ findWorkspaceRoot,
14
+ writeDebug,
15
+ writeInfo,
16
+ writeSuccess,
17
+ writeWarning
18
+ } from "./chunk-GOL5LHR6.mjs";
19
+
20
+ // src/executors/r2-upload-publish/executor.ts
21
+ import { S3 } from "@aws-sdk/client-s3";
22
+ import {
23
+ createProjectGraphAsync,
24
+ joinPathFragments,
25
+ readCachedProjectGraph
26
+ } from "@nx/devkit";
27
+ import { glob } from "glob";
28
+ import { execSync } from "node:child_process";
29
+ import { readFile } from "node:fs/promises";
30
+ async function runExecutor(options, context) {
31
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
32
+ if (!context.projectName) {
33
+ throw new Error("The executor requires a projectName.");
34
+ }
35
+ console.info(
36
+ `\u{1F680} Running Storm Cloudflare Publish executor on the ${context.projectName} worker`
37
+ );
38
+ if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
39
+ throw new Error("The executor requires projectsConfigurations.");
40
+ }
41
+ try {
42
+ const workspaceRoot = findWorkspaceRoot();
43
+ const config = await getConfig(workspaceRoot);
44
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
45
+ const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
46
+ const projectDetails = getPackageInfo(
47
+ context.projectsConfigurations.projects[context.projectName]
48
+ );
49
+ if (!projectDetails?.content) {
50
+ throw new Error(
51
+ `Could not find the project details for ${context.projectName}`
52
+ );
53
+ }
54
+ const args = createCliOptions({ ...options });
55
+ if (isDryRun) {
56
+ args.push("--dry-run");
57
+ }
58
+ const cloudflareAccountId = process.env.STORM_BOT_CLOUDFLARE_ACCOUNT;
59
+ if (!options?.registry && !cloudflareAccountId) {
60
+ throw new Error(
61
+ "The Storm Registry URL is not set in the Storm config. Please set either the `extensions.cyclone.registry` or `config.extensions.cyclone.accountId` property in the Storm config."
62
+ );
63
+ }
64
+ if (!process.env.AWS_ACCESS_KEY_ID || !process.env.AWS_SECRET_ACCESS_KEY) {
65
+ throw new Error(
66
+ "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."
67
+ );
68
+ }
69
+ const endpoint = options?.registry ? options.registry : `https://${cloudflareAccountId}.r2.cloudflarestorage.com`;
70
+ let projectGraph;
71
+ try {
72
+ projectGraph = readCachedProjectGraph();
73
+ } catch {
74
+ await createProjectGraphAsync();
75
+ projectGraph = readCachedProjectGraph();
76
+ }
77
+ if (!projectGraph) {
78
+ throw new Error(
79
+ "The executor failed because the project graph is not available. Please run the build command again."
80
+ );
81
+ }
82
+ writeInfo(
83
+ `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`
84
+ );
85
+ const s3Client = new S3({
86
+ region: "auto",
87
+ endpoint,
88
+ credentials: {
89
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID,
90
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
91
+ }
92
+ });
93
+ const version = projectDetails.content?.version;
94
+ writeInfo(`Generated component version: ${version}`);
95
+ const files = await glob(joinPathFragments(sourceRoot, "**/*"), {
96
+ ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
97
+ });
98
+ const projectPath = `registry/${context.projectName}`;
99
+ const internalDependencies = await getInternalDependencies(
100
+ context.projectName,
101
+ projectGraph
102
+ );
103
+ const dependencies = internalDependencies.filter(
104
+ (projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")
105
+ ).reduce((ret, dep) => {
106
+ if (!ret[dep.name]) {
107
+ ret[dep.name] = "latest";
108
+ }
109
+ return ret;
110
+ }, projectDetails.content.dependencies ?? {});
111
+ const release = options.tag ?? execSync("npm config get tag").toString().trim();
112
+ writeInfo(`Clearing out existing items in ${projectPath}`);
113
+ if (!isDryRun) {
114
+ const response = await s3Client.listObjects({
115
+ Bucket: options.bucketId,
116
+ Prefix: projectPath
117
+ });
118
+ if (response?.Contents && response.Contents.length > 0) {
119
+ writeDebug(
120
+ `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`
121
+ );
122
+ await Promise.all(
123
+ response.Contents.map(
124
+ (item) => s3Client.deleteObjects({
125
+ Bucket: options.bucketId,
126
+ Delete: {
127
+ Objects: [
128
+ {
129
+ Key: item.Key
130
+ }
131
+ ],
132
+ Quiet: false
133
+ }
134
+ })
135
+ )
136
+ );
137
+ } else {
138
+ writeDebug(
139
+ `No existing items to delete in the component registry path ${projectPath}`
140
+ );
141
+ }
142
+ } else {
143
+ writeWarning("[Dry run]: skipping upload to the Cyclone Registry.");
144
+ }
145
+ const meta = {
146
+ name: context.projectName,
147
+ version,
148
+ release,
149
+ description: projectDetails.content.description,
150
+ tags: projectDetails.content.keywords,
151
+ dependencies,
152
+ devDependencies: null,
153
+ internalDependencies: internalDependencies.filter(
154
+ (projectNode) => projectNode.data.tags && projectNode.data.tags.some((tag) => tag.toLowerCase() === "component")
155
+ ).map((dep) => dep.name)
156
+ };
157
+ if (projectDetails.type === "package.json") {
158
+ meta.devDependencies = projectDetails.content.devDependencies;
159
+ }
160
+ const metaJson = JSON.stringify(meta);
161
+ writeInfo(`Generating meta.json file:
162
+ ${metaJson}`);
163
+ await r2UploadFile(
164
+ s3Client,
165
+ options.bucketId,
166
+ projectPath,
167
+ "meta.json",
168
+ version,
169
+ metaJson,
170
+ "application/json",
171
+ isDryRun
172
+ );
173
+ await Promise.all(
174
+ files.map((file) => {
175
+ const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
176
+ return readFile(file, { encoding: "utf8" }).then(
177
+ (fileContent) => r2UploadFile(
178
+ s3Client,
179
+ options.bucketId,
180
+ projectPath,
181
+ fileName,
182
+ version,
183
+ fileContent,
184
+ "text/plain",
185
+ isDryRun
186
+ )
187
+ );
188
+ })
189
+ );
190
+ writeSuccess(
191
+ `Successfully uploaded the ${projectName} component to the Cyclone Registry`,
192
+ config
193
+ );
194
+ return {
195
+ success: true
196
+ };
197
+ } catch (error) {
198
+ console.error("Failed to publish to Cloudflare Workers Registry");
199
+ console.error(error);
200
+ console.log("");
201
+ return {
202
+ success: false
203
+ };
204
+ }
205
+ }
206
+
207
+ export {
208
+ runExecutor
209
+ };
@@ -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 _chunk2MLHKN5Rjs = require('./chunk-2MLHKN5R.js');
3
+ var _chunkN4ABVEWNjs = require('./chunk-N4ABVEWN.js');
4
4
 
5
5
 
6
6
  var _chunkOL65RB72js = require('./chunk-OL65RB72.js');
@@ -66,7 +66,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
66
66
  const options = await normalizeOptions(tree, schema, config);
67
67
  const tasks = [];
68
68
  tasks.push(
69
- await _chunk2MLHKN5Rjs.generator_default.call(void 0, tree, {
69
+ await _chunkN4ABVEWNjs.generator_default.call(void 0, tree, {
70
70
  ...options,
71
71
  skipFormat: true
72
72
  })
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generator_default
3
- } from "./chunk-Q44FJY6W.mjs";
3
+ } from "./chunk-ZLI4XREA.mjs";
4
4
  import {
5
5
  getConfig
6
6
  } from "./chunk-7H2K6PT4.mjs";
@@ -728,9 +728,9 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
728
728
 
729
729
  // ../esbuild/src/assets.ts
730
730
  async function copyBuildAssets(context) {
731
- if (_optionalChain([context, 'access', _52 => _52.result, 'optionalAccess', _53 => _53.errors, 'access', _54 => _54.length]) === 0) {
731
+ if (!_optionalChain([context, 'access', _52 => _52.result, 'optionalAccess', _53 => _53.errors, 'access', _54 => _54.length]) && _optionalChain([context, 'access', _55 => _55.options, 'access', _56 => _56.assets, 'optionalAccess', _57 => _57.length])) {
732
732
  _chunkSQUJ3SXLjs.writeDebug.call(void 0,
733
- ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
733
+ ` \u{1F4CB} Copying ${context.options.assets.length} asset files to output directory: ${context.outputPath}`,
734
734
  context.workspaceConfig
735
735
  );
736
736
  const stopwatch = _chunkSQUJ3SXLjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
@@ -766,7 +766,6 @@ var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
766
766
 
767
767
  // ../esbuild/src/config.ts
768
768
  var DEFAULT_BUILD_OPTIONS = {
769
- assets: [],
770
769
  platform: "node",
771
770
  target: "node22",
772
771
  format: "esm",
@@ -836,7 +835,7 @@ async function resolveContext(userOptions) {
836
835
  const projectJson = JSON.parse(projectJsonFile);
837
836
  const projectName = projectJson.name || userOptions.name;
838
837
  const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
839
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _55 => _55.projects, 'optionalAccess', _56 => _56[projectName]])) {
838
+ if (!_optionalChain([projectConfigurations, 'optionalAccess', _58 => _58.projects, 'optionalAccess', _59 => _59[projectName]])) {
840
839
  throw new Error(
841
840
  "The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
842
841
  );
@@ -1131,7 +1130,7 @@ async function executeTsup(context) {
1131
1130
 
1132
1131
  // ../esbuild/src/build.ts
1133
1132
  async function reportResults(context) {
1134
- if (_optionalChain([context, 'access', _57 => _57.result, 'optionalAccess', _58 => _58.errors, 'access', _59 => _59.length]) === 0) {
1133
+ if (_optionalChain([context, 'access', _60 => _60.result, 'optionalAccess', _61 => _61.errors, 'access', _62 => _62.length]) === 0) {
1135
1134
  if (context.result.warnings.length > 0) {
1136
1135
  _chunkSQUJ3SXLjs.writeWarning.call(void 0,
1137
1136
  ` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
@@ -1142,7 +1141,7 @@ async function reportResults(context) {
1142
1141
  ` \u{1F4E6} The ${context.options.name} build completed successfully`,
1143
1142
  context.workspaceConfig
1144
1143
  );
1145
- } else if (_optionalChain([context, 'access', _60 => _60.result, 'optionalAccess', _61 => _61.errors]) && _optionalChain([context, 'access', _62 => _62.result, 'optionalAccess', _63 => _63.errors, 'access', _64 => _64.length]) > 0) {
1144
+ } else if (_optionalChain([context, 'access', _63 => _63.result, 'optionalAccess', _64 => _64.errors]) && _optionalChain([context, 'access', _65 => _65.result, 'optionalAccess', _66 => _66.errors, 'access', _67 => _67.length]) > 0) {
1146
1145
  _chunkSQUJ3SXLjs.writeError.call(void 0,
1147
1146
  ` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
1148
1147
  context.workspaceConfig
@@ -1221,16 +1220,16 @@ async function build2(options) {
1221
1220
  // ../workspace-tools/src/executors/esbuild/executor.ts
1222
1221
  async function esbuildExecutorFn(options, context, config) {
1223
1222
  _chunkSQUJ3SXLjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
1224
- if (!_optionalChain([context, 'access', _65 => _65.projectsConfigurations, 'optionalAccess', _66 => _66.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'access', _69 => _69[context.projectName], 'optionalAccess', _70 => _70.root])) {
1223
+ if (!_optionalChain([context, 'access', _68 => _68.projectsConfigurations, 'optionalAccess', _69 => _69.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _70 => _70.projectsConfigurations, 'access', _71 => _71.projects, 'access', _72 => _72[context.projectName], 'optionalAccess', _73 => _73.root])) {
1225
1224
  throw new Error(
1226
1225
  "The Build process failed because the context is not valid. Please run this command from a workspace."
1227
1226
  );
1228
1227
  }
1229
1228
  await build2({
1230
1229
  ...options,
1231
- projectRoot: _optionalChain([context, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'optionalAccess', _73 => _73[context.projectName], 'access', _74 => _74.root]),
1230
+ projectRoot: _optionalChain([context, 'access', _74 => _74.projectsConfigurations, 'access', _75 => _75.projects, 'optionalAccess', _76 => _76[context.projectName], 'access', _77 => _77.root]),
1232
1231
  name: context.projectName,
1233
- sourceRoot: _optionalChain([context, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'optionalAccess', _77 => _77[context.projectName], 'optionalAccess', _78 => _78.sourceRoot]),
1232
+ sourceRoot: _optionalChain([context, 'access', _78 => _78.projectsConfigurations, 'access', _79 => _79.projects, 'optionalAccess', _80 => _80[context.projectName], 'optionalAccess', _81 => _81.sourceRoot]),
1234
1233
  format: options.format,
1235
1234
  platform: options.format
1236
1235
  });
@@ -1279,15 +1278,15 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
1279
1278
  var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
1280
1279
  var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
1281
1280
  async function sizeLimitExecutorFn(options, context, config) {
1282
- if (!_optionalChain([context, 'optionalAccess', _79 => _79.projectName]) || !_optionalChain([context, 'access', _80 => _80.projectsConfigurations, 'optionalAccess', _81 => _81.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
1281
+ if (!_optionalChain([context, 'optionalAccess', _82 => _82.projectName]) || !_optionalChain([context, 'access', _83 => _83.projectsConfigurations, 'optionalAccess', _84 => _84.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
1283
1282
  throw new Error(
1284
1283
  "The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
1285
1284
  );
1286
1285
  }
1287
1286
  _chunkSQUJ3SXLjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
1288
1287
  _sizelimit2.default.call(void 0, [_file2.default, _esbuild3.default, _esbuildwhy2.default], {
1289
- checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _82 => _82.projectsConfigurations, 'access', _83 => _83.projects, 'access', _84 => _84[context.projectName], 'optionalAccess', _85 => _85.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
1290
- _nullishCoalesce(_optionalChain([context, 'access', _86 => _86.projectsConfigurations, 'access', _87 => _87.projects, 'access', _88 => _88[context.projectName], 'optionalAccess', _89 => _89.root]), () => ( "./")),
1288
+ checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _85 => _85.projectsConfigurations, 'access', _86 => _86.projects, 'access', _87 => _87[context.projectName], 'optionalAccess', _88 => _88.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
1289
+ _nullishCoalesce(_optionalChain([context, 'access', _89 => _89.projectsConfigurations, 'access', _90 => _90.projects, 'access', _91 => _91[context.projectName], 'optionalAccess', _92 => _92.root]), () => ( "./")),
1291
1290
  "src"
1292
1291
  )))
1293
1292
  }).then((result) => {
@@ -1357,7 +1356,7 @@ var executor_default8 = withRunExecutor(
1357
1356
  var _jiti = require('jiti');
1358
1357
  async function unbuildExecutorFn(options, context, config) {
1359
1358
  _chunkSQUJ3SXLjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
1360
- if (!_optionalChain([context, 'access', _90 => _90.projectsConfigurations, 'optionalAccess', _91 => _91.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
1359
+ if (!_optionalChain([context, 'access', _93 => _93.projectsConfigurations, 'optionalAccess', _94 => _94.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
1361
1360
  throw new Error(
1362
1361
  "The Build process failed because the context is not valid. Please run this command from a workspace root directory."
1363
1362
  );
@@ -1471,7 +1470,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
1471
1470
  );
1472
1471
  config = await _chunkOL65RB72js.getConfig.call(void 0, workspaceRoot3);
1473
1472
  }
1474
- if (_optionalChain([generatorOptions, 'optionalAccess', _92 => _92.hooks, 'optionalAccess', _93 => _93.applyDefaultOptions])) {
1473
+ if (_optionalChain([generatorOptions, 'optionalAccess', _95 => _95.hooks, 'optionalAccess', _96 => _96.applyDefaultOptions])) {
1475
1474
  _chunkSQUJ3SXLjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
1476
1475
  options = await Promise.resolve(
1477
1476
  generatorOptions.hooks.applyDefaultOptions(options, config)
@@ -1488,7 +1487,7 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
1488
1487
  { workspaceRoot: tree.root, config },
1489
1488
  applyWorkspaceBaseTokens
1490
1489
  );
1491
- if (_optionalChain([generatorOptions, 'optionalAccess', _94 => _94.hooks, 'optionalAccess', _95 => _95.preProcess])) {
1490
+ if (_optionalChain([generatorOptions, 'optionalAccess', _97 => _97.hooks, 'optionalAccess', _98 => _98.preProcess])) {
1492
1491
  _chunkSQUJ3SXLjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
1493
1492
  await Promise.resolve(
1494
1493
  generatorOptions.hooks.preProcess(tokenized, config)
@@ -1499,15 +1498,15 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
1499
1498
  generatorFn(tree, tokenized, config)
1500
1499
  );
1501
1500
  if (result) {
1502
- if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _96 => _96.error, 'optionalAccess', _97 => _97.message]) && typeof _optionalChain([result, 'optionalAccess', _98 => _98.error, 'optionalAccess', _99 => _99.message]) === "string" && _optionalChain([result, 'optionalAccess', _100 => _100.error, 'optionalAccess', _101 => _101.name]) && typeof _optionalChain([result, 'optionalAccess', _102 => _102.error, 'optionalAccess', _103 => _103.name]) === "string") {
1501
+ if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _99 => _99.error, 'optionalAccess', _100 => _100.message]) && typeof _optionalChain([result, 'optionalAccess', _101 => _101.error, 'optionalAccess', _102 => _102.message]) === "string" && _optionalChain([result, 'optionalAccess', _103 => _103.error, 'optionalAccess', _104 => _104.name]) && typeof _optionalChain([result, 'optionalAccess', _105 => _105.error, 'optionalAccess', _106 => _106.name]) === "string") {
1503
1502
  throw new Error(`The ${name} generator failed to run`, {
1504
- cause: _optionalChain([result, 'optionalAccess', _104 => _104.error])
1503
+ cause: _optionalChain([result, 'optionalAccess', _107 => _107.error])
1505
1504
  });
1506
1505
  } else if (result.success && result.data) {
1507
1506
  return result;
1508
1507
  }
1509
1508
  }
1510
- if (_optionalChain([generatorOptions, 'optionalAccess', _105 => _105.hooks, 'optionalAccess', _106 => _106.postProcess])) {
1509
+ if (_optionalChain([generatorOptions, 'optionalAccess', _108 => _108.hooks, 'optionalAccess', _109 => _109.postProcess])) {
1511
1510
  _chunkSQUJ3SXLjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
1512
1511
  await Promise.resolve(generatorOptions.hooks.postProcess(config));
1513
1512
  _chunkSQUJ3SXLjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
@@ -1639,15 +1638,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1639
1638
  _devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
1640
1639
  let repository = {
1641
1640
  type: "github",
1642
- url: _optionalChain([config, 'optionalAccess', _107 => _107.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _108 => _108.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _109 => _109.namespace]) || _optionalChain([config, 'optionalAccess', _110 => _110.name]) || "repository"}.git`
1641
+ url: _optionalChain([config, 'optionalAccess', _110 => _110.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _111 => _111.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _112 => _112.namespace]) || _optionalChain([config, 'optionalAccess', _113 => _113.name]) || "repository"}.git`
1643
1642
  };
1644
1643
  let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
1645
1644
  if (tree.exists("package.json")) {
1646
1645
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
1647
- if (_optionalChain([packageJson, 'optionalAccess', _111 => _111.repository])) {
1646
+ if (_optionalChain([packageJson, 'optionalAccess', _114 => _114.repository])) {
1648
1647
  repository = packageJson.repository;
1649
1648
  }
1650
- if (_optionalChain([packageJson, 'optionalAccess', _112 => _112.description])) {
1649
+ if (_optionalChain([packageJson, 'optionalAccess', _115 => _115.description])) {
1651
1650
  description = packageJson.description;
1652
1651
  }
1653
1652
  }
@@ -1702,9 +1701,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1702
1701
  _devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
1703
1702
  ...json,
1704
1703
  pnpm: {
1705
- ..._optionalChain([json, 'optionalAccess', _113 => _113.pnpm]),
1704
+ ..._optionalChain([json, 'optionalAccess', _116 => _116.pnpm]),
1706
1705
  overrides: {
1707
- ..._optionalChain([json, 'optionalAccess', _114 => _114.pnpm, 'optionalAccess', _115 => _115.overrides]),
1706
+ ..._optionalChain([json, 'optionalAccess', _117 => _117.pnpm, 'optionalAccess', _118 => _118.overrides]),
1708
1707
  [_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
1709
1708
  }
1710
1709
  }
@@ -1722,10 +1721,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1722
1721
  ]);
1723
1722
  if (tree.exists("package.json")) {
1724
1723
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
1725
- if (_optionalChain([packageJson, 'optionalAccess', _116 => _116.repository])) {
1724
+ if (_optionalChain([packageJson, 'optionalAccess', _119 => _119.repository])) {
1726
1725
  repository = packageJson.repository;
1727
1726
  }
1728
- if (_optionalChain([packageJson, 'optionalAccess', _117 => _117.description])) {
1727
+ if (_optionalChain([packageJson, 'optionalAccess', _120 => _120.description])) {
1729
1728
  description = packageJson.description;
1730
1729
  }
1731
1730
  }
@@ -1762,22 +1761,22 @@ function getOutputPath(options) {
1762
1761
  function createProjectTsConfigJson(tree, options) {
1763
1762
  const tsconfig = {
1764
1763
  extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
1765
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _118 => _118.tsconfigOptions]), () => ( {})),
1764
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _121 => _121.tsconfigOptions]), () => ( {})),
1766
1765
  compilerOptions: {
1767
1766
  ...options.rootProject ? _js.tsConfigBaseOptions : {},
1768
1767
  outDir: _chunkSQUJ3SXLjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
1769
1768
  noEmit: true,
1770
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _119 => _119.tsconfigOptions, 'optionalAccess', _120 => _120.compilerOptions]), () => ( {}))
1769
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _122 => _122.tsconfigOptions, 'optionalAccess', _123 => _123.compilerOptions]), () => ( {}))
1771
1770
  },
1772
- files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _121 => _121.tsconfigOptions, 'optionalAccess', _122 => _122.files]), () => ( []))],
1771
+ files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _124 => _124.tsconfigOptions, 'optionalAccess', _125 => _125.files]), () => ( []))],
1773
1772
  include: [
1774
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _123 => _123.tsconfigOptions, 'optionalAccess', _124 => _124.include]), () => ( [])),
1773
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _126 => _126.tsconfigOptions, 'optionalAccess', _127 => _127.include]), () => ( [])),
1775
1774
  "src/**/*.ts",
1776
1775
  "src/**/*.js",
1777
1776
  "bin/**/*"
1778
1777
  ],
1779
1778
  exclude: [
1780
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _125 => _125.tsconfigOptions, 'optionalAccess', _126 => _126.exclude]), () => ( [])),
1779
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _128 => _128.tsconfigOptions, 'optionalAccess', _129 => _129.exclude]), () => ( [])),
1781
1780
  "jest.config.ts",
1782
1781
  "src/**/*.spec.ts",
1783
1782
  "src/**/*.test.ts"
@@ -1787,8 +1786,8 @@ function createProjectTsConfigJson(tree, options) {
1787
1786
  }
1788
1787
  async function normalizeOptions(tree, options, config) {
1789
1788
  let importPath = options.importPath;
1790
- if (!importPath && _optionalChain([config, 'optionalAccess', _127 => _127.namespace])) {
1791
- importPath = `@${_optionalChain([config, 'optionalAccess', _128 => _128.namespace])}/${options.name}`;
1789
+ if (!importPath && _optionalChain([config, 'optionalAccess', _130 => _130.namespace])) {
1790
+ importPath = `@${_optionalChain([config, 'optionalAccess', _131 => _131.namespace])}/${options.name}`;
1792
1791
  }
1793
1792
  if (options.publishable) {
1794
1793
  if (!importPath) {
@@ -1944,8 +1943,8 @@ async function configSchemaGeneratorFn(tree, options, config) {
1944
1943
  });
1945
1944
  _chunkSQUJ3SXLjs.writeTrace.call(void 0, jsonSchema, config);
1946
1945
  const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
1947
- _nullishCoalesce(_optionalChain([config, 'optionalAccess', _129 => _129.workspaceRoot]), () => ( _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, ))),
1948
- _optionalChain([options, 'access', _130 => _130.outputFile, 'optionalAccess', _131 => _131.startsWith, 'call', _132 => _132("./")]) ? "" : "./"
1946
+ _nullishCoalesce(_optionalChain([config, 'optionalAccess', _132 => _132.workspaceRoot]), () => ( _chunkSQUJ3SXLjs.findWorkspaceRoot.call(void 0, ))),
1947
+ _optionalChain([options, 'access', _133 => _133.outputFile, 'optionalAccess', _134 => _134.startsWith, 'call', _135 => _135("./")]) ? "" : "./"
1949
1948
  );
1950
1949
  _chunkSQUJ3SXLjs.writeTrace.call(void 0,
1951
1950
  `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`,
@@ -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.63.11",
10
+ version: "0.63.13",
11
11
  description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
12
12
  repository: {
13
13
  type: "github",