@storm-software/cloudflare-tools 0.55.14 → 0.55.16
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 +12 -0
- package/README.md +1 -1
- package/dist/{chunk-GCD4ACJC.js → chunk-23PVXPM6.js} +16 -16
- package/dist/{chunk-ADRS43PR.js → chunk-57JETFC4.js} +3 -3
- package/dist/{chunk-NP7DE7UM.mjs → chunk-7GVMKVE6.mjs} +1 -1
- package/dist/{chunk-7MWPMAXE.js → chunk-7V42HCIV.js} +12 -12
- package/dist/{chunk-NSUTBVTW.mjs → chunk-AD4JO55I.mjs} +4 -5
- package/dist/{chunk-7KXI3SYD.mjs → chunk-AOKTQV2C.mjs} +1 -1
- package/dist/{chunk-BKBJDKMA.mjs → chunk-CH4HU3UC.mjs} +1 -1
- package/dist/{chunk-GMLMIRU7.mjs → chunk-EY654AX3.mjs} +125 -22
- package/dist/{chunk-43HWVEIC.js → chunk-FNE7DP2D.js} +121 -18
- package/dist/{chunk-XSVPXWSA.mjs → chunk-JYGVCUHY.mjs} +3 -3
- package/dist/{chunk-V323GQ2Y.js → chunk-LEX4MDEP.js} +158 -159
- package/dist/{chunk-H5WF7RTA.js → chunk-LHFLBIC3.js} +1 -1
- package/dist/{chunk-6Q4S7VSU.js → chunk-OO2KFXL5.js} +41 -41
- package/dist/{chunk-IAJQKJVH.mjs → chunk-Q2OJ6JDC.mjs} +3 -3
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.55.16 (2025-01-29)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous
|
|
4
|
+
|
|
5
|
+
- **monorepo:** Regenerate README markdown files ([07f7d3d5](https://github.com/storm-software/storm-ops/commit/07f7d3d5))
|
|
6
|
+
|
|
7
|
+
## 0.55.15 (2025-01-29)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous
|
|
10
|
+
|
|
11
|
+
- **monorepo:** Regenerate README markdown files ([c2ecaaf8](https://github.com/storm-software/storm-ops/commit/c2ecaaf8))
|
|
12
|
+
|
|
1
13
|
## 0.55.14 (2025-01-29)
|
|
2
14
|
|
|
3
15
|
### 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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
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
|
|
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
|
|
11
|
+
var _chunkOO2KFXL5js = require('./chunk-OO2KFXL5.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
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 =
|
|
40
|
-
const config = await
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
+
_chunkFNE7DP2Djs.writeDebug.call(void 0, `No existing items to delete in the component registry path ${projectPath}`);
|
|
109
109
|
}
|
|
110
110
|
} else {
|
|
111
|
-
|
|
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
|
-
|
|
127
|
+
_chunkFNE7DP2Djs.writeInfo.call(void 0, `Generating meta.json file:
|
|
128
128
|
${metaJson}`);
|
|
129
|
-
await
|
|
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) =>
|
|
134
|
+
}).then((fileContent) => _chunk57JETFC4js.r2UploadFile.call(void 0, s3Client, options.bucketId, projectPath, fileName, version, fileContent, "text/plain", isDryRun));
|
|
135
135
|
}));
|
|
136
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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,9 +1,9 @@
|
|
|
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
|
|
3
|
+
var _chunkLHFLBIC3js = require('./chunk-LHFLBIC3.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkOO2KFXL5js = require('./chunk-OO2KFXL5.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ var _chunk6Q4S7VSUjs = require('./chunk-6Q4S7VSU.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkFNE7DP2Djs = require('./chunk-FNE7DP2D.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
@@ -38,21 +38,21 @@ var vitestScript = `"test": "vitest run"`;
|
|
|
38
38
|
|
|
39
39
|
// src/generators/worker/generator.ts
|
|
40
40
|
async function applicationGenerator(tree, schema) {
|
|
41
|
-
const stopwatch =
|
|
41
|
+
const stopwatch = _chunkFNE7DP2Djs.getStopwatch.call(void 0, "Storm Worker generator");
|
|
42
42
|
let config;
|
|
43
43
|
try {
|
|
44
|
-
|
|
44
|
+
_chunkFNE7DP2Djs.writeInfo.call(void 0, `\u26A1 Running the Storm Worker generator...
|
|
45
45
|
|
|
46
46
|
`, config);
|
|
47
|
-
const workspaceRoot =
|
|
48
|
-
|
|
47
|
+
const workspaceRoot = _chunkFNE7DP2Djs.findWorkspaceRoot.call(void 0, );
|
|
48
|
+
_chunkFNE7DP2Djs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.json file...
|
|
49
49
|
- workspaceRoot: ${workspaceRoot}`, config);
|
|
50
|
-
config = await
|
|
51
|
-
|
|
50
|
+
config = await _chunkOO2KFXL5js.getConfig.call(void 0, workspaceRoot);
|
|
51
|
+
_chunkFNE7DP2Djs.writeTrace.call(void 0, `Loaded Storm config into env:
|
|
52
52
|
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`, config);
|
|
53
53
|
const options = await normalizeOptions(tree, schema, config);
|
|
54
54
|
const tasks = [];
|
|
55
|
-
tasks.push(await
|
|
55
|
+
tasks.push(await _chunkLHFLBIC3js.generator_default.call(void 0, tree, {
|
|
56
56
|
...options,
|
|
57
57
|
skipFormat: true
|
|
58
58
|
}));
|
|
@@ -107,8 +107,8 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[
|
|
|
107
107
|
return _devkit.runTasksInSerial.call(void 0, ...tasks);
|
|
108
108
|
} catch (error) {
|
|
109
109
|
return () => {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
_chunkFNE7DP2Djs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
111
|
+
_chunkFNE7DP2Djs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
112
112
|
- Details: ${error.message}
|
|
113
113
|
- Stacktrace: ${error.stack}`, config);
|
|
114
114
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-XU6MTFCV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CH4HU3UC.mjs";
|
|
8
8
|
import {
|
|
9
9
|
StormConfigSchema,
|
|
10
10
|
correctPaths,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
writeSuccess,
|
|
21
21
|
writeTrace,
|
|
22
22
|
writeWarning
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EY654AX3.mjs";
|
|
24
24
|
import {
|
|
25
25
|
__dirname,
|
|
26
26
|
__name,
|
|
@@ -2068,7 +2068,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2068
2068
|
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2069
2069
|
}
|
|
2070
2070
|
const jiti = createJiti(config.workspaceRoot, {
|
|
2071
|
-
fsCache: config.skipCache ? false : joinPaths(config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2071
|
+
fsCache: config.skipCache ? false : joinPaths(config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2072
2072
|
interopDefault: true
|
|
2073
2073
|
});
|
|
2074
2074
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -2081,7 +2081,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2081
2081
|
}, {
|
|
2082
2082
|
stubOptions: {
|
|
2083
2083
|
jiti: {
|
|
2084
|
-
|
|
2084
|
+
fsCache: config.skipCache ? false : joinPaths(config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
2085
2085
|
}
|
|
2086
2086
|
},
|
|
2087
2087
|
rollup: {
|
|
@@ -2115,7 +2115,6 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2115
2115
|
options.entry ??= [
|
|
2116
2116
|
"{sourceRoot}"
|
|
2117
2117
|
];
|
|
2118
|
-
options.outputPath ??= "dist/{projectRoot}";
|
|
2119
2118
|
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
2120
2119
|
return options;
|
|
2121
2120
|
}, "applyDefaultOptions")
|
|
@@ -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.
|
|
11
|
+
version: "0.55.16",
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
30
|
+
return trailingSeparator ? "./" : ".";
|
|
31
|
+
}
|
|
32
|
+
if (trailingSeparator) {
|
|
33
|
+
path += "/";
|
|
34
|
+
}
|
|
35
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
36
|
+
path += "/";
|
|
19
37
|
}
|
|
20
|
-
|
|
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((...
|
|
23
|
-
|
|
24
|
-
|
|
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(
|
|
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
|
|
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(
|
|
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 =
|
|
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
|
|
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(
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
30
|
+
return trailingSeparator ? "./" : ".";
|
|
31
|
+
}
|
|
32
|
+
if (trailingSeparator) {
|
|
33
|
+
path += "/";
|
|
34
|
+
}
|
|
35
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
36
|
+
path += "/";
|
|
19
37
|
}
|
|
20
|
-
|
|
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, (...
|
|
23
|
-
|
|
24
|
-
|
|
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(
|
|
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) {
|