@fastkit/plugboy 0.3.0 → 1.0.0-next.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.
- package/README.md +8 -5
- package/dist/cli.d.mts +5 -0
- package/dist/cli.mjs +33 -129
- package/dist/cli.mjs.map +1 -1
- package/dist/combine-rules-CWp-M491.mjs +66 -0
- package/dist/combine-rules-CWp-M491.mjs.map +1 -0
- package/dist/dependencies/bundle-require.d.mts +1 -0
- package/dist/dependencies/bundle-require.mjs +3 -3
- package/dist/dependencies/cac.d.mts +1 -0
- package/dist/dependencies/cac.mjs +3 -3
- package/dist/dependencies/glob.d.mts +1 -0
- package/dist/dependencies/glob.mjs +3 -3
- package/dist/dependencies/inquirer.d.mts +1 -0
- package/dist/dependencies/inquirer.mjs +3 -3
- package/dist/dependencies/pkg-types.d.mts +1 -0
- package/dist/dependencies/pkg-types.mjs +3 -3
- package/dist/dependencies/sort-package-json.d.mts +2 -0
- package/dist/dependencies/sort-package-json.mjs +5 -4
- package/dist/dependencies/sort-package-json.mjs.map +1 -1
- package/dist/dependencies/tsdown.d.mts +1 -0
- package/dist/dependencies/tsdown.mjs +3 -0
- package/dist/optimize-layer-CK8NR_VC.mjs +58 -0
- package/dist/optimize-layer-CK8NR_VC.mjs.map +1 -0
- package/dist/optimize-media-Bxy27Cj7.mjs +86 -0
- package/dist/optimize-media-Bxy27Cj7.mjs.map +1 -0
- package/dist/plugboy.d.mts +6284 -0
- package/dist/plugboy.mjs +3 -103
- package/dist/runtime-utils.d.mts +28 -0
- package/dist/runtime-utils.mjs +94 -0
- package/dist/runtime-utils.mjs.map +1 -0
- package/dist/workspace-BqcryYAT.mjs +1391 -0
- package/dist/workspace-BqcryYAT.mjs.map +1 -0
- package/env.d.ts +0 -18
- package/package.json +15 -12
- package/dist/chunk-IDJLTVUE.mjs +0 -1619
- package/dist/chunk-IDJLTVUE.mjs.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/combine-rules-2CRG6D4B.mjs +0 -69
- package/dist/combine-rules-2CRG6D4B.mjs.map +0 -1
- package/dist/dependencies/bundle-require.d.ts +0 -7
- package/dist/dependencies/bundle-require.mjs.map +0 -1
- package/dist/dependencies/cac.d.ts +0 -1
- package/dist/dependencies/cac.mjs.map +0 -1
- package/dist/dependencies/esbuild.d.ts +0 -1
- package/dist/dependencies/esbuild.mjs +0 -3
- package/dist/dependencies/esbuild.mjs.map +0 -1
- package/dist/dependencies/glob.d.ts +0 -1
- package/dist/dependencies/glob.mjs.map +0 -1
- package/dist/dependencies/inquirer.d.ts +0 -1
- package/dist/dependencies/inquirer.mjs.map +0 -1
- package/dist/dependencies/pkg-types.d.ts +0 -1
- package/dist/dependencies/pkg-types.mjs.map +0 -1
- package/dist/dependencies/sort-package-json.d.ts +0 -2
- package/dist/dependencies/tsup.d.ts +0 -1
- package/dist/dependencies/tsup.mjs +0 -3
- package/dist/dependencies/tsup.mjs.map +0 -1
- package/dist/optimize-layer-Q35C25P4.mjs +0 -61
- package/dist/optimize-layer-Q35C25P4.mjs.map +0 -1
- package/dist/optimize-media-ZZWDHLLV.mjs +0 -99
- package/dist/optimize-media-ZZWDHLLV.mjs.map +0 -1
- package/dist/plugboy.d.ts +0 -777
- package/dist/plugboy.mjs.map +0 -1
package/dist/plugboy.mjs
CHANGED
|
@@ -1,103 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Path,
|
|
5
|
-
PlugboyProject,
|
|
6
|
-
PlugboyWorkspace,
|
|
7
|
-
TSUP_SYNC_OPTIONS,
|
|
8
|
-
WORKSPACE_PACKAGE_SYNC_FIELDS,
|
|
9
|
-
WORKSPACE_REQUIRED_FIELDS,
|
|
10
|
-
buildHooks,
|
|
11
|
-
copyDirSync,
|
|
12
|
-
createHooksDefaults,
|
|
13
|
-
definePlugin,
|
|
14
|
-
defineProjectConfig,
|
|
15
|
-
defineWorkspaceConfig,
|
|
16
|
-
exposeEntries,
|
|
17
|
-
extractProjectPlugins,
|
|
18
|
-
findConfig,
|
|
19
|
-
findFile,
|
|
20
|
-
findProjectPlugin,
|
|
21
|
-
findWorkspacePackages,
|
|
22
|
-
generateWorkspace,
|
|
23
|
-
getDirname,
|
|
24
|
-
getFilename,
|
|
25
|
-
getProject,
|
|
26
|
-
getProjectPackageJson,
|
|
27
|
-
getWorkspace,
|
|
28
|
-
getWorkspacePackageJson,
|
|
29
|
-
isFileNotFoundException,
|
|
30
|
-
isProjectPackageJson,
|
|
31
|
-
isPromise,
|
|
32
|
-
isWorkspacePackageJson,
|
|
33
|
-
loadProjectConfig,
|
|
34
|
-
loadWorkspaceConfig,
|
|
35
|
-
mergeDTSSettingsList,
|
|
36
|
-
normalizeDTSPreserveTypeSettings,
|
|
37
|
-
normalizeDTSPreserveTypeTarget,
|
|
38
|
-
normalizeDTSSettings,
|
|
39
|
-
pathExists,
|
|
40
|
-
resolveListable,
|
|
41
|
-
resolveOptimizeCSSOptions,
|
|
42
|
-
resolveRawExposeEntriesSettings,
|
|
43
|
-
resolveRawWorkspaceEntries,
|
|
44
|
-
resolveRawWorkspaceEntry,
|
|
45
|
-
resolveUserHooks,
|
|
46
|
-
resolveUserPluginOptions,
|
|
47
|
-
resolveUserProjectConfig,
|
|
48
|
-
resolveUserWorkspaceConfig,
|
|
49
|
-
rmrf,
|
|
50
|
-
syncWorkspacePackageFields
|
|
51
|
-
} from "./chunk-IDJLTVUE.mjs";
|
|
52
|
-
export {
|
|
53
|
-
Builder,
|
|
54
|
-
PROJECT_REQUIRED_FIELDS,
|
|
55
|
-
Path,
|
|
56
|
-
PlugboyProject,
|
|
57
|
-
PlugboyWorkspace,
|
|
58
|
-
TSUP_SYNC_OPTIONS,
|
|
59
|
-
WORKSPACE_PACKAGE_SYNC_FIELDS,
|
|
60
|
-
WORKSPACE_REQUIRED_FIELDS,
|
|
61
|
-
buildHooks,
|
|
62
|
-
copyDirSync,
|
|
63
|
-
createHooksDefaults,
|
|
64
|
-
definePlugin,
|
|
65
|
-
defineProjectConfig,
|
|
66
|
-
defineWorkspaceConfig,
|
|
67
|
-
exposeEntries,
|
|
68
|
-
extractProjectPlugins,
|
|
69
|
-
findConfig,
|
|
70
|
-
findFile,
|
|
71
|
-
findProjectPlugin,
|
|
72
|
-
findWorkspacePackages,
|
|
73
|
-
generateWorkspace,
|
|
74
|
-
getDirname,
|
|
75
|
-
getFilename,
|
|
76
|
-
getProject,
|
|
77
|
-
getProjectPackageJson,
|
|
78
|
-
getWorkspace,
|
|
79
|
-
getWorkspacePackageJson,
|
|
80
|
-
isFileNotFoundException,
|
|
81
|
-
isProjectPackageJson,
|
|
82
|
-
isPromise,
|
|
83
|
-
isWorkspacePackageJson,
|
|
84
|
-
loadProjectConfig,
|
|
85
|
-
loadWorkspaceConfig,
|
|
86
|
-
mergeDTSSettingsList,
|
|
87
|
-
normalizeDTSPreserveTypeSettings,
|
|
88
|
-
normalizeDTSPreserveTypeTarget,
|
|
89
|
-
normalizeDTSSettings,
|
|
90
|
-
pathExists,
|
|
91
|
-
resolveListable,
|
|
92
|
-
resolveOptimizeCSSOptions,
|
|
93
|
-
resolveRawExposeEntriesSettings,
|
|
94
|
-
resolveRawWorkspaceEntries,
|
|
95
|
-
resolveRawWorkspaceEntry,
|
|
96
|
-
resolveUserHooks,
|
|
97
|
-
resolveUserPluginOptions,
|
|
98
|
-
resolveUserProjectConfig,
|
|
99
|
-
resolveUserWorkspaceConfig,
|
|
100
|
-
rmrf,
|
|
101
|
-
syncWorkspacePackageFields
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=plugboy.mjs.map
|
|
1
|
+
import { $ as normalizeDTSSettings, A as resolveRawExposeEntriesSettings, B as exitHook, C as findProjectPlugin, D as loadProjectConfig, E as isProjectPackageJson, F as getFilename, G as resolveListable, H as mergeExternals, I as isFileNotFoundException, J as WORKSPACE_REQUIRED_FIELDS, K as PROJECT_REQUIRED_FIELDS, L as pathExists, M as findConfig, N as findFile, O as resolveUserProjectConfig, P as getDirname, Q as normalizeDTSPreserveTypeTarget, R as rmrf, S as extractProjectPlugins, T as defineProjectConfig, U as mergeNoExternals, V as mergeChunkAddons, W as isPromise, X as mergeDTSSettingsList, Y as resolveOptimizeCSSOptions, Z as normalizeDTSPreserveTypeSettings, _ as loadWorkspaceConfig, a as syncWorkspacePackageFields, b as resolveUserWorkspaceConfig, c as Builder, d as getWorkspacePackageJson, et as createHooksDefaults, f as Path, g as isWorkspacePackageJson, h as defineWorkspaceConfig, i as getWorkspace, j as copyDirSync, k as exposeEntries, l as findWorkspacePackages, m as resolveUserHooks, n as PlugboyWorkspace, o as PlugboyProject, p as buildHooks, q as TSDOWN_SYNC_OPTIONS, r as WORKSPACE_PACKAGE_SYNC_FIELDS, s as getProject, t as generateWorkspace, u as getProjectPackageJson, v as resolveRawWorkspaceEntries, w as resolveUserPluginOption, x as definePlugin, y as resolveRawWorkspaceEntry, z as writeFileAtomic } from "./workspace-BqcryYAT.mjs";
|
|
2
|
+
|
|
3
|
+
export { Builder, PROJECT_REQUIRED_FIELDS, Path, PlugboyProject, PlugboyWorkspace, TSDOWN_SYNC_OPTIONS, WORKSPACE_PACKAGE_SYNC_FIELDS, WORKSPACE_REQUIRED_FIELDS, buildHooks, copyDirSync, createHooksDefaults, definePlugin, defineProjectConfig, defineWorkspaceConfig, exitHook, exposeEntries, extractProjectPlugins, findConfig, findFile, findProjectPlugin, findWorkspacePackages, generateWorkspace, getDirname, getFilename, getProject, getProjectPackageJson, getWorkspace, getWorkspacePackageJson, isFileNotFoundException, isProjectPackageJson, isPromise, isWorkspacePackageJson, loadProjectConfig, loadWorkspaceConfig, mergeChunkAddons, mergeDTSSettingsList, mergeExternals, mergeNoExternals, normalizeDTSPreserveTypeSettings, normalizeDTSPreserveTypeTarget, normalizeDTSSettings, pathExists, resolveListable, resolveOptimizeCSSOptions, resolveRawExposeEntriesSettings, resolveRawWorkspaceEntries, resolveRawWorkspaceEntry, resolveUserHooks, resolveUserPluginOption, resolveUserProjectConfig, resolveUserWorkspaceConfig, rmrf, syncWorkspacePackageFields, writeFileAtomic };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/runtime-utils/path.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns the absolute file path of the calling file.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.
|
|
6
|
+
* @returns {string} Absolute file path of the caller.
|
|
7
|
+
* @throws {CallerFileError} If the caller file cannot be determined.
|
|
8
|
+
*/
|
|
9
|
+
declare function getCallerFile(depth?: number): string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the absolute file path of the calling file.
|
|
12
|
+
*
|
|
13
|
+
* @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.
|
|
14
|
+
* @returns {string} Absolute file path of the caller.
|
|
15
|
+
* @throws {CallerFileError} If the caller file cannot be determined.
|
|
16
|
+
*/
|
|
17
|
+
declare function getCallerFilePath(depth?: number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the directory that contains the package.json
|
|
20
|
+
* associated with the specified import.meta.url.
|
|
21
|
+
*
|
|
22
|
+
* If no package.json is found while walking up the directory tree,
|
|
23
|
+
* an error will be thrown.
|
|
24
|
+
*/
|
|
25
|
+
declare function getPackageDir(callerFilePath?: string): Promise<string>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getCallerFile, getCallerFilePath, getPackageDir };
|
|
28
|
+
//# sourceMappingURL=runtime-utils.d.mts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { stat } from "node:fs/promises";
|
|
4
|
+
|
|
5
|
+
//#region src/runtime-utils/path.ts
|
|
6
|
+
/**
|
|
7
|
+
* Universal ESM function to get the file path of the caller.
|
|
8
|
+
* Works in Node.js, Deno, and Bun (native ESM environments).
|
|
9
|
+
*
|
|
10
|
+
* - Uses V8 structured stack traces when available (Node/Bun).
|
|
11
|
+
* - Falls back to string-based stack parsing when necessary (e.g., Deno).
|
|
12
|
+
* - Throws a descriptive error when the file path cannot be determined.
|
|
13
|
+
*/
|
|
14
|
+
var CallerFileError = class extends Error {
|
|
15
|
+
info;
|
|
16
|
+
constructor(message, info = {}) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = "CallerFileError";
|
|
19
|
+
this.info = info;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Returns the absolute file path of the calling file.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.
|
|
26
|
+
* @returns {string} Absolute file path of the caller.
|
|
27
|
+
* @throws {CallerFileError} If the caller file cannot be determined.
|
|
28
|
+
*/
|
|
29
|
+
function getCallerFile(depth = 1) {
|
|
30
|
+
if (typeof depth !== "number" || depth < 1) throw new CallerFileError("Invalid depth argument", { depth });
|
|
31
|
+
try {
|
|
32
|
+
const originalPrepare = Error.prepareStackTrace;
|
|
33
|
+
Error.prepareStackTrace = (_, structuredStackTrace) => structuredStackTrace;
|
|
34
|
+
const { stack } = /* @__PURE__ */ new Error();
|
|
35
|
+
Error.prepareStackTrace = originalPrepare;
|
|
36
|
+
if (Array.isArray(stack)) {
|
|
37
|
+
const frame = stack[depth];
|
|
38
|
+
if (frame && typeof frame.getFileName === "function") {
|
|
39
|
+
const file = frame.getFileName();
|
|
40
|
+
if (typeof file === "string") return file;
|
|
41
|
+
throw new CallerFileError("CallSite#getFileName() returned null", { frame });
|
|
42
|
+
} else throw new CallerFileError("Invalid or missing CallSite object", { frame });
|
|
43
|
+
} else throw new CallerFileError("Structured stack trace unavailable", { stack });
|
|
44
|
+
} catch (v8Error) {
|
|
45
|
+
try {
|
|
46
|
+
const stackStr = (/* @__PURE__ */ new Error()).stack;
|
|
47
|
+
if (typeof stackStr !== "string") throw new CallerFileError("Error.stack is not a string", { stack: stackStr });
|
|
48
|
+
const lines = stackStr.split("\n").map((l) => l.trim()).filter(Boolean);
|
|
49
|
+
const index = 1 + depth;
|
|
50
|
+
if (index >= lines.length) throw new CallerFileError("Stack trace too shallow", { lines });
|
|
51
|
+
const line = lines[index];
|
|
52
|
+
const match = line.match(/(file:\/\/[^\s)]+)/) || line.match(/(\/[^:\s)]+)(:\d+){0,2}/) || line.match(/([A-Za-z]:\\[^:\s)]+)(:\d+){0,2}/);
|
|
53
|
+
if (!match) throw new CallerFileError("No file path pattern found in stack line", { line });
|
|
54
|
+
const raw = match[1];
|
|
55
|
+
if (raw.startsWith("file://")) return new URL(raw).pathname;
|
|
56
|
+
return raw.replace(/:\d+(:\d+)?$/, "");
|
|
57
|
+
} catch (fallbackError) {
|
|
58
|
+
if (fallbackError instanceof CallerFileError) throw fallbackError;
|
|
59
|
+
throw new CallerFileError("Fallback stack parsing failed", { cause: fallbackError });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns the absolute file path of the calling file.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.
|
|
67
|
+
* @returns {string} Absolute file path of the caller.
|
|
68
|
+
* @throws {CallerFileError} If the caller file cannot be determined.
|
|
69
|
+
*/
|
|
70
|
+
function getCallerFilePath(depth = 1) {
|
|
71
|
+
const file = getCallerFile(depth + 1);
|
|
72
|
+
return file.startsWith("file:") ? fileURLToPath(file) : file;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the directory that contains the package.json
|
|
76
|
+
* associated with the specified import.meta.url.
|
|
77
|
+
*
|
|
78
|
+
* If no package.json is found while walking up the directory tree,
|
|
79
|
+
* an error will be thrown.
|
|
80
|
+
*/
|
|
81
|
+
async function getPackageDir(callerFilePath = getCallerFilePath()) {
|
|
82
|
+
let dir = dirname(callerFilePath);
|
|
83
|
+
while (true) {
|
|
84
|
+
if (await stat(join(dir, "package.json")).then(() => true).catch(() => false)) return dir;
|
|
85
|
+
const parent = dirname(dir);
|
|
86
|
+
if (parent === dir) break;
|
|
87
|
+
dir = parent;
|
|
88
|
+
}
|
|
89
|
+
throw new Error(`package.json not found for: ${callerFilePath}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { getCallerFile, getCallerFilePath, getPackageDir };
|
|
94
|
+
//# sourceMappingURL=runtime-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-utils.mjs","names":[],"sources":["../src/runtime-utils/path.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * Universal ESM function to get the file path of the caller.\n * Works in Node.js, Deno, and Bun (native ESM environments).\n *\n * - Uses V8 structured stack traces when available (Node/Bun).\n * - Falls back to string-based stack parsing when necessary (e.g., Deno).\n * - Throws a descriptive error when the file path cannot be determined.\n */\n\nclass CallerFileError extends Error {\n info: unknown;\n constructor(message: string, info: unknown = {}) {\n super(message);\n this.name = 'CallerFileError';\n this.info = info;\n }\n}\n\n/**\n * Returns the absolute file path of the calling file.\n *\n * @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.\n * @returns {string} Absolute file path of the caller.\n * @throws {CallerFileError} If the caller file cannot be determined.\n */\nexport function getCallerFile(depth = 1) {\n if (typeof depth !== 'number' || depth < 1) {\n throw new CallerFileError('Invalid depth argument', { depth });\n }\n\n // --- Primary method: V8 structured stack trace (Node.js / Bun) ---\n try {\n const originalPrepare = Error.prepareStackTrace;\n Error.prepareStackTrace = (_, structuredStackTrace) => structuredStackTrace;\n const err = new Error();\n const { stack } = err;\n Error.prepareStackTrace = originalPrepare;\n\n if (Array.isArray(stack)) {\n const frame = stack[depth];\n if (frame && typeof frame.getFileName === 'function') {\n const file = frame.getFileName();\n if (typeof file === 'string') return file;\n throw new CallerFileError('CallSite#getFileName() returned null', {\n frame,\n });\n } else {\n throw new CallerFileError('Invalid or missing CallSite object', {\n frame,\n });\n }\n } else {\n throw new CallerFileError('Structured stack trace unavailable', {\n stack,\n });\n }\n } catch (v8Error) {\n // --- Fallback: plain text stack parsing (Deno and others) ---\n try {\n const stackStr = new Error().stack;\n if (typeof stackStr !== 'string') {\n throw new CallerFileError('Error.stack is not a string', {\n stack: stackStr,\n });\n }\n\n const lines = stackStr\n .split('\\n')\n .map((l) => l.trim())\n .filter(Boolean);\n const index = 1 + depth;\n if (index >= lines.length) {\n throw new CallerFileError('Stack trace too shallow', { lines });\n }\n\n const line = lines[index];\n\n // Match file URLs or absolute paths\n const match =\n line.match(/(file:\\/\\/[^\\s)]+)/) ||\n line.match(/(\\/[^:\\s)]+)(:\\d+){0,2}/) ||\n line.match(/([A-Za-z]:\\\\[^:\\s)]+)(:\\d+){0,2}/);\n\n if (!match) {\n throw new CallerFileError('No file path pattern found in stack line', {\n line,\n });\n }\n\n const raw = match[1];\n if (raw.startsWith('file://')) {\n const url = new URL(raw);\n return url.pathname;\n }\n\n return raw.replace(/:\\d+(:\\d+)?$/, '');\n } catch (fallbackError) {\n if (fallbackError instanceof CallerFileError) throw fallbackError;\n throw new CallerFileError('Fallback stack parsing failed', {\n cause: fallbackError,\n });\n }\n }\n}\n\n/**\n * Returns the absolute file path of the calling file.\n *\n * @param {number} depth - 1 = immediate caller, 2 = caller's caller, etc.\n * @returns {string} Absolute file path of the caller.\n * @throws {CallerFileError} If the caller file cannot be determined.\n */\nexport function getCallerFilePath(depth = 1) {\n const file = getCallerFile(depth + 1);\n return file.startsWith('file:') ? fileURLToPath(file) : file;\n}\n\n/**\n * Returns the directory that contains the package.json\n * associated with the specified import.meta.url.\n *\n * If no package.json is found while walking up the directory tree,\n * an error will be thrown.\n */\nexport async function getPackageDir(\n callerFilePath = getCallerFilePath(),\n): Promise<string> {\n // const { stat } = await import('node:fs/promises');\n // const { join, dirname } = await import('node:path');\n // const { fileURLToPath } = await import('node:url');\n\n let dir = dirname(callerFilePath);\n\n while (true) {\n const pkgJson = join(dir, 'package.json');\n\n const exists = await stat(pkgJson)\n .then(() => true)\n .catch(() => false);\n if (exists) return dir;\n\n // Move to the parent directory\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n\n throw new Error(`package.json not found for: ${callerFilePath}`);\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAM,kBAAN,cAA8B,MAAM;CAClC;CACA,YAAY,SAAiB,OAAgB,EAAE,EAAE;AAC/C,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;;;;;;;;;;AAWhB,SAAgB,cAAc,QAAQ,GAAG;AACvC,KAAI,OAAO,UAAU,YAAY,QAAQ,EACvC,OAAM,IAAI,gBAAgB,0BAA0B,EAAE,OAAO,CAAC;AAIhE,KAAI;EACF,MAAM,kBAAkB,MAAM;AAC9B,QAAM,qBAAqB,GAAG,yBAAyB;EAEvD,MAAM,EAAE,0BADI,IAAI,OAAO;AAEvB,QAAM,oBAAoB;AAE1B,MAAI,MAAM,QAAQ,MAAM,EAAE;GACxB,MAAM,QAAQ,MAAM;AACpB,OAAI,SAAS,OAAO,MAAM,gBAAgB,YAAY;IACpD,MAAM,OAAO,MAAM,aAAa;AAChC,QAAI,OAAO,SAAS,SAAU,QAAO;AACrC,UAAM,IAAI,gBAAgB,wCAAwC,EAChE,OACD,CAAC;SAEF,OAAM,IAAI,gBAAgB,sCAAsC,EAC9D,OACD,CAAC;QAGJ,OAAM,IAAI,gBAAgB,sCAAsC,EAC9D,OACD,CAAC;UAEG,SAAS;AAEhB,MAAI;GACF,MAAM,4BAAW,IAAI,OAAO,EAAC;AAC7B,OAAI,OAAO,aAAa,SACtB,OAAM,IAAI,gBAAgB,+BAA+B,EACvD,OAAO,UACR,CAAC;GAGJ,MAAM,QAAQ,SACX,MAAM,KAAK,CACX,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ;GAClB,MAAM,QAAQ,IAAI;AAClB,OAAI,SAAS,MAAM,OACjB,OAAM,IAAI,gBAAgB,2BAA2B,EAAE,OAAO,CAAC;GAGjE,MAAM,OAAO,MAAM;GAGnB,MAAM,QACJ,KAAK,MAAM,qBAAqB,IAChC,KAAK,MAAM,0BAA0B,IACrC,KAAK,MAAM,mCAAmC;AAEhD,OAAI,CAAC,MACH,OAAM,IAAI,gBAAgB,4CAA4C,EACpE,MACD,CAAC;GAGJ,MAAM,MAAM,MAAM;AAClB,OAAI,IAAI,WAAW,UAAU,CAE3B,QADY,IAAI,IAAI,IAAI,CACb;AAGb,UAAO,IAAI,QAAQ,gBAAgB,GAAG;WAC/B,eAAe;AACtB,OAAI,yBAAyB,gBAAiB,OAAM;AACpD,SAAM,IAAI,gBAAgB,iCAAiC,EACzD,OAAO,eACR,CAAC;;;;;;;;;;;AAYR,SAAgB,kBAAkB,QAAQ,GAAG;CAC3C,MAAM,OAAO,cAAc,QAAQ,EAAE;AACrC,QAAO,KAAK,WAAW,QAAQ,GAAG,cAAc,KAAK,GAAG;;;;;;;;;AAU1D,eAAsB,cACpB,iBAAiB,mBAAmB,EACnB;CAKjB,IAAI,MAAM,QAAQ,eAAe;AAEjC,QAAO,MAAM;AAMX,MAHe,MAAM,KAFL,KAAK,KAAK,eAAe,CAEP,CAC/B,WAAW,KAAK,CAChB,YAAY,MAAM,CACT,QAAO;EAGnB,MAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,WAAW,IAAK;AACpB,QAAM;;AAGR,OAAM,IAAI,MAAM,+BAA+B,iBAAiB"}
|