@stryke/fs 0.24.2 → 0.26.0

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.
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.exists = exists;
7
+ exports.existsSync = existsSync;
8
+ var _nodeFs = require("node:fs");
9
+ var _promises = require("node:fs/promises");
10
+ function existsSync(s) {
11
+ return (0, _nodeFs.existsSync)(s);
12
+ }
13
+ async function exists(s) {
14
+ return (0, _promises.access)(s, _promises.constants.F_OK).then(() => !0).catch(() => !1);
15
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if a file exists
3
+ *
4
+ * @param filePath - The file path to check
5
+ * @returns An indicator specifying if the file exists
6
+ */
7
+ export declare function existsSync(filePath: string): boolean;
8
+ /**
9
+ * Check if a file exists
10
+ *
11
+ * @param filePath - The file path to check
12
+ * @returns An indicator specifying if the file exists
13
+ */
14
+ export declare function exists(filePath: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ import{existsSync as t}from"node:fs";import{access as n,constants as e}from"node:fs/promises";export function existsSync(s){return t(s)}export async function exists(s){return n(s,e.F_OK).then(()=>!0).catch(()=>!1)}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WORKSPACE_ROOT_CONTENT = exports.PROJECT_ROOT_CONTENT = void 0;
7
+ exports.getProjectRoot = getProjectRoot;
8
+ exports.getWorkspaceRoot = getWorkspaceRoot;
9
+ exports.isProjectRoot = isProjectRoot;
10
+ exports.isWorkspaceRoot = isWorkspaceRoot;
11
+ var _configTools = require("@storm-software/config-tools");
12
+ var _getParentPath = require("@stryke/path/get-parent-path");
13
+ var _isRootDir = require("@stryke/path/is-root-dir");
14
+ const WORKSPACE_ROOT_CONTENT = exports.WORKSPACE_ROOT_CONTENT = ["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lock", "nx.json", "knip.json", "pnpm-workspace.yaml", "LICENSE", ".all-contributorsrc", ".whitesource", "syncpack.config.js", "syncpack.json", "socket.yaml", "lefthook.yaml", ".npmrc", ".log4brains.yml", ".huskyrc", ".husky", ".lintstagedrc", ".commitlintrc", "lefthook.yml", ".github", ".nx", ".vscode", "patches"],
15
+ PROJECT_ROOT_CONTENT = exports.PROJECT_ROOT_CONTENT = ["project.json", "package.json", ".storm"];
16
+ function getWorkspaceRoot(o = process.cwd()) {
17
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) return process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
18
+ const t = (0, _configTools.findWorkspaceRootSafe)(o);
19
+ if (t) return t;
20
+ let r = (0, _getParentPath.getParentPath)(WORKSPACE_ROOT_CONTENT, o);
21
+ if (r) return r;
22
+ for (r = o; r && !(0, _isRootDir.isSystemRoot)(r);) if (r = (0, _getParentPath.getParentPath)("storm-workspace.json", r, {
23
+ skipCwd: !0
24
+ }), r) return r;
25
+ return o;
26
+ }
27
+ function isWorkspaceRoot(o = process.cwd()) {
28
+ const t = getWorkspaceRoot(o);
29
+ return t ? t === o : !1;
30
+ }
31
+ function getProjectRoot(o = process.cwd()) {
32
+ const t = (0, _getParentPath.getParentPath)(PROJECT_ROOT_CONTENT, o);
33
+ return t || o;
34
+ }
35
+ function isProjectRoot(o = process.cwd()) {
36
+ const t = getProjectRoot(o);
37
+ return t ? t === o : !1;
38
+ }
@@ -0,0 +1,30 @@
1
+ export declare const WORKSPACE_ROOT_CONTENT: string[];
2
+ export declare const PROJECT_ROOT_CONTENT: string[];
3
+ /**
4
+ * Get the workspace root path
5
+ *
6
+ * @param dir - A directory to start the search from
7
+ * @returns The workspace root path
8
+ */
9
+ export declare function getWorkspaceRoot(dir?: string): any;
10
+ /**
11
+ * Check if the given directory is the workspace root
12
+ *
13
+ * @param dir - A directory to check
14
+ * @returns True if the directory is the workspace root, false otherwise
15
+ */
16
+ export declare function isWorkspaceRoot(dir?: string): boolean;
17
+ /**
18
+ * Get the project root path
19
+ *
20
+ * @param dir - A directory to start the search from
21
+ * @returns The project root path
22
+ */
23
+ export declare function getProjectRoot(dir?: string): any;
24
+ /**
25
+ * Check if the given directory is the project root
26
+ *
27
+ * @param dir - A directory to check
28
+ * @returns True if the directory is the project root, false otherwise
29
+ */
30
+ export declare function isProjectRoot(dir?: string): boolean;
@@ -0,0 +1 @@
1
+ import{findWorkspaceRootSafe as e}from"@storm-software/config-tools";import{getParentPath as s}from"@stryke/path/get-parent-path";import{isSystemRoot as n}from"@stryke/path/is-root-dir";export const WORKSPACE_ROOT_CONTENT=["package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock","nx.json","knip.json","pnpm-workspace.yaml","LICENSE",".all-contributorsrc",".whitesource","syncpack.config.js","syncpack.json","socket.yaml","lefthook.yaml",".npmrc",".log4brains.yml",".huskyrc",".husky",".lintstagedrc",".commitlintrc","lefthook.yml",".github",".nx",".vscode","patches"],PROJECT_ROOT_CONTENT=["project.json","package.json",".storm"];export function getWorkspaceRoot(o=process.cwd()){if(process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH)return process.env.STORM_WORKSPACE_ROOT||process.env.NX_WORKSPACE_ROOT_PATH;const t=e(o);if(t)return t;let r=s(WORKSPACE_ROOT_CONTENT,o);if(r)return r;for(r=o;r&&!n(r);)if(r=s("storm-workspace.json",r,{skipCwd:!0}),r)return r;return o}export function isWorkspaceRoot(o=process.cwd()){const t=getWorkspaceRoot(o);return t?t===o:!1}export function getProjectRoot(o=process.cwd()){const t=s(PROJECT_ROOT_CONTENT,o);return t||o}export function isProjectRoot(o=process.cwd()){const t=getProjectRoot(o);return t?t===o:!1}
package/dist/helpers.cjs CHANGED
@@ -9,10 +9,10 @@ exports.extractFileFromTar = extractFileFromTar;
9
9
  exports.extractFileFromTarGzip = extractFileFromTarGzip;
10
10
  exports.removeDirectory = removeDirectory;
11
11
  exports.removeDirectorySync = removeDirectorySync;
12
- var _exists = require("@stryke/path/exists");
13
12
  var _nanotar = require("nanotar");
14
13
  var _nodeFs = require("node:fs");
15
14
  var _promises = require("node:fs/promises");
15
+ var _exists = require("./exists.cjs");
16
16
  function createDirectorySync(r) {
17
17
  if (!(0, _exists.existsSync)(r)) return (0, _nodeFs.mkdirSync)(r, {
18
18
  recursive: !0
package/dist/helpers.mjs CHANGED
@@ -1 +1 @@
1
- import{exists as c,existsSync as s}from"@stryke/path/exists";import{parseTar as y,parseTarGzip as g}from"nanotar";import{createWriteStream as u,mkdirSync as p,rmSync as w}from"node:fs";import{mkdir as a,readFile as o,rm as x}from"node:fs/promises";export function createDirectorySync(r){if(!s(r))return p(r,{recursive:!0})}export async function createDirectory(r){if(!await c(r))return a(r,{recursive:!0})}export function removeDirectorySync(r){if(s(r))return w(r,{recursive:!0})}export async function removeDirectory(r){if(s(r))return x(r,{recursive:!0})}export async function extractFileFromTar(r,i,t){const e=y(await o(r)).find(n=>n.name===i);if(!e?.data)return;await c(t)||await a(t,{recursive:!0}),u(t).write(e.data)}export async function extractFileFromTarGzip(r,i,t){const e=(await g(await o(r))).find(n=>n.name===i);if(!e?.data)return;await c(t)||await a(t,{recursive:!0}),u(t).write(e.data)}
1
+ import{parseTar as y,parseTarGzip as g}from"nanotar";import{createWriteStream as u,mkdirSync as p,rmSync as w}from"node:fs";import{mkdir as c,readFile as o,rm as x}from"node:fs/promises";import{exists as s,existsSync as a}from"./exists";export function createDirectorySync(r){if(!a(r))return p(r,{recursive:!0})}export async function createDirectory(r){if(!await s(r))return c(r,{recursive:!0})}export function removeDirectorySync(r){if(a(r))return w(r,{recursive:!0})}export async function removeDirectory(r){if(a(r))return x(r,{recursive:!0})}export async function extractFileFromTar(r,i,t){const e=y(await o(r)).find(n=>n.name===i);if(!e?.data)return;await s(t)||await c(t,{recursive:!0}),u(t).write(e.data)}export async function extractFileFromTarGzip(r,i,t){const e=(await g(await o(r))).find(n=>n.name===i);if(!e?.data)return;await s(t)||await c(t,{recursive:!0}),u(t).write(e.data)}
package/dist/index.cjs CHANGED
@@ -69,6 +69,28 @@ Object.keys(_copyFile).forEach(function (key) {
69
69
  }
70
70
  });
71
71
  });
72
+ var _exists = require("./exists.cjs");
73
+ Object.keys(_exists).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _exists[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _exists[key];
80
+ }
81
+ });
82
+ });
83
+ var _getWorkspaceRoot = require("./get-workspace-root.cjs");
84
+ Object.keys(_getWorkspaceRoot).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _getWorkspaceRoot[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _getWorkspaceRoot[key];
91
+ }
92
+ });
93
+ });
72
94
  var _helpers = require("./helpers.cjs");
73
95
  Object.keys(_helpers).forEach(function (key) {
74
96
  if (key === "default" || key === "__esModule") return;
@@ -157,6 +179,17 @@ Object.keys(_removeFile).forEach(function (key) {
157
179
  }
158
180
  });
159
181
  });
182
+ var _resolve = require("./resolve.cjs");
183
+ Object.keys(_resolve).forEach(function (key) {
184
+ if (key === "default" || key === "__esModule") return;
185
+ if (key in exports && exports[key] === _resolve[key]) return;
186
+ Object.defineProperty(exports, key, {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _resolve[key];
190
+ }
191
+ });
192
+ });
160
193
  var _semverFns = require("./semver-fns.cjs");
161
194
  Object.keys(_semverFns).forEach(function (key) {
162
195
  if (key === "default" || key === "__esModule") return;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export * from "./command-exists";
12
12
  export * from "./compress";
13
13
  export * from "./constants";
14
14
  export * from "./copy-file";
15
+ export * from "./exists";
16
+ export * from "./get-workspace-root";
15
17
  export * from "./helpers";
16
18
  export * from "./install";
17
19
  export * from "./json";
@@ -20,6 +22,7 @@ export * from "./package-fns";
20
22
  export * from "./read-file";
21
23
  export * from "./registry";
22
24
  export * from "./remove-file";
25
+ export * from "./resolve";
23
26
  export * from "./semver-fns";
24
27
  export * from "./toml";
25
28
  export * from "./tsconfig";
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export*from"./buffer";export*from"./chmod-x";export*from"./command-exists";export*from"./compress";export*from"./constants";export*from"./copy-file";export*from"./helpers";export*from"./install";export*from"./json";export*from"./list-files";export*from"./package-fns";export*from"./read-file";export*from"./registry";export*from"./remove-file";export*from"./semver-fns";export*from"./toml";export*from"./tsconfig";export*from"./write-file";export*from"./yaml";
1
+ export*from"./buffer";export*from"./chmod-x";export*from"./command-exists";export*from"./compress";export*from"./constants";export*from"./copy-file";export*from"./exists";export*from"./get-workspace-root";export*from"./helpers";export*from"./install";export*from"./json";export*from"./list-files";export*from"./package-fns";export*from"./read-file";export*from"./registry";export*from"./remove-file";export*from"./resolve";export*from"./semver-fns";export*from"./toml";export*from"./tsconfig";export*from"./write-file";export*from"./yaml";
package/dist/install.cjs CHANGED
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.install = install;
7
7
  exports.packageExists = void 0;
8
8
  var _installPkg = require("@antfu/install-pkg");
9
- var _resolve = require("@stryke/path/resolve");
10
9
  require("tinyexec");
10
+ var _resolve = require("./resolve.cjs");
11
11
  async function install(t, a) {
12
12
  return (0, _installPkg.installPackage)(t, a);
13
13
  }
package/dist/install.mjs CHANGED
@@ -1 +1 @@
1
- import{installPackage as e}from"@antfu/install-pkg";import{resolve as n}from"@stryke/path/resolve";import"tinyexec";export async function install(t,a){return e(t,a)}export const packageExists=async(t,a)=>{const s=await n(a?.cwd||process.cwd());try{await n(t,{paths:[s]})}catch{await install(t,a)}};
1
+ import{installPackage as e}from"@antfu/install-pkg";import"tinyexec";import{resolve as n}from"./resolve";export async function install(t,a){return e(t,a)}export const packageExists=async(t,a)=>{const s=await n(a?.cwd||process.cwd());try{await n(t,{paths:[s]})}catch{await install(t,a)}};
@@ -3,25 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.doesPackageMatch = doesPackageMatch;
6
7
  exports.getPackageInfo = getPackageInfo;
8
+ exports.getPackageListing = getPackageListing;
7
9
  exports.getPackageManager = getPackageManager;
8
10
  exports.isPackageExists = isPackageExists;
9
11
  exports.isPackageListed = isPackageListed;
10
12
  exports.loadPackageJson = loadPackageJson;
11
- var _path = require("@stryke/path");
13
+ var _filePathFns = require("@stryke/path/file-path-fns");
12
14
  var _getParentPath = require("@stryke/path/get-parent-path");
13
- var _getWorkspaceRoot = require("@stryke/path/get-workspace-root");
14
- var _resolve = require("@stryke/path/resolve");
15
+ var _joinPaths = require("@stryke/path/join-paths");
15
16
  var _package = require("@stryke/string-format/package");
16
17
  var _isString = require("@stryke/type-checks/is-string");
17
18
  var _nodeFs = require("node:fs");
18
19
  var _semver = require("semver");
20
+ var _exists = require("./exists.cjs");
21
+ var _getWorkspaceRoot = require("./get-workspace-root.cjs");
19
22
  var _json = require("./json.cjs");
20
- var _semverFns = require("./semver-fns.cjs");
21
- function getPackageManager(n = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
22
- const e = (0, _getParentPath.getParentPath)(["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lock"], n);
23
+ var _resolve = require("./resolve.cjs");
24
+ function getPackageManager(t = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
25
+ const e = (0, _getParentPath.getParentPath)(["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "bun.lock"], t);
23
26
  if (!e) return "pnpm";
24
- switch ((0, _path.findFileName)(e)) {
27
+ switch ((0, _filePathFns.findFileName)(e)) {
25
28
  case "yarn.lock":
26
29
  return "yarn";
27
30
  case "pnpm-lock.yaml":
@@ -32,46 +35,62 @@ function getPackageManager(n = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
32
35
  return "npm";
33
36
  }
34
37
  }
35
- async function h(n) {
38
+ async function v(t) {
36
39
  let e;
37
40
  for (;;) {
38
- if (!n) return;
39
- const a = (0, _path.findFilePath)(n);
40
- if (a === n) return;
41
- if (n = a, e = (0, _path.joinPaths)(n, "package.json"), await (0, _path.exists)(e)) break;
41
+ if (!t) return;
42
+ const n = (0, _filePathFns.findFilePath)(t);
43
+ if (n === t) return;
44
+ if (t = n, e = (0, _joinPaths.joinPaths)(t, "package.json"), await (0, _exists.exists)(e)) break;
42
45
  }
43
46
  return e;
44
47
  }
45
- async function J(n, e = {}) {
46
- const a = await (0, _resolve.resolvePackage)(n, e);
47
- if (a) return h(a);
48
+ async function x(t, e = {}) {
49
+ const n = await (0, _resolve.resolvePackage)(t, e);
50
+ if (n) return v(n);
48
51
  }
49
- async function getPackageInfo(n, e = {}) {
50
- const a = await J(n, e);
51
- if (!a) return;
52
- const s = await (0, _json.readJsonFile)(a);
52
+ async function getPackageInfo(t, e = {}) {
53
+ const n = await x(t, e);
54
+ if (!n) return;
55
+ const s = await (0, _json.readJsonFile)(n);
53
56
  return {
54
- name: n,
57
+ name: t,
55
58
  version: s.version,
56
- rootPath: (0, _path.findFilePath)(a),
57
- packageJsonPath: a,
59
+ rootPath: (0, _filePathFns.findFilePath)(n),
60
+ packageJsonPath: n,
58
61
  packageJson: s
59
62
  };
60
63
  }
61
- async function loadPackageJson(n = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
62
- const e = (0, _getParentPath.getParentPath)("package.json", n, {
64
+ async function loadPackageJson(t = (0, _getWorkspaceRoot.getWorkspaceRoot)()) {
65
+ const e = (0, _getParentPath.getParentPath)("package.json", t, {
63
66
  skipCwd: !1
64
67
  });
65
68
  return !e || !(0, _nodeFs.existsSync)(e) ? null : (0, _json.readJsonFile)(e);
66
69
  }
67
- async function isPackageListed(n, e) {
68
- const a = (0, _package.getPackageName)(n),
69
- s = (0, _isString.isString)(e) ? e : e?.cwd;
70
- let o = (0, _isString.isString)(e) ? void 0 : e?.version;
71
- (!o || !(0, _semverFns.isValidRange)(o)) && (o = (0, _package.hasPackageVersion)(n) && (0, _semverFns.isValidRange)((0, _package.getPackageVersion)(n)) ? (0, _package.getPackageVersion)(n) : void 0);
72
- const t = await loadPackageJson(s);
73
- return t ? !!((t.dependencies && a in t.dependencies && t.dependencies[a] && (!o || (0, _semver.subset)(t.dependencies[a], o))) ?? (t.devDependencies && a in t.devDependencies && t.devDependencies[a] && (!o || (0, _semver.subset)(t.devDependencies[a], o)))) : !1;
70
+ async function isPackageListed(t, e) {
71
+ const n = (0, _package.getPackageName)(t),
72
+ s = (0, _isString.isString)(e) ? e : e?.cwd,
73
+ a = await loadPackageJson(s);
74
+ return a ? !!(a.dependencies && n in a.dependencies && a.dependencies[n] || a.devDependencies && n in a.devDependencies && a.devDependencies[n]) : !1;
75
+ }
76
+ async function getPackageListing(t, e) {
77
+ const n = (0, _package.getPackageName)(t),
78
+ s = (0, _isString.isString)(e) ? e : e?.cwd,
79
+ a = await loadPackageJson(s);
80
+ if (!a) return;
81
+ const i = a.dependencies && n in a.dependencies ? a.dependencies[n] : a.devDependencies && n in a.devDependencies ? a.devDependencies[n] : void 0,
82
+ o = (a.dependencies && n in a.dependencies ? "dependencies" : a.devDependencies && n in a.devDependencies ? "devDependencies" : void 0) || void 0;
83
+ return i && o ? {
84
+ version: i,
85
+ type: o
86
+ } : void 0;
87
+ }
88
+ async function doesPackageMatch(t, e, n) {
89
+ const s = await getPackageListing(t, {
90
+ cwd: n
91
+ });
92
+ return s ? s.version.startsWith("catalog:") || s.version.startsWith("workspace:") || (0, _semver.subset)(s.version, e) : !1;
74
93
  }
75
- function isPackageExists(n, e = {}) {
76
- return !!(0, _resolve.resolvePackage)(n, e);
94
+ function isPackageExists(t, e = {}) {
95
+ return !!(0, _resolve.resolvePackage)(t, e);
77
96
  }
@@ -1,7 +1,7 @@
1
- import type { PackageResolvingOptions } from "@stryke/path/resolve";
2
1
  import type { PackageJson } from "@stryke/types/package-json";
3
2
  import type { PackageManager } from "@stryke/types/package-manager";
4
3
  import type { Range } from "semver";
4
+ import type { PackageResolvingOptions } from "./resolve";
5
5
  /**
6
6
  * Get the package manager used in the project
7
7
  * @param dir - The path to the project
@@ -34,6 +34,8 @@ export interface PackageExistsOptions {
34
34
  * The current working directory
35
35
  */
36
36
  cwd?: string;
37
+ }
38
+ export interface PackageMatchesOptions extends PackageExistsOptions {
37
39
  /**
38
40
  * The version range of the package to check
39
41
  */
@@ -55,6 +57,27 @@ export declare function isPackageListed(name: string, cwd?: string): Promise<boo
55
57
  * @returns An indicator specifying if the package is listed
56
58
  */
57
59
  export declare function isPackageListed(name: string, options?: PackageExistsOptions): Promise<boolean>;
60
+ export interface GetPackageListingReturn {
61
+ version: string;
62
+ type: "dependencies" | "devDependencies";
63
+ }
64
+ /**
65
+ * Return the package version and dependency type listed in the package.json file
66
+ *
67
+ * @param name - The name of the package
68
+ * @param cwdOrOptions - The current working directory or options to use when checking if the package is listed
69
+ * @returns The version and type of the package if listed, otherwise undefined
70
+ */
71
+ export declare function getPackageListing(name: string, cwdOrOptions?: string | PackageExistsOptions): Promise<GetPackageListingReturn | undefined>;
72
+ /**
73
+ * Check if a package version matches a specific version range
74
+ *
75
+ * @param name - The name of the package
76
+ * @param version - The version to check against
77
+ * @param cwd - The current working directory
78
+ * @returns An indicator specifying if the package version matches the range
79
+ */
80
+ export declare function doesPackageMatch(name: string, version: string, cwd?: string): Promise<boolean>;
58
81
  /**
59
82
  * Check if a package exists
60
83
  *
@@ -1 +1 @@
1
- import{exists as l,findFileName as u,findFilePath as r,joinPaths as d}from"@stryke/path";import{getParentPath as i}from"@stryke/path/get-parent-path";import{getWorkspaceRoot as c}from"@stryke/path/get-workspace-root";import{resolvePackage as g}from"@stryke/path/resolve";import{getPackageName as y,getPackageVersion as p,hasPackageVersion as v}from"@stryke/string-format/package";import{isString as k}from"@stryke/type-checks/is-string";import{existsSync as x}from"node:fs";import{subset as m}from"semver";import{readJsonFile as f}from"./json";import{isValidRange as P}from"./semver-fns";export function getPackageManager(n=c()){const e=i(["package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock"],n);if(!e)return"pnpm";switch(u(e)){case"yarn.lock":return"yarn";case"pnpm-lock.yaml":return"pnpm";case"bun.lock":return"bun";default:return"npm"}}async function h(n){let e;for(;;){if(!n)return;const a=r(n);if(a===n)return;if(n=a,e=d(n,"package.json"),await l(e))break}return e}async function J(n,e={}){const a=await g(n,e);if(a)return h(a)}export async function getPackageInfo(n,e={}){const a=await J(n,e);if(!a)return;const s=await f(a);return{name:n,version:s.version,rootPath:r(a),packageJsonPath:a,packageJson:s}}export async function loadPackageJson(n=c()){const e=i("package.json",n,{skipCwd:!1});return!e||!x(e)?null:f(e)}export async function isPackageListed(n,e){const a=y(n),s=k(e)?e:e?.cwd;let o=k(e)?void 0:e?.version;(!o||!P(o))&&(o=v(n)&&P(p(n))?p(n):void 0);const t=await loadPackageJson(s);return t?!!((t.dependencies&&a in t.dependencies&&t.dependencies[a]&&(!o||m(t.dependencies[a],o)))??(t.devDependencies&&a in t.devDependencies&&t.devDependencies[a]&&(!o||m(t.devDependencies[a],o)))):!1}export function isPackageExists(n,e={}){return!!g(n,e)}
1
+ import{findFileName as m,findFilePath as r}from"@stryke/path/file-path-fns";import{getParentPath as c}from"@stryke/path/get-parent-path";import{joinPaths as u}from"@stryke/path/join-paths";import{getPackageName as p}from"@stryke/string-format/package";import{isString as g}from"@stryke/type-checks/is-string";import{existsSync as P}from"node:fs";import{subset as l}from"semver";import{exists as y}from"./exists";import{getWorkspaceRoot as d}from"./get-workspace-root";import{readJsonFile as k}from"./json";import{resolvePackage as f}from"./resolve";export function getPackageManager(t=d()){const e=c(["package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock"],t);if(!e)return"pnpm";switch(m(e)){case"yarn.lock":return"yarn";case"pnpm-lock.yaml":return"pnpm";case"bun.lock":return"bun";default:return"npm"}}async function v(t){let e;for(;;){if(!t)return;const n=r(t);if(n===t)return;if(t=n,e=u(t,"package.json"),await y(e))break}return e}async function x(t,e={}){const n=await f(t,e);if(n)return v(n)}export async function getPackageInfo(t,e={}){const n=await x(t,e);if(!n)return;const s=await k(n);return{name:t,version:s.version,rootPath:r(n),packageJsonPath:n,packageJson:s}}export async function loadPackageJson(t=d()){const e=c("package.json",t,{skipCwd:!1});return!e||!P(e)?null:k(e)}export async function isPackageListed(t,e){const n=p(t),s=g(e)?e:e?.cwd,a=await loadPackageJson(s);return a?!!(a.dependencies&&n in a.dependencies&&a.dependencies[n]||a.devDependencies&&n in a.devDependencies&&a.devDependencies[n]):!1}export async function getPackageListing(t,e){const n=p(t),s=g(e)?e:e?.cwd,a=await loadPackageJson(s);if(!a)return;const i=a.dependencies&&n in a.dependencies?a.dependencies[n]:a.devDependencies&&n in a.devDependencies?a.devDependencies[n]:void 0,o=(a.dependencies&&n in a.dependencies?"dependencies":a.devDependencies&&n in a.devDependencies?"devDependencies":void 0)||void 0;return i&&o?{version:i,type:o}:void 0}export async function doesPackageMatch(t,e,n){const s=await getPackageListing(t,{cwd:n});return s?s.version.startsWith("catalog:")||s.version.startsWith("workspace:")||l(s.version,e):!1}export function isPackageExists(t,e={}){return!!f(t,e)}
package/dist/registry.cjs CHANGED
@@ -9,9 +9,9 @@ exports.getParsedNodeOptionsWithoutInspect = getParsedNodeOptionsWithoutInspect;
9
9
  exports.getRegistry = getRegistry;
10
10
  exports.tokenizeArgs = void 0;
11
11
  var _installPkg = require("@antfu/install-pkg");
12
- var _getWorkspaceRoot = require("@stryke/path/get-workspace-root");
13
12
  var _nodeChild_process = require("node:child_process");
14
13
  var _nodeUtil = require("node:util");
14
+ var _getWorkspaceRoot = require("./get-workspace-root.cjs");
15
15
  const l = r => {
16
16
  const {
17
17
  values: e,
package/dist/registry.mjs CHANGED
@@ -1 +1 @@
1
- import{detectPackageManager as s}from"@antfu/install-pkg";import{getWorkspaceRoot as a}from"@stryke/path/get-workspace-root";import{execSync as c}from"node:child_process";import{parseArgs as g}from"node:util";const l=r=>{const{values:e,tokens:n}=g({args:r,strict:!1,tokens:!0});let o=null;for(let i=0;i<n.length;i++){const t=n[i];if(t.kind==="option-terminator")break;if(t.kind==="option"){o=typeof t.value>"u"?t:null;continue}if(t.kind!=="positional"){o=null;continue}o&&(o.name in e&&typeof e[o.name]=="string"?e[o.name]+=` ${t.value}`:e[o.name]=t.value)}return e};export const tokenizeArgs=r=>{const e=[];let n=!1,o=!0;for(let i=0;i<r.length;i++){let t=r[i];if(t==="\\"&&n){if(r.length===i+1)throw new Error("Invalid escape character at the end.");t=r[++i]}else if(t===" "&&!n){o=!0;continue}else if(t==='"'){n=!n;continue}o?(e.push(t),o=!1):e[e.length-1]+=t}if(n)throw new Error("Unterminated string");return e};const f=()=>process.env.NODE_OPTIONS?tokenizeArgs(process.env.NODE_OPTIONS):[];export function formatNodeOptions(r){return Object.entries(r).map(([e,n])=>n===!0?`--${e}`:n?`--${e}=${n.includes(" ")&&!n.startsWith('"')?JSON.stringify(n):n}`:null).filter(e=>e!==null).join(" ")}export function getParsedNodeOptionsWithoutInspect(){const r=f();if(r.length===0)return{};const e=l(r);return delete e.inspect,delete e["inspect-brk"],delete e.inspect_brk,e}export function getFormattedNodeOptionsWithoutInspect(){const r=getParsedNodeOptionsWithoutInspect();return Object.keys(r).length===0?"":formatNodeOptions(r)}export async function getRegistry(r){const e=a(r),n=await s(e),o=n==="npm"?"--no-workspaces":"";let i="https://registry.npmjs.org/";try{const t=c(`${n} config get registry ${o}`,{env:{...process.env,NODE_OPTIONS:getFormattedNodeOptionsWithoutInspect()}}).toString().trim();t.startsWith("http")&&(i=t.endsWith("/")?t:`${t}/`)}catch(t){throw new Error(`Failed to get registry from "${n}".`,{cause:t})}return i}
1
+ import{detectPackageManager as s}from"@antfu/install-pkg";import{execSync as a}from"node:child_process";import{parseArgs as c}from"node:util";import{getWorkspaceRoot as g}from"./get-workspace-root";const l=r=>{const{values:e,tokens:n}=c({args:r,strict:!1,tokens:!0});let o=null;for(let i=0;i<n.length;i++){const t=n[i];if(t.kind==="option-terminator")break;if(t.kind==="option"){o=typeof t.value>"u"?t:null;continue}if(t.kind!=="positional"){o=null;continue}o&&(o.name in e&&typeof e[o.name]=="string"?e[o.name]+=` ${t.value}`:e[o.name]=t.value)}return e};export const tokenizeArgs=r=>{const e=[];let n=!1,o=!0;for(let i=0;i<r.length;i++){let t=r[i];if(t==="\\"&&n){if(r.length===i+1)throw new Error("Invalid escape character at the end.");t=r[++i]}else if(t===" "&&!n){o=!0;continue}else if(t==='"'){n=!n;continue}o?(e.push(t),o=!1):e[e.length-1]+=t}if(n)throw new Error("Unterminated string");return e};const f=()=>process.env.NODE_OPTIONS?tokenizeArgs(process.env.NODE_OPTIONS):[];export function formatNodeOptions(r){return Object.entries(r).map(([e,n])=>n===!0?`--${e}`:n?`--${e}=${n.includes(" ")&&!n.startsWith('"')?JSON.stringify(n):n}`:null).filter(e=>e!==null).join(" ")}export function getParsedNodeOptionsWithoutInspect(){const r=f();if(r.length===0)return{};const e=l(r);return delete e.inspect,delete e["inspect-brk"],delete e.inspect_brk,e}export function getFormattedNodeOptionsWithoutInspect(){const r=getParsedNodeOptionsWithoutInspect();return Object.keys(r).length===0?"":formatNodeOptions(r)}export async function getRegistry(r){const e=g(r),n=await s(e),o=n==="npm"?"--no-workspaces":"";let i="https://registry.npmjs.org/";try{const t=a(`${n} config get registry ${o}`,{env:{...process.env,NODE_OPTIONS:getFormattedNodeOptionsWithoutInspect()}}).toString().trim();t.startsWith("http")&&(i=t.endsWith("/")?t:`${t}/`)}catch(t){throw new Error(`Failed to get registry from "${n}".`,{cause:t})}return i}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.importModule = importModule;
7
+ exports.resolve = resolve;
8
+ exports.resolvePackage = resolvePackage;
9
+ exports.resolvePackageSync = resolvePackageSync;
10
+ exports.resolveSafe = resolveSafe;
11
+ exports.resolveSafeSync = resolveSafeSync;
12
+ exports.resolveSync = resolveSync;
13
+ var _correctPath = require("@stryke/path/correct-path");
14
+ var _filePathFns = require("@stryke/path/file-path-fns");
15
+ var _joinPaths = require("@stryke/path/join-paths");
16
+ var _mlly = require("mlly");
17
+ var _getWorkspaceRoot = require("./get-workspace-root.cjs");
18
+ async function resolve(r, e = {}) {
19
+ const t = e.paths ?? [];
20
+ t.length === 0 && t.push(process.cwd());
21
+ const n = (0, _getWorkspaceRoot.getWorkspaceRoot)();
22
+ return t.includes(n) || t.push(n), (0, _correctPath.correctPath)(await (0, _mlly.resolvePath)(r, {
23
+ url: t
24
+ }));
25
+ }
26
+ function resolveSync(r, e = {}) {
27
+ const t = e.paths ?? [];
28
+ t.length === 0 && t.push(process.cwd());
29
+ const n = (0, _getWorkspaceRoot.getWorkspaceRoot)();
30
+ return t.includes(n) || t.push(n), (0, _correctPath.correctPath)((0, _mlly.resolvePathSync)(r, {
31
+ url: e.paths
32
+ }));
33
+ }
34
+ async function resolveSafe(r, e = {}) {
35
+ try {
36
+ return await resolve(r, e);
37
+ } catch {
38
+ return;
39
+ }
40
+ }
41
+ function resolveSafeSync(r, e = {}) {
42
+ try {
43
+ return resolveSync(r, e);
44
+ } catch {
45
+ return;
46
+ }
47
+ }
48
+ async function importModule(r) {
49
+ const e = await Promise.resolve(`${r}`).then(s => require(s));
50
+ return e && (0, _mlly.interopDefault)(e);
51
+ }
52
+ async function resolvePackage(r, e = {}) {
53
+ let t = await resolveSafe((0, _joinPaths.joinPaths)(r, "package.json"), e);
54
+ return t || (t = await resolveSafe((0, _joinPaths.joinPaths)(r, "index.js"), e), t || (t = await resolveSafe(r, e))), t ? (0, _filePathFns.findFilePath)(t) : void 0;
55
+ }
56
+ function resolvePackageSync(r, e = {}) {
57
+ let t = resolveSafeSync((0, _joinPaths.joinPaths)(r, "package.json"), e);
58
+ return t || (t = resolveSafeSync((0, _joinPaths.joinPaths)(r, "index.js"), e), t || (t = resolveSafeSync(r, e))), t ? (0, _filePathFns.findFilePath)(t) : void 0;
59
+ }
@@ -0,0 +1,71 @@
1
+ import type { Platform } from "@stryke/types/system";
2
+ export interface PackageResolvingOptions {
3
+ /**
4
+ * Paths to resolve the package from
5
+ */
6
+ paths?: string[];
7
+ /**
8
+ * Resolve path as linux (stand-in for unix/posix) or win32
9
+ */
10
+ platform?: Platform;
11
+ }
12
+ /**
13
+ * Resolve the path to a specified module
14
+ *
15
+ * @param path - The path to the module
16
+ * @param options - The options to use when resolving the module
17
+ * @returns A promise for the path to the module
18
+ */
19
+ export declare function resolve(path: string, options?: PackageResolvingOptions): Promise<any>;
20
+ /**
21
+ * Resolve the path to a specified module
22
+ *
23
+ * @param path - The path to the module
24
+ * @param options - The options to use when resolving the module
25
+ * @returns The path to the module or undefined
26
+ */
27
+ export declare function resolveSync(path: string, options?: PackageResolvingOptions): any;
28
+ /**
29
+ * Resolve the path to a specified module with error handling
30
+ *
31
+ * @param name - The name of the module
32
+ * @param options - The options to use when resolving the module
33
+ * @returns A promise for the path to the module
34
+ */
35
+ export declare function resolveSafe(name: string, options?: PackageResolvingOptions): Promise<any>;
36
+ /**
37
+ * Resolve the path to a specified module with error handling
38
+ *
39
+ * @param name - The name of the module
40
+ * @param options - The options to use when resolving the module
41
+ * @returns The path to the module or undefined
42
+ */
43
+ export declare function resolveSafeSync(name: string, options?: PackageResolvingOptions): any;
44
+ /**
45
+ * Import a module from a specified path
46
+ *
47
+ * @param path - The path to the module
48
+ * @returns The module
49
+ */
50
+ export declare function importModule<T = any>(path: string): Promise<T>;
51
+ /**
52
+ * Resolve the path to a specified package asynchronously
53
+ *
54
+ * @remarks
55
+ * This path points to the root of the package, which is usually the directory containing the `package.json` file. Please note: this path does not include the `package.json` file itself.
56
+ *
57
+ * @param name - The name of the module
58
+ * @returns A promise for the module or undefined
59
+ */
60
+ export declare function resolvePackage(name: string, options?: PackageResolvingOptions): Promise<any>;
61
+ /**
62
+ * Resolve the path to a specified package synchronously
63
+ *
64
+ * @remarks
65
+ * This path points to the root of the package, which is usually the directory containing the `package.json` file. Please note: this path does not include the `package.json` file itself.
66
+ *
67
+ * @param name - The name of the module
68
+ * @param options - The options to use when resolving the module
69
+ * @returns The module or undefined
70
+ */
71
+ export declare function resolvePackageSync(name: string, options?: PackageResolvingOptions): any;
@@ -0,0 +1 @@
1
+ import{correctPath as s}from"@stryke/path/correct-path";import{findFilePath as i}from"@stryke/path/file-path-fns";import{joinPaths as o}from"@stryke/path/join-paths";import{interopDefault as c,resolvePath as p,resolvePathSync as f}from"mlly";import{getWorkspaceRoot as a}from"./get-workspace-root";export async function resolve(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(await p(r,{url:t}))}export function resolveSync(r,e={}){const t=e.paths??[];t.length===0&&t.push(process.cwd());const n=a();return t.includes(n)||t.push(n),s(f(r,{url:e.paths}))}export async function resolveSafe(r,e={}){try{return await resolve(r,e)}catch{return}}export function resolveSafeSync(r,e={}){try{return resolveSync(r,e)}catch{return}}export async function importModule(r){const e=await import(r);return e&&c(e)}export async function resolvePackage(r,e={}){let t=await resolveSafe(o(r,"package.json"),e);return t||(t=await resolveSafe(o(r,"index.js"),e),t||(t=await resolveSafe(r,e))),t?i(t):void 0}export function resolvePackageSync(r,e={}){let t=resolveSafeSync(o(r,"package.json"),e);return t||(t=resolveSafeSync(o(r,"index.js"),e),t||(t=resolveSafeSync(r,e))),t?i(t):void 0}
package/dist/tsconfig.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.loadTsConfig = loadTsConfig;
7
- var _exists = require("@stryke/path/exists");
8
7
  var _filePathFns = require("@stryke/path/file-path-fns");
9
8
  var _joinPaths = require("@stryke/path/join-paths");
10
9
  var _defu = _interopRequireDefault(require("defu"));
11
10
  var _mlly = require("mlly");
11
+ var _exists = require("./exists.cjs");
12
12
  var _json = require("./json.cjs");
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  async function loadTsConfig(e = process.cwd()) {
package/dist/tsconfig.mjs CHANGED
@@ -1 +1 @@
1
- import{existsSync as i}from"@stryke/path/exists";import{findFilePath as r}from"@stryke/path/file-path-fns";import{joinPaths as t}from"@stryke/path/join-paths";import a from"defu";import{resolvePath as p}from"mlly";import{readJsonFile as c}from"./json";export async function loadTsConfig(e=process.cwd()){let s=e.endsWith(".json")?e:t(e,"tsconfig.json");if(!i(s)&&(s=await p(e,{url:import.meta.url}),!i(s)))throw new Error(`tsconfig.json not found at ${s}. Please ensure the file exists.`);let o=await c(s);if(o?.compilerOptions?.baseUrl&&(o.compilerOptions.baseUrl=t(r(s),o.compilerOptions.baseUrl)),o?.extends){const f=Array.isArray(o.extends)?o.extends:[o.extends];for(const m of f){const n=await loadTsConfig(t(r(s),m));n&&(o=a(o,n??{}))}}return o.extends=void 0,o}
1
+ import{findFilePath as i}from"@stryke/path/file-path-fns";import{joinPaths as t}from"@stryke/path/join-paths";import a from"defu";import{resolvePath as p}from"mlly";import{existsSync as r}from"./exists";import{readJsonFile as c}from"./json";export async function loadTsConfig(e=process.cwd()){let s=e.endsWith(".json")?e:t(e,"tsconfig.json");if(!r(s)&&(s=await p(e,{url:import.meta.url}),!r(s)))throw new Error(`tsconfig.json not found at ${s}. Please ensure the file exists.`);let o=await c(s);if(o?.compilerOptions?.baseUrl&&(o.compilerOptions.baseUrl=t(i(s),o.compilerOptions.baseUrl)),o?.extends){const f=Array.isArray(o.extends)?o.extends:[o.extends];for(const m of f){const n=await loadTsConfig(t(i(s),m));n&&(o=a(o,n??{}))}}return o.extends=void 0,o}
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.writeFileSync = exports.writeFile = void 0;
7
7
  var _correctPath = require("@stryke/path/correct-path");
8
- var _exists = require("@stryke/path/exists");
9
8
  var _filePathFns = require("@stryke/path/file-path-fns");
10
9
  var _nodeFs = require("node:fs");
11
10
  var _promises = require("node:fs/promises");
11
+ var _exists = require("./exists.cjs");
12
12
  var _helpers = require("./helpers.cjs");
13
13
  const writeFileSync = (e, t = "", o = {}) => {
14
14
  if (!e) throw new Error("No file path provided to write data");
@@ -1 +1 @@
1
- import{correctPath as i}from"@stryke/path/correct-path";import{existsSync as n}from"@stryke/path/exists";import{findFilePath as c}from"@stryke/path/file-path-fns";import{writeFileSync as s}from"node:fs";import{writeFile as d}from"node:fs/promises";import{createDirectory as p,createDirectorySync as a}from"./helpers";export const writeFileSync=(e,t="",o={})=>{if(!e)throw new Error("No file path provided to write data");const r=c(i(e));if(!n(r))if(o.createDirectory!==!1)a(r);else throw new Error(`Directory ${r} does not exist`);s(e,t||"",o)},writeFile=async(e,t="",o={})=>{if(!e)throw new Error("No file path provided to read data");const r=c(i(e));if(!n(r))if(o.createDirectory!==!1)await p(r);else throw new Error(`Directory ${r} does not exist`);return d(e,t||"",o)};
1
+ import{correctPath as i}from"@stryke/path/correct-path";import{findFilePath as n}from"@stryke/path/file-path-fns";import{writeFileSync as s}from"node:fs";import{writeFile as d}from"node:fs/promises";import{existsSync as c}from"./exists";import{createDirectory as p,createDirectorySync as a}from"./helpers";export const writeFileSync=(e,t="",o={})=>{if(!e)throw new Error("No file path provided to write data");const r=n(i(e));if(!c(r))if(o.createDirectory!==!1)a(r);else throw new Error(`Directory ${r} does not exist`);s(e,t||"",o)},writeFile=async(e,t="",o={})=>{if(!e)throw new Error("No file path provided to read data");const r=n(i(e));if(!c(r))if(o.createDirectory!==!1)await p(r);else throw new Error(`Directory ${r} does not exist`);return d(e,t||"",o)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/fs",
3
- "version": "0.24.2",
3
+ "version": "0.26.0",
4
4
  "type": "module",
5
5
  "description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
6
6
  "repository": {
@@ -9,13 +9,14 @@
9
9
  "directory": "packages/fs"
10
10
  },
11
11
  "private": false,
12
- "peerDependencies": { "nx": "21.3.10" },
12
+ "peerDependencies": { "nx": "^21.4.1" },
13
13
  "peerDependenciesMeta": { "nx": { "optional": true } },
14
14
  "dependencies": {
15
15
  "@antfu/install-pkg": "^1.0.0",
16
16
  "@ltd/j-toml": "^1.38.0",
17
+ "@storm-software/config-tools": "latest",
17
18
  "@stryke/convert": "^0.3.1",
18
- "@stryke/path": "^0.12.5",
19
+ "@stryke/path": "^0.13.0",
19
20
  "@stryke/string-format": "^0.10.0",
20
21
  "@zkochan/js-yaml": "^0.0.7",
21
22
  "chalk": "^5.4.1",
@@ -31,7 +32,7 @@
31
32
  "devDependencies": {
32
33
  "@types/node": "^22.14.0",
33
34
  "@types/semver": "^7.5.8",
34
- "nx": "21.3.10",
35
+ "nx": "^21.4.1",
35
36
  "tinyexec": "^0.3.2"
36
37
  },
37
38
  "publishConfig": { "access": "public" },
@@ -130,6 +131,20 @@
130
131
  "default": "./dist/semver-fns.mjs"
131
132
  }
132
133
  },
134
+ "./resolve": {
135
+ "import": {
136
+ "types": "./dist/resolve.d.ts",
137
+ "default": "./dist/resolve.mjs"
138
+ },
139
+ "require": {
140
+ "types": "./dist/resolve.d.ts",
141
+ "default": "./dist/resolve.cjs"
142
+ },
143
+ "default": {
144
+ "types": "./dist/resolve.d.ts",
145
+ "default": "./dist/resolve.mjs"
146
+ }
147
+ },
133
148
  "./remove-file": {
134
149
  "import": {
135
150
  "types": "./dist/remove-file.d.ts",
@@ -241,6 +256,34 @@
241
256
  "default": "./dist/helpers.mjs"
242
257
  }
243
258
  },
259
+ "./get-workspace-root": {
260
+ "import": {
261
+ "types": "./dist/get-workspace-root.d.ts",
262
+ "default": "./dist/get-workspace-root.mjs"
263
+ },
264
+ "require": {
265
+ "types": "./dist/get-workspace-root.d.ts",
266
+ "default": "./dist/get-workspace-root.cjs"
267
+ },
268
+ "default": {
269
+ "types": "./dist/get-workspace-root.d.ts",
270
+ "default": "./dist/get-workspace-root.mjs"
271
+ }
272
+ },
273
+ "./exists": {
274
+ "import": {
275
+ "types": "./dist/exists.d.ts",
276
+ "default": "./dist/exists.mjs"
277
+ },
278
+ "require": {
279
+ "types": "./dist/exists.d.ts",
280
+ "default": "./dist/exists.cjs"
281
+ },
282
+ "default": {
283
+ "types": "./dist/exists.d.ts",
284
+ "default": "./dist/exists.mjs"
285
+ }
286
+ },
244
287
  "./copy-file": {
245
288
  "import": {
246
289
  "types": "./dist/copy-file.d.ts",
@@ -338,5 +381,5 @@
338
381
  "main": "./dist/index.cjs",
339
382
  "module": "./dist/index.mjs",
340
383
  "types": "./dist/index.d.ts",
341
- "gitHead": "6d49c50f150faf90973f0dce1af515553599f3e1"
384
+ "gitHead": "dc317cbe47e06f3b3f7887b9176087c3de488853"
342
385
  }