@storm-software/cloudflare-tools 0.70.31 → 0.70.33

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 (31) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +2 -1
  3. package/dist/{chunk-HWDSHE6T.js → chunk-5O7N5PFT.js} +5 -5
  4. package/dist/{chunk-WAFEBLGS.js → chunk-CEXIMFQ7.js} +5 -5
  5. package/dist/{chunk-4XOYLZYF.js → chunk-D7QBZ5SX.js} +3 -3
  6. package/dist/{chunk-RSNYZTUY.mjs → chunk-G2NSVE4M.mjs} +44 -0
  7. package/dist/{chunk-GBH7EUPD.mjs → chunk-GNPYSJXD.mjs} +5 -5
  8. package/dist/{chunk-DEOKIEVB.js → chunk-H3AT6FQM.js} +123 -70
  9. package/dist/{chunk-DTVTFZ3M.js → chunk-HYSCV25J.js} +45 -1
  10. package/dist/{chunk-UJR46SM6.mjs → chunk-P56MHZBO.mjs} +2 -2
  11. package/dist/{chunk-3ND7IFGL.mjs → chunk-TLDPJKAD.mjs} +1 -1
  12. package/dist/{chunk-B5JIAZPS.mjs → chunk-U72IN2SJ.mjs} +62 -9
  13. package/dist/executors.js +4 -4
  14. package/dist/executors.mjs +4 -4
  15. package/dist/generators.js +4 -4
  16. package/dist/generators.mjs +3 -3
  17. package/dist/index.js +9 -9
  18. package/dist/index.mjs +10 -10
  19. package/dist/src/executors/cloudflare-publish/executor.js +2 -2
  20. package/dist/src/executors/cloudflare-publish/executor.mjs +2 -2
  21. package/dist/src/executors/r2-upload-publish/executor.js +4 -4
  22. package/dist/src/executors/r2-upload-publish/executor.mjs +3 -3
  23. package/dist/src/executors/serve/executor.js +3 -3
  24. package/dist/src/executors/serve/executor.mjs +2 -2
  25. package/dist/src/generators/init/generator.js +2 -2
  26. package/dist/src/generators/init/generator.mjs +1 -1
  27. package/dist/src/generators/worker/generator.js +4 -4
  28. package/dist/src/generators/worker/generator.mjs +3 -3
  29. package/package.json +6 -6
  30. package/dist/chunk-L5AZ34A2.mjs +0 -209
  31. package/dist/chunk-NALNCVVQ.js +0 -209
@@ -3,13 +3,16 @@ import {
3
3
  addProjectTag
4
4
  } from "./chunk-PH3DHY4Q.mjs";
5
5
  import {
6
+ correctPaths,
6
7
  findWorkspaceRoot,
7
8
  getConfig,
8
9
  getWorkspaceConfig,
10
+ isAbsolute,
9
11
  joinPaths,
12
+ relative,
10
13
  schemaRegistry,
11
14
  workspaceConfigSchema
12
- } from "./chunk-RSNYZTUY.mjs";
15
+ } from "./chunk-G2NSVE4M.mjs";
13
16
  import {
14
17
  formatLogMessage,
15
18
  getStopwatch,
@@ -225,7 +228,7 @@ import {
225
228
  execSync,
226
229
  spawn
227
230
  } from "node:child_process";
228
- import { relative } from "node:path";
231
+ import { relative as relative2 } from "node:path";
229
232
  var INVALID_CARGO_ARGS = [
230
233
  "allFeatures",
231
234
  "allTargets",
@@ -473,7 +476,7 @@ import _resolve from "resolve";
473
476
 
474
477
  // ../build-tools/src/plugins/type-definitions.ts
475
478
  import { stripIndents } from "@nx/devkit";
476
- import { relative as relative2 } from "path";
479
+ import { relative as relative3 } from "path";
477
480
 
478
481
  // ../build-tools/src/utilities/copy-assets.ts
479
482
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
@@ -1207,15 +1210,64 @@ async function napiExecutor(options, context, config) {
1207
1210
  throw new Error(`Could not find package.json at ${packageJson}`);
1208
1211
  }
1209
1212
  const napi = new NapiCli();
1210
- const buildOptions = { ...options };
1213
+ const normalizedOptions = { ...options };
1211
1214
  const metadata = cargoMetadata();
1212
- buildOptions.outputDir = options.outputPath;
1213
- buildOptions.packageJsonPath = options.packageJsonPath || packageJson;
1214
- buildOptions.targetDir = options.targetDir || metadata?.target_directory || joinPaths(config.workspaceRoot, "dist", "target");
1215
+ normalizedOptions.targetDir = options.targetDir || metadata?.target_directory || joinPaths(config.workspaceRoot, "dist", "target");
1216
+ normalizedOptions.outputDir = options.outputPath;
1217
+ normalizedOptions.packageJsonPath = options.packageJsonPath || packageJson;
1218
+ if (options.cwd) {
1219
+ normalizedOptions.cwd = correctPaths(options.cwd);
1220
+ } else {
1221
+ normalizedOptions.cwd = correctPaths(projectRoot);
1222
+ const absoluteProjectRoot = joinPaths(
1223
+ config.workspaceRoot,
1224
+ projectRoot || "."
1225
+ );
1226
+ if (normalizedOptions.outputDir) {
1227
+ normalizedOptions.outputDir = relative(
1228
+ absoluteProjectRoot,
1229
+ correctPaths(
1230
+ isAbsolute(normalizedOptions.outputDir) ? normalizedOptions.outputDir : joinPaths(config.workspaceRoot, normalizedOptions.outputDir)
1231
+ )
1232
+ );
1233
+ }
1234
+ if (normalizedOptions.packageJsonPath) {
1235
+ normalizedOptions.packageJsonPath = relative(
1236
+ absoluteProjectRoot,
1237
+ correctPaths(
1238
+ isAbsolute(normalizedOptions.packageJsonPath) ? normalizedOptions.packageJsonPath : joinPaths(config.workspaceRoot, normalizedOptions.packageJsonPath)
1239
+ )
1240
+ );
1241
+ }
1242
+ if (normalizedOptions.targetDir) {
1243
+ normalizedOptions.targetDir = relative(
1244
+ absoluteProjectRoot,
1245
+ correctPaths(
1246
+ isAbsolute(normalizedOptions.targetDir) ? normalizedOptions.targetDir : joinPaths(config.workspaceRoot, normalizedOptions.targetDir)
1247
+ )
1248
+ );
1249
+ }
1250
+ if (normalizedOptions.configPath) {
1251
+ normalizedOptions.configPath = relative(
1252
+ absoluteProjectRoot,
1253
+ correctPaths(
1254
+ isAbsolute(normalizedOptions.configPath) ? normalizedOptions.configPath : joinPaths(config.workspaceRoot, normalizedOptions.configPath)
1255
+ )
1256
+ );
1257
+ }
1258
+ if (normalizedOptions.manifestPath) {
1259
+ normalizedOptions.manifestPath = relative(
1260
+ absoluteProjectRoot,
1261
+ correctPaths(
1262
+ isAbsolute(normalizedOptions.manifestPath) ? normalizedOptions.manifestPath : joinPaths(config.workspaceRoot, normalizedOptions.manifestPath)
1263
+ )
1264
+ );
1265
+ }
1266
+ }
1215
1267
  if (process.env.VERCEL) {
1216
1268
  return { success: true };
1217
1269
  }
1218
- const { task } = await napi.build(buildOptions);
1270
+ const { task } = await napi.build(normalizedOptions);
1219
1271
  return { success: true, terminalOutput: await task };
1220
1272
  }
1221
1273
  var executor_default7 = withRunExecutor(
@@ -1225,11 +1277,12 @@ var executor_default7 = withRunExecutor(
1225
1277
  skipReadingConfig: false,
1226
1278
  hooks: {
1227
1279
  applyDefaultOptions: (options) => {
1228
- options.outputPath ??= "dist/{projectRoot}/target";
1280
+ options.outputPath ??= "{sourceRoot}";
1229
1281
  options.toolchain ??= "stable";
1230
1282
  options.dtsCache ??= true;
1231
1283
  options.platform ??= true;
1232
1284
  options.constEnum ??= false;
1285
+ options.verbose ??= false;
1233
1286
  options.jsBinding ??= "binding.js";
1234
1287
  options.dts ??= "binding.d.ts";
1235
1288
  return options;
package/dist/executors.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";require('./chunk-XO66D74Z.js');
2
2
  require('./chunk-IRORGRVZ.js');
3
- require('./chunk-NALNCVVQ.js');
4
- require('./chunk-DEOKIEVB.js');
5
- require('./chunk-NU34IEWN.js');
6
- require('./chunk-DTVTFZ3M.js');
3
+ require('./chunk-H3AT6FQM.js');
4
+ require('./chunk-D7QBZ5SX.js');
7
5
  require('./chunk-NCQM44P3.js');
6
+ require('./chunk-NU34IEWN.js');
7
+ require('./chunk-HYSCV25J.js');
8
8
  require('./chunk-2CDSXWFA.js');
9
9
  require('./chunk-MCKGQKYU.js');
@@ -1,9 +1,9 @@
1
1
  import "./chunk-YSCEY447.mjs";
2
2
  import "./chunk-FMEUIW3K.mjs";
3
- import "./chunk-L5AZ34A2.mjs";
4
- import "./chunk-B5JIAZPS.mjs";
5
- import "./chunk-PH3DHY4Q.mjs";
6
- import "./chunk-RSNYZTUY.mjs";
3
+ import "./chunk-U72IN2SJ.mjs";
4
+ import "./chunk-TLDPJKAD.mjs";
7
5
  import "./chunk-IANDAPQS.mjs";
6
+ import "./chunk-PH3DHY4Q.mjs";
7
+ import "./chunk-G2NSVE4M.mjs";
8
8
  import "./chunk-V44DYGWX.mjs";
9
9
  import "./chunk-I4HGWOGD.mjs";
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWAFEBLGSjs = require('./chunk-WAFEBLGS.js');
5
+ var _chunkCEXIMFQ7js = require('./chunk-CEXIMFQ7.js');
6
6
 
7
7
 
8
8
 
9
- var _chunkHWDSHE6Tjs = require('./chunk-HWDSHE6T.js');
10
- require('./chunk-DTVTFZ3M.js');
9
+ var _chunk5O7N5PFTjs = require('./chunk-5O7N5PFT.js');
10
+ require('./chunk-HYSCV25J.js');
11
11
  require('./chunk-2CDSXWFA.js');
12
12
  require('./chunk-MCKGQKYU.js');
13
13
 
@@ -15,4 +15,4 @@ require('./chunk-MCKGQKYU.js');
15
15
 
16
16
 
17
17
 
18
- exports.applicationGenerator = _chunkWAFEBLGSjs.applicationGenerator; exports.applicationSchematic = _chunkWAFEBLGSjs.applicationSchematic; exports.initGenerator = _chunkHWDSHE6Tjs.initGenerator; exports.initSchematic = _chunkHWDSHE6Tjs.initSchematic;
18
+ exports.applicationGenerator = _chunkCEXIMFQ7js.applicationGenerator; exports.applicationSchematic = _chunkCEXIMFQ7js.applicationSchematic; exports.initGenerator = _chunk5O7N5PFTjs.initGenerator; exports.initSchematic = _chunk5O7N5PFTjs.initSchematic;
@@ -2,12 +2,12 @@ import "./chunk-3J7KBHMJ.mjs";
2
2
  import {
3
3
  applicationGenerator,
4
4
  applicationSchematic
5
- } from "./chunk-UJR46SM6.mjs";
5
+ } from "./chunk-P56MHZBO.mjs";
6
6
  import {
7
7
  initGenerator,
8
8
  initSchematic
9
- } from "./chunk-GBH7EUPD.mjs";
10
- import "./chunk-RSNYZTUY.mjs";
9
+ } from "./chunk-GNPYSJXD.mjs";
10
+ import "./chunk-G2NSVE4M.mjs";
11
11
  import "./chunk-V44DYGWX.mjs";
12
12
  import "./chunk-I4HGWOGD.mjs";
13
13
  export {
package/dist/index.js CHANGED
@@ -3,24 +3,24 @@ require('./chunk-DHBG5ASJ.js');
3
3
 
4
4
 
5
5
 
6
- var _chunkWAFEBLGSjs = require('./chunk-WAFEBLGS.js');
6
+ var _chunkCEXIMFQ7js = require('./chunk-CEXIMFQ7.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkHWDSHE6Tjs = require('./chunk-HWDSHE6T.js');
10
+ var _chunk5O7N5PFTjs = require('./chunk-5O7N5PFT.js');
11
+ require('./chunk-CVGPWUNP.js');
11
12
  require('./chunk-IRORGRVZ.js');
12
- require('./chunk-NALNCVVQ.js');
13
- require('./chunk-DEOKIEVB.js');
13
+ require('./chunk-H3AT6FQM.js');
14
+ require('./chunk-D7QBZ5SX.js');
14
15
 
15
16
 
16
17
 
17
- var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
18
- require('./chunk-DTVTFZ3M.js');
19
- require('./chunk-CVGPWUNP.js');
18
+ var _chunkNCQM44P3js = require('./chunk-NCQM44P3.js');
20
19
 
21
20
 
22
21
 
23
- var _chunkNCQM44P3js = require('./chunk-NCQM44P3.js');
22
+ var _chunkNU34IEWNjs = require('./chunk-NU34IEWN.js');
23
+ require('./chunk-HYSCV25J.js');
24
24
  require('./chunk-2CDSXWFA.js');
25
25
  require('./chunk-MCKGQKYU.js');
26
26
 
@@ -155,4 +155,4 @@ function createPackageJson(projectJsonPath, workspaceRoot) {
155
155
 
156
156
 
157
157
 
158
- exports.applicationGenerator = _chunkWAFEBLGSjs.applicationGenerator; exports.applicationSchematic = _chunkWAFEBLGSjs.applicationSchematic; exports.createNodesV2 = createNodesV2; exports.getInternalDependencies = _chunkNCQM44P3js.getInternalDependencies; exports.initGenerator = _chunkHWDSHE6Tjs.initGenerator; exports.initSchematic = _chunkHWDSHE6Tjs.initSchematic; exports.name = name; exports.r2UploadFile = _chunkNCQM44P3js.r2UploadFile;
158
+ exports.applicationGenerator = _chunkCEXIMFQ7js.applicationGenerator; exports.applicationSchematic = _chunkCEXIMFQ7js.applicationSchematic; exports.createNodesV2 = createNodesV2; exports.getInternalDependencies = _chunkNCQM44P3js.getInternalDependencies; exports.initGenerator = _chunk5O7N5PFTjs.initGenerator; exports.initSchematic = _chunk5O7N5PFTjs.initSchematic; exports.name = name; exports.r2UploadFile = _chunkNCQM44P3js.r2UploadFile;
package/dist/index.mjs CHANGED
@@ -3,24 +3,24 @@ import "./chunk-3J7KBHMJ.mjs";
3
3
  import {
4
4
  applicationGenerator,
5
5
  applicationSchematic
6
- } from "./chunk-UJR46SM6.mjs";
6
+ } from "./chunk-P56MHZBO.mjs";
7
7
  import {
8
8
  initGenerator,
9
9
  initSchematic
10
- } from "./chunk-GBH7EUPD.mjs";
11
- import "./chunk-FMEUIW3K.mjs";
12
- import "./chunk-L5AZ34A2.mjs";
13
- import "./chunk-B5JIAZPS.mjs";
14
- import {
15
- ProjectTagConstants,
16
- addProjectTag
17
- } from "./chunk-PH3DHY4Q.mjs";
18
- import "./chunk-RSNYZTUY.mjs";
10
+ } from "./chunk-GNPYSJXD.mjs";
19
11
  import "./chunk-7Z5PILRU.mjs";
12
+ import "./chunk-FMEUIW3K.mjs";
13
+ import "./chunk-U72IN2SJ.mjs";
14
+ import "./chunk-TLDPJKAD.mjs";
20
15
  import {
21
16
  getInternalDependencies,
22
17
  r2UploadFile
23
18
  } from "./chunk-IANDAPQS.mjs";
19
+ import {
20
+ ProjectTagConstants,
21
+ addProjectTag
22
+ } from "./chunk-PH3DHY4Q.mjs";
23
+ import "./chunk-G2NSVE4M.mjs";
24
24
  import "./chunk-V44DYGWX.mjs";
25
25
  import "./chunk-I4HGWOGD.mjs";
26
26
 
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
  var _chunkIRORGRVZjs = require('../../../chunk-IRORGRVZ.js');
4
- require('../../../chunk-DEOKIEVB.js');
4
+ require('../../../chunk-H3AT6FQM.js');
5
5
  require('../../../chunk-NU34IEWN.js');
6
- require('../../../chunk-DTVTFZ3M.js');
6
+ require('../../../chunk-HYSCV25J.js');
7
7
  require('../../../chunk-2CDSXWFA.js');
8
8
  require('../../../chunk-MCKGQKYU.js');
9
9
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runExecutor
3
3
  } from "../../../chunk-FMEUIW3K.mjs";
4
- import "../../../chunk-B5JIAZPS.mjs";
4
+ import "../../../chunk-U72IN2SJ.mjs";
5
5
  import "../../../chunk-PH3DHY4Q.mjs";
6
- import "../../../chunk-RSNYZTUY.mjs";
6
+ import "../../../chunk-G2NSVE4M.mjs";
7
7
  import "../../../chunk-V44DYGWX.mjs";
8
8
  import "../../../chunk-I4HGWOGD.mjs";
9
9
  export {
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNALNCVVQjs = require('../../../chunk-NALNCVVQ.js');
4
- require('../../../chunk-NU34IEWN.js');
5
- require('../../../chunk-DTVTFZ3M.js');
3
+ var _chunkD7QBZ5SXjs = require('../../../chunk-D7QBZ5SX.js');
6
4
  require('../../../chunk-NCQM44P3.js');
5
+ require('../../../chunk-NU34IEWN.js');
6
+ require('../../../chunk-HYSCV25J.js');
7
7
  require('../../../chunk-2CDSXWFA.js');
8
8
  require('../../../chunk-MCKGQKYU.js');
9
9
 
10
10
 
11
- exports.default = _chunkNALNCVVQjs.runExecutor;
11
+ exports.default = _chunkD7QBZ5SXjs.runExecutor;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runExecutor
3
- } from "../../../chunk-L5AZ34A2.mjs";
4
- import "../../../chunk-PH3DHY4Q.mjs";
5
- import "../../../chunk-RSNYZTUY.mjs";
3
+ } from "../../../chunk-TLDPJKAD.mjs";
6
4
  import "../../../chunk-IANDAPQS.mjs";
5
+ import "../../../chunk-PH3DHY4Q.mjs";
6
+ import "../../../chunk-G2NSVE4M.mjs";
7
7
  import "../../../chunk-V44DYGWX.mjs";
8
8
  import "../../../chunk-I4HGWOGD.mjs";
9
9
  export {
@@ -1,10 +1,10 @@
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 _chunkDEOKIEVBjs = require('../../../chunk-DEOKIEVB.js');
3
+ var _chunkH3AT6FQMjs = require('../../../chunk-H3AT6FQM.js');
4
4
 
5
5
 
6
6
  var _chunkNU34IEWNjs = require('../../../chunk-NU34IEWN.js');
7
- require('../../../chunk-DTVTFZ3M.js');
7
+ require('../../../chunk-HYSCV25J.js');
8
8
  require('../../../chunk-2CDSXWFA.js');
9
9
 
10
10
 
@@ -55,7 +55,7 @@ async function* serveExecutor(options, context) {
55
55
  success: true
56
56
  };
57
57
  }
58
- var executor_default = _chunkDEOKIEVBjs.withRunExecutor.call(void 0,
58
+ var executor_default = _chunkH3AT6FQMjs.withRunExecutor.call(void 0,
59
59
  "Cloudflare Serve executor",
60
60
  serveExecutor,
61
61
  {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  withRunExecutor
3
- } from "../../../chunk-B5JIAZPS.mjs";
3
+ } from "../../../chunk-U72IN2SJ.mjs";
4
4
  import {
5
5
  createCliOptions
6
6
  } from "../../../chunk-PH3DHY4Q.mjs";
7
- import "../../../chunk-RSNYZTUY.mjs";
7
+ import "../../../chunk-G2NSVE4M.mjs";
8
8
  import "../../../chunk-V44DYGWX.mjs";
9
9
  import {
10
10
  __require
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkHWDSHE6Tjs = require('../../../chunk-HWDSHE6T.js');
5
+ var _chunk5O7N5PFTjs = require('../../../chunk-5O7N5PFT.js');
6
6
  require('../../../chunk-MCKGQKYU.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.default = _chunkHWDSHE6Tjs.generator_default; exports.initGenerator = _chunkHWDSHE6Tjs.initGenerator; exports.initSchematic = _chunkHWDSHE6Tjs.initSchematic;
11
+ exports.default = _chunk5O7N5PFTjs.generator_default; exports.initGenerator = _chunk5O7N5PFTjs.initGenerator; exports.initSchematic = _chunk5O7N5PFTjs.initSchematic;
@@ -2,7 +2,7 @@ import {
2
2
  generator_default,
3
3
  initGenerator,
4
4
  initSchematic
5
- } from "../../../chunk-GBH7EUPD.mjs";
5
+ } from "../../../chunk-GNPYSJXD.mjs";
6
6
  import "../../../chunk-I4HGWOGD.mjs";
7
7
  export {
8
8
  generator_default as default,
@@ -2,13 +2,13 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWAFEBLGSjs = require('../../../chunk-WAFEBLGS.js');
6
- require('../../../chunk-HWDSHE6T.js');
7
- require('../../../chunk-DTVTFZ3M.js');
5
+ var _chunkCEXIMFQ7js = require('../../../chunk-CEXIMFQ7.js');
6
+ require('../../../chunk-5O7N5PFT.js');
7
+ require('../../../chunk-HYSCV25J.js');
8
8
  require('../../../chunk-2CDSXWFA.js');
9
9
  require('../../../chunk-MCKGQKYU.js');
10
10
 
11
11
 
12
12
 
13
13
 
14
- exports.applicationGenerator = _chunkWAFEBLGSjs.applicationGenerator; exports.applicationSchematic = _chunkWAFEBLGSjs.applicationSchematic; exports.default = _chunkWAFEBLGSjs.generator_default;
14
+ exports.applicationGenerator = _chunkCEXIMFQ7js.applicationGenerator; exports.applicationSchematic = _chunkCEXIMFQ7js.applicationSchematic; exports.default = _chunkCEXIMFQ7js.generator_default;
@@ -2,9 +2,9 @@ import {
2
2
  applicationGenerator,
3
3
  applicationSchematic,
4
4
  generator_default
5
- } from "../../../chunk-UJR46SM6.mjs";
6
- import "../../../chunk-GBH7EUPD.mjs";
7
- import "../../../chunk-RSNYZTUY.mjs";
5
+ } from "../../../chunk-P56MHZBO.mjs";
6
+ import "../../../chunk-GNPYSJXD.mjs";
7
+ import "../../../chunk-G2NSVE4M.mjs";
8
8
  import "../../../chunk-V44DYGWX.mjs";
9
9
  import "../../../chunk-I4HGWOGD.mjs";
10
10
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/cloudflare-tools",
3
- "version": "0.70.31",
3
+ "version": "0.70.33",
4
4
  "description": "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
5
5
  "repository": {
6
6
  "type": "github",
@@ -117,9 +117,9 @@
117
117
  "@nx/js": "^22.0.3",
118
118
  "@nx/node": "^22.0.3",
119
119
  "@nx/web": "^22.0.3",
120
- "@storm-software/config": "1.134.30",
121
- "@storm-software/config-tools": "1.188.30",
122
- "@storm-software/workspace-tools": "1.293.0",
120
+ "@storm-software/config": "1.134.32",
121
+ "@storm-software/config-tools": "1.188.32",
122
+ "@storm-software/workspace-tools": "1.293.2",
123
123
  "nx": "^22.0.3",
124
124
  "tsup": "8.4.0",
125
125
  "wrangler": ">=3.58.0"
@@ -145,10 +145,10 @@
145
145
  "nx": "^22.0.3",
146
146
  "tsup": "8.4.0",
147
147
  "untyped": "^2.0.0",
148
- "wrangler": "^4.47.0"
148
+ "wrangler": "^4.48.0"
149
149
  },
150
150
  "publishConfig": { "access": "public" },
151
151
  "executors": "./executors.json",
152
152
  "generators": "./generators.json",
153
- "gitHead": "f21daf5d548f7a6c140f0c7d54bf58309aa2e4ae"
153
+ "gitHead": "5c88ccffba3683f10a8dcc98422964880995e3b2"
154
154
  }
@@ -1,209 +0,0 @@
1
- import {
2
- createCliOptions,
3
- getPackageInfo
4
- } from "./chunk-PH3DHY4Q.mjs";
5
- import {
6
- findWorkspaceRoot,
7
- getConfig
8
- } from "./chunk-RSNYZTUY.mjs";
9
- import {
10
- getInternalDependencies,
11
- r2UploadFile
12
- } from "./chunk-IANDAPQS.mjs";
13
- import {
14
- writeDebug,
15
- writeInfo,
16
- writeSuccess,
17
- writeWarning
18
- } from "./chunk-V44DYGWX.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
- };