@threejs-doctor/cli 0.1.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/LICENSE +21 -0
- package/bin/threejs-doctor.js +10 -0
- package/dist/cli.d.ts +18 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +70 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/bench.d.ts +4 -0
- package/dist/commands/bench.d.ts.map +1 -0
- package/dist/commands/bench.js +8 -0
- package/dist/commands/bench.js.map +1 -0
- package/dist/commands/ci.d.ts +2 -0
- package/dist/commands/ci.d.ts.map +1 -0
- package/dist/commands/ci.js +2 -0
- package/dist/commands/ci.js.map +1 -0
- package/dist/commands/scan.d.ts +10 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +13 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/report/human.d.ts +3 -0
- package/dist/report/human.d.ts.map +1 -0
- package/dist/report/human.js +39 -0
- package/dist/report/human.js.map +1 -0
- package/dist/report/json.d.ts +3 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/json.js +4 -0
- package/dist/report/json.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 codergeeta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DoctorReport } from '@threejs-doctor/runtime';
|
|
2
|
+
import type { Profile } from '@threejs-doctor/core';
|
|
3
|
+
export interface CliArgs {
|
|
4
|
+
command: 'scan' | 'bench' | 'ci' | 'help';
|
|
5
|
+
path: string;
|
|
6
|
+
format: 'human' | 'json';
|
|
7
|
+
profile: Profile;
|
|
8
|
+
budget: 'low' | 'mid' | 'high';
|
|
9
|
+
minScore: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CliDeps {
|
|
12
|
+
runScan: (args: CliArgs) => Promise<DoctorReport>;
|
|
13
|
+
runBench: (args: CliArgs) => Promise<DoctorReport>;
|
|
14
|
+
write: (text: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseArgs(argv: string[]): CliArgs;
|
|
17
|
+
export declare function main(argv?: string[], deps?: CliDeps): Promise<number>;
|
|
18
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAA;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IACjD,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAClD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAuBjD;AAED,wBAAsB,IAAI,CACxB,IAAI,GAAE,MAAM,EAA0B,EACtC,IAAI,CAAC,EAAE,OAAO,GACb,OAAO,CAAC,MAAM,CAAC,CAwCjB"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { formatHumanReport } from './report/human.js';
|
|
2
|
+
import { formatJsonReport } from './report/json.js';
|
|
3
|
+
export function parseArgs(argv) {
|
|
4
|
+
const args = {
|
|
5
|
+
command: 'help',
|
|
6
|
+
path: '.',
|
|
7
|
+
format: 'human',
|
|
8
|
+
profile: 'auto',
|
|
9
|
+
budget: 'low',
|
|
10
|
+
minScore: 70,
|
|
11
|
+
};
|
|
12
|
+
if (argv.length === 0)
|
|
13
|
+
return args;
|
|
14
|
+
const cmd = argv[0];
|
|
15
|
+
if (cmd === 'scan' || cmd === 'bench' || cmd === 'ci' || cmd === 'help') {
|
|
16
|
+
args.command = cmd;
|
|
17
|
+
}
|
|
18
|
+
if (cmd === 'scan' && argv[1] && !argv[1].startsWith('-'))
|
|
19
|
+
args.path = argv[1];
|
|
20
|
+
for (let i = 0; i < argv.length; i++) {
|
|
21
|
+
const a = argv[i];
|
|
22
|
+
if (a === '--format')
|
|
23
|
+
args.format = argv[++i] === 'json' ? 'json' : 'human';
|
|
24
|
+
if (a === '--profile')
|
|
25
|
+
args.profile = argv[++i];
|
|
26
|
+
if (a === '--budget')
|
|
27
|
+
args.budget = argv[++i] ?? 'low';
|
|
28
|
+
if (a === '--min-score')
|
|
29
|
+
args.minScore = Number(argv[++i]);
|
|
30
|
+
}
|
|
31
|
+
return args;
|
|
32
|
+
}
|
|
33
|
+
export async function main(argv = process.argv.slice(2), deps) {
|
|
34
|
+
const args = parseArgs(argv);
|
|
35
|
+
const write = deps?.write ?? ((t) => console.log(t));
|
|
36
|
+
if (args.command === 'help') {
|
|
37
|
+
write(`Usage:
|
|
38
|
+
npx threejs-doctor bench --profile <profile> --budget low [--format human|json]
|
|
39
|
+
npx @threejs-doctor/cli bench --profile <profile> --budget low
|
|
40
|
+
# scan / ci are not implemented (exit 1)`);
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
if (args.command === 'ci' && !Number.isFinite(args.minScore)) {
|
|
44
|
+
write('error: --min-score must be a finite number');
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
const runScan = deps?.runScan ?? (await import('./commands/scan.js')).runScan;
|
|
48
|
+
const runBench = deps?.runBench ?? (await import('./commands/bench.js')).runBench;
|
|
49
|
+
let report;
|
|
50
|
+
try {
|
|
51
|
+
report = args.command === 'bench' ? await runBench(args) : await runScan(args);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
55
|
+
const code = err && typeof err === 'object' && 'code' in err ? err.code : undefined;
|
|
56
|
+
if (code === 'SCAN_NOT_IMPLEMENTED' || message.toLowerCase().includes('not implemented')) {
|
|
57
|
+
write(message);
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
write(args.format === 'json' ? formatJsonReport(report) : formatHumanReport(report));
|
|
63
|
+
if (args.command === 'ci') {
|
|
64
|
+
const hasError = report.findings.some((f) => f.severity === 'error');
|
|
65
|
+
if (report.score < args.minScore || hasError || report.incomplete)
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAmBnD,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,IAAI,GAAY;QACpB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb,CAAA;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;QACxE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAA;IACpB,CAAC;IACD,IAAI,GAAG,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC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;IAEpF,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAA;QACpE,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,MAAM,CAAC,UAAU;YAAE,OAAO,CAAC,CAAA;IAC7E,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench.d.ts","sourceRoot":"","sources":["../../src/commands/bench.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,wBAAsB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAMnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench.js","sourceRoot":"","sources":["../../src/commands/bench.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAa;IAC1C,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAA;IAC/D,OAAO,aAAa,CAAC;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;QAC7D,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/commands/ci.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../../src/commands/ci.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CliArgs } from '../cli.js';
|
|
2
|
+
import type { DoctorReport } from '@threejs-doctor/runtime';
|
|
3
|
+
export declare const SCAN_NOT_IMPLEMENTED = "not implemented: threejs-doctor scan/ci is not a working gate. Static scan is a stub and must not be used as a score gate. Attach the runtime Doctor to a live Three.js scene until a real scanner exists.";
|
|
4
|
+
export declare class ScanNotImplementedError extends Error {
|
|
5
|
+
readonly code = "SCAN_NOT_IMPLEMENTED";
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
/** Static project scan is not implemented. Live scene attach is the runtime API. */
|
|
9
|
+
export declare function runScan(_args: CliArgs): Promise<DoctorReport>;
|
|
10
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,eAAO,MAAM,oBAAoB,+MAC6K,CAAA;AAE9M,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,0BAAyB;gBAC1B,OAAO,SAAuB;CAI3C;AAED,oFAAoF;AACpF,wBAAsB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAEnE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const SCAN_NOT_IMPLEMENTED = 'not implemented: threejs-doctor scan/ci is not a working gate. Static scan is a stub and must not be used as a score gate. Attach the runtime Doctor to a live Three.js scene until a real scanner exists.';
|
|
2
|
+
export class ScanNotImplementedError extends Error {
|
|
3
|
+
code = 'SCAN_NOT_IMPLEMENTED';
|
|
4
|
+
constructor(message = SCAN_NOT_IMPLEMENTED) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'ScanNotImplementedError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** Static project scan is not implemented. Live scene attach is the runtime API. */
|
|
10
|
+
export async function runScan(_args) {
|
|
11
|
+
throw new ScanNotImplementedError();
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,4MAA4M,CAAA;AAE9M,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,GAAG,sBAAsB,CAAA;IACtC,YAAY,OAAO,GAAG,oBAAoB;QACxC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAc;IAC1C,MAAM,IAAI,uBAAuB,EAAE,CAAA;AACrC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAG,qBAA8B,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,qBAA8B,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human.d.ts","sourceRoot":"","sources":["../../src/report/human.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function formatHumanReport(report) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
lines.push(`threejs-doctor — profile=${report.profile} mode=${report.mode}`);
|
|
4
|
+
lines.push(`Doctor Score: ${report.score}`);
|
|
5
|
+
lines.push('');
|
|
6
|
+
lines.push('Findings:');
|
|
7
|
+
if (report.findings.length === 0)
|
|
8
|
+
lines.push(' (none)');
|
|
9
|
+
for (const f of report.findings) {
|
|
10
|
+
lines.push(` [${f.severity}] ${f.id}: ${f.message}`);
|
|
11
|
+
lines.push(` fix: ${f.suggestedFix}`);
|
|
12
|
+
}
|
|
13
|
+
lines.push('');
|
|
14
|
+
lines.push('Baseline → After (deltas):');
|
|
15
|
+
const keys = Object.keys(report.baseline);
|
|
16
|
+
for (const key of keys) {
|
|
17
|
+
const base = report.baseline[key];
|
|
18
|
+
const after = report.after?.[key];
|
|
19
|
+
const delta = report.deltas?.[key];
|
|
20
|
+
lines.push(` ${String(key)}: ${base}${after === undefined ? '' : ` → ${after}`}${delta === undefined ? '' : ` (${delta >= 0 ? '+' : ''}${delta})`}`);
|
|
21
|
+
}
|
|
22
|
+
lines.push('');
|
|
23
|
+
lines.push(`Applied passes: ${report.appliedPasses.join(', ') || '(none)'}`);
|
|
24
|
+
if (report.failedPasses.length) {
|
|
25
|
+
lines.push('Failed passes:');
|
|
26
|
+
for (const p of report.failedPasses)
|
|
27
|
+
lines.push(` ${p.id}: ${p.error}`);
|
|
28
|
+
}
|
|
29
|
+
if (report.incomplete) {
|
|
30
|
+
lines.push('Run incomplete: after metrics unavailable; baseline retained.');
|
|
31
|
+
}
|
|
32
|
+
if (report.visualDelta) {
|
|
33
|
+
lines.push(report.rolledBackDueToVisual
|
|
34
|
+
? 'Visual delta vs control (confirmed); applied passes were rolled back. Capture must use a fixed viewpoint.'
|
|
35
|
+
: 'Visual delta vs control; do not treat apply: [safe] as visually safe.');
|
|
36
|
+
}
|
|
37
|
+
return lines.join('\n');
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=human.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human.js","sourceRoot":"","sources":["../../src/report/human.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IAC5E,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;IAC3C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACxD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,K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AM,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;IAC1E,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAA;IAC7E,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CACR,MAAM,CAAC,qBAAqB;YAC1B,CAAC,CAAC,2GAA2G;YAC7G,CAAC,CAAC,uEAAuE,CAC5E,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/report/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/report/json.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@threejs-doctor/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "threejs-doctor CLI (bench; scan/ci not implemented)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "codergeeta",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"threejs-doctor": "./bin/threejs-doctor.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./bin/threejs-doctor.js": "./bin/threejs-doctor.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"bin"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@threejs-doctor/bench": "^0.1.0",
|
|
26
|
+
"@threejs-doctor/runtime": "^0.1.0",
|
|
27
|
+
"@threejs-doctor/rules": "^0.1.0",
|
|
28
|
+
"@threejs-doctor/core": "^0.1.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.7.3",
|
|
32
|
+
"vitest": "^3.0.5"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/codergeeta/threejs-doctor.git",
|
|
40
|
+
"directory": "packages/cli"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/codergeeta/threejs-doctor#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/codergeeta/threejs-doctor/issues"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.json",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
53
|
+
}
|
|
54
|
+
}
|