@praxis.guard/auditor-cli 0.0.28 → 0.0.29
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/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxis.guard/auditor-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"lint": "eslint .",
|
|
22
23
|
"typecheck": "tsc -p tsconfig.json",
|
|
24
|
+
"pretest": "pnpm run build",
|
|
23
25
|
"test": "node --import tsx/esm --test src/**/*.test.ts",
|
|
24
26
|
"mcp:dev": "tsx src/cli.ts mcp",
|
|
25
27
|
"prepack": "pnpm run build && node scripts/prepare-package.cjs",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function detectFirebaseProjectId(cwd: string): string | null;
|
|
2
|
-
/**
|
|
3
|
-
* Resolve a Firebase Hosting site id for a given target (e.g. target "app" -> site "praxis-app-33b40").
|
|
4
|
-
* This reads `.firebaserc` and finds the first site configured for that hosting target.
|
|
5
|
-
*/
|
|
6
|
-
export declare function detectHostingSiteId(cwd: string, projectId: string, hostingTarget: string): string | null;
|
|
7
|
-
//# sourceMappingURL=firebase-targets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firebase-targets.d.ts","sourceRoot":"","sources":["../../src/cli/firebase-targets.ts"],"names":[],"mappings":"AAoBA,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWlE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYxG"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
function findFirebaserc(startDir) {
|
|
4
|
-
let dir = startDir;
|
|
5
|
-
for (let i = 0; i < 10; i++) {
|
|
6
|
-
const p = path.join(dir, ".firebaserc");
|
|
7
|
-
if (fs.existsSync(p))
|
|
8
|
-
return p;
|
|
9
|
-
const parent = path.dirname(dir);
|
|
10
|
-
if (parent === dir)
|
|
11
|
-
break;
|
|
12
|
-
dir = parent;
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
export function detectFirebaseProjectId(cwd) {
|
|
17
|
-
const rcPath = findFirebaserc(cwd);
|
|
18
|
-
if (!rcPath)
|
|
19
|
-
return null;
|
|
20
|
-
try {
|
|
21
|
-
const raw = fs.readFileSync(rcPath, "utf8");
|
|
22
|
-
const data = JSON.parse(raw);
|
|
23
|
-
const project = data?.projects?.default;
|
|
24
|
-
return typeof project === "string" && project.length > 0 ? project : null;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Resolve a Firebase Hosting site id for a given target (e.g. target "app" -> site "praxis-app-33b40").
|
|
32
|
-
* This reads `.firebaserc` and finds the first site configured for that hosting target.
|
|
33
|
-
*/
|
|
34
|
-
export function detectHostingSiteId(cwd, projectId, hostingTarget) {
|
|
35
|
-
const rcPath = findFirebaserc(cwd);
|
|
36
|
-
if (!rcPath)
|
|
37
|
-
return null;
|
|
38
|
-
try {
|
|
39
|
-
const raw = fs.readFileSync(rcPath, "utf8");
|
|
40
|
-
const data = JSON.parse(raw);
|
|
41
|
-
const sites = data?.targets?.[projectId]?.hosting?.[hostingTarget];
|
|
42
|
-
const site = Array.isArray(sites) ? sites[0] : null;
|
|
43
|
-
return typeof site === "string" && site.length > 0 ? site : null;
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=firebase-targets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firebase-targets.js","sourceRoot":"","sources":["../../src/cli/firebase-targets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACxC,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAW;IACjD,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAe,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;QACxC,OAAO,OAAO,OAAO,KAA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