@storm-software/cloudflare-tools 0.71.223 → 0.71.225

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 (43) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-U6OMVOFA.mjs → chunk-3E2GFJMN.mjs} +1 -1
  4. package/dist/{chunk-YLHBNFNJ.js → chunk-4MIUPZ4C.js} +70 -68
  5. package/dist/{chunk-XB6S7S3C.js → chunk-62X6T4SY.js} +3 -3
  6. package/dist/{chunk-7LCOGL6D.mjs → chunk-6LBDQPVT.mjs} +4 -4
  7. package/dist/chunk-6XTILRPH.mjs +70 -0
  8. package/dist/{chunk-CV2KQKMS.js → chunk-DQMGW6HJ.js} +4 -4
  9. package/dist/{chunk-KDPTLM6V.mjs → chunk-EIJGRLEG.mjs} +1 -1
  10. package/dist/chunk-F37ESSZE.js +70 -0
  11. package/dist/{chunk-WH4RGUNC.mjs → chunk-FGVJOBJP.mjs} +2 -2
  12. package/dist/{chunk-O327KKPU.js → chunk-HNDXHX7M.js} +2 -2
  13. package/dist/{chunk-AIONW2LO.mjs → chunk-J5A7VLNZ.mjs} +3 -3
  14. package/dist/{chunk-F6LJYBWD.js → chunk-JVXHQADT.js} +3 -3
  15. package/dist/{chunk-E7ITICBK.js → chunk-NCVDTA5M.js} +2 -1
  16. package/dist/chunk-PS2AUG7M.js +266 -0
  17. package/dist/chunk-QDWACPEV.mjs +269 -0
  18. package/dist/{chunk-QU27DXRB.mjs → chunk-UZMB4DDU.mjs} +23 -21
  19. package/dist/{chunk-T6GKRQUF.mjs → chunk-ZXLMDNFQ.mjs} +1 -0
  20. package/dist/executors.js +4 -4
  21. package/dist/executors.mjs +5 -5
  22. package/dist/generators.js +3 -3
  23. package/dist/generators.mjs +3 -3
  24. package/dist/index.js +7 -7
  25. package/dist/index.mjs +7 -7
  26. package/dist/src/executors/cloudflare-publish/executor.js +4 -4
  27. package/dist/src/executors/cloudflare-publish/executor.mjs +4 -4
  28. package/dist/src/executors/r2-upload-publish/executor.js +3 -3
  29. package/dist/src/executors/r2-upload-publish/executor.mjs +3 -3
  30. package/dist/src/executors/r2-upload-publish/untyped.mjs +1 -1
  31. package/dist/src/executors/serve/executor.js +6 -6
  32. package/dist/src/executors/serve/executor.mjs +4 -4
  33. package/dist/src/generators/init/generator.js +2 -2
  34. package/dist/src/generators/init/generator.mjs +2 -2
  35. package/dist/src/generators/worker/generator.js +3 -3
  36. package/dist/src/generators/worker/generator.mjs +3 -3
  37. package/dist/src/plugins/index.d.mts +2 -2
  38. package/dist/src/plugins/index.d.ts +2 -2
  39. package/dist/src/plugins/index.mjs +1 -1
  40. package/dist/src/utils/http-handler.mjs +1 -1
  41. package/dist/src/utils/index.mjs +1 -1
  42. package/dist/src/utils/r2-bucket-helpers.mjs +1 -1
  43. package/package.json +9 -9
@@ -0,0 +1,70 @@
1
+ import {
2
+ __commonJS
3
+ } from "./chunk-EIJGRLEG.mjs";
4
+
5
+ // package.json
6
+ var require_package = __commonJS({
7
+ "package.json"(exports, module) {
8
+ module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.225", 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.1075.0", "@aws-sdk/lib-storage": "^3.1075.0", "@smithy/node-http-handler": "^4.9.0", "@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.3", nx: "catalog:", tsup: "catalog:", untyped: "catalog:", wrangler: "^4.105.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
+ }
10
+ });
11
+
12
+ // src/generators/init/generator.ts
13
+ import {
14
+ addDependenciesToPackageJson,
15
+ convertNxGenerator,
16
+ formatFiles,
17
+ removeDependenciesFromPackageJson
18
+ } from "@nx/devkit";
19
+ import { initGenerator as nodeInitGenerator } from "@nx/js";
20
+ import { tslibVersion } from "@nx/node/src/utils/versions";
21
+
22
+ // src/generators/init/libs/versions.ts
23
+ var cloudflareToolsVersion = require_package().version;
24
+ var wranglerVersion = "^3.51.2";
25
+ var cloudflareWorkersTypeVersions = "^4.20240419.0";
26
+ var honoVersion = "^4.2.6";
27
+
28
+ // src/generators/init/generator.ts
29
+ async function initGenerator(tree, schema) {
30
+ const initTask = await nodeInitGenerator(tree, {
31
+ ...schema,
32
+ skipFormat: true
33
+ });
34
+ const installTask = updateDependencies(tree, schema);
35
+ if (!schema.skipFormat) {
36
+ await formatFiles(tree);
37
+ }
38
+ return async () => {
39
+ await initTask();
40
+ await installTask();
41
+ };
42
+ }
43
+ function updateDependencies(tree, schema) {
44
+ removeDependenciesFromPackageJson(
45
+ tree,
46
+ ["@storm-software/cloudflare-tools"],
47
+ []
48
+ );
49
+ const honoPackage = schema.template === "hono" ? { hono: honoVersion } : {};
50
+ return addDependenciesToPackageJson(
51
+ tree,
52
+ {
53
+ tslib: tslibVersion,
54
+ ...honoPackage
55
+ },
56
+ {
57
+ wrangler: wranglerVersion,
58
+ "@cloudflare/workers-types": cloudflareWorkersTypeVersions,
59
+ "@storm-software/cloudflare-tools": cloudflareToolsVersion
60
+ }
61
+ );
62
+ }
63
+ var generator_default = initGenerator;
64
+ var initSchematic = convertNxGenerator(initGenerator);
65
+
66
+ export {
67
+ initGenerator,
68
+ generator_default,
69
+ initSchematic
70
+ };
@@ -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 _chunkF6LJYBWDjs = require('./chunk-F6LJYBWD.js');
3
+ var _chunkF37ESSZEjs = require('./chunk-F37ESSZE.js');
4
4
 
5
5
 
6
6
 
@@ -28,7 +28,7 @@ var _chunkAWKQRM2Hjs = require('./chunk-AWKQRM2H.js');
28
28
 
29
29
 
30
30
  var _devkit = require('@nx/devkit');
31
- var _projectnameandrootutils = require('@nx/devkit/src/generators/project-name-and-root-utils');
31
+ var _internal = require('@nx/devkit/internal');
32
32
  var _node = require('@nx/node');
33
33
  var _versions = require('@nx/node/src/utils/versions');
34
34
  var _path = require('path');
@@ -70,7 +70,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
70
70
  const options = await normalizeOptions(tree, schema, config);
71
71
  const tasks = [];
72
72
  tasks.push(
73
- await _chunkF6LJYBWDjs.generator_default.call(void 0, tree, {
73
+ await _chunkF37ESSZEjs.generator_default.call(void 0, tree, {
74
74
  ...options,
75
75
  skipFormat: true
76
76
  })
@@ -236,7 +236,7 @@ function removeTestFiles(tree, options) {
236
236
  tree.delete(_path.join.call(void 0, options.appProjectRoot, "src", "index.test.ts"));
237
237
  }
238
238
  async function normalizeOptions(host, options, config) {
239
- const { projectName: appProjectName, projectRoot: appProjectRoot } = await _projectnameandrootutils.determineProjectNameAndRootOptions.call(void 0, host, {
239
+ const { projectName: appProjectName, projectRoot: appProjectRoot } = await _internal.determineProjectNameAndRootOptions.call(void 0, host, {
240
240
  name: options.name,
241
241
  projectType: "application",
242
242
  directory: options.directory,
@@ -9,7 +9,7 @@ var __commonJS = (cb, mod) => function __require2() {
9
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
10
  };
11
11
 
12
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__c0506f311429fb3eff490d86a619ee0f/node_modules/tsup/assets/esm_shims.js
12
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__a44b4f62122f89559b5a273229b3b576/node_modules/tsup/assets/esm_shims.js
13
13
  import { fileURLToPath } from "url";
14
14
  import path from "path";
15
15
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -0,0 +1,70 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkMCKGQKYUjs = require('./chunk-MCKGQKYU.js');
4
+
5
+ // package.json
6
+ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
7
+ "package.json"(exports, module) {
8
+ module.exports = { name: "@storm-software/cloudflare-tools", version: "0.71.225", 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.1075.0", "@aws-sdk/lib-storage": "^3.1075.0", "@smithy/node-http-handler": "^4.9.0", "@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.3", nx: "catalog:", tsup: "catalog:", untyped: "catalog:", wrangler: "^4.105.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
+ }
10
+ });
11
+
12
+ // src/generators/init/generator.ts
13
+
14
+
15
+
16
+
17
+
18
+ var _devkit = require('@nx/devkit');
19
+ var _js = require('@nx/js');
20
+ var _versions = require('@nx/node/src/utils/versions');
21
+
22
+ // src/generators/init/libs/versions.ts
23
+ var cloudflareToolsVersion = require_package().version;
24
+ var wranglerVersion = "^3.51.2";
25
+ var cloudflareWorkersTypeVersions = "^4.20240419.0";
26
+ var honoVersion = "^4.2.6";
27
+
28
+ // src/generators/init/generator.ts
29
+ async function initGenerator(tree, schema) {
30
+ const initTask = await _js.initGenerator.call(void 0, tree, {
31
+ ...schema,
32
+ skipFormat: true
33
+ });
34
+ const installTask = updateDependencies(tree, schema);
35
+ if (!schema.skipFormat) {
36
+ await _devkit.formatFiles.call(void 0, tree);
37
+ }
38
+ return async () => {
39
+ await initTask();
40
+ await installTask();
41
+ };
42
+ }
43
+ function updateDependencies(tree, schema) {
44
+ _devkit.removeDependenciesFromPackageJson.call(void 0,
45
+ tree,
46
+ ["@storm-software/cloudflare-tools"],
47
+ []
48
+ );
49
+ const honoPackage = schema.template === "hono" ? { hono: honoVersion } : {};
50
+ return _devkit.addDependenciesToPackageJson.call(void 0,
51
+ tree,
52
+ {
53
+ tslib: _versions.tslibVersion,
54
+ ...honoPackage
55
+ },
56
+ {
57
+ wrangler: wranglerVersion,
58
+ "@cloudflare/workers-types": cloudflareWorkersTypeVersions,
59
+ "@storm-software/cloudflare-tools": cloudflareToolsVersion
60
+ }
61
+ );
62
+ }
63
+ var generator_default = initGenerator;
64
+ var initSchematic = _devkit.convertNxGenerator.call(void 0, initGenerator);
65
+
66
+
67
+
68
+
69
+
70
+ exports.initGenerator = initGenerator; exports.generator_default = generator_default; exports.initSchematic = initSchematic;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createCliOptions
3
- } from "./chunk-T6GKRQUF.mjs";
3
+ } from "./chunk-ZXLMDNFQ.mjs";
4
4
  import {
5
5
  __require
6
- } from "./chunk-KDPTLM6V.mjs";
6
+ } from "./chunk-EIJGRLEG.mjs";
7
7
 
8
8
  // src/executors/cloudflare-publish/executor.ts
9
9
  import { joinPathFragments } from "@nx/devkit";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkE7ITICBKjs = require('./chunk-E7ITICBK.js');
3
+ var _chunkNCVDTA5Mjs = require('./chunk-NCVDTA5M.js');
4
4
 
5
5
 
6
6
  var _chunkMCKGQKYUjs = require('./chunk-MCKGQKYU.js');
@@ -24,7 +24,7 @@ async function runExecutor(options, context) {
24
24
  _optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.root])
25
25
  );
26
26
  try {
27
- const args = _chunkE7ITICBKjs.createCliOptions.call(void 0, { ...options });
27
+ const args = _chunkNCVDTA5Mjs.createCliOptions.call(void 0, { ...options });
28
28
  if (isDryRun) {
29
29
  args.push("--dry-run");
30
30
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generator_default
3
- } from "./chunk-7LCOGL6D.mjs";
3
+ } from "./chunk-6XTILRPH.mjs";
4
4
  import {
5
5
  findWorkspaceRoot,
6
6
  getConfig
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-K4H5ZMYA.mjs";
17
17
  import {
18
18
  __dirname
19
- } from "./chunk-KDPTLM6V.mjs";
19
+ } from "./chunk-EIJGRLEG.mjs";
20
20
 
21
21
  // src/generators/worker/generator.ts
22
22
  import {
@@ -31,7 +31,7 @@ import {
31
31
  updateJson,
32
32
  updateProjectConfiguration
33
33
  } from "@nx/devkit";
34
- import { determineProjectNameAndRootOptions } from "@nx/devkit/src/generators/project-name-and-root-utils";
34
+ import { determineProjectNameAndRootOptions } from "@nx/devkit/internal";
35
35
  import { applicationGenerator as nodeApplicationGenerator } from "@nx/node";
36
36
  import { nxVersion } from "@nx/node/src/utils/versions";
37
37
  import { join } from "path";
@@ -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.222",
10
+ version: "0.71.224",
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: [
@@ -162,7 +162,7 @@ var require_package = _chunkMCKGQKYUjs.__commonJS.call(void 0, {
162
162
  dependencies: {
163
163
  "@aws-sdk/client-s3": "^3.1075.0",
164
164
  "@aws-sdk/lib-storage": "^3.1075.0",
165
- "@smithy/node-http-handler": "^4.8.2",
165
+ "@smithy/node-http-handler": "^4.9.0",
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.2",
179
+ "@smithy/protocol-http": "^5.5.3",
180
180
  nx: "catalog:",
181
181
  tsup: "catalog:",
182
182
  untyped: "catalog:",
@@ -74,4 +74,5 @@ function createCliOptions(obj) {
74
74
 
75
75
 
76
76
 
77
- exports.getPackageInfo = getPackageInfo; exports.createCliOptions = createCliOptions;
77
+
78
+ exports.parseCargoToml = parseCargoToml; exports.getPackageInfo = getPackageInfo; exports.createCliOptions = createCliOptions;
@@ -0,0 +1,266 @@
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
+
3
+ var _chunkJVXHQADTjs = require('./chunk-JVXHQADT.js');
4
+
5
+
6
+
7
+ var _chunkPGTHXO6Mjs = require('./chunk-PGTHXO6M.js');
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunkAWKQRM2Hjs = require('./chunk-AWKQRM2H.js');
17
+
18
+ // src/generators/worker/generator.ts
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ var _devkit = require('@nx/devkit');
31
+ var _internal = require('@nx/devkit/internal');
32
+ var _node = require('@nx/node');
33
+ var _versions = require('@nx/node/src/utils/versions');
34
+ var _path = require('path');
35
+
36
+ // src/generators/worker/libs/get-account-id.ts
37
+ function getAccountId(accountId) {
38
+ return `account_id = "${accountId}"`;
39
+ }
40
+
41
+ // src/generators/worker/libs/vitest-imports.ts
42
+ var vitestImports = `import { describe, expect, it, beforeAll, afterAll } from 'vitest';`;
43
+
44
+ // src/generators/worker/libs/vitest-script.ts
45
+ var vitestScript = `"test": "vitest run"`;
46
+
47
+ // src/generators/worker/generator.ts
48
+ async function applicationGenerator(tree, schema) {
49
+ const stopwatch = _chunkAWKQRM2Hjs.getStopwatch.call(void 0, "Storm Worker generator");
50
+ let config;
51
+ try {
52
+ const workspaceRoot = _chunkPGTHXO6Mjs.findWorkspaceRoot.call(void 0, );
53
+ config = await _chunkPGTHXO6Mjs.getConfig.call(void 0, workspaceRoot);
54
+ _chunkAWKQRM2Hjs.writeInfo.call(void 0,
55
+ `${_chunkAWKQRM2Hjs.brandIcon.call(void 0, config)} Running the Storm Worker generator...
56
+
57
+ `,
58
+ config
59
+ );
60
+ _chunkAWKQRM2Hjs.writeDebug.call(void 0,
61
+ `Loading the Storm Config from environment variables and storm.json file...
62
+ - workspaceRoot: ${workspaceRoot}`,
63
+ config
64
+ );
65
+ _chunkAWKQRM2Hjs.writeTrace.call(void 0,
66
+ `Loaded Storm config into env:
67
+ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`,
68
+ config
69
+ );
70
+ const options = await normalizeOptions(tree, schema, config);
71
+ const tasks = [];
72
+ tasks.push(
73
+ await _chunkJVXHQADTjs.generator_default.call(void 0, tree, {
74
+ ...options,
75
+ skipFormat: true
76
+ })
77
+ );
78
+ tasks.push(
79
+ await _node.applicationGenerator.call(void 0, tree, {
80
+ ...options,
81
+ framework: "none",
82
+ skipFormat: true,
83
+ unitTestRunner: options.unitTestRunner == "vitest" ? "none" : options.unitTestRunner,
84
+ e2eTestRunner: "none",
85
+ name: schema.name
86
+ })
87
+ );
88
+ if (options.unitTestRunner === "vitest") {
89
+ const { vitestGenerator, createOrEditViteConfig } = _devkit.ensurePackage.call(void 0,
90
+ "@nx/vite",
91
+ _versions.nxVersion
92
+ );
93
+ const vitestTask = await vitestGenerator(tree, {
94
+ project: options.name,
95
+ uiFramework: "none",
96
+ coverageProvider: "v8",
97
+ skipFormat: true,
98
+ testEnvironment: "node"
99
+ });
100
+ tasks.push(vitestTask);
101
+ createOrEditViteConfig(
102
+ tree,
103
+ {
104
+ project: options.name,
105
+ includeLib: false,
106
+ includeVitest: true,
107
+ testEnvironment: "node"
108
+ },
109
+ true
110
+ );
111
+ }
112
+ addCloudflareFiles(tree, options);
113
+ updateTsAppConfig(tree, options);
114
+ addTargets(tree, options);
115
+ if (options.unitTestRunner === "none") {
116
+ removeTestFiles(tree, options);
117
+ }
118
+ if (!options.skipFormat) {
119
+ await _devkit.formatFiles.call(void 0, tree);
120
+ }
121
+ if (options.template === "hono") {
122
+ tasks.push(() => {
123
+ const packageJsonPath = _devkit.joinPathFragments.call(void 0,
124
+ _nullishCoalesce(options.directory, () => ( "")),
125
+ "package.json"
126
+ );
127
+ if (tree.exists(packageJsonPath)) {
128
+ _devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => ({
129
+ ...json,
130
+ dependencies: {
131
+ hono: "4.4.0",
132
+ ..._optionalChain([json, 'optionalAccess', _ => _.dependencies])
133
+ }
134
+ }));
135
+ }
136
+ });
137
+ }
138
+ return _devkit.runTasksInSerial.call(void 0, ...tasks);
139
+ } catch (error) {
140
+ return () => {
141
+ _chunkAWKQRM2Hjs.writeFatal.call(void 0,
142
+ "A fatal error occurred while running the generator - the process was forced to terminate",
143
+ config
144
+ );
145
+ _chunkAWKQRM2Hjs.writeError.call(void 0,
146
+ `An exception was thrown in the generator's process
147
+ - Details: ${error.message}
148
+ - Stacktrace: ${error.stack}`,
149
+ config
150
+ );
151
+ };
152
+ } finally {
153
+ stopwatch();
154
+ }
155
+ }
156
+ function updateTsAppConfig(tree, options) {
157
+ _devkit.updateJson.call(void 0, tree, _path.join.call(void 0, options.appProjectRoot, "tsconfig.app.json"), (json) => {
158
+ json.compilerOptions = {
159
+ ...json.compilerOptions,
160
+ esModuleInterop: true,
161
+ target: "es2021",
162
+ lib: ["es2021"],
163
+ module: "es2022",
164
+ moduleResolution: "node",
165
+ resolveJsonModule: true,
166
+ allowJs: true,
167
+ checkJs: false,
168
+ noEmit: true,
169
+ isolatedModules: true,
170
+ allowSyntheticDefaultImports: true,
171
+ forceConsistentCasingInFileNames: true,
172
+ strict: true,
173
+ skipLibCheck: true
174
+ };
175
+ json.compilerOptions.types = [
176
+ ...json.compilerOptions.types,
177
+ "@cloudflare/workers-types"
178
+ ];
179
+ return json;
180
+ });
181
+ }
182
+ function addCloudflareFiles(tree, options) {
183
+ tree.delete(_path.join.call(void 0, options.appProjectRoot, "src/main.ts"));
184
+ _devkit.generateFiles.call(void 0,
185
+ tree,
186
+ _path.join.call(void 0, __dirname, "./files/common"),
187
+ options.appProjectRoot,
188
+ {
189
+ ...options,
190
+ tmpl: "",
191
+ name: options.name,
192
+ accountId: options.accountId ? getAccountId(options.accountId) : "",
193
+ vitestScript: options.unitTestRunner === "vitest" ? vitestScript : ""
194
+ }
195
+ );
196
+ if (options.template && options.template !== "none") {
197
+ _devkit.generateFiles.call(void 0,
198
+ tree,
199
+ _path.join.call(void 0, __dirname, `./files/${options.template}`),
200
+ _path.join.call(void 0, options.appProjectRoot, "src"),
201
+ {
202
+ ...options,
203
+ tmpl: "",
204
+ name: options.name,
205
+ accountId: options.accountId ? getAccountId(options.accountId) : "",
206
+ vitestScript: options.unitTestRunner === "vitest" ? vitestScript : "",
207
+ vitestImports: options.unitTestRunner === "vitest" ? vitestImports : ""
208
+ }
209
+ );
210
+ }
211
+ }
212
+ function addTargets(tree, options) {
213
+ try {
214
+ const projectConfiguration = _devkit.readProjectConfiguration.call(void 0, tree, options.name);
215
+ projectConfiguration.targets = {
216
+ ..._nullishCoalesce(projectConfiguration.targets, () => ( {})),
217
+ serve: {
218
+ executor: "@storm-software/cloudflare-tools:serve",
219
+ options: {
220
+ port: options.port
221
+ }
222
+ },
223
+ "nx-release-publish": {
224
+ executor: "@storm-software/cloudflare-tools:cloudflare-publish"
225
+ }
226
+ };
227
+ if (projectConfiguration.targets.build) {
228
+ delete projectConfiguration.targets.build;
229
+ }
230
+ _devkit.updateProjectConfiguration.call(void 0, tree, options.name, projectConfiguration);
231
+ } catch (e) {
232
+ console.error(e);
233
+ }
234
+ }
235
+ function removeTestFiles(tree, options) {
236
+ tree.delete(_path.join.call(void 0, options.appProjectRoot, "src", "index.test.ts"));
237
+ }
238
+ async function normalizeOptions(host, options, config) {
239
+ const { projectName: appProjectName, projectRoot: appProjectRoot } = await _internal.determineProjectNameAndRootOptions.call(void 0, host, {
240
+ name: options.name,
241
+ projectType: "application",
242
+ directory: options.directory,
243
+ rootProject: options.rootProject
244
+ });
245
+ options.rootProject = appProjectRoot === ".";
246
+ return {
247
+ addPlugin: process.env.NX_ADD_PLUGINS !== "false",
248
+ accountId: process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
249
+ ...options,
250
+ name: _devkit.names.call(void 0, appProjectName).fileName,
251
+ frontendProject: options.frontendProject ? _devkit.names.call(void 0, options.frontendProject).fileName : void 0,
252
+ appProjectRoot,
253
+ unitTestRunner: _nullishCoalesce(options.unitTestRunner, () => ( "vitest")),
254
+ rootProject: _nullishCoalesce(options.rootProject, () => ( false)),
255
+ template: _nullishCoalesce(options.template, () => ( "fetch-handler")),
256
+ port: _nullishCoalesce(options.port, () => ( 3e3))
257
+ };
258
+ }
259
+ var generator_default2 = applicationGenerator;
260
+ var applicationSchematic = _devkit.convertNxGenerator.call(void 0, applicationGenerator);
261
+
262
+
263
+
264
+
265
+
266
+ exports.applicationGenerator = applicationGenerator; exports.generator_default = generator_default2; exports.applicationSchematic = applicationSchematic;