@stryke/fs 0.33.83 → 0.33.84
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 +6 -0
- package/dist/_virtual/_rolldown/runtime.cjs +0 -14
- package/dist/buffer.cjs +0 -12
- package/dist/buffer.mjs +1 -8
- package/dist/buffer.mjs.map +1 -1
- package/dist/chmod-x.cjs +0 -14
- package/dist/chmod-x.mjs +1 -10
- package/dist/chmod-x.mjs.map +1 -1
- package/dist/command-exists.cjs +1 -11
- package/dist/command-exists.mjs +1 -6
- package/dist/command-exists.mjs.map +1 -1
- package/dist/compress.cjs +1 -8
- package/dist/compress.mjs +1 -3
- package/dist/compress.mjs.map +1 -1
- package/dist/constants.cjs +0 -13
- package/dist/constants.mjs +1 -8
- package/dist/copy-file.cjs +1 -13
- package/dist/copy-file.mjs +1 -8
- package/dist/copy-file.mjs.map +1 -1
- package/dist/exists.cjs +1 -11
- package/dist/exists.mjs +1 -6
- package/dist/exists.mjs.map +1 -1
- package/dist/get-parent-path.cjs +1 -8
- package/dist/get-parent-path.mjs +1 -3
- package/dist/get-parent-path.mjs.map +1 -1
- package/dist/get-workspace-root.cjs +0 -16
- package/dist/get-workspace-root.mjs +1 -12
- package/dist/get-workspace-root.mjs.map +1 -1
- package/dist/helpers.cjs +0 -14
- package/dist/helpers.mjs +1 -10
- package/dist/helpers.mjs.map +1 -1
- package/dist/index.cjs +0 -111
- package/dist/index.mjs +1 -107
- package/dist/install.cjs +0 -10
- package/dist/install.mjs +1 -6
- package/dist/install.mjs.map +1 -1
- package/dist/is-file.cjs +1 -13
- package/dist/is-file.mjs +1 -8
- package/dist/is-file.mjs.map +1 -1
- package/dist/json.cjs +0 -12
- package/dist/json.mjs +1 -8
- package/dist/json.mjs.map +1 -1
- package/dist/list-files.cjs +1 -15
- package/dist/list-files.mjs +1 -10
- package/dist/list-files.mjs.map +1 -1
- package/dist/package-fns.cjs +1 -16
- package/dist/package-fns.mjs +1 -11
- package/dist/package-fns.mjs.map +1 -1
- package/dist/read-file.cjs +1 -13
- package/dist/read-file.mjs +1 -8
- package/dist/read-file.mjs.map +1 -1
- package/dist/registry.cjs +0 -13
- package/dist/registry.mjs +1 -9
- package/dist/registry.mjs.map +1 -1
- package/dist/remove-file.cjs +1 -11
- package/dist/remove-file.mjs +1 -6
- package/dist/remove-file.mjs.map +1 -1
- package/dist/resolve.cjs +1 -20
- package/dist/resolve.mjs +1 -15
- package/dist/resolve.mjs.map +1 -1
- package/dist/semver-fns.cjs +1 -20
- package/dist/semver-fns.mjs +1 -15
- package/dist/semver-fns.mjs.map +1 -1
- package/dist/toml.cjs +0 -12
- package/dist/toml.mjs +1 -8
- package/dist/toml.mjs.map +1 -1
- package/dist/tsconfig.cjs +1 -8
- package/dist/tsconfig.mjs +1 -3
- package/dist/tsconfig.mjs.map +1 -1
- package/dist/write-file.cjs +1 -11
- package/dist/write-file.mjs +1 -6
- package/dist/write-file.mjs.map +1 -1
- package/dist/yaml.cjs +1 -11
- package/dist/yaml.mjs +1 -6
- package/dist/yaml.mjs.map +1 -1
- package/package.json +9 -109
- package/dist/_virtual/_rolldown/runtime.mjs +0 -18
- package/dist/buffer.test.cjs +0 -13
- package/dist/buffer.test.d.cts +0 -1
- package/dist/buffer.test.d.mts +0 -1
- package/dist/buffer.test.mjs +0 -14
- package/dist/buffer.test.mjs.map +0 -1
- package/dist/chmod-x.test.cjs +0 -13
- package/dist/chmod-x.test.d.cts +0 -1
- package/dist/chmod-x.test.d.mts +0 -1
- package/dist/chmod-x.test.mjs +0 -14
- package/dist/chmod-x.test.mjs.map +0 -1
- package/dist/command-exists.test.cjs +0 -13
- package/dist/command-exists.test.d.cts +0 -1
- package/dist/command-exists.test.d.mts +0 -1
- package/dist/command-exists.test.mjs +0 -14
- package/dist/command-exists.test.mjs.map +0 -1
- package/dist/compress.test.cjs +0 -13
- package/dist/compress.test.d.cts +0 -1
- package/dist/compress.test.d.mts +0 -1
- package/dist/compress.test.mjs +0 -14
- package/dist/compress.test.mjs.map +0 -1
- package/dist/constants.mjs.map +0 -1
- package/dist/constants.test.cjs +0 -13
- package/dist/constants.test.d.cts +0 -1
- package/dist/constants.test.d.mts +0 -1
- package/dist/constants.test.mjs +0 -14
- package/dist/constants.test.mjs.map +0 -1
- package/dist/copy-file.test.cjs +0 -13
- package/dist/copy-file.test.d.cts +0 -1
- package/dist/copy-file.test.d.mts +0 -1
- package/dist/copy-file.test.mjs +0 -14
- package/dist/copy-file.test.mjs.map +0 -1
- package/dist/exists.test.cjs +0 -13
- package/dist/exists.test.d.cts +0 -1
- package/dist/exists.test.d.mts +0 -1
- package/dist/exists.test.mjs +0 -14
- package/dist/exists.test.mjs.map +0 -1
- package/dist/get-parent-path.test.cjs +0 -13
- package/dist/get-parent-path.test.d.cts +0 -1
- package/dist/get-parent-path.test.d.mts +0 -1
- package/dist/get-parent-path.test.mjs +0 -14
- package/dist/get-parent-path.test.mjs.map +0 -1
- package/dist/get-workspace-root.test.cjs +0 -13
- package/dist/get-workspace-root.test.d.cts +0 -1
- package/dist/get-workspace-root.test.d.mts +0 -1
- package/dist/get-workspace-root.test.mjs +0 -14
- package/dist/get-workspace-root.test.mjs.map +0 -1
- package/dist/helpers.test.cjs +0 -13
- package/dist/helpers.test.d.cts +0 -1
- package/dist/helpers.test.d.mts +0 -1
- package/dist/helpers.test.mjs +0 -14
- package/dist/helpers.test.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/index.test.cjs +0 -13
- package/dist/index.test.d.cts +0 -1
- package/dist/index.test.d.mts +0 -1
- package/dist/index.test.mjs +0 -14
- package/dist/index.test.mjs.map +0 -1
- package/dist/install.test.cjs +0 -13
- package/dist/install.test.d.cts +0 -1
- package/dist/install.test.d.mts +0 -1
- package/dist/install.test.mjs +0 -14
- package/dist/install.test.mjs.map +0 -1
- package/dist/is-file.test.cjs +0 -13
- package/dist/is-file.test.d.cts +0 -1
- package/dist/is-file.test.d.mts +0 -1
- package/dist/is-file.test.mjs +0 -14
- package/dist/is-file.test.mjs.map +0 -1
- package/dist/json.test.cjs +0 -13
- package/dist/json.test.d.cts +0 -1
- package/dist/json.test.d.mts +0 -1
- package/dist/json.test.mjs +0 -14
- package/dist/json.test.mjs.map +0 -1
- package/dist/list-files.test.cjs +0 -13
- package/dist/list-files.test.d.cts +0 -1
- package/dist/list-files.test.d.mts +0 -1
- package/dist/list-files.test.mjs +0 -14
- package/dist/list-files.test.mjs.map +0 -1
- package/dist/package-fns.test.cjs +0 -13
- package/dist/package-fns.test.d.cts +0 -1
- package/dist/package-fns.test.d.mts +0 -1
- package/dist/package-fns.test.mjs +0 -14
- package/dist/package-fns.test.mjs.map +0 -1
- package/dist/read-file.test.cjs +0 -13
- package/dist/read-file.test.d.cts +0 -1
- package/dist/read-file.test.d.mts +0 -1
- package/dist/read-file.test.mjs +0 -14
- package/dist/read-file.test.mjs.map +0 -1
- package/dist/registry.test.cjs +0 -13
- package/dist/registry.test.d.cts +0 -1
- package/dist/registry.test.d.mts +0 -1
- package/dist/registry.test.mjs +0 -14
- package/dist/registry.test.mjs.map +0 -1
- package/dist/remove-file.test.cjs +0 -13
- package/dist/remove-file.test.d.cts +0 -1
- package/dist/remove-file.test.d.mts +0 -1
- package/dist/remove-file.test.mjs +0 -14
- package/dist/remove-file.test.mjs.map +0 -1
- package/dist/resolve.test.cjs +0 -13
- package/dist/resolve.test.d.cts +0 -1
- package/dist/resolve.test.d.mts +0 -1
- package/dist/resolve.test.mjs +0 -14
- package/dist/resolve.test.mjs.map +0 -1
- package/dist/semver-fns.test.cjs +0 -13
- package/dist/semver-fns.test.d.cts +0 -1
- package/dist/semver-fns.test.d.mts +0 -1
- package/dist/semver-fns.test.mjs +0 -14
- package/dist/semver-fns.test.mjs.map +0 -1
- package/dist/toml.test.cjs +0 -13
- package/dist/toml.test.d.cts +0 -1
- package/dist/toml.test.d.mts +0 -1
- package/dist/toml.test.mjs +0 -14
- package/dist/toml.test.mjs.map +0 -1
- package/dist/tsconfig.test.cjs +0 -13
- package/dist/tsconfig.test.d.cts +0 -1
- package/dist/tsconfig.test.d.mts +0 -1
- package/dist/tsconfig.test.mjs +0 -14
- package/dist/tsconfig.test.mjs.map +0 -1
- package/dist/write-file.test.cjs +0 -13
- package/dist/write-file.test.d.cts +0 -1
- package/dist/write-file.test.d.mts +0 -1
- package/dist/write-file.test.mjs +0 -14
- package/dist/write-file.test.mjs.map +0 -1
- package/dist/yaml.test.cjs +0 -13
- package/dist/yaml.test.d.cts +0 -1
- package/dist/yaml.test.d.mts +0 -1
- package/dist/yaml.test.mjs +0 -14
- package/dist/yaml.test.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Stryke - Fs
|
|
4
4
|
|
|
5
|
+
## [0.33.83](https://github.com/storm-software/stryke/releases/tag/fs%400.33.83) (06/01/2026)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **fs:** Resolve issue with `listFiles` to handle all glob patterns ([1204dab0](https://github.com/storm-software/stryke/commit/1204dab0))
|
|
10
|
+
|
|
5
11
|
## [0.33.82](https://github.com/storm-software/stryke/releases/tag/fs%400.33.82) (06/01/2026)
|
|
6
12
|
|
|
7
13
|
### Miscellaneous
|
|
@@ -5,19 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __exportAll = (all, no_symbols) => {
|
|
9
|
-
let target = {};
|
|
10
|
-
for (var name in all) {
|
|
11
|
-
__defProp(target, name, {
|
|
12
|
-
get: all[name],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
if (!no_symbols) {
|
|
17
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
-
}
|
|
19
|
-
return target;
|
|
20
|
-
};
|
|
21
8
|
var __copyProps = (to, from, except, desc) => {
|
|
22
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
10
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -39,5 +26,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
26
|
|
|
40
27
|
//#endregion
|
|
41
28
|
|
|
42
|
-
exports.__exportAll = __exportAll;
|
|
43
29
|
exports.__toESM = __toESM;
|
package/dist/buffer.cjs
CHANGED
|
@@ -7,12 +7,6 @@ let node_fs = require("node:fs");
|
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
|
|
9
9
|
//#region src/buffer.ts
|
|
10
|
-
var buffer_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
11
|
-
readFileBuffer: () => readFileBuffer,
|
|
12
|
-
readFileBufferSync: () => readFileBufferSync,
|
|
13
|
-
writeFileBuffer: () => writeFileBuffer,
|
|
14
|
-
writeFileBufferSync: () => writeFileBufferSync
|
|
15
|
-
});
|
|
16
10
|
/**
|
|
17
11
|
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
|
|
18
12
|
*
|
|
@@ -61,12 +55,6 @@ function writeFileBufferSync(filePath, data) {
|
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
//#endregion
|
|
64
|
-
Object.defineProperty(exports, 'buffer_exports', {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () {
|
|
67
|
-
return buffer_exports;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
58
|
exports.readFileBuffer = readFileBuffer;
|
|
71
59
|
exports.readFileBufferSync = readFileBufferSync;
|
|
72
60
|
exports.writeFileBuffer = writeFileBuffer;
|
package/dist/buffer.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { createDirectory, createDirectorySync } from "./helpers.mjs";
|
|
3
2
|
import { findFilePath } from "@stryke/path";
|
|
4
3
|
import { Buffer } from "node:buffer";
|
|
@@ -6,12 +5,6 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
6
5
|
import { readFile, writeFile } from "node:fs/promises";
|
|
7
6
|
|
|
8
7
|
//#region src/buffer.ts
|
|
9
|
-
var buffer_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
readFileBuffer: () => readFileBuffer,
|
|
11
|
-
readFileBufferSync: () => readFileBufferSync,
|
|
12
|
-
writeFileBuffer: () => writeFileBuffer,
|
|
13
|
-
writeFileBufferSync: () => writeFileBufferSync
|
|
14
|
-
});
|
|
15
8
|
/**
|
|
16
9
|
* Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.
|
|
17
10
|
*
|
|
@@ -60,5 +53,5 @@ function writeFileBufferSync(filePath, data) {
|
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
//#endregion
|
|
63
|
-
export {
|
|
56
|
+
export { readFileBuffer, readFileBufferSync, writeFileBuffer, writeFileBufferSync };
|
|
64
57
|
//# sourceMappingURL=buffer.mjs.map
|
package/dist/buffer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.mjs","names":[],"sources":["../src/buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { findFilePath } from \"@stryke/path\";\nimport { Buffer } from \"node:buffer\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport async function readFileBuffer(filePath: string): Promise<ArrayBuffer> {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = await readFile(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport function readFileBufferSync(filePath: string): ArrayBuffer {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = readFileSync(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport async function writeFileBuffer(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n await createDirectory(findFilePath(filePath));\n }\n\n await writeFile(filePath, Buffer.from(data));\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport function writeFileBufferSync(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n createDirectorySync(findFilePath(filePath));\n }\n\n writeFileSync(filePath, Buffer.from(data));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buffer.mjs","names":[],"sources":["../src/buffer.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { findFilePath } from \"@stryke/path\";\nimport { Buffer } from \"node:buffer\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport async function readFileBuffer(filePath: string): Promise<ArrayBuffer> {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = await readFile(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Reads a file from the given path and returns its content as an ArrayBuffer. The file is expected to be located relative to the current directory of this module.\n *\n * @param filePath - The path to the file to read.\n * @returns The content of the file as an ArrayBuffer.\n */\nexport function readFileBufferSync(filePath: string): ArrayBuffer {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n if (!existsSync(filePath)) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n\n const b = readFileSync(filePath);\n\n return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport async function writeFileBuffer(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n await createDirectory(findFilePath(filePath));\n }\n\n await writeFile(filePath, Buffer.from(data));\n}\n\n/**\n * Writes an ArrayBuffer to a file at the specified path.\n *\n * @param filePath - The path to the file where the data should be written.\n * @param data - The ArrayBuffer containing the data to write.\n */\nexport function writeFileBufferSync(filePath: string, data: ArrayBuffer) {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n if (!existsSync(findFilePath(filePath))) {\n createDirectorySync(findFilePath(filePath));\n }\n\n writeFileSync(filePath, Buffer.from(data));\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,eAAsB,eAAe,UAAwC;AAC3E,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAEvD,KAAI,CAAC,WAAW,SAAS,CACvB,OAAM,IAAI,MAAM,gCAAgC,WAAW;CAG7D,MAAM,IAAI,MAAM,SAAS,SAAS;AAElC,QAAO,EAAE,OAAO,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW;;;;;;;;AASlE,SAAgB,mBAAmB,UAA+B;AAChE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;AAEvD,KAAI,CAAC,WAAW,SAAS,CACvB,OAAM,IAAI,MAAM,gCAAgC,WAAW;CAG7D,MAAM,IAAI,aAAa,SAAS;AAEhC,QAAO,EAAE,OAAO,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW;;;;;;;;AASlE,eAAsB,gBAAgB,UAAkB,MAAmB;AACzE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,sCAAsC;AAExD,KAAI,CAAC,WAAW,aAAa,SAAS,CAAC,CACrC,OAAM,gBAAgB,aAAa,SAAS,CAAC;AAG/C,OAAM,UAAU,UAAU,OAAO,KAAK,KAAK,CAAC;;;;;;;;AAS9C,SAAgB,oBAAoB,UAAkB,MAAmB;AACvE,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,sCAAsC;AAExD,KAAI,CAAC,WAAW,aAAa,SAAS,CAAC,CACrC,qBAAoB,aAAa,SAAS,CAAC;AAG7C,eAAc,UAAU,OAAO,KAAK,KAAK,CAAC"}
|
package/dist/chmod-x.cjs
CHANGED
|
@@ -4,14 +4,6 @@ let node_fs = require("node:fs");
|
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
5
5
|
|
|
6
6
|
//#region src/chmod-x.ts
|
|
7
|
-
var chmod_x_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
8
|
-
chmodX: () => chmodX,
|
|
9
|
-
chmodXSync: () => chmodXSync,
|
|
10
|
-
isExecutable: () => isExecutable,
|
|
11
|
-
isExecutableSync: () => isExecutableSync,
|
|
12
|
-
isWritable: () => isWritable,
|
|
13
|
-
isWritableSync: () => isWritableSync
|
|
14
|
-
});
|
|
15
7
|
/**
|
|
16
8
|
* Adds execute permissions to a file
|
|
17
9
|
*
|
|
@@ -96,12 +88,6 @@ function isExecutableSync(filename) {
|
|
|
96
88
|
//#endregion
|
|
97
89
|
exports.chmodX = chmodX;
|
|
98
90
|
exports.chmodXSync = chmodXSync;
|
|
99
|
-
Object.defineProperty(exports, 'chmod_x_exports', {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function () {
|
|
102
|
-
return chmod_x_exports;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
91
|
exports.isExecutable = isExecutable;
|
|
106
92
|
exports.isExecutableSync = isExecutableSync;
|
|
107
93
|
exports.isWritable = isWritable;
|
package/dist/chmod-x.mjs
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { accessSync, chmodSync, constants, statSync } from "node:fs";
|
|
3
2
|
import { access, chmod } from "node:fs/promises";
|
|
4
3
|
|
|
5
4
|
//#region src/chmod-x.ts
|
|
6
|
-
var chmod_x_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
-
chmodX: () => chmodX,
|
|
8
|
-
chmodXSync: () => chmodXSync,
|
|
9
|
-
isExecutable: () => isExecutable,
|
|
10
|
-
isExecutableSync: () => isExecutableSync,
|
|
11
|
-
isWritable: () => isWritable,
|
|
12
|
-
isWritableSync: () => isWritableSync
|
|
13
|
-
});
|
|
14
5
|
/**
|
|
15
6
|
* Adds execute permissions to a file
|
|
16
7
|
*
|
|
@@ -93,5 +84,5 @@ function isExecutableSync(filename) {
|
|
|
93
84
|
}
|
|
94
85
|
|
|
95
86
|
//#endregion
|
|
96
|
-
export { chmodX, chmodXSync,
|
|
87
|
+
export { chmodX, chmodXSync, isExecutable, isExecutableSync, isWritable, isWritableSync };
|
|
97
88
|
//# sourceMappingURL=chmod-x.mjs.map
|
package/dist/chmod-x.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chmod-x.mjs","names":[],"sources":["../src/chmod-x.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { accessSync, chmodSync, constants, statSync } from \"node:fs\";\nimport { access, chmod } from \"node:fs/promises\";\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport function chmodXSync(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n chmodSync(file, base8);\n}\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport async function chmodX(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n return chmod(file, base8);\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is writable, false otherwise\n */\nexport async function isWritable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is writable, false otherwise\n */\nexport function isWritableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is executable, false otherwise\n */\nexport async function isExecutable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is executable, false otherwise\n */\nexport function isExecutableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chmod-x.mjs","names":[],"sources":["../src/chmod-x.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { accessSync, chmodSync, constants, statSync } from \"node:fs\";\nimport { access, chmod } from \"node:fs/promises\";\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport function chmodXSync(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n chmodSync(file, base8);\n}\n\n/**\n * Adds execute permissions to a file\n *\n * @param file - The file to add execute permissions to\n */\nexport async function chmodX(file: string) {\n // Note: skip for windows as chmod does on exist there\n // and will error with `EACCES: permission denied`\n if (process.platform === \"win32\") {\n return;\n }\n\n const s = statSync(file);\n const newMode = s.mode | 64 | 8 | 1;\n\n if (s.mode === newMode) {\n return;\n }\n const base8 = newMode.toString(8).slice(-3);\n\n return chmod(file, base8);\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is writable, false otherwise\n */\nexport async function isWritable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the write permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is writable, false otherwise\n */\nexport function isWritableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.W_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns A promise that resolves to true if the file is executable, false otherwise\n */\nexport async function isExecutable(filename: string): Promise<boolean> {\n try {\n await access(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Checks the execute permission of a file\n *\n * @param filename - The file to check the permission of\n * @returns True if the file is executable, false otherwise\n */\nexport function isExecutableSync(filename: string): boolean {\n try {\n accessSync(filename, constants.X_OK);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,WAAW,MAAc;AAGvC,KAAI,QAAQ,aAAa,QACvB;CAGF,MAAM,IAAI,SAAS,KAAK;CACxB,MAAM,UAAU,EAAE,OAAO;AAEzB,KAAI,EAAE,SAAS,QACb;AAIF,WAAU,MAFI,QAAQ,SAAS,EAAE,CAAC,MAAM,GAEnB,CAAC;;;;;;;AAQxB,eAAsB,OAAO,MAAc;AAGzC,KAAI,QAAQ,aAAa,QACvB;CAGF,MAAM,IAAI,SAAS,KAAK;CACxB,MAAM,UAAU,EAAE,OAAO;AAEzB,KAAI,EAAE,SAAS,QACb;AAIF,QAAO,MAAM,MAFC,QAAQ,SAAS,EAAE,CAAC,MAAM,GAEhB,CAAC;;;;;;;;AAS3B,eAAsB,WAAW,UAAoC;AACnE,KAAI;AACF,QAAM,OAAO,UAAU,UAAU,KAAK;AACtC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,SAAgB,eAAe,UAA2B;AACxD,KAAI;AACF,aAAW,UAAU,UAAU,KAAK;AACpC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,eAAsB,aAAa,UAAoC;AACrE,KAAI;AACF,QAAM,OAAO,UAAU,UAAU,KAAK;AACtC,SAAO;SACD;AACN,SAAO;;;;;;;;;AAUX,SAAgB,iBAAiB,UAA2B;AAC1D,KAAI;AACF,aAAW,UAAU,UAAU,KAAK;AACpC,SAAO;SACD;AACN,SAAO"}
|
package/dist/command-exists.cjs
CHANGED
|
@@ -6,10 +6,6 @@ let node_child_process = require("node:child_process");
|
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
|
|
8
8
|
//#region src/command-exists.ts
|
|
9
|
-
var command_exists_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
10
|
-
commandExists: () => commandExists,
|
|
11
|
-
commandExistsSync: () => commandExistsSync
|
|
12
|
-
});
|
|
13
9
|
const isUsingWindows = process.platform == "win32";
|
|
14
10
|
async function fileNotExists(commandName) {
|
|
15
11
|
try {
|
|
@@ -104,10 +100,4 @@ function commandExistsSync(commandName) {
|
|
|
104
100
|
|
|
105
101
|
//#endregion
|
|
106
102
|
exports.commandExists = commandExists;
|
|
107
|
-
exports.commandExistsSync = commandExistsSync;
|
|
108
|
-
Object.defineProperty(exports, 'command_exists_exports', {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return command_exists_exports;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
103
|
+
exports.commandExistsSync = commandExistsSync;
|
package/dist/command-exists.mjs
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { accessSync } from "node:fs";
|
|
3
2
|
import { access, constants as constants$1 } from "node:fs/promises";
|
|
4
3
|
import { exec, execSync } from "node:child_process";
|
|
5
4
|
import { basename, dirname } from "node:path";
|
|
6
5
|
|
|
7
6
|
//#region src/command-exists.ts
|
|
8
|
-
var command_exists_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
-
commandExists: () => commandExists,
|
|
10
|
-
commandExistsSync: () => commandExistsSync
|
|
11
|
-
});
|
|
12
7
|
const isUsingWindows = process.platform == "win32";
|
|
13
8
|
async function fileNotExists(commandName) {
|
|
14
9
|
try {
|
|
@@ -102,5 +97,5 @@ function commandExistsSync(commandName) {
|
|
|
102
97
|
}
|
|
103
98
|
|
|
104
99
|
//#endregion
|
|
105
|
-
export { commandExists, commandExistsSync
|
|
100
|
+
export { commandExists, commandExistsSync };
|
|
106
101
|
//# sourceMappingURL=command-exists.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-exists.mjs","names":["constants"],"sources":["../src/command-exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { exec, execSync } from \"node:child_process\";\nimport { accessSync } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\nimport { basename, dirname } from \"node:path\";\n\nconst isUsingWindows = process.platform == \"win32\";\n\nasync function fileNotExists(commandName: string) {\n try {\n await access(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nfunction fileNotExistsSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nasync function localExecutable(commandName: string) {\n return access(commandName, constants.F_OK | constants.X_OK);\n}\n\nfunction localExecutableSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK | constants.X_OK);\n return true;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nasync function commandExistsUnix(\n commandName: string,\n cleanedCommandName: string\n) {\n const isFile = await fileNotExists(commandName);\n\n if (!isFile) {\n exec(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n await localExecutable(commandName);\n }\n}\n\nasync function commandExistsWindows(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return;\n }\n\n exec(`where ${cleanedCommandName}`);\n}\n\nfunction commandExistsUnixSync(\n commandName: string,\n cleanedCommandName: string\n): boolean {\n if (fileNotExistsSync(commandName)) {\n try {\n const stdout = execSync(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n }\n return localExecutableSync(commandName);\n}\n\nfunction commandExistsWindowsSync(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return false;\n }\n try {\n const stdout = execSync(`where ${cleanedCommandName}`, { stdio: [] });\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nfunction cleanInput(s: string) {\n if (/[^\\w/:=-]/.test(s)) {\n s = `'${s.replace(/'/g, \"'\\\\''\")}'`;\n s = s\n .replace(/^(?:'')+/g, \"\") // un-duplicate single-quote at the beginning\n .replace(/\\\\'''/g, \"\\\\'\"); // remove non-escaped single-quote if there are enclosed between 2 escaped\n }\n return s;\n}\n\nconst cleanWindowsInput = (s: string) => {\n const isPathName = /\\\\/.test(s);\n if (isPathName) {\n return `\"${dirname(s)}:${basename(s)}\"`;\n }\n return `\"${s}\"`;\n};\n\n/**\n * Asynchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns A promise that resolves to `true` if the command exists and is executable, `false` otherwise\n */\nexport async function commandExists(commandName: string) {\n const cleanedCommandName = cleanInput(commandName);\n\n if (typeof Promise !== \"undefined\") {\n return commandExists(commandName);\n }\n if (isUsingWindows) {\n return commandExistsWindows(commandName, cleanedCommandName);\n } else {\n return commandExistsUnix(commandName, cleanedCommandName);\n }\n}\n\n/**\n * Synchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns `true` if the command exists and is executable, `false` otherwise\n */\nexport function commandExistsSync(commandName: string): boolean {\n if (isUsingWindows) {\n return commandExistsWindowsSync(\n commandName,\n cleanWindowsInput(commandName)\n );\n } else {\n return commandExistsUnixSync(commandName, cleanInput(commandName));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-exists.mjs","names":["constants"],"sources":["../src/command-exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { exec, execSync } from \"node:child_process\";\nimport { accessSync } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\nimport { basename, dirname } from \"node:path\";\n\nconst isUsingWindows = process.platform == \"win32\";\n\nasync function fileNotExists(commandName: string) {\n try {\n await access(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nfunction fileNotExistsSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK);\n return false;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return true;\n }\n}\n\nasync function localExecutable(commandName: string) {\n return access(commandName, constants.F_OK | constants.X_OK);\n}\n\nfunction localExecutableSync(commandName: string) {\n try {\n accessSync(commandName, constants.F_OK | constants.X_OK);\n return true;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nasync function commandExistsUnix(\n commandName: string,\n cleanedCommandName: string\n) {\n const isFile = await fileNotExists(commandName);\n\n if (!isFile) {\n exec(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n await localExecutable(commandName);\n }\n}\n\nasync function commandExistsWindows(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return;\n }\n\n exec(`where ${cleanedCommandName}`);\n}\n\nfunction commandExistsUnixSync(\n commandName: string,\n cleanedCommandName: string\n): boolean {\n if (fileNotExistsSync(commandName)) {\n try {\n const stdout = execSync(\n `command -v ${cleanedCommandName} 2>/dev/null` +\n ` && { echo >&1 ${cleanedCommandName}; exit 0; }`\n );\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n }\n return localExecutableSync(commandName);\n}\n\nfunction commandExistsWindowsSync(\n commandName: string,\n cleanedCommandName: string\n) {\n // Regex from Julio from: https://stackoverflow.com/questions/51494579/regex-windows-path-validator\n if (!/^(?!(?:.*\\s|.*\\.|\\W+)$)(?:[a-z]:)?[^<>:\"|?*\\n]+$/im.test(commandName)) {\n return false;\n }\n try {\n const stdout = execSync(`where ${cleanedCommandName}`, { stdio: [] });\n\n return !!stdout;\n // eslint-disable-next-line unused-imports/no-unused-vars, ts/no-unused-vars\n } catch (_) {\n return false;\n }\n}\n\nfunction cleanInput(s: string) {\n if (/[^\\w/:=-]/.test(s)) {\n s = `'${s.replace(/'/g, \"'\\\\''\")}'`;\n s = s\n .replace(/^(?:'')+/g, \"\") // un-duplicate single-quote at the beginning\n .replace(/\\\\'''/g, \"\\\\'\"); // remove non-escaped single-quote if there are enclosed between 2 escaped\n }\n return s;\n}\n\nconst cleanWindowsInput = (s: string) => {\n const isPathName = /\\\\/.test(s);\n if (isPathName) {\n return `\"${dirname(s)}:${basename(s)}\"`;\n }\n return `\"${s}\"`;\n};\n\n/**\n * Asynchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns A promise that resolves to `true` if the command exists and is executable, `false` otherwise\n */\nexport async function commandExists(commandName: string) {\n const cleanedCommandName = cleanInput(commandName);\n\n if (typeof Promise !== \"undefined\") {\n return commandExists(commandName);\n }\n if (isUsingWindows) {\n return commandExistsWindows(commandName, cleanedCommandName);\n } else {\n return commandExistsUnix(commandName, cleanedCommandName);\n }\n}\n\n/**\n * Synchronously checks if a command exists in the system.\n *\n * @remarks\n * This function will check if the command is available in the system's PATH and if it is executable.\n * @param commandName - The name of the command to check for existence\n * @returns `true` if the command exists and is executable, `false` otherwise\n */\nexport function commandExistsSync(commandName: string): boolean {\n if (isUsingWindows) {\n return commandExistsWindowsSync(\n commandName,\n cleanWindowsInput(commandName)\n );\n } else {\n return commandExistsUnixSync(commandName, cleanInput(commandName));\n }\n}\n"],"mappings":";;;;;;AAuBA,MAAM,iBAAiB,QAAQ,YAAY;AAE3C,eAAe,cAAc,aAAqB;AAChD,KAAI;AACF,QAAM,OAAO,aAAaA,YAAU,KAAK;AACzC,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,SAAS,kBAAkB,aAAqB;AAC9C,KAAI;AACF,aAAW,aAAaA,YAAU,KAAK;AACvC,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,eAAe,gBAAgB,aAAqB;AAClD,QAAO,OAAO,aAAaA,YAAU,OAAOA,YAAU,KAAK;;AAG7D,SAAS,oBAAoB,aAAqB;AAChD,KAAI;AACF,aAAW,aAAaA,YAAU,OAAOA,YAAU,KAAK;AACxD,SAAO;UAEA,GAAG;AACV,SAAO;;;AAIX,eAAe,kBACb,aACA,oBACA;AAGA,KAAI,CAAC,MAFgB,cAAc,YAAY,EAElC;AACX,OACE,cAAc,mBAAmB,6BACb,mBAAmB,aACxC;AAED,QAAM,gBAAgB,YAAY;;;AAItC,eAAe,qBACb,aACA,oBACA;AAEA,KAAI,CAAC,qDAAqD,KAAK,YAAY,CACzE;AAGF,MAAK,SAAS,qBAAqB;;AAGrC,SAAS,sBACP,aACA,oBACS;AACT,KAAI,kBAAkB,YAAY,CAChC,KAAI;AAMF,SAAO,CAAC,CALO,SACb,cAAc,mBAAmB,6BACb,mBAAmB,aAG1B;UAER,GAAG;AACV,SAAO;;AAGX,QAAO,oBAAoB,YAAY;;AAGzC,SAAS,yBACP,aACA,oBACA;AAEA,KAAI,CAAC,qDAAqD,KAAK,YAAY,CACzE,QAAO;AAET,KAAI;AAGF,SAAO,CAAC,CAFO,SAAS,SAAS,sBAAsB,EAAE,OAAO,EAAE,EAAE,CAErD;UAER,GAAG;AACV,SAAO;;;AAIX,SAAS,WAAW,GAAW;AAC7B,KAAI,YAAY,KAAK,EAAE,EAAE;AACvB,MAAI,IAAI,EAAE,QAAQ,MAAM,QAAQ,CAAC;AACjC,MAAI,EACD,QAAQ,aAAa,GAAG,CACxB,QAAQ,UAAU,MAAM;;AAE7B,QAAO;;AAGT,MAAM,qBAAqB,MAAc;AAEvC,KADmB,KAAK,KAAK,EACf,CACZ,QAAO,IAAI,QAAQ,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC;AAEvC,QAAO,IAAI,EAAE;;;;;;;;;;AAWf,eAAsB,cAAc,aAAqB;CACvD,MAAM,qBAAqB,WAAW,YAAY;AAElD,KAAI,OAAO,YAAY,YACrB,QAAO,cAAc,YAAY;AAEnC,KAAI,eACF,QAAO,qBAAqB,aAAa,mBAAmB;KAE5D,QAAO,kBAAkB,aAAa,mBAAmB;;;;;;;;;;AAY7D,SAAgB,kBAAkB,aAA8B;AAC9D,KAAI,eACF,QAAO,yBACL,aACA,kBAAkB,YAAY,CAC/B;KAED,QAAO,sBAAsB,aAAa,WAAW,YAAY,CAAC"}
|
package/dist/compress.cjs
CHANGED
|
@@ -10,7 +10,6 @@ let _stryke_convert_uint8_array_to_string = require("@stryke/convert/uint8-array
|
|
|
10
10
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
11
11
|
|
|
12
12
|
//#region src/compress.ts
|
|
13
|
-
var compress_exports = /* @__PURE__ */ require_runtime.__exportAll({ compressDirectory: () => compressDirectory });
|
|
14
13
|
/**
|
|
15
14
|
* Compress a directory or file into a tar.gz archive.
|
|
16
15
|
*
|
|
@@ -27,10 +26,4 @@ async function compressDirectory(directory, options) {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
//#endregion
|
|
30
|
-
exports.compressDirectory = compressDirectory;
|
|
31
|
-
Object.defineProperty(exports, 'compress_exports', {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return compress_exports;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
29
|
+
exports.compressDirectory = compressDirectory;
|
package/dist/compress.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { isDirectory } from "./is-file.mjs";
|
|
3
2
|
import { listFiles } from "./list-files.mjs";
|
|
4
3
|
import { readFileIfExisting } from "./read-file.mjs";
|
|
@@ -9,7 +8,6 @@ import { uint8ArrayToString } from "@stryke/convert/uint8-array-to-string";
|
|
|
9
8
|
import { joinPaths as joinPaths$1 } from "@stryke/path/join-paths";
|
|
10
9
|
|
|
11
10
|
//#region src/compress.ts
|
|
12
|
-
var compress_exports = /* @__PURE__ */ __exportAll({ compressDirectory: () => compressDirectory });
|
|
13
11
|
/**
|
|
14
12
|
* Compress a directory or file into a tar.gz archive.
|
|
15
13
|
*
|
|
@@ -26,5 +24,5 @@ async function compressDirectory(directory, options) {
|
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
//#endregion
|
|
29
|
-
export { compressDirectory
|
|
27
|
+
export { compressDirectory };
|
|
30
28
|
//# sourceMappingURL=compress.mjs.map
|
package/dist/compress.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.mjs","names":["joinPaths"],"sources":["../src/compress.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"compress.mjs","names":["joinPaths"],"sources":["../src/compress.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { uint8ArrayToString } from \"@stryke/convert/uint8-array-to-string\";\nimport { findFolderName, resolveParentPath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { GlobOptions } from \"glob\";\nimport { createTarGzip } from \"nanotar\";\nimport { isDirectory } from \"./is-file\";\nimport { listFiles } from \"./list-files\";\nimport { readFileIfExisting } from \"./read-file\";\nimport { writeFile } from \"./write-file\";\n\nexport interface CompressDirectoryOptions extends GlobOptions {\n destination?: string;\n}\n\n/**\n * Compress a directory or file into a tar.gz archive.\n *\n * @param directory - The source directory or file/glob to compress.\n * @param options - Options for the compression.\n */\nexport async function compressDirectory(\n directory: string,\n options?: CompressDirectoryOptions\n): Promise<void> {\n const files = await listFiles(\n isDirectory(directory) ? joinPaths(directory, \"**/*\") : directory,\n options\n );\n const data = await createTarGzip(\n await Promise.all(\n files.map(async file => ({\n name: file,\n data: await readFileIfExisting(file)\n }))\n ),\n {\n attrs: { group: \"storm-software\" }\n }\n );\n\n return writeFile(\n options?.destination\n ? isDirectory(options.destination)\n ? joinPaths(options.destination, `${new Date().getTime()}.tar.gz`)\n : options.destination\n : isDirectory(directory)\n ? `${joinPaths(resolveParentPath(directory), findFolderName(directory))}.tar.gz`\n : directory,\n uint8ArrayToString(data)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,eAAsB,kBACpB,WACA,SACe;CACf,MAAM,QAAQ,MAAM,UAClB,YAAY,UAAU,GAAGA,YAAU,WAAW,OAAO,GAAG,WACxD,QACD;CACD,MAAM,OAAO,MAAM,cACjB,MAAM,QAAQ,IACZ,MAAM,IAAI,OAAM,UAAS;EACvB,MAAM;EACN,MAAM,MAAM,mBAAmB,KAAK;EACrC,EAAE,CACJ,EACD,EACE,OAAO,EAAE,OAAO,kBAAkB,EACnC,CACF;AAED,QAAO,UACL,SAAS,cACL,YAAY,QAAQ,YAAY,GAC9BA,YAAU,QAAQ,aAAa,oBAAG,IAAI,MAAM,EAAC,SAAS,CAAC,SAAS,GAChE,QAAQ,cACV,YAAY,UAAU,GACpB,GAAGA,YAAU,kBAAkB,UAAU,EAAE,eAAe,UAAU,CAAC,CAAC,WACtE,WACN,mBAAmB,KAAK,CACzB"}
|
package/dist/constants.cjs
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/constants.ts
|
|
5
|
-
var constants_exports = /* @__PURE__ */ require_runtime.__exportAll({});
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
Object.defineProperty(exports, 'constants_exports', {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return constants_exports;
|
|
12
|
-
}
|
|
13
|
-
});
|
package/dist/constants.mjs
CHANGED
package/dist/copy-file.cjs
CHANGED
|
@@ -15,12 +15,6 @@ let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path
|
|
|
15
15
|
let mlly = require("mlly");
|
|
16
16
|
|
|
17
17
|
//#region src/copy-file.ts
|
|
18
|
-
var copy_file_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
19
|
-
copyFile: () => copyFile,
|
|
20
|
-
copyFileSync: () => copyFileSync,
|
|
21
|
-
copyFiles: () => copyFiles,
|
|
22
|
-
copyFilesSync: () => copyFilesSync
|
|
23
|
-
});
|
|
24
18
|
/**
|
|
25
19
|
* Copy a file from one location to another
|
|
26
20
|
*
|
|
@@ -90,10 +84,4 @@ function copyFilesSync(source, destination) {
|
|
|
90
84
|
exports.copyFile = copyFile;
|
|
91
85
|
exports.copyFileSync = copyFileSync;
|
|
92
86
|
exports.copyFiles = copyFiles;
|
|
93
|
-
exports.copyFilesSync = copyFilesSync;
|
|
94
|
-
Object.defineProperty(exports, 'copy_file_exports', {
|
|
95
|
-
enumerable: true,
|
|
96
|
-
get: function () {
|
|
97
|
-
return copy_file_exports;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
87
|
+
exports.copyFilesSync = copyFilesSync;
|
package/dist/copy-file.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { existsSync as existsSync$1 } from "./exists.mjs";
|
|
3
2
|
import { createDirectory, createDirectorySync } from "./helpers.mjs";
|
|
4
3
|
import { isDirectory, isFile } from "./is-file.mjs";
|
|
@@ -14,12 +13,6 @@ import { resolveParentPath } from "@stryke/path/resolve-parent-path";
|
|
|
14
13
|
import { fileURLToPath } from "mlly";
|
|
15
14
|
|
|
16
15
|
//#region src/copy-file.ts
|
|
17
|
-
var copy_file_exports = /* @__PURE__ */ __exportAll({
|
|
18
|
-
copyFile: () => copyFile,
|
|
19
|
-
copyFileSync: () => copyFileSync,
|
|
20
|
-
copyFiles: () => copyFiles,
|
|
21
|
-
copyFilesSync: () => copyFilesSync
|
|
22
|
-
});
|
|
23
16
|
/**
|
|
24
17
|
* Copy a file from one location to another
|
|
25
18
|
*
|
|
@@ -86,5 +79,5 @@ function copyFilesSync(source, destination) {
|
|
|
86
79
|
}
|
|
87
80
|
|
|
88
81
|
//#endregion
|
|
89
|
-
export { copyFile, copyFileSync, copyFiles, copyFilesSync
|
|
82
|
+
export { copyFile, copyFileSync, copyFiles, copyFilesSync };
|
|
90
83
|
//# sourceMappingURL=copy-file.mjs.map
|
package/dist/copy-file.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-file.mjs","names":["existsSync","cpf","cpfSync"],"sources":["../src/copy-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stripStars } from \"@stryke/path/correct-path\";\nimport { findFilePath, hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport { fileURLToPath } from \"mlly\";\nimport { copyFileSync as cpfSync } from \"node:fs\";\nimport { copyFile as cpf } from \"node:fs/promises\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\nimport { isDirectory, isFile } from \"./is-file\";\nimport { listFiles, listFilesSync } from \"./list-files\";\n\n/**\n * Copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFile(\n source: string | URL,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n await createDirectory(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n await createDirectory(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpf(src, dest);\n }\n}\n\n/**\n * Synchronously copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFileSync(source: string | URL, destination: string | URL) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n createDirectorySync(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n createDirectorySync(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpfSync(src, dest);\n }\n}\n\n/**\n * Copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFiles(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFile(src, dest);\n }\n\n return Promise.all(\n (await listFiles(src)).map(async entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n await copyFiles(entryPath, destFile);\n } else {\n await copyFile(entryPath, destFile);\n }\n })\n );\n}\n\n/**\n * Synchronously copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFilesSync(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFileSync(src, dest);\n }\n\n return listFilesSync(src).map(entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n copyFilesSync(entryPath, destFile);\n } else {\n copyFileSync(entryPath, destFile);\n }\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-file.mjs","names":["existsSync","cpf","cpfSync"],"sources":["../src/copy-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { stripStars } from \"@stryke/path/correct-path\";\nimport { findFilePath, hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport { fileURLToPath } from \"mlly\";\nimport { copyFileSync as cpfSync } from \"node:fs\";\nimport { copyFile as cpf } from \"node:fs/promises\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\nimport { isDirectory, isFile } from \"./is-file\";\nimport { listFiles, listFilesSync } from \"./list-files\";\n\n/**\n * Copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFile(\n source: string | URL,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n await createDirectory(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n await createDirectory(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpf(src, dest);\n }\n}\n\n/**\n * Synchronously copy a file from one location to another\n *\n * @param source - The file to copy, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFileSync(source: string | URL, destination: string | URL) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (!hasFileExtension(dest)) {\n if (!existsSync(resolveParentPath(dest))) {\n createDirectorySync(resolveParentPath(dest));\n }\n } else if (!existsSync(findFilePath(dest))) {\n createDirectorySync(findFilePath(dest));\n }\n\n if (isString(src) && existsSync(src)) {\n return cpfSync(src, dest);\n }\n}\n\n/**\n * Copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport async function copyFiles(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFile(src, dest);\n }\n\n return Promise.all(\n (await listFiles(src)).map(async entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n await copyFiles(entryPath, destFile);\n } else {\n await copyFile(entryPath, destFile);\n }\n })\n );\n}\n\n/**\n * Synchronously copy files from one location to another\n *\n * @param source - The source location, this can be a file, directory, URL, or glob pattern\n * @param destination - The destination location\n * @returns An indicator specifying if the copy was successful\n */\nexport function copyFilesSync(\n source: string | URL | Omit<AssetGlob, \"output\">,\n destination: string | URL\n) {\n const src = source instanceof URL ? fileURLToPath(source) : source;\n const dest =\n destination instanceof URL ? fileURLToPath(destination) : destination;\n\n if (isString(src) && isFile(src)) {\n return copyFileSync(src, dest);\n }\n\n return listFilesSync(src).map(entryPath => {\n const destFile = joinPaths(\n dest,\n replacePath(entryPath, isString(src) ? stripStars(src) : src.input)\n );\n\n if (isDirectory(entryPath)) {\n copyFilesSync(entryPath, destFile);\n } else {\n copyFileSync(entryPath, destFile);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwCA,eAAsB,SACpB,QACA,aACA;CACA,MAAM,MAAM,kBAAkB,MAAM,cAAc,OAAO,GAAG;CAC5D,MAAM,OACJ,uBAAuB,MAAM,cAAc,YAAY,GAAG;AAE5D,KAAI,CAAC,iBAAiB,KAAK,EACzB;MAAI,CAACA,aAAW,kBAAkB,KAAK,CAAC,CACtC,OAAM,gBAAgB,kBAAkB,KAAK,CAAC;YAEvC,CAACA,aAAW,aAAa,KAAK,CAAC,CACxC,OAAM,gBAAgB,aAAa,KAAK,CAAC;AAG3C,KAAI,SAAS,IAAI,IAAIA,aAAW,IAAI,CAClC,QAAOC,WAAI,KAAK,KAAK;;;;;;;;;AAWzB,SAAgB,aAAa,QAAsB,aAA2B;CAC5E,MAAM,MAAM,kBAAkB,MAAM,cAAc,OAAO,GAAG;CAC5D,MAAM,OACJ,uBAAuB,MAAM,cAAc,YAAY,GAAG;AAE5D,KAAI,CAAC,iBAAiB,KAAK,EACzB;MAAI,CAACD,aAAW,kBAAkB,KAAK,CAAC,CACtC,qBAAoB,kBAAkB,KAAK,CAAC;YAErC,CAACA,aAAW,aAAa,KAAK,CAAC,CACxC,qBAAoB,aAAa,KAAK,CAAC;AAGzC,KAAI,SAAS,IAAI,IAAIA,aAAW,IAAI,CAClC,QAAOE,eAAQ,KAAK,KAAK;;;;;;;;;AAW7B,eAAsB,UACpB,QACA,aACA;CACA,MAAM,MAAM,kBAAkB,MAAM,cAAc,OAAO,GAAG;CAC5D,MAAM,OACJ,uBAAuB,MAAM,cAAc,YAAY,GAAG;AAE5D,KAAI,SAAS,IAAI,IAAI,OAAO,IAAI,CAC9B,QAAO,SAAS,KAAK,KAAK;AAG5B,QAAO,QAAQ,KACZ,MAAM,UAAU,IAAI,EAAE,IAAI,OAAM,cAAa;EAC5C,MAAM,WAAW,UACf,MACA,YAAY,WAAW,SAAS,IAAI,GAAG,WAAW,IAAI,GAAG,IAAI,MAAM,CACpE;AAED,MAAI,YAAY,UAAU,CACxB,OAAM,UAAU,WAAW,SAAS;MAEpC,OAAM,SAAS,WAAW,SAAS;GAErC,CACH;;;;;;;;;AAUH,SAAgB,cACd,QACA,aACA;CACA,MAAM,MAAM,kBAAkB,MAAM,cAAc,OAAO,GAAG;CAC5D,MAAM,OACJ,uBAAuB,MAAM,cAAc,YAAY,GAAG;AAE5D,KAAI,SAAS,IAAI,IAAI,OAAO,IAAI,CAC9B,QAAO,aAAa,KAAK,KAAK;AAGhC,QAAO,cAAc,IAAI,CAAC,KAAI,cAAa;EACzC,MAAM,WAAW,UACf,MACA,YAAY,WAAW,SAAS,IAAI,GAAG,WAAW,IAAI,GAAG,IAAI,MAAM,CACpE;AAED,MAAI,YAAY,UAAU,CACxB,eAAc,WAAW,SAAS;MAElC,cAAa,WAAW,SAAS;GAEnC"}
|
package/dist/exists.cjs
CHANGED
|
@@ -4,10 +4,6 @@ let node_fs = require("node:fs");
|
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
5
5
|
|
|
6
6
|
//#region src/exists.ts
|
|
7
|
-
var exists_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
8
|
-
exists: () => exists,
|
|
9
|
-
existsSync: () => existsSync
|
|
10
|
-
});
|
|
11
7
|
/**
|
|
12
8
|
* Check if a file exists
|
|
13
9
|
*
|
|
@@ -29,10 +25,4 @@ async function exists(filePath) {
|
|
|
29
25
|
|
|
30
26
|
//#endregion
|
|
31
27
|
exports.exists = exists;
|
|
32
|
-
exports.existsSync = existsSync;
|
|
33
|
-
Object.defineProperty(exports, 'exists_exports', {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () {
|
|
36
|
-
return exists_exports;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
28
|
+
exports.existsSync = existsSync;
|
package/dist/exists.mjs
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { existsSync as existsSync$1 } from "node:fs";
|
|
3
2
|
import { access, constants as constants$1 } from "node:fs/promises";
|
|
4
3
|
|
|
5
4
|
//#region src/exists.ts
|
|
6
|
-
var exists_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
-
exists: () => exists,
|
|
8
|
-
existsSync: () => existsSync
|
|
9
|
-
});
|
|
10
5
|
/**
|
|
11
6
|
* Check if a file exists
|
|
12
7
|
*
|
|
@@ -27,5 +22,5 @@ async function exists(filePath) {
|
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
//#endregion
|
|
30
|
-
export { exists, existsSync
|
|
25
|
+
export { exists, existsSync };
|
|
31
26
|
//# sourceMappingURL=exists.mjs.map
|
package/dist/exists.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exists.mjs","names":["existsSyncFs","constants"],"sources":["../src/exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"exists.mjs","names":["existsSyncFs","constants"],"sources":["../src/exists.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { existsSync as existsSyncFs } from \"node:fs\";\nimport { access, constants } from \"node:fs/promises\";\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport function existsSync(filePath: string): boolean {\n return existsSyncFs(filePath);\n}\n\n/**\n * Check if a file exists\n *\n * @param filePath - The file path to check\n * @returns An indicator specifying if the file exists\n */\nexport async function exists(filePath: string): Promise<boolean> {\n return access(filePath, constants.F_OK)\n .then(() => true)\n .catch(() => false);\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,WAAW,UAA2B;AACpD,QAAOA,aAAa,SAAS;;;;;;;;AAS/B,eAAsB,OAAO,UAAoC;AAC/D,QAAO,OAAO,UAAUC,YAAU,KAAK,CACpC,WAAW,KAAK,CAChB,YAAY,MAAM"}
|
package/dist/get-parent-path.cjs
CHANGED
|
@@ -8,7 +8,6 @@ let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
|
8
8
|
let _stryke_path_cwd = require("@stryke/path/cwd");
|
|
9
9
|
|
|
10
10
|
//#region src/get-parent-path.ts
|
|
11
|
-
var get_parent_path_exports = /* @__PURE__ */ require_runtime.__exportAll({ getParentPath: () => getParentPath });
|
|
12
11
|
/**
|
|
13
12
|
* Get the first parent path that has a file or directory with the provided name.
|
|
14
13
|
*
|
|
@@ -34,10 +33,4 @@ const getParentPath = (name, cwd = (0, _stryke_path_cwd.cwd)(), options = {}) =>
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
//#endregion
|
|
37
|
-
exports.getParentPath = getParentPath;
|
|
38
|
-
Object.defineProperty(exports, 'get_parent_path_exports', {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return get_parent_path_exports;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
36
|
+
exports.getParentPath = getParentPath;
|
package/dist/get-parent-path.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { isDirectory } from "./is-file.mjs";
|
|
3
2
|
import { existsSync } from "node:fs";
|
|
4
3
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
@@ -7,7 +6,6 @@ import { toArray } from "@stryke/convert/to-array";
|
|
|
7
6
|
import { cwd } from "@stryke/path/cwd";
|
|
8
7
|
|
|
9
8
|
//#region src/get-parent-path.ts
|
|
10
|
-
var get_parent_path_exports = /* @__PURE__ */ __exportAll({ getParentPath: () => getParentPath });
|
|
11
9
|
/**
|
|
12
10
|
* Get the first parent path that has a file or directory with the provided name.
|
|
13
11
|
*
|
|
@@ -33,5 +31,5 @@ const getParentPath = (name, cwd$1 = cwd(), options = {}) => {
|
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
//#endregion
|
|
36
|
-
export { getParentPath
|
|
34
|
+
export { getParentPath };
|
|
37
35
|
//# sourceMappingURL=get-parent-path.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-parent-path.mjs","names":["currentDir","cwd"],"sources":["../src/get-parent-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { cwd as currentDir } from \"@stryke/path/cwd\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { existsSync } from \"node:fs\";\nimport { isDirectory } from \"./is-file\";\n\nexport interface GetParentPathOptions {\n /**\n * Whether to ignore the case of the file names when checking for existence.\n *\n * @defaultValue true\n */\n ignoreCase: boolean;\n\n /**\n * Whether to skip the current working directory when checking for the file.\n *\n * @defaultValue false\n */\n skipCwd: boolean;\n\n /**\n * Should we include the found file/directory name in the results.\n *\n * @defaultValue false\n */\n includeNameInResults?: boolean;\n}\n\n/**\n * Get the first parent path that has a file or directory with the provided name.\n *\n * @param name - The name (or names) of the file to look for in the parent paths.\n * @param cwd - The current working directory.\n * @returns The first parent path that exists.\n */\nexport const getParentPath = (\n name: string | string[],\n cwd = currentDir(),\n options: Partial<GetParentPathOptions> = {}\n): string | undefined => {\n const ignoreCase = options?.ignoreCase ?? true;\n const skipCwd = options?.skipCwd ?? false;\n const includeNameInResults = options?.includeNameInResults ?? false;\n\n let dir = cwd;\n if (skipCwd) {\n dir = resolveParentPath(cwd);\n }\n\n let names = toArray(name);\n if (ignoreCase) {\n names = names.map(name => name.toLowerCase());\n }\n\n while (true) {\n const target = names.find(name => existsSync(joinPaths(dir, name)));\n if (target) {\n return includeNameInResults || isDirectory(joinPaths(dir, target))\n ? joinPaths(dir, target)\n : dir;\n }\n\n const parentDir = resolveParentPath(dir);\n if (parentDir === dir) {\n // It'll fail anyway\n return undefined;\n }\n\n dir = parentDir;\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-parent-path.mjs","names":["currentDir","cwd"],"sources":["../src/get-parent-path.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { cwd as currentDir } from \"@stryke/path/cwd\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { existsSync } from \"node:fs\";\nimport { isDirectory } from \"./is-file\";\n\nexport interface GetParentPathOptions {\n /**\n * Whether to ignore the case of the file names when checking for existence.\n *\n * @defaultValue true\n */\n ignoreCase: boolean;\n\n /**\n * Whether to skip the current working directory when checking for the file.\n *\n * @defaultValue false\n */\n skipCwd: boolean;\n\n /**\n * Should we include the found file/directory name in the results.\n *\n * @defaultValue false\n */\n includeNameInResults?: boolean;\n}\n\n/**\n * Get the first parent path that has a file or directory with the provided name.\n *\n * @param name - The name (or names) of the file to look for in the parent paths.\n * @param cwd - The current working directory.\n * @returns The first parent path that exists.\n */\nexport const getParentPath = (\n name: string | string[],\n cwd = currentDir(),\n options: Partial<GetParentPathOptions> = {}\n): string | undefined => {\n const ignoreCase = options?.ignoreCase ?? true;\n const skipCwd = options?.skipCwd ?? false;\n const includeNameInResults = options?.includeNameInResults ?? false;\n\n let dir = cwd;\n if (skipCwd) {\n dir = resolveParentPath(cwd);\n }\n\n let names = toArray(name);\n if (ignoreCase) {\n names = names.map(name => name.toLowerCase());\n }\n\n while (true) {\n const target = names.find(name => existsSync(joinPaths(dir, name)));\n if (target) {\n return includeNameInResults || isDirectory(joinPaths(dir, target))\n ? joinPaths(dir, target)\n : dir;\n }\n\n const parentDir = resolveParentPath(dir);\n if (parentDir === dir) {\n // It'll fail anyway\n return undefined;\n }\n\n dir = parentDir;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAa,iBACX,MACA,QAAMA,KAAY,EAClB,UAAyC,EAAE,KACpB;CACvB,MAAM,aAAa,SAAS,cAAc;CAC1C,MAAM,UAAU,SAAS,WAAW;CACpC,MAAM,uBAAuB,SAAS,wBAAwB;CAE9D,IAAI,MAAMC;AACV,KAAI,QACF,OAAM,kBAAkBA,MAAI;CAG9B,IAAI,QAAQ,QAAQ,KAAK;AACzB,KAAI,WACF,SAAQ,MAAM,KAAI,SAAQ,KAAK,aAAa,CAAC;AAG/C,QAAO,MAAM;EACX,MAAM,SAAS,MAAM,MAAK,SAAQ,WAAW,UAAU,KAAK,KAAK,CAAC,CAAC;AACnE,MAAI,OACF,QAAO,wBAAwB,YAAY,UAAU,KAAK,OAAO,CAAC,GAC9D,UAAU,KAAK,OAAO,GACtB;EAGN,MAAM,YAAY,kBAAkB,IAAI;AACxC,MAAI,cAAc,IAEhB;AAGF,QAAM"}
|
|
@@ -7,16 +7,6 @@ let _storm_software_config_tools = require("@storm-software/config-tools");
|
|
|
7
7
|
let _stryke_path_is_root_dir = require("@stryke/path/is-root-dir");
|
|
8
8
|
|
|
9
9
|
//#region src/get-workspace-root.ts
|
|
10
|
-
var get_workspace_root_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
11
|
-
PROJECT_ROOT_CONTENT: () => PROJECT_ROOT_CONTENT,
|
|
12
|
-
WORKSPACE_ROOT_CONTENT: () => WORKSPACE_ROOT_CONTENT,
|
|
13
|
-
getProjectRoot: () => getProjectRoot,
|
|
14
|
-
getWorkspaceRoot: () => getWorkspaceRoot,
|
|
15
|
-
isProjectRoot: () => isProjectRoot,
|
|
16
|
-
isWorkspaceRoot: () => isWorkspaceRoot,
|
|
17
|
-
relativeToProjectRoot: () => relativeToProjectRoot,
|
|
18
|
-
relativeToWorkspaceRoot: () => relativeToWorkspaceRoot
|
|
19
|
-
});
|
|
20
10
|
const WORKSPACE_ROOT_CONTENT = [
|
|
21
11
|
".all-contributorsrc",
|
|
22
12
|
".commitlintrc",
|
|
@@ -163,12 +153,6 @@ exports.PROJECT_ROOT_CONTENT = PROJECT_ROOT_CONTENT;
|
|
|
163
153
|
exports.WORKSPACE_ROOT_CONTENT = WORKSPACE_ROOT_CONTENT;
|
|
164
154
|
exports.getProjectRoot = getProjectRoot;
|
|
165
155
|
exports.getWorkspaceRoot = getWorkspaceRoot;
|
|
166
|
-
Object.defineProperty(exports, 'get_workspace_root_exports', {
|
|
167
|
-
enumerable: true,
|
|
168
|
-
get: function () {
|
|
169
|
-
return get_workspace_root_exports;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
156
|
exports.isProjectRoot = isProjectRoot;
|
|
173
157
|
exports.isWorkspaceRoot = isWorkspaceRoot;
|
|
174
158
|
exports.relativeToProjectRoot = relativeToProjectRoot;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
1
|
import { getParentPath } from "./get-parent-path.mjs";
|
|
3
2
|
import { relativePath } from "@stryke/path/file-path-fns";
|
|
4
3
|
import { cwd } from "@stryke/path/cwd";
|
|
@@ -6,16 +5,6 @@ import { findWorkspaceRootSafe } from "@storm-software/config-tools";
|
|
|
6
5
|
import { isSystemRoot } from "@stryke/path/is-root-dir";
|
|
7
6
|
|
|
8
7
|
//#region src/get-workspace-root.ts
|
|
9
|
-
var get_workspace_root_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
PROJECT_ROOT_CONTENT: () => PROJECT_ROOT_CONTENT,
|
|
11
|
-
WORKSPACE_ROOT_CONTENT: () => WORKSPACE_ROOT_CONTENT,
|
|
12
|
-
getProjectRoot: () => getProjectRoot,
|
|
13
|
-
getWorkspaceRoot: () => getWorkspaceRoot,
|
|
14
|
-
isProjectRoot: () => isProjectRoot,
|
|
15
|
-
isWorkspaceRoot: () => isWorkspaceRoot,
|
|
16
|
-
relativeToProjectRoot: () => relativeToProjectRoot,
|
|
17
|
-
relativeToWorkspaceRoot: () => relativeToWorkspaceRoot
|
|
18
|
-
});
|
|
19
8
|
const WORKSPACE_ROOT_CONTENT = [
|
|
20
9
|
".all-contributorsrc",
|
|
21
10
|
".commitlintrc",
|
|
@@ -158,5 +147,5 @@ function relativeToProjectRoot(filePath) {
|
|
|
158
147
|
}
|
|
159
148
|
|
|
160
149
|
//#endregion
|
|
161
|
-
export { PROJECT_ROOT_CONTENT, WORKSPACE_ROOT_CONTENT, getProjectRoot, getWorkspaceRoot,
|
|
150
|
+
export { PROJECT_ROOT_CONTENT, WORKSPACE_ROOT_CONTENT, getProjectRoot, getWorkspaceRoot, isProjectRoot, isWorkspaceRoot, relativeToProjectRoot, relativeToWorkspaceRoot };
|
|
162
151
|
//# sourceMappingURL=get-workspace-root.mjs.map
|