@storm-software/cloudflare-tools 0.55.15 → 0.55.17

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 (37) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-GCD4ACJC.js → chunk-23PVXPM6.js} +16 -16
  4. package/dist/{chunk-ADRS43PR.js → chunk-57JETFC4.js} +3 -3
  5. package/dist/{chunk-NP7DE7UM.mjs → chunk-7GVMKVE6.mjs} +1 -1
  6. package/dist/{chunk-BKBJDKMA.mjs → chunk-CH4HU3UC.mjs} +1 -1
  7. package/dist/{chunk-PKT2CDJF.js → chunk-ECM7NILS.js} +1 -1
  8. package/dist/{chunk-GMLMIRU7.mjs → chunk-EY654AX3.mjs} +125 -22
  9. package/dist/{chunk-43HWVEIC.js → chunk-FNE7DP2D.js} +121 -18
  10. package/dist/{chunk-XSVPXWSA.mjs → chunk-JYGVCUHY.mjs} +3 -3
  11. package/dist/{chunk-EORYLA5L.mjs → chunk-LFOKGJV3.mjs} +1 -1
  12. package/dist/{chunk-6Q4S7VSU.js → chunk-OO2KFXL5.js} +41 -41
  13. package/dist/{chunk-P5LCBPJC.mjs → chunk-SI2PJVZV.mjs} +3 -3
  14. package/dist/{chunk-J7EAOMOM.js → chunk-TWSVFCGJ.js} +159 -159
  15. package/dist/{chunk-IXEVMGVN.mjs → chunk-UYVVVI5O.mjs} +3 -3
  16. package/dist/{chunk-LYIKXP45.js → chunk-YIVJLSPZ.js} +12 -12
  17. package/dist/executors.js +5 -5
  18. package/dist/executors.mjs +5 -5
  19. package/dist/generators.js +5 -5
  20. package/dist/generators.mjs +4 -4
  21. package/dist/index.js +8 -8
  22. package/dist/index.mjs +7 -7
  23. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  24. package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
  25. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  26. package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
  27. package/dist/src/executors/serve/executor.js +4 -4
  28. package/dist/src/executors/serve/executor.mjs +3 -3
  29. package/dist/src/generators/init/generator.js +2 -2
  30. package/dist/src/generators/init/generator.mjs +1 -1
  31. package/dist/src/generators/worker/generator.js +5 -5
  32. package/dist/src/generators/worker/generator.mjs +4 -4
  33. package/dist/src/utils/index.js +3 -3
  34. package/dist/src/utils/index.mjs +2 -2
  35. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  36. package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
  37. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 0.55.17 (2025-01-29)
2
+
3
+ ### Miscellaneous
4
+
5
+ - **monorepo:** Regenerate README markdown files ([2eb0a4f0](https://github.com/storm-software/storm-ops/commit/2eb0a4f0))
6
+ - **monorepo:** Regenerate README markdown files ([da76edd7](https://github.com/storm-software/storm-ops/commit/da76edd7))
7
+
8
+ ## 0.55.16 (2025-01-29)
9
+
10
+ ### Miscellaneous
11
+
12
+ - **monorepo:** Regenerate README markdown files ([07f7d3d5](https://github.com/storm-software/storm-ops/commit/07f7d3d5))
13
+
1
14
  ## 0.55.15 (2025-01-29)
2
15
 
3
16
  ### 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.55.14-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.55.16-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 -->
@@ -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 _chunkADRS43PRjs = require('./chunk-ADRS43PR.js');
4
+ var _chunk57JETFC4js = require('./chunk-57JETFC4.js');
5
5
 
6
6
 
7
7
 
8
8
  var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
9
9
 
10
10
 
11
- var _chunk6Q4S7VSUjs = require('./chunk-6Q4S7VSU.js');
11
+ var _chunkOO2KFXL5js = require('./chunk-OO2KFXL5.js');
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunk43HWVEICjs = require('./chunk-43HWVEIC.js');
18
+ var _chunkFNE7DP2Djs = require('./chunk-FNE7DP2D.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 = _chunk43HWVEICjs.findWorkspaceRoot.call(void 0, );
40
- const config = await _chunk6Q4S7VSUjs.getConfig.call(void 0, workspaceRoot);
39
+ const workspaceRoot = _chunkFNE7DP2Djs.findWorkspaceRoot.call(void 0, );
40
+ const config = await _chunkOO2KFXL5js.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]);
@@ -62,7 +62,7 @@ async function runExecutor(options, context) {
62
62
  if (!projectGraph) {
63
63
  throw new Error("No project graph found in cache");
64
64
  }
65
- _chunk43HWVEICjs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
65
+ _chunkFNE7DP2Djs.writeInfo.call(void 0, `Publishing ${context.projectName} to the Storm Registry at ${endpoint}`);
66
66
  const s3Client = new (0, _clients3.S3)({
67
67
  region: "auto",
68
68
  endpoint,
@@ -72,12 +72,12 @@ async function runExecutor(options, context) {
72
72
  }
73
73
  });
74
74
  const version = _optionalChain([projectDetails, 'access', _18 => _18.content, 'optionalAccess', _19 => _19.version]);
75
- _chunk43HWVEICjs.writeInfo.call(void 0, `Generated component version: ${version}`);
75
+ _chunkFNE7DP2Djs.writeInfo.call(void 0, `Generated component version: ${version}`);
76
76
  const files = await _glob.glob.call(void 0, _devkit.joinPathFragments.call(void 0, sourceRoot, "**/*"), {
77
77
  ignore: "**/{*.stories.tsx,*.stories.ts,*.spec.tsx,*.spec.ts}"
78
78
  });
79
79
  const projectPath = `registry/${context.projectName}`;
80
- const internalDependencies = await _chunkADRS43PRjs.getInternalDependencies.call(void 0, context.projectName, projectGraph);
80
+ const internalDependencies = await _chunk57JETFC4js.getInternalDependencies.call(void 0, context.projectName, projectGraph);
81
81
  const dependencies = internalDependencies.filter((projectNode) => !projectNode.data.tags || projectNode.data.tags.every((tag) => tag.toLowerCase() !== "component")).reduce((ret, dep) => {
82
82
  if (!ret[dep.name]) {
83
83
  ret[dep.name] = "latest";
@@ -85,14 +85,14 @@ async function runExecutor(options, context) {
85
85
  return ret;
86
86
  }, _nullishCoalesce(projectDetails.content.dependencies, () => ( {})));
87
87
  const release = _nullishCoalesce(options.tag, () => ( _child_process.execSync.call(void 0, "npm config get tag").toString().trim()));
88
- _chunk43HWVEICjs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
88
+ _chunkFNE7DP2Djs.writeInfo.call(void 0, `Clearing out existing items in ${projectPath}`);
89
89
  if (!isDryRun) {
90
90
  const response = await s3Client.listObjects({
91
91
  Bucket: options.bucketId,
92
92
  Prefix: projectPath
93
93
  });
94
94
  if (_optionalChain([response, 'optionalAccess', _20 => _20.Contents]) && response.Contents.length > 0) {
95
- _chunk43HWVEICjs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
95
+ _chunkFNE7DP2Djs.writeDebug.call(void 0, `Deleting the following existing items from the component registry: ${response.Contents.map((item) => item.Key).join(", ")}`);
96
96
  await Promise.all(response.Contents.map((item) => s3Client.deleteObjects({
97
97
  Bucket: options.bucketId,
98
98
  Delete: {
@@ -105,10 +105,10 @@ async function runExecutor(options, context) {
105
105
  }
106
106
  })));
107
107
  } else {
108
- _chunk43HWVEICjs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
108
+ _chunkFNE7DP2Djs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
109
109
  }
110
110
  } else {
111
- _chunk43HWVEICjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
111
+ _chunkFNE7DP2Djs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
112
112
  }
113
113
  const meta = {
114
114
  name: context.projectName,
@@ -124,16 +124,16 @@ async function runExecutor(options, context) {
124
124
  meta.devDependencies = projectDetails.content.devDependencies;
125
125
  }
126
126
  const metaJson = JSON.stringify(meta);
127
- _chunk43HWVEICjs.writeInfo.call(void 0, `Generating meta.json file:
127
+ _chunkFNE7DP2Djs.writeInfo.call(void 0, `Generating meta.json file:
128
128
  ${metaJson}`);
129
- await _chunkADRS43PRjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
129
+ await _chunk57JETFC4js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, "meta.json", version, metaJson, "application/json", isDryRun);
130
130
  await Promise.all(files.map((file) => {
131
131
  const fileName = file.replaceAll("\\", "/").replace(sourceRoot.replaceAll("\\", "/"), "");
132
132
  return _promises.readFile.call(void 0, file, {
133
133
  encoding: "utf8"
134
- }).then((fileContent) => _chunkADRS43PRjs.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
134
+ }).then((fileContent) => _chunk57JETFC4js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
135
135
  }));
136
- _chunk43HWVEICjs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
136
+ _chunkFNE7DP2Djs.writeSuccess.call(void 0, `Successfully uploaded the ${projectName} component to the Cyclone Registry`, config);
137
137
  return {
138
138
  success: true
139
139
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunk43HWVEICjs = require('./chunk-43HWVEIC.js');
4
+ var _chunkFNE7DP2Djs = require('./chunk-FNE7DP2D.js');
5
5
 
6
6
 
7
7
  var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
@@ -11,7 +11,7 @@ var _crypto = require('crypto');
11
11
  var r2UploadFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (client, bucketName, projectPath, fileName, version, fileContent, contentType = "text/plain", isDryRun = false) => {
12
12
  const checksum = _crypto.createHash.call(void 0, "sha256").update(fileContent).digest("base64");
13
13
  const fileKey = `${projectPath}/${fileName.startsWith("/") ? fileName.substring(1) : fileName}`;
14
- _chunk43HWVEICjs.writeDebug.call(void 0, `Uploading file: ${fileKey}`);
14
+ _chunkFNE7DP2Djs.writeDebug.call(void 0, `Uploading file: ${fileKey}`);
15
15
  if (!isDryRun) {
16
16
  await client.putObject({
17
17
  Bucket: bucketName,
@@ -24,7 +24,7 @@ var r2UploadFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (c
24
24
  }
25
25
  });
26
26
  } else {
27
- _chunk43HWVEICjs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
27
+ _chunkFNE7DP2Djs.writeWarning.call(void 0, "[Dry run]: skipping upload to the Cyclone Registry.");
28
28
  }
29
29
  }, "r2UploadFile");
30
30
  var getInternalDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (projectName, graph) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  writeDebug,
3
3
  writeWarning
4
- } from "./chunk-GMLMIRU7.mjs";
4
+ } from "./chunk-EY654AX3.mjs";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-A7FFSBE6.mjs";
@@ -14,7 +14,7 @@ import {
14
14
  joinPaths,
15
15
  writeTrace,
16
16
  writeWarning
17
- } from "./chunk-GMLMIRU7.mjs";
17
+ } from "./chunk-EY654AX3.mjs";
18
18
  import {
19
19
  __name
20
20
  } from "./chunk-A7FFSBE6.mjs";
@@ -8,7 +8,7 @@ var require_package = _chunkJ5SB6L2Ljs.__commonJS.call(void 0, {
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@storm-software/cloudflare-tools",
11
- version: "0.55.15",
11
+ version: "0.55.17",
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",
@@ -3,41 +3,144 @@ import {
3
3
  } from "./chunk-A7FFSBE6.mjs";
4
4
 
5
5
  // ../config-tools/src/utilities/correct-paths.ts
6
- import { join } from "node:path";
7
- var removeWindowsDriveLetter = /* @__PURE__ */ __name((osSpecificPath) => {
8
- return osSpecificPath.replace(/^[A-Z]:/, "");
9
- }, "removeWindowsDriveLetter");
10
- var correctPaths = /* @__PURE__ */ __name((path) => {
11
- if (!path) {
12
- return "";
13
- }
14
- if (path.includes("\\")) {
15
- if (!path.toUpperCase().startsWith("C:")) {
16
- path = `C:${path}`;
6
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
7
+ function normalizeWindowsPath(input = "") {
8
+ if (!input) {
9
+ return input;
10
+ }
11
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
12
+ }
13
+ __name(normalizeWindowsPath, "normalizeWindowsPath");
14
+ var _UNC_REGEX = /^[/\\]{2}/;
15
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
16
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
17
+ var correctPaths = /* @__PURE__ */ __name(function(path) {
18
+ if (!path || path.length === 0) {
19
+ return ".";
20
+ }
21
+ path = normalizeWindowsPath(path);
22
+ const isUNCPath = path.match(_UNC_REGEX);
23
+ const isPathAbsolute = isAbsolute(path);
24
+ const trailingSeparator = path[path.length - 1] === "/";
25
+ path = normalizeString(path, !isPathAbsolute);
26
+ if (path.length === 0) {
27
+ if (isPathAbsolute) {
28
+ return "/";
17
29
  }
18
- return path.replaceAll("/", "\\");
30
+ return trailingSeparator ? "./" : ".";
31
+ }
32
+ if (trailingSeparator) {
33
+ path += "/";
34
+ }
35
+ if (_DRIVE_LETTER_RE.test(path)) {
36
+ path += "/";
19
37
  }
20
- return removeWindowsDriveLetter(path).split("\\").join("/");
38
+ if (isUNCPath) {
39
+ if (!isPathAbsolute) {
40
+ return `//./${path}`;
41
+ }
42
+ return `//${path}`;
43
+ }
44
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
21
45
  }, "correctPaths");
22
- var joinPaths = /* @__PURE__ */ __name((...paths) => {
23
- if (!paths || paths.length === 0) {
24
- return "";
46
+ var joinPaths = /* @__PURE__ */ __name(function(...segments) {
47
+ let path = "";
48
+ for (const seg of segments) {
49
+ if (!seg) {
50
+ continue;
51
+ }
52
+ if (path.length > 0) {
53
+ const pathTrailing = path[path.length - 1] === "/";
54
+ const segLeading = seg[0] === "/";
55
+ const both = pathTrailing && segLeading;
56
+ if (both) {
57
+ path += seg.slice(1);
58
+ } else {
59
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
60
+ }
61
+ } else {
62
+ path += seg;
63
+ }
25
64
  }
26
- return correctPaths(join(...paths));
65
+ return correctPaths(path);
27
66
  }, "joinPaths");
67
+ function normalizeString(path, allowAboveRoot) {
68
+ let res = "";
69
+ let lastSegmentLength = 0;
70
+ let lastSlash = -1;
71
+ let dots = 0;
72
+ let char = null;
73
+ for (let index = 0; index <= path.length; ++index) {
74
+ if (index < path.length) {
75
+ char = path[index];
76
+ } else if (char === "/") {
77
+ break;
78
+ } else {
79
+ char = "/";
80
+ }
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {
83
+ } else if (dots === 2) {
84
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
85
+ if (res.length > 2) {
86
+ const lastSlashIndex = res.lastIndexOf("/");
87
+ if (lastSlashIndex === -1) {
88
+ res = "";
89
+ lastSegmentLength = 0;
90
+ } else {
91
+ res = res.slice(0, lastSlashIndex);
92
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
93
+ }
94
+ lastSlash = index;
95
+ dots = 0;
96
+ continue;
97
+ } else if (res.length > 0) {
98
+ res = "";
99
+ lastSegmentLength = 0;
100
+ lastSlash = index;
101
+ dots = 0;
102
+ continue;
103
+ }
104
+ }
105
+ if (allowAboveRoot) {
106
+ res += res.length > 0 ? "/.." : "..";
107
+ lastSegmentLength = 2;
108
+ }
109
+ } else {
110
+ if (res.length > 0) {
111
+ res += `/${path.slice(lastSlash + 1, index)}`;
112
+ } else {
113
+ res = path.slice(lastSlash + 1, index);
114
+ }
115
+ lastSegmentLength = index - lastSlash - 1;
116
+ }
117
+ lastSlash = index;
118
+ dots = 0;
119
+ } else if (char === "." && dots !== -1) {
120
+ ++dots;
121
+ } else {
122
+ dots = -1;
123
+ }
124
+ }
125
+ return res;
126
+ }
127
+ __name(normalizeString, "normalizeString");
128
+ var isAbsolute = /* @__PURE__ */ __name(function(p) {
129
+ return _IS_ABSOLUTE_RE.test(p);
130
+ }, "isAbsolute");
28
131
 
29
132
  // ../config-tools/src/utilities/find-up.ts
30
133
  import { existsSync } from "node:fs";
31
- import { join as join2 } from "node:path";
134
+ import { join } from "node:path";
32
135
  var MAX_PATH_SEARCH_DEPTH = 30;
33
136
  var depth = 0;
34
137
  function findFolderUp(startPath, endFileNames) {
35
138
  const _startPath = startPath ?? process.cwd();
36
- if (endFileNames.some((endFileName) => existsSync(join2(_startPath, endFileName)))) {
139
+ if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
37
140
  return _startPath;
38
141
  }
39
142
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
40
- const parent = join2(_startPath, "..");
143
+ const parent = join(_startPath, "..");
41
144
  return findFolderUp(parent, endFileNames);
42
145
  }
43
146
  return void 0;
@@ -296,7 +399,7 @@ var COLOR_KEYS = [
296
399
  // ../config-tools/src/utilities/get-default-config.ts
297
400
  import { existsSync as existsSync2 } from "node:fs";
298
401
  import { readFile } from "node:fs/promises";
299
- import { join as join3 } from "node:path";
402
+ import { join as join2 } from "node:path";
300
403
  var DEFAULT_COLOR_CONFIG = {
301
404
  "light": {
302
405
  "background": "#fafafa",
@@ -332,7 +435,7 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
332
435
  let namespace = void 0;
333
436
  let repository = void 0;
334
437
  const workspaceRoot = findWorkspaceRoot(root);
335
- if (existsSync2(join3(workspaceRoot, "package.json"))) {
438
+ if (existsSync2(join2(workspaceRoot, "package.json"))) {
336
439
  const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
337
440
  if (file) {
338
441
  const packageJson = JSON.parse(file);
@@ -3,32 +3,135 @@
3
3
  var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
4
4
 
5
5
  // ../config-tools/src/utilities/correct-paths.ts
6
- var _path = require('path');
7
- var removeWindowsDriveLetter = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (osSpecificPath) => {
8
- return osSpecificPath.replace(/^[A-Z]:/, "");
9
- }, "removeWindowsDriveLetter");
10
- var correctPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path) => {
11
- if (!path) {
12
- return "";
13
- }
14
- if (path.includes("\\")) {
15
- if (!path.toUpperCase().startsWith("C:")) {
16
- path = `C:${path}`;
6
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
7
+ function normalizeWindowsPath(input = "") {
8
+ if (!input) {
9
+ return input;
10
+ }
11
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
12
+ }
13
+ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeWindowsPath, "normalizeWindowsPath");
14
+ var _UNC_REGEX = /^[/\\]{2}/;
15
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
16
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
17
+ var correctPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, function(path) {
18
+ if (!path || path.length === 0) {
19
+ return ".";
20
+ }
21
+ path = normalizeWindowsPath(path);
22
+ const isUNCPath = path.match(_UNC_REGEX);
23
+ const isPathAbsolute = isAbsolute(path);
24
+ const trailingSeparator = path[path.length - 1] === "/";
25
+ path = normalizeString(path, !isPathAbsolute);
26
+ if (path.length === 0) {
27
+ if (isPathAbsolute) {
28
+ return "/";
17
29
  }
18
- return path.replaceAll("/", "\\");
30
+ return trailingSeparator ? "./" : ".";
31
+ }
32
+ if (trailingSeparator) {
33
+ path += "/";
34
+ }
35
+ if (_DRIVE_LETTER_RE.test(path)) {
36
+ path += "/";
19
37
  }
20
- return removeWindowsDriveLetter(path).split("\\").join("/");
38
+ if (isUNCPath) {
39
+ if (!isPathAbsolute) {
40
+ return `//./${path}`;
41
+ }
42
+ return `//${path}`;
43
+ }
44
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
21
45
  }, "correctPaths");
22
- var joinPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (...paths) => {
23
- if (!paths || paths.length === 0) {
24
- return "";
46
+ var joinPaths = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, function(...segments) {
47
+ let path = "";
48
+ for (const seg of segments) {
49
+ if (!seg) {
50
+ continue;
51
+ }
52
+ if (path.length > 0) {
53
+ const pathTrailing = path[path.length - 1] === "/";
54
+ const segLeading = seg[0] === "/";
55
+ const both = pathTrailing && segLeading;
56
+ if (both) {
57
+ path += seg.slice(1);
58
+ } else {
59
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
60
+ }
61
+ } else {
62
+ path += seg;
63
+ }
25
64
  }
26
- return correctPaths(_path.join.call(void 0, ...paths));
65
+ return correctPaths(path);
27
66
  }, "joinPaths");
67
+ function normalizeString(path, allowAboveRoot) {
68
+ let res = "";
69
+ let lastSegmentLength = 0;
70
+ let lastSlash = -1;
71
+ let dots = 0;
72
+ let char = null;
73
+ for (let index = 0; index <= path.length; ++index) {
74
+ if (index < path.length) {
75
+ char = path[index];
76
+ } else if (char === "/") {
77
+ break;
78
+ } else {
79
+ char = "/";
80
+ }
81
+ if (char === "/") {
82
+ if (lastSlash === index - 1 || dots === 1) {
83
+ } else if (dots === 2) {
84
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
85
+ if (res.length > 2) {
86
+ const lastSlashIndex = res.lastIndexOf("/");
87
+ if (lastSlashIndex === -1) {
88
+ res = "";
89
+ lastSegmentLength = 0;
90
+ } else {
91
+ res = res.slice(0, lastSlashIndex);
92
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
93
+ }
94
+ lastSlash = index;
95
+ dots = 0;
96
+ continue;
97
+ } else if (res.length > 0) {
98
+ res = "";
99
+ lastSegmentLength = 0;
100
+ lastSlash = index;
101
+ dots = 0;
102
+ continue;
103
+ }
104
+ }
105
+ if (allowAboveRoot) {
106
+ res += res.length > 0 ? "/.." : "..";
107
+ lastSegmentLength = 2;
108
+ }
109
+ } else {
110
+ if (res.length > 0) {
111
+ res += `/${path.slice(lastSlash + 1, index)}`;
112
+ } else {
113
+ res = path.slice(lastSlash + 1, index);
114
+ }
115
+ lastSegmentLength = index - lastSlash - 1;
116
+ }
117
+ lastSlash = index;
118
+ dots = 0;
119
+ } else if (char === "." && dots !== -1) {
120
+ ++dots;
121
+ } else {
122
+ dots = -1;
123
+ }
124
+ }
125
+ return res;
126
+ }
127
+ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeString, "normalizeString");
128
+ var isAbsolute = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, function(p) {
129
+ return _IS_ABSOLUTE_RE.test(p);
130
+ }, "isAbsolute");
28
131
 
29
132
  // ../config-tools/src/utilities/find-up.ts
30
133
  var _fs = require('fs');
31
-
134
+ var _path = require('path');
32
135
  var MAX_PATH_SEARCH_DEPTH = 30;
33
136
  var depth = 0;
34
137
  function findFolderUp(startPath, endFileNames) {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  getInternalDependencies,
3
3
  r2UploadFile
4
- } from "./chunk-NP7DE7UM.mjs";
4
+ } from "./chunk-7GVMKVE6.mjs";
5
5
  import {
6
6
  createCliOptions,
7
7
  getPackageInfo
8
8
  } from "./chunk-XU6MTFCV.mjs";
9
9
  import {
10
10
  getConfig
11
- } from "./chunk-BKBJDKMA.mjs";
11
+ } from "./chunk-CH4HU3UC.mjs";
12
12
  import {
13
13
  findWorkspaceRoot,
14
14
  writeDebug,
15
15
  writeInfo,
16
16
  writeSuccess,
17
17
  writeWarning
18
- } from "./chunk-GMLMIRU7.mjs";
18
+ } from "./chunk-EY654AX3.mjs";
19
19
  import {
20
20
  __name
21
21
  } from "./chunk-A7FFSBE6.mjs";
@@ -8,7 +8,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.15",
11
+ version: "0.55.17",
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",