@shined/doctor 0.0.9 → 0.0.11
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/bin/index.mjs +37 -0
- package/index.d.ts +8 -0
- package/index.js +1 -0
- package/package.json +12 -10
package/bin/index.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { cac } from "cac";
|
|
4
|
+
import { initializeLogger,doctor } from "../index.js"
|
|
5
|
+
import { performance } from "node:perf_hooks"
|
|
6
|
+
const cli = cac("doctor");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
cli.command('','check project health')
|
|
10
|
+
.option('-v, --verbose', 'Verbose output')
|
|
11
|
+
.option('--cwd <path>', 'Current working directory')
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
|
|
14
|
+
const start = performance.now();
|
|
15
|
+
|
|
16
|
+
initializeLogger();
|
|
17
|
+
|
|
18
|
+
const cwd = options.cwd || process.cwd();
|
|
19
|
+
|
|
20
|
+
const res = await doctor(cwd,{
|
|
21
|
+
// verbose: true,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const end = performance.now();
|
|
25
|
+
console.log(`Time taken: ${end - start} milliseconds`);
|
|
26
|
+
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
cli.help();
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
cli.parse();
|
|
37
|
+
|
package/index.d.ts
CHANGED
|
@@ -10,6 +10,14 @@ export interface Diagnostic {
|
|
|
10
10
|
labels: Array<LabeledLoc>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
export declare function doctor(cwd: string, options: DoctorOptions): Promise<void>
|
|
14
|
+
|
|
15
|
+
export interface DoctorOptions {
|
|
16
|
+
verbose?: boolean
|
|
17
|
+
globals?: Record<string, string>
|
|
18
|
+
ignore?: Array<string>
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
export interface GlobJsArgs {
|
|
14
22
|
ignore?: Array<string>
|
|
15
23
|
cwd: string
|
package/index.js
CHANGED
|
@@ -370,6 +370,7 @@ if (!nativeBinding) {
|
|
|
370
370
|
throw new Error(`Failed to load native binding`)
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
+
module.exports.doctor = nativeBinding.doctor
|
|
373
374
|
module.exports.initializeLogger = nativeBinding.initializeLogger
|
|
374
375
|
module.exports.innerDebugLint = nativeBinding.innerDebugLint
|
|
375
376
|
module.exports.innerLint = nativeBinding.innerLint
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shined/doctor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
|
+
"bin": "./bin/index.mjs",
|
|
6
7
|
"repository": {
|
|
7
8
|
"url": "git+https://github.com/sheinsight/doctor-engine.git"
|
|
8
9
|
},
|
|
@@ -12,20 +13,21 @@
|
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
14
15
|
"index.js",
|
|
15
|
-
"index.d.ts"
|
|
16
|
+
"index.d.ts",
|
|
17
|
+
"bin/index.mjs"
|
|
16
18
|
],
|
|
17
19
|
"license": "MIT",
|
|
18
20
|
"dependencies": {
|
|
19
21
|
"cac": "^6.7.14"
|
|
20
22
|
},
|
|
21
23
|
"optionalDependencies": {
|
|
22
|
-
"@shined/doctor-darwin-x64": "0.0.
|
|
23
|
-
"@shined/doctor-darwin-arm64": "0.0.
|
|
24
|
-
"@shined/doctor-win32-x64-msvc": "0.0.
|
|
25
|
-
"@shined/doctor-win32-arm64-msvc": "0.0.
|
|
26
|
-
"@shined/doctor-linux-x64-gnu": "0.0.
|
|
27
|
-
"@shined/doctor-linux-x64-musl": "0.0.
|
|
28
|
-
"@shined/doctor-linux-arm64-gnu": "0.0.
|
|
29
|
-
"@shined/doctor-linux-arm64-musl": "0.0.
|
|
24
|
+
"@shined/doctor-darwin-x64": "0.0.11",
|
|
25
|
+
"@shined/doctor-darwin-arm64": "0.0.11",
|
|
26
|
+
"@shined/doctor-win32-x64-msvc": "0.0.11",
|
|
27
|
+
"@shined/doctor-win32-arm64-msvc": "0.0.11",
|
|
28
|
+
"@shined/doctor-linux-x64-gnu": "0.0.11",
|
|
29
|
+
"@shined/doctor-linux-x64-musl": "0.0.11",
|
|
30
|
+
"@shined/doctor-linux-arm64-gnu": "0.0.11",
|
|
31
|
+
"@shined/doctor-linux-arm64-musl": "0.0.11"
|
|
30
32
|
}
|
|
31
33
|
}
|