@shined/doctor 0.0.19 → 0.0.21-snapshot.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/index.mjs +5 -3
- package/index.d.ts +37 -37
- package/index.js +6 -2
- package/package.json +10 -10
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SHEIN
|
|
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/bin/index.mjs
CHANGED
|
@@ -17,9 +17,11 @@ cli.command('','check project health')
|
|
|
17
17
|
|
|
18
18
|
const cwd = options.cwd || process.cwd();
|
|
19
19
|
|
|
20
|
-
const res = await doctor(cwd
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const res = await doctor(cwd);
|
|
21
|
+
|
|
22
|
+
if (res.length > 0) {
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
23
25
|
|
|
24
26
|
const end = performance.now();
|
|
25
27
|
console.log(`Time taken: ${end - start} milliseconds`);
|
package/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface Diagnostic {
|
|
|
10
10
|
labels: Array<LabeledLoc>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export declare function doctor(cwd: string,
|
|
13
|
+
export declare function doctor(cwd: string, opts?: DoctorOptions | undefined | null): Promise<Array<NapiMessages>>
|
|
14
14
|
|
|
15
15
|
export interface DoctorOptions {
|
|
16
16
|
verbose?: boolean
|
|
@@ -18,7 +18,7 @@ export interface DoctorOptions {
|
|
|
18
18
|
withDashboard?: boolean
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export declare function getLanguagesStatistics(paths: Array<string>): Array<
|
|
21
|
+
export declare function getLanguagesStatistics(paths: Array<string>): Array<LanguageStatistics>
|
|
22
22
|
|
|
23
23
|
export interface GlobJsArgs {
|
|
24
24
|
ignore?: Array<string>
|
|
@@ -39,46 +39,14 @@ export interface LabeledLoc {
|
|
|
39
39
|
loc: Location
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export interface
|
|
43
|
-
|
|
44
|
-
end: Position
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export declare const enum LogLevel {
|
|
48
|
-
Error = 0,
|
|
49
|
-
Warn = 1,
|
|
50
|
-
Info = 2,
|
|
51
|
-
Debug = 3,
|
|
52
|
-
Trace = 4
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export declare const enum NaPiCategory {
|
|
56
|
-
V20250601Inner = 0
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface NapiDiagnostics {
|
|
60
|
-
message: string
|
|
61
|
-
code?: string
|
|
62
|
-
severity?: NapiSeverity
|
|
63
|
-
help?: string
|
|
64
|
-
url?: string
|
|
65
|
-
labels?: Array<NapiLabeledSpan>
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface NapiLabeledSpan {
|
|
69
|
-
label?: string
|
|
70
|
-
span: NapiSourceSpan
|
|
71
|
-
primary: boolean
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface NapiLanguageStatistics {
|
|
75
|
-
language: NapiLanguageType
|
|
42
|
+
export interface LanguageStatistics {
|
|
43
|
+
language: LanguageType
|
|
76
44
|
code: number
|
|
77
45
|
comments: number
|
|
78
46
|
blanks: number
|
|
79
47
|
}
|
|
80
48
|
|
|
81
|
-
export declare const enum
|
|
49
|
+
export declare const enum LanguageType {
|
|
82
50
|
ABNF = 'ABNF',
|
|
83
51
|
Abap = 'Abap',
|
|
84
52
|
ActionScript = 'ActionScript',
|
|
@@ -307,6 +275,38 @@ export declare const enum NapiLanguageType {
|
|
|
307
275
|
Zsh = 'Zsh'
|
|
308
276
|
}
|
|
309
277
|
|
|
278
|
+
export interface Location {
|
|
279
|
+
start: Position
|
|
280
|
+
end: Position
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare const enum LogLevel {
|
|
284
|
+
Error = 0,
|
|
285
|
+
Warn = 1,
|
|
286
|
+
Info = 2,
|
|
287
|
+
Debug = 3,
|
|
288
|
+
Trace = 4
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export declare const enum NaPiCategory {
|
|
292
|
+
V20250601Inner = 0
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface NapiDiagnostics {
|
|
296
|
+
message: string
|
|
297
|
+
code?: string
|
|
298
|
+
severity?: NapiSeverity
|
|
299
|
+
help?: string
|
|
300
|
+
url?: string
|
|
301
|
+
labels?: Array<NapiLabeledSpan>
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface NapiLabeledSpan {
|
|
305
|
+
label?: string
|
|
306
|
+
span: NapiSourceSpan
|
|
307
|
+
primary: boolean
|
|
308
|
+
}
|
|
309
|
+
|
|
310
310
|
export interface NapiMessages {
|
|
311
311
|
sourcePath: string
|
|
312
312
|
diagnostics: Array<NapiDiagnostics>
|
package/index.js
CHANGED
|
@@ -35,7 +35,11 @@ const isMuslFromFilesystem = () => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const isMuslFromReport = () => {
|
|
38
|
-
|
|
38
|
+
let report = null
|
|
39
|
+
if (typeof process.report?.getReport === 'function') {
|
|
40
|
+
process.report.excludeNetwork = true
|
|
41
|
+
report = process.report.getReport()
|
|
42
|
+
}
|
|
39
43
|
if (!report) {
|
|
40
44
|
return null
|
|
41
45
|
}
|
|
@@ -375,7 +379,7 @@ module.exports.getLanguagesStatistics = nativeBinding.getLanguagesStatistics
|
|
|
375
379
|
module.exports.initializeLogger = nativeBinding.initializeLogger
|
|
376
380
|
module.exports.innerDebugLint = nativeBinding.innerDebugLint
|
|
377
381
|
module.exports.innerLint = nativeBinding.innerLint
|
|
382
|
+
module.exports.LanguageType = nativeBinding.LanguageType
|
|
378
383
|
module.exports.LogLevel = nativeBinding.LogLevel
|
|
379
384
|
module.exports.NaPiCategory = nativeBinding.NaPiCategory
|
|
380
|
-
module.exports.NapiLanguageType = nativeBinding.NapiLanguageType
|
|
381
385
|
module.exports.NapiSeverity = nativeBinding.NapiSeverity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shined/doctor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21-snapshot.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"bin": "./bin/index.mjs",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
12
|
+
"tag": "snapshot"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"index.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"cac": "^6.7.14"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@shined/doctor-darwin-x64": "0.0.
|
|
25
|
-
"@shined/doctor-darwin-arm64": "0.0.
|
|
26
|
-
"@shined/doctor-win32-x64-msvc": "0.0.
|
|
27
|
-
"@shined/doctor-win32-arm64-msvc": "0.0.
|
|
28
|
-
"@shined/doctor-linux-x64-gnu": "0.0.
|
|
29
|
-
"@shined/doctor-linux-x64-musl": "0.0.
|
|
30
|
-
"@shined/doctor-linux-arm64-gnu": "0.0.
|
|
31
|
-
"@shined/doctor-linux-arm64-musl": "0.0.
|
|
24
|
+
"@shined/doctor-darwin-x64": "0.0.21-snapshot.0",
|
|
25
|
+
"@shined/doctor-darwin-arm64": "0.0.21-snapshot.0",
|
|
26
|
+
"@shined/doctor-win32-x64-msvc": "0.0.21-snapshot.0",
|
|
27
|
+
"@shined/doctor-win32-arm64-msvc": "0.0.21-snapshot.0",
|
|
28
|
+
"@shined/doctor-linux-x64-gnu": "0.0.21-snapshot.0",
|
|
29
|
+
"@shined/doctor-linux-x64-musl": "0.0.21-snapshot.0",
|
|
30
|
+
"@shined/doctor-linux-arm64-gnu": "0.0.21-snapshot.0",
|
|
31
|
+
"@shined/doctor-linux-arm64-musl": "0.0.21-snapshot.0"
|
|
32
32
|
}
|
|
33
33
|
}
|