@prism-d1/cli 1.0.19 → 1.0.20
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/dist/src/utils/root.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Finds the repository root by walking up from the current file
|
|
3
3
|
* looking for prism-cli.sh (a known root marker).
|
|
4
4
|
* Works from both source (cli/src/...) and compiled (cli/dist/src/...) paths.
|
|
5
|
+
* When installed globally via npm, falls back to walking up from cwd.
|
|
5
6
|
*/
|
|
6
7
|
export declare function getRepoRoot(importMetaUrl: string): string;
|
|
7
8
|
//# sourceMappingURL=root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../src/utils/root.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../src/utils/root.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAmBzD"}
|
package/dist/src/utils/root.js
CHANGED
|
@@ -5,8 +5,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
* Finds the repository root by walking up from the current file
|
|
6
6
|
* looking for prism-cli.sh (a known root marker).
|
|
7
7
|
* Works from both source (cli/src/...) and compiled (cli/dist/src/...) paths.
|
|
8
|
+
* When installed globally via npm, falls back to walking up from cwd.
|
|
8
9
|
*/
|
|
9
10
|
export function getRepoRoot(importMetaUrl) {
|
|
11
|
+
// First try walking up from the script location (works in source checkout)
|
|
10
12
|
let dir = dirname(fileURLToPath(importMetaUrl));
|
|
11
13
|
for (let i = 0; i < 10; i++) {
|
|
12
14
|
if (existsSync(resolve(dir, 'prism-cli.sh'))) {
|
|
@@ -14,7 +16,15 @@ export function getRepoRoot(importMetaUrl) {
|
|
|
14
16
|
}
|
|
15
17
|
dir = resolve(dir, '..');
|
|
16
18
|
}
|
|
17
|
-
// When installed via npm,
|
|
18
|
-
|
|
19
|
+
// When installed via npm, walk up from cwd instead
|
|
20
|
+
dir = process.cwd();
|
|
21
|
+
for (let i = 0; i < 10; i++) {
|
|
22
|
+
if (existsSync(resolve(dir, 'prism-cli.sh'))) {
|
|
23
|
+
return dir;
|
|
24
|
+
}
|
|
25
|
+
dir = resolve(dir, '..');
|
|
26
|
+
}
|
|
27
|
+
// Final fallback: cwd itself (user should be in the repo)
|
|
28
|
+
return process.cwd();
|
|
19
29
|
}
|
|
20
30
|
//# sourceMappingURL=root.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../../src/utils/root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../../src/utils/root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB;IAC/C,2EAA2E;IAC3E,IAAI,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,GA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