@stryke/fs 0.33.79 → 0.33.80
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/dist/_virtual/_rolldown/runtime.cjs +14 -0
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/buffer.cjs +12 -0
- package/dist/buffer.mjs +8 -1
- package/dist/buffer.mjs.map +1 -1
- package/dist/buffer.test.cjs +13 -0
- package/dist/buffer.test.d.cts +1 -0
- package/dist/buffer.test.d.mts +1 -0
- package/dist/buffer.test.mjs +14 -0
- package/dist/buffer.test.mjs.map +1 -0
- package/dist/chmod-x.cjs +14 -0
- package/dist/chmod-x.mjs +10 -1
- package/dist/chmod-x.mjs.map +1 -1
- package/dist/chmod-x.test.cjs +13 -0
- package/dist/chmod-x.test.d.cts +1 -0
- package/dist/chmod-x.test.d.mts +1 -0
- package/dist/chmod-x.test.mjs +14 -0
- package/dist/chmod-x.test.mjs.map +1 -0
- package/dist/command-exists.cjs +11 -1
- package/dist/command-exists.mjs +6 -1
- package/dist/command-exists.mjs.map +1 -1
- package/dist/command-exists.test.cjs +13 -0
- package/dist/command-exists.test.d.cts +1 -0
- package/dist/command-exists.test.d.mts +1 -0
- package/dist/command-exists.test.mjs +14 -0
- package/dist/command-exists.test.mjs.map +1 -0
- package/dist/compress.cjs +8 -1
- package/dist/compress.mjs +3 -1
- package/dist/compress.mjs.map +1 -1
- package/dist/compress.test.cjs +13 -0
- package/dist/compress.test.d.cts +1 -0
- package/dist/compress.test.d.mts +1 -0
- package/dist/compress.test.mjs +14 -0
- package/dist/compress.test.mjs.map +1 -0
- package/dist/constants.cjs +13 -0
- package/dist/constants.mjs +8 -1
- package/dist/constants.mjs.map +1 -0
- package/dist/constants.test.cjs +13 -0
- package/dist/constants.test.d.cts +1 -0
- package/dist/constants.test.d.mts +1 -0
- package/dist/constants.test.mjs +14 -0
- package/dist/constants.test.mjs.map +1 -0
- package/dist/copy-file.cjs +13 -1
- package/dist/copy-file.mjs +8 -1
- package/dist/copy-file.mjs.map +1 -1
- package/dist/copy-file.test.cjs +13 -0
- package/dist/copy-file.test.d.cts +1 -0
- package/dist/copy-file.test.d.mts +1 -0
- package/dist/copy-file.test.mjs +14 -0
- package/dist/copy-file.test.mjs.map +1 -0
- package/dist/exists.cjs +11 -1
- package/dist/exists.mjs +6 -1
- package/dist/exists.mjs.map +1 -1
- package/dist/exists.test.cjs +13 -0
- package/dist/exists.test.d.cts +1 -0
- package/dist/exists.test.d.mts +1 -0
- package/dist/exists.test.mjs +14 -0
- package/dist/exists.test.mjs.map +1 -0
- package/dist/get-parent-path.cjs +8 -1
- package/dist/get-parent-path.mjs +3 -1
- package/dist/get-parent-path.mjs.map +1 -1
- package/dist/get-parent-path.test.cjs +13 -0
- package/dist/get-parent-path.test.d.cts +1 -0
- package/dist/get-parent-path.test.d.mts +1 -0
- package/dist/get-parent-path.test.mjs +14 -0
- package/dist/get-parent-path.test.mjs.map +1 -0
- package/dist/get-workspace-root.cjs +16 -0
- package/dist/get-workspace-root.mjs +12 -1
- package/dist/get-workspace-root.mjs.map +1 -1
- package/dist/get-workspace-root.test.cjs +13 -0
- package/dist/get-workspace-root.test.d.cts +1 -0
- package/dist/get-workspace-root.test.d.mts +1 -0
- package/dist/get-workspace-root.test.mjs +14 -0
- package/dist/get-workspace-root.test.mjs.map +1 -0
- package/dist/helpers.cjs +14 -0
- package/dist/helpers.mjs +10 -1
- package/dist/helpers.mjs.map +1 -1
- package/dist/helpers.test.cjs +13 -0
- package/dist/helpers.test.d.cts +1 -0
- package/dist/helpers.test.d.mts +1 -0
- package/dist/helpers.test.mjs +14 -0
- package/dist/helpers.test.mjs.map +1 -0
- package/dist/index.cjs +111 -0
- package/dist/index.mjs +107 -1
- package/dist/index.mjs.map +1 -0
- package/dist/index.test.cjs +13 -0
- package/dist/index.test.d.cts +1 -0
- package/dist/index.test.d.mts +1 -0
- package/dist/index.test.mjs +14 -0
- package/dist/index.test.mjs.map +1 -0
- package/dist/install.cjs +10 -0
- package/dist/install.mjs +6 -1
- package/dist/install.mjs.map +1 -1
- package/dist/install.test.cjs +13 -0
- package/dist/install.test.d.cts +1 -0
- package/dist/install.test.d.mts +1 -0
- package/dist/install.test.mjs +14 -0
- package/dist/install.test.mjs.map +1 -0
- package/dist/is-file.cjs +13 -1
- package/dist/is-file.mjs +8 -1
- package/dist/is-file.mjs.map +1 -1
- package/dist/is-file.test.cjs +13 -0
- package/dist/is-file.test.d.cts +1 -0
- package/dist/is-file.test.d.mts +1 -0
- package/dist/is-file.test.mjs +14 -0
- package/dist/is-file.test.mjs.map +1 -0
- package/dist/json.cjs +12 -0
- package/dist/json.mjs +8 -1
- package/dist/json.mjs.map +1 -1
- package/dist/json.test.cjs +13 -0
- package/dist/json.test.d.cts +1 -0
- package/dist/json.test.d.mts +1 -0
- package/dist/json.test.mjs +14 -0
- package/dist/json.test.mjs.map +1 -0
- package/dist/list-files.cjs +15 -1
- package/dist/list-files.mjs +10 -1
- package/dist/list-files.mjs.map +1 -1
- package/dist/list-files.test.cjs +13 -0
- package/dist/list-files.test.d.cts +1 -0
- package/dist/list-files.test.d.mts +1 -0
- package/dist/list-files.test.mjs +14 -0
- package/dist/list-files.test.mjs.map +1 -0
- package/dist/package-fns.cjs +16 -1
- package/dist/package-fns.mjs +11 -1
- package/dist/package-fns.mjs.map +1 -1
- package/dist/package-fns.test.cjs +13 -0
- package/dist/package-fns.test.d.cts +1 -0
- package/dist/package-fns.test.d.mts +1 -0
- package/dist/package-fns.test.mjs +14 -0
- package/dist/package-fns.test.mjs.map +1 -0
- package/dist/read-file.cjs +13 -1
- package/dist/read-file.mjs +8 -1
- package/dist/read-file.mjs.map +1 -1
- package/dist/read-file.test.cjs +13 -0
- package/dist/read-file.test.d.cts +1 -0
- package/dist/read-file.test.d.mts +1 -0
- package/dist/read-file.test.mjs +14 -0
- package/dist/read-file.test.mjs.map +1 -0
- package/dist/registry.cjs +13 -0
- package/dist/registry.mjs +9 -1
- package/dist/registry.mjs.map +1 -1
- package/dist/registry.test.cjs +13 -0
- package/dist/registry.test.d.cts +1 -0
- package/dist/registry.test.d.mts +1 -0
- package/dist/registry.test.mjs +14 -0
- package/dist/registry.test.mjs.map +1 -0
- package/dist/remove-file.cjs +11 -1
- package/dist/remove-file.mjs +6 -1
- package/dist/remove-file.mjs.map +1 -1
- package/dist/remove-file.test.cjs +13 -0
- package/dist/remove-file.test.d.cts +1 -0
- package/dist/remove-file.test.d.mts +1 -0
- package/dist/remove-file.test.mjs +14 -0
- package/dist/remove-file.test.mjs.map +1 -0
- package/dist/resolve.cjs +20 -1
- package/dist/resolve.mjs +15 -1
- package/dist/resolve.mjs.map +1 -1
- package/dist/resolve.test.cjs +13 -0
- package/dist/resolve.test.d.cts +1 -0
- package/dist/resolve.test.d.mts +1 -0
- package/dist/resolve.test.mjs +14 -0
- package/dist/resolve.test.mjs.map +1 -0
- package/dist/semver-fns.cjs +20 -1
- package/dist/semver-fns.mjs +15 -1
- package/dist/semver-fns.mjs.map +1 -1
- package/dist/semver-fns.test.cjs +13 -0
- package/dist/semver-fns.test.d.cts +1 -0
- package/dist/semver-fns.test.d.mts +1 -0
- package/dist/semver-fns.test.mjs +14 -0
- package/dist/semver-fns.test.mjs.map +1 -0
- package/dist/toml.cjs +12 -0
- package/dist/toml.mjs +8 -1
- package/dist/toml.mjs.map +1 -1
- package/dist/toml.test.cjs +13 -0
- package/dist/toml.test.d.cts +1 -0
- package/dist/toml.test.d.mts +1 -0
- package/dist/toml.test.mjs +14 -0
- package/dist/toml.test.mjs.map +1 -0
- package/dist/tsconfig.cjs +8 -1
- package/dist/tsconfig.mjs +3 -1
- package/dist/tsconfig.mjs.map +1 -1
- package/dist/tsconfig.test.cjs +13 -0
- package/dist/tsconfig.test.d.cts +1 -0
- package/dist/tsconfig.test.d.mts +1 -0
- package/dist/tsconfig.test.mjs +14 -0
- package/dist/tsconfig.test.mjs.map +1 -0
- package/dist/write-file.cjs +11 -1
- package/dist/write-file.mjs +6 -1
- package/dist/write-file.mjs.map +1 -1
- package/dist/write-file.test.cjs +13 -0
- package/dist/write-file.test.d.cts +1 -0
- package/dist/write-file.test.d.mts +1 -0
- package/dist/write-file.test.mjs +14 -0
- package/dist/write-file.test.mjs.map +1 -0
- package/dist/yaml.cjs +11 -1
- package/dist/yaml.mjs +6 -1
- package/dist/yaml.mjs.map +1 -1
- package/dist/yaml.test.cjs +13 -0
- package/dist/yaml.test.d.cts +1 -0
- package/dist/yaml.test.d.mts +1 -0
- package/dist/yaml.test.mjs +14 -0
- package/dist/yaml.test.mjs.map +1 -0
- package/package.json +110 -10
package/dist/write-file.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-file.mjs","names":["existsSync","writeFileFs"],"sources":["../src/write-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 { correctPath } from \"@stryke/path/correct-path\";\nimport { findFilePath } from \"@stryke/path/file-path-fns\";\nimport type { Abortable } from \"node:events\";\nimport type {\n WriteFileOptions as FSWriteFileOptions,\n Mode,\n ObjectEncodingOptions,\n OpenMode\n} from \"node:fs\";\nimport { writeFileSync as writeFileSyncFs } from \"node:fs\";\nimport { writeFile as writeFileFs } from \"node:fs/promises\";\nimport type { Encoding } from \"./constants\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\nexport interface WriteFileOptions {\n /**\n * Whether to create the directory if it does not exist\n *\n * @defaultValue true\n */\n createDirectory?: boolean;\n}\n\n/**\n * Write the given content to the given file path\n *\n * @param filePath - The file path to write to\n * @param content - The content to write to the file\n */\nexport const writeFileSync = (\n filePath: string,\n content = \"\",\n options: WriteFileOptions & FSWriteFileOptions = {}\n): void => {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n\n const directory = findFilePath(correctPath(filePath));\n if (!existsSync(directory)) {\n if (options.createDirectory !== false) {\n createDirectorySync(directory);\n } else {\n throw new Error(`Directory ${directory} does not exist`);\n }\n }\n\n writeFileSyncFs(filePath, content || \"\", options);\n};\n\n/**\n * Read the given content to the given file path\n *\n * @param filePath - The file path to read to\n * @param content - The content to write to the file\n * @returns The content of the file\n */\nexport const writeFile = async (\n filePath: string,\n content = \"\",\n options: WriteFileOptions &\n (\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n flush?: boolean | undefined;\n } & Abortable)\n | Encoding\n ) = {}\n): Promise<void> => {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n\n const directory = findFilePath(correctPath(filePath));\n if (!existsSync(directory)) {\n if (options.createDirectory !== false) {\n await createDirectory(directory);\n } else {\n throw new Error(`Directory ${directory} does not exist`);\n }\n }\n\n return writeFileFs(filePath, content || \"\", options);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-file.mjs","names":["existsSync","writeFileFs"],"sources":["../src/write-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 { correctPath } from \"@stryke/path/correct-path\";\nimport { findFilePath } from \"@stryke/path/file-path-fns\";\nimport type { Abortable } from \"node:events\";\nimport type {\n WriteFileOptions as FSWriteFileOptions,\n Mode,\n ObjectEncodingOptions,\n OpenMode\n} from \"node:fs\";\nimport { writeFileSync as writeFileSyncFs } from \"node:fs\";\nimport { writeFile as writeFileFs } from \"node:fs/promises\";\nimport type { Encoding } from \"./constants\";\nimport { existsSync } from \"./exists\";\nimport { createDirectory, createDirectorySync } from \"./helpers\";\n\nexport interface WriteFileOptions {\n /**\n * Whether to create the directory if it does not exist\n *\n * @defaultValue true\n */\n createDirectory?: boolean;\n}\n\n/**\n * Write the given content to the given file path\n *\n * @param filePath - The file path to write to\n * @param content - The content to write to the file\n */\nexport const writeFileSync = (\n filePath: string,\n content = \"\",\n options: WriteFileOptions & FSWriteFileOptions = {}\n): void => {\n if (!filePath) {\n throw new Error(\"No file path provided to write data\");\n }\n\n const directory = findFilePath(correctPath(filePath));\n if (!existsSync(directory)) {\n if (options.createDirectory !== false) {\n createDirectorySync(directory);\n } else {\n throw new Error(`Directory ${directory} does not exist`);\n }\n }\n\n writeFileSyncFs(filePath, content || \"\", options);\n};\n\n/**\n * Read the given content to the given file path\n *\n * @param filePath - The file path to read to\n * @param content - The content to write to the file\n * @returns The content of the file\n */\nexport const writeFile = async (\n filePath: string,\n content = \"\",\n options: WriteFileOptions &\n (\n | (ObjectEncodingOptions & {\n mode?: Mode | undefined;\n flag?: OpenMode | undefined;\n flush?: boolean | undefined;\n } & Abortable)\n | Encoding\n ) = {}\n): Promise<void> => {\n if (!filePath) {\n throw new Error(\"No file path provided to read data\");\n }\n\n const directory = findFilePath(correctPath(filePath));\n if (!existsSync(directory)) {\n if (options.createDirectory !== false) {\n await createDirectory(directory);\n } else {\n throw new Error(`Directory ${directory} does not exist`);\n }\n }\n\n return writeFileFs(filePath, content || \"\", options);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgDA,MAAa,iBACX,UACA,UAAU,IACV,UAAiD,EAAE,KAC1C;AACT,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,sCAAsC;CAGxD,MAAM,YAAY,aAAa,YAAY,SAAS,CAAC;AACrD,KAAI,CAACA,aAAW,UAAU,CACxB,KAAI,QAAQ,oBAAoB,MAC9B,qBAAoB,UAAU;KAE9B,OAAM,IAAI,MAAM,aAAa,UAAU,iBAAiB;AAI5D,iBAAgB,UAAU,WAAW,IAAI,QAAQ;;;;;;;;;AAUnD,MAAa,YAAY,OACvB,UACA,UAAU,IACV,UAQM,EAAE,KACU;AAClB,KAAI,CAAC,SACH,OAAM,IAAI,MAAM,qCAAqC;CAGvD,MAAM,YAAY,aAAa,YAAY,SAAS,CAAC;AACrD,KAAI,CAACA,aAAW,UAAU,CACxB,KAAI,QAAQ,oBAAoB,MAC9B,OAAM,gBAAgB,UAAU;KAEhC,OAAM,IAAI,MAAM,aAAa,UAAU,iBAAiB;AAI5D,QAAOC,YAAY,UAAU,WAAW,IAAI,QAAQ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_write_file = require('./write-file.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/write-file.test.ts
|
|
6
|
+
(0, vitest.describe)("write-file.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_write_file.write_file_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_write_file.write_file_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { write_file_exports } from "./write-file.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/write-file.test.ts
|
|
5
|
+
describe("write-file.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(write_file_exports).toBeDefined();
|
|
8
|
+
expect(typeof write_file_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=write-file.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-file.test.mjs","names":["moduleExports"],"sources":["../src/write-file.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./write-file.ts\";\n\ndescribe(\"write-file.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,+BAA+B;AACtC,IAAG,8BAA8B;AAC/B,SAAOA,mBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,mBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/dist/yaml.cjs
CHANGED
|
@@ -4,6 +4,10 @@ const require_read_file = require('./read-file.cjs');
|
|
|
4
4
|
let yaml = require("yaml");
|
|
5
5
|
|
|
6
6
|
//#region src/yaml.ts
|
|
7
|
+
var yaml_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
8
|
+
readYamlFile: () => readYamlFile,
|
|
9
|
+
readYamlFileSync: () => readYamlFileSync
|
|
10
|
+
});
|
|
7
11
|
/**
|
|
8
12
|
* Reads a YAML file and returns the object the YAML content represents.
|
|
9
13
|
*
|
|
@@ -27,4 +31,10 @@ async function readYamlFile(path, options = {}) {
|
|
|
27
31
|
|
|
28
32
|
//#endregion
|
|
29
33
|
exports.readYamlFile = readYamlFile;
|
|
30
|
-
exports.readYamlFileSync = readYamlFileSync;
|
|
34
|
+
exports.readYamlFileSync = readYamlFileSync;
|
|
35
|
+
Object.defineProperty(exports, 'yaml_exports', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return yaml_exports;
|
|
39
|
+
}
|
|
40
|
+
});
|
package/dist/yaml.mjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { readFile, readFileSync } from "./read-file.mjs";
|
|
2
3
|
import { parse } from "yaml";
|
|
3
4
|
|
|
4
5
|
//#region src/yaml.ts
|
|
6
|
+
var yaml_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
readYamlFile: () => readYamlFile,
|
|
8
|
+
readYamlFileSync: () => readYamlFileSync
|
|
9
|
+
});
|
|
5
10
|
/**
|
|
6
11
|
* Reads a YAML file and returns the object the YAML content represents.
|
|
7
12
|
*
|
|
@@ -24,5 +29,5 @@ async function readYamlFile(path, options = {}) {
|
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
//#endregion
|
|
27
|
-
export { readYamlFile, readYamlFileSync };
|
|
32
|
+
export { readYamlFile, readYamlFileSync, yaml_exports };
|
|
28
33
|
//# sourceMappingURL=yaml.mjs.map
|
package/dist/yaml.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.mjs","names":[],"sources":["../src/yaml.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 type {\n DocumentOptions,\n ParseOptions,\n SchemaOptions,\n ToJSOptions\n} from \"yaml\";\nimport { parse } from \"yaml\";\nimport { readFile, readFileSync } from \"./read-file\";\n\nexport type YamlReadOptions = ParseOptions &\n DocumentOptions &\n SchemaOptions &\n ToJSOptions;\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport function readYamlFileSync<T extends object = any>(\n path: string,\n options?: YamlReadOptions\n): T {\n return parse(readFileSync(path), options) as T;\n}\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport async function readYamlFile<T extends object = any>(\n path: string,\n options: YamlReadOptions = {}\n): Promise<T> {\n return parse(await readFile(path), options) as T;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"yaml.mjs","names":[],"sources":["../src/yaml.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 type {\n DocumentOptions,\n ParseOptions,\n SchemaOptions,\n ToJSOptions\n} from \"yaml\";\nimport { parse } from \"yaml\";\nimport { readFile, readFileSync } from \"./read-file\";\n\nexport type YamlReadOptions = ParseOptions &\n DocumentOptions &\n SchemaOptions &\n ToJSOptions;\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport function readYamlFileSync<T extends object = any>(\n path: string,\n options?: YamlReadOptions\n): T {\n return parse(readFileSync(path), options) as T;\n}\n\n/**\n * Reads a YAML file and returns the object the YAML content represents.\n *\n * @param path - A path to a file.\n * @param options - YAML parse options\n * @returns Object the YAML content of the file represents\n */\nexport async function readYamlFile<T extends object = any>(\n path: string,\n options: YamlReadOptions = {}\n): Promise<T> {\n return parse(await readFile(path), options) as T;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,SAAgB,iBACd,MACA,SACG;AACH,QAAO,MAAM,aAAa,KAAK,EAAE,QAAQ;;;;;;;;;AAU3C,eAAsB,aACpB,MACA,UAA2B,EAAE,EACjB;AACZ,QAAO,MAAM,MAAM,SAAS,KAAK,EAAE,QAAQ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_yaml = require('./yaml.cjs');
|
|
3
|
+
let vitest = require("vitest");
|
|
4
|
+
|
|
5
|
+
//#region src/yaml.test.ts
|
|
6
|
+
(0, vitest.describe)("yaml.ts exports", () => {
|
|
7
|
+
(0, vitest.it)("loads module exports", () => {
|
|
8
|
+
(0, vitest.expect)(require_yaml.yaml_exports).toBeDefined();
|
|
9
|
+
(0, vitest.expect)(typeof require_yaml.yaml_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { yaml_exports } from "./yaml.mjs";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
//#region src/yaml.test.ts
|
|
5
|
+
describe("yaml.ts exports", () => {
|
|
6
|
+
it("loads module exports", () => {
|
|
7
|
+
expect(yaml_exports).toBeDefined();
|
|
8
|
+
expect(typeof yaml_exports).toBe("object");
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { };
|
|
14
|
+
//# sourceMappingURL=yaml.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml.test.mjs","names":["moduleExports"],"sources":["../src/yaml.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./yaml.ts\";\n\ndescribe(\"yaml.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,yBAAyB;AAChC,IAAG,8BAA8B;AAC/B,SAAOA,aAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,aAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stryke/fs",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.80",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
|
|
6
6
|
"repository": {
|
|
@@ -15,89 +15,189 @@
|
|
|
15
15
|
"import": "./dist/buffer.mjs",
|
|
16
16
|
"require": "./dist/buffer.cjs"
|
|
17
17
|
},
|
|
18
|
+
"./buffer.test": {
|
|
19
|
+
"import": "./dist/buffer.test.mjs",
|
|
20
|
+
"require": "./dist/buffer.test.cjs"
|
|
21
|
+
},
|
|
18
22
|
"./chmod-x": {
|
|
19
23
|
"import": "./dist/chmod-x.mjs",
|
|
20
24
|
"require": "./dist/chmod-x.cjs"
|
|
21
25
|
},
|
|
26
|
+
"./chmod-x.test": {
|
|
27
|
+
"import": "./dist/chmod-x.test.mjs",
|
|
28
|
+
"require": "./dist/chmod-x.test.cjs"
|
|
29
|
+
},
|
|
22
30
|
"./command-exists": {
|
|
23
31
|
"import": "./dist/command-exists.mjs",
|
|
24
32
|
"require": "./dist/command-exists.cjs"
|
|
25
33
|
},
|
|
34
|
+
"./command-exists.test": {
|
|
35
|
+
"import": "./dist/command-exists.test.mjs",
|
|
36
|
+
"require": "./dist/command-exists.test.cjs"
|
|
37
|
+
},
|
|
26
38
|
"./compress": {
|
|
27
39
|
"import": "./dist/compress.mjs",
|
|
28
40
|
"require": "./dist/compress.cjs"
|
|
29
41
|
},
|
|
42
|
+
"./compress.test": {
|
|
43
|
+
"import": "./dist/compress.test.mjs",
|
|
44
|
+
"require": "./dist/compress.test.cjs"
|
|
45
|
+
},
|
|
30
46
|
"./constants": {
|
|
31
47
|
"import": "./dist/constants.mjs",
|
|
32
48
|
"require": "./dist/constants.cjs"
|
|
33
49
|
},
|
|
50
|
+
"./constants.test": {
|
|
51
|
+
"import": "./dist/constants.test.mjs",
|
|
52
|
+
"require": "./dist/constants.test.cjs"
|
|
53
|
+
},
|
|
34
54
|
"./copy-file": {
|
|
35
55
|
"import": "./dist/copy-file.mjs",
|
|
36
56
|
"require": "./dist/copy-file.cjs"
|
|
37
57
|
},
|
|
58
|
+
"./copy-file.test": {
|
|
59
|
+
"import": "./dist/copy-file.test.mjs",
|
|
60
|
+
"require": "./dist/copy-file.test.cjs"
|
|
61
|
+
},
|
|
38
62
|
"./exists": {
|
|
39
63
|
"import": "./dist/exists.mjs",
|
|
40
64
|
"require": "./dist/exists.cjs"
|
|
41
65
|
},
|
|
66
|
+
"./exists.test": {
|
|
67
|
+
"import": "./dist/exists.test.mjs",
|
|
68
|
+
"require": "./dist/exists.test.cjs"
|
|
69
|
+
},
|
|
42
70
|
"./get-parent-path": {
|
|
43
71
|
"import": "./dist/get-parent-path.mjs",
|
|
44
72
|
"require": "./dist/get-parent-path.cjs"
|
|
45
73
|
},
|
|
74
|
+
"./get-parent-path.test": {
|
|
75
|
+
"import": "./dist/get-parent-path.test.mjs",
|
|
76
|
+
"require": "./dist/get-parent-path.test.cjs"
|
|
77
|
+
},
|
|
46
78
|
"./get-workspace-root": {
|
|
47
79
|
"import": "./dist/get-workspace-root.mjs",
|
|
48
80
|
"require": "./dist/get-workspace-root.cjs"
|
|
49
81
|
},
|
|
82
|
+
"./get-workspace-root.test": {
|
|
83
|
+
"import": "./dist/get-workspace-root.test.mjs",
|
|
84
|
+
"require": "./dist/get-workspace-root.test.cjs"
|
|
85
|
+
},
|
|
50
86
|
"./helpers": {
|
|
51
87
|
"import": "./dist/helpers.mjs",
|
|
52
88
|
"require": "./dist/helpers.cjs"
|
|
53
89
|
},
|
|
90
|
+
"./helpers.test": {
|
|
91
|
+
"import": "./dist/helpers.test.mjs",
|
|
92
|
+
"require": "./dist/helpers.test.cjs"
|
|
93
|
+
},
|
|
94
|
+
"./index.test": {
|
|
95
|
+
"import": "./dist/index.test.mjs",
|
|
96
|
+
"require": "./dist/index.test.cjs"
|
|
97
|
+
},
|
|
54
98
|
"./install": {
|
|
55
99
|
"import": "./dist/install.mjs",
|
|
56
100
|
"require": "./dist/install.cjs"
|
|
57
101
|
},
|
|
102
|
+
"./install.test": {
|
|
103
|
+
"import": "./dist/install.test.mjs",
|
|
104
|
+
"require": "./dist/install.test.cjs"
|
|
105
|
+
},
|
|
58
106
|
"./is-file": {
|
|
59
107
|
"import": "./dist/is-file.mjs",
|
|
60
108
|
"require": "./dist/is-file.cjs"
|
|
61
109
|
},
|
|
110
|
+
"./is-file.test": {
|
|
111
|
+
"import": "./dist/is-file.test.mjs",
|
|
112
|
+
"require": "./dist/is-file.test.cjs"
|
|
113
|
+
},
|
|
62
114
|
"./json": { "import": "./dist/json.mjs", "require": "./dist/json.cjs" },
|
|
115
|
+
"./json.test": {
|
|
116
|
+
"import": "./dist/json.test.mjs",
|
|
117
|
+
"require": "./dist/json.test.cjs"
|
|
118
|
+
},
|
|
63
119
|
"./list-files": {
|
|
64
120
|
"import": "./dist/list-files.mjs",
|
|
65
121
|
"require": "./dist/list-files.cjs"
|
|
66
122
|
},
|
|
123
|
+
"./list-files.test": {
|
|
124
|
+
"import": "./dist/list-files.test.mjs",
|
|
125
|
+
"require": "./dist/list-files.test.cjs"
|
|
126
|
+
},
|
|
67
127
|
"./package-fns": {
|
|
68
128
|
"import": "./dist/package-fns.mjs",
|
|
69
129
|
"require": "./dist/package-fns.cjs"
|
|
70
130
|
},
|
|
131
|
+
"./package-fns.test": {
|
|
132
|
+
"import": "./dist/package-fns.test.mjs",
|
|
133
|
+
"require": "./dist/package-fns.test.cjs"
|
|
134
|
+
},
|
|
71
135
|
"./read-file": {
|
|
72
136
|
"import": "./dist/read-file.mjs",
|
|
73
137
|
"require": "./dist/read-file.cjs"
|
|
74
138
|
},
|
|
139
|
+
"./read-file.test": {
|
|
140
|
+
"import": "./dist/read-file.test.mjs",
|
|
141
|
+
"require": "./dist/read-file.test.cjs"
|
|
142
|
+
},
|
|
75
143
|
"./registry": {
|
|
76
144
|
"import": "./dist/registry.mjs",
|
|
77
145
|
"require": "./dist/registry.cjs"
|
|
78
146
|
},
|
|
147
|
+
"./registry.test": {
|
|
148
|
+
"import": "./dist/registry.test.mjs",
|
|
149
|
+
"require": "./dist/registry.test.cjs"
|
|
150
|
+
},
|
|
79
151
|
"./remove-file": {
|
|
80
152
|
"import": "./dist/remove-file.mjs",
|
|
81
153
|
"require": "./dist/remove-file.cjs"
|
|
82
154
|
},
|
|
155
|
+
"./remove-file.test": {
|
|
156
|
+
"import": "./dist/remove-file.test.mjs",
|
|
157
|
+
"require": "./dist/remove-file.test.cjs"
|
|
158
|
+
},
|
|
83
159
|
"./resolve": {
|
|
84
160
|
"import": "./dist/resolve.mjs",
|
|
85
161
|
"require": "./dist/resolve.cjs"
|
|
86
162
|
},
|
|
163
|
+
"./resolve.test": {
|
|
164
|
+
"import": "./dist/resolve.test.mjs",
|
|
165
|
+
"require": "./dist/resolve.test.cjs"
|
|
166
|
+
},
|
|
87
167
|
"./semver-fns": {
|
|
88
168
|
"import": "./dist/semver-fns.mjs",
|
|
89
169
|
"require": "./dist/semver-fns.cjs"
|
|
90
170
|
},
|
|
171
|
+
"./semver-fns.test": {
|
|
172
|
+
"import": "./dist/semver-fns.test.mjs",
|
|
173
|
+
"require": "./dist/semver-fns.test.cjs"
|
|
174
|
+
},
|
|
91
175
|
"./toml": { "import": "./dist/toml.mjs", "require": "./dist/toml.cjs" },
|
|
176
|
+
"./toml.test": {
|
|
177
|
+
"import": "./dist/toml.test.mjs",
|
|
178
|
+
"require": "./dist/toml.test.cjs"
|
|
179
|
+
},
|
|
92
180
|
"./tsconfig": {
|
|
93
181
|
"import": "./dist/tsconfig.mjs",
|
|
94
182
|
"require": "./dist/tsconfig.cjs"
|
|
95
183
|
},
|
|
184
|
+
"./tsconfig.test": {
|
|
185
|
+
"import": "./dist/tsconfig.test.mjs",
|
|
186
|
+
"require": "./dist/tsconfig.test.cjs"
|
|
187
|
+
},
|
|
96
188
|
"./write-file": {
|
|
97
189
|
"import": "./dist/write-file.mjs",
|
|
98
190
|
"require": "./dist/write-file.cjs"
|
|
99
191
|
},
|
|
192
|
+
"./write-file.test": {
|
|
193
|
+
"import": "./dist/write-file.test.mjs",
|
|
194
|
+
"require": "./dist/write-file.test.cjs"
|
|
195
|
+
},
|
|
100
196
|
"./yaml": { "import": "./dist/yaml.mjs", "require": "./dist/yaml.cjs" },
|
|
197
|
+
"./yaml.test": {
|
|
198
|
+
"import": "./dist/yaml.test.mjs",
|
|
199
|
+
"require": "./dist/yaml.test.cjs"
|
|
200
|
+
},
|
|
101
201
|
"./*": "./*"
|
|
102
202
|
},
|
|
103
203
|
"main": "./dist/index.cjs",
|
|
@@ -105,14 +205,14 @@
|
|
|
105
205
|
"types": "./dist/index.d.cts",
|
|
106
206
|
"dependencies": {
|
|
107
207
|
"@antfu/install-pkg": "^1.1.0",
|
|
108
|
-
"@storm-software/config-tools": "^1.190.
|
|
109
|
-
"@stryke/convert": "^0.7.
|
|
110
|
-
"@stryke/helpers": "^0.10.
|
|
111
|
-
"@stryke/json": "^0.15.
|
|
112
|
-
"@stryke/path": "^0.29.
|
|
113
|
-
"@stryke/string-format": "^0.17.
|
|
114
|
-
"@stryke/type-checks": "^0.6.
|
|
115
|
-
"@stryke/types": "^0.12.
|
|
208
|
+
"@storm-software/config-tools": "^1.190.37",
|
|
209
|
+
"@stryke/convert": "^0.7.11",
|
|
210
|
+
"@stryke/helpers": "^0.10.20",
|
|
211
|
+
"@stryke/json": "^0.15.4",
|
|
212
|
+
"@stryke/path": "^0.29.7",
|
|
213
|
+
"@stryke/string-format": "^0.17.22",
|
|
214
|
+
"@stryke/type-checks": "^0.6.13",
|
|
215
|
+
"@stryke/types": "^0.12.8",
|
|
116
216
|
"chalk": "^5.6.2",
|
|
117
217
|
"defu": "^6.1.7",
|
|
118
218
|
"glob": "^11.1.0",
|
|
@@ -129,5 +229,5 @@
|
|
|
129
229
|
"tsdown": "^0.21.10"
|
|
130
230
|
},
|
|
131
231
|
"publishConfig": { "access": "public" },
|
|
132
|
-
"gitHead": "
|
|
232
|
+
"gitHead": "004d35078864920425b41d1d90b45ef504f5a092"
|
|
133
233
|
}
|