@shined/doctor 0.0.21-snapshot.1 → 0.0.21-snapshot.6

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 CHANGED
@@ -1,39 +1,3 @@
1
1
  #!/usr/bin/env node
2
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
-
22
- if (res.length > 0) {
23
- process.exit(1);
24
- }
25
-
26
- const end = performance.now();
27
- console.log(`Time taken: ${end - start} milliseconds`);
28
-
29
- });
30
-
31
-
32
-
33
-
34
-
35
- cli.help();
36
-
37
-
38
- cli.parse();
39
-
3
+ import "../es/cli.mjs"
package/es/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/es/cli.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { cac } from "cac";
2
+ import { doctor, initializeLogger } from "@shined/doctor-binding";
3
+ import { performance } from "node:perf_hooks";
4
+
5
+ //#region src/cli.mts
6
+ const cli = cac("doctor");
7
+ cli.command("", "check project health").option("-v, --verbose", "Verbose output").option("--cwd <path>", "Current working directory").action(async (options) => {
8
+ const start = performance.now();
9
+ initializeLogger();
10
+ const cwd = options.cwd || process.cwd();
11
+ const res = await doctor(cwd);
12
+ if (res.length > 0) process.exit(1);
13
+ const end = performance.now();
14
+ console.log(`Time taken: ${end - start} milliseconds`);
15
+ });
16
+ cli.help();
17
+ cli.parse();
18
+
19
+ //#endregion
package/es/index.d.mts ADDED
@@ -0,0 +1 @@
1
+ export * from "@shined/doctor-binding";
package/es/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export * from "@shined/doctor-binding"
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@shined/doctor",
3
- "version": "0.0.21-snapshot.1",
4
- "main": "index.js",
5
- "types": "index.d.ts",
3
+ "version": "0.0.21-snapshot.6",
4
+ "main": "es/index.js",
5
+ "types": "es/index.d.ts",
6
6
  "bin": {
7
7
  "doctor": "./bin/index.mjs"
8
8
  },
@@ -14,26 +14,16 @@
14
14
  "tag": "snapshot"
15
15
  },
16
16
  "files": [
17
- "index.js",
18
- "index.d.ts",
19
- "bin/index.mjs"
17
+ "bin",
18
+ "es"
20
19
  ],
21
20
  "license": "MIT",
22
21
  "dependencies": {
23
- "cac": "^6.7.14"
22
+ "cac": "^6.7.14",
23
+ "@shined/doctor-binding": "0.0.21-snapshot.6"
24
24
  },
25
25
  "bugs": {
26
26
  "url": "https://github.com/sheinsight/doctor-engine/issues"
27
27
  },
28
- "homepage": "https://github.com/sheinsight/doctor-engine#readme",
29
- "optionalDependencies": {
30
- "@shined/doctor-darwin-x64": "0.0.21-snapshot.1",
31
- "@shined/doctor-darwin-arm64": "0.0.21-snapshot.1",
32
- "@shined/doctor-win32-x64-msvc": "0.0.21-snapshot.1",
33
- "@shined/doctor-win32-arm64-msvc": "0.0.21-snapshot.1",
34
- "@shined/doctor-linux-x64-gnu": "0.0.21-snapshot.1",
35
- "@shined/doctor-linux-x64-musl": "0.0.21-snapshot.1",
36
- "@shined/doctor-linux-arm64-gnu": "0.0.21-snapshot.1",
37
- "@shined/doctor-linux-arm64-musl": "0.0.21-snapshot.1"
38
- }
28
+ "homepage": "https://github.com/sheinsight/doctor-engine#readme"
39
29
  }
package/index.d.ts DELETED
@@ -1,339 +0,0 @@
1
- /* auto-generated by NAPI-RS */
2
- /* eslint-disable */
3
- export interface Diagnostic {
4
- fileName: string
5
- help: string
6
- url: string
7
- severity: string
8
- code: string
9
- message: string
10
- labels: Array<LabeledLoc>
11
- }
12
-
13
- export declare function doctor(cwd: string, opts?: DoctorOptions | undefined | null): Promise<Array<NapiMessages>>
14
-
15
- export interface DoctorOptions {
16
- verbose?: boolean
17
- maxRenderCount?: number
18
- withDashboard?: boolean
19
- }
20
-
21
- export declare function getLanguagesStatistics(paths: Array<string>): Array<LanguageStatistics>
22
-
23
- export interface GlobJsArgs {
24
- ignore?: Array<string>
25
- cwd: string
26
- verbose?: boolean
27
- absolute?: boolean
28
- globals?: Record<string, string>
29
- }
30
-
31
- export declare function initializeLogger(level?: LogLevel | undefined | null): void
32
-
33
- export declare function innerDebugLint(oxlintConfig: string, globJsArgs: GlobJsArgs): Promise<Array<Diagnostic>>
34
-
35
- export declare function innerLint(globJsArgs: GlobJsArgs, category: NaPiCategory): Promise<Array<Diagnostic>>
36
-
37
- export interface LabeledLoc {
38
- span: Span
39
- loc: Location
40
- }
41
-
42
- export interface LanguageStatistics {
43
- language: LanguageType
44
- code: number
45
- comments: number
46
- blanks: number
47
- }
48
-
49
- export declare const enum LanguageType {
50
- ABNF = 'ABNF',
51
- Abap = 'Abap',
52
- ActionScript = 'ActionScript',
53
- Ada = 'Ada',
54
- Agda = 'Agda',
55
- Alex = 'Alex',
56
- Alloy = 'Alloy',
57
- Arduino = 'Arduino',
58
- AsciiDoc = 'AsciiDoc',
59
- Asn1 = 'Asn1',
60
- Asp = 'Asp',
61
- AspNet = 'AspNet',
62
- Assembly = 'Assembly',
63
- AssemblyGAS = 'AssemblyGAS',
64
- AutoHotKey = 'AutoHotKey',
65
- Autoconf = 'Autoconf',
66
- Automake = 'Automake',
67
- Bash = 'Bash',
68
- Batch = 'Batch',
69
- Bean = 'Bean',
70
- BrightScript = 'BrightScript',
71
- C = 'C',
72
- CHeader = 'CHeader',
73
- CMake = 'CMake',
74
- CSharp = 'CSharp',
75
- CShell = 'CShell',
76
- Cabal = 'Cabal',
77
- Cassius = 'Cassius',
78
- Ceylon = 'Ceylon',
79
- Clojure = 'Clojure',
80
- ClojureC = 'ClojureC',
81
- ClojureScript = 'ClojureScript',
82
- Cobol = 'Cobol',
83
- CodeQL = 'CodeQL',
84
- CoffeeScript = 'CoffeeScript',
85
- Cogent = 'Cogent',
86
- ColdFusion = 'ColdFusion',
87
- ColdFusionScript = 'ColdFusionScript',
88
- Coq = 'Coq',
89
- Cpp = 'Cpp',
90
- CppHeader = 'CppHeader',
91
- Crystal = 'Crystal',
92
- Css = 'Css',
93
- D = 'D',
94
- Daml = 'Daml',
95
- Dart = 'Dart',
96
- DeviceTree = 'DeviceTree',
97
- Dhall = 'Dhall',
98
- Dockerfile = 'Dockerfile',
99
- DotNetResource = 'DotNetResource',
100
- DreamMaker = 'DreamMaker',
101
- Dust = 'Dust',
102
- Edn = 'Edn',
103
- Elisp = 'Elisp',
104
- Elixir = 'Elixir',
105
- Elm = 'Elm',
106
- Elvish = 'Elvish',
107
- EmacsDevEnv = 'EmacsDevEnv',
108
- Emojicode = 'Emojicode',
109
- Erlang = 'Erlang',
110
- FEN = 'FEN',
111
- FSharp = 'FSharp',
112
- Fish = 'Fish',
113
- FlatBuffers = 'FlatBuffers',
114
- Forth = 'Forth',
115
- FortranLegacy = 'FortranLegacy',
116
- FortranModern = 'FortranModern',
117
- FreeMarker = 'FreeMarker',
118
- Fstar = 'Fstar',
119
- Futhark = 'Futhark',
120
- GDB = 'GDB',
121
- GdScript = 'GdScript',
122
- Gherkin = 'Gherkin',
123
- Gleam = 'Gleam',
124
- Glsl = 'Glsl',
125
- Go = 'Go',
126
- Gohtml = 'Gohtml',
127
- Graphql = 'Graphql',
128
- Groovy = 'Groovy',
129
- Gwion = 'Gwion',
130
- Hamlet = 'Hamlet',
131
- Handlebars = 'Handlebars',
132
- Happy = 'Happy',
133
- Haskell = 'Haskell',
134
- Haxe = 'Haxe',
135
- Hcl = 'Hcl',
136
- Headache = 'Headache',
137
- Hex = 'Hex',
138
- Hlsl = 'Hlsl',
139
- HolyC = 'HolyC',
140
- Html = 'Html',
141
- Idris = 'Idris',
142
- Ini = 'Ini',
143
- IntelHex = 'IntelHex',
144
- Isabelle = 'Isabelle',
145
- Jai = 'Jai',
146
- Java = 'Java',
147
- JavaScript = 'JavaScript',
148
- Json = 'Json',
149
- Jsonnet = 'Jsonnet',
150
- Jsx = 'Jsx',
151
- Julia = 'Julia',
152
- Julius = 'Julius',
153
- Jupyter = 'Jupyter',
154
- K = 'K',
155
- KakouneScript = 'KakouneScript',
156
- Kotlin = 'Kotlin',
157
- LLVM = 'LLVM',
158
- Lean = 'Lean',
159
- Less = 'Less',
160
- LinkerScript = 'LinkerScript',
161
- Liquid = 'Liquid',
162
- Lisp = 'Lisp',
163
- LiveScript = 'LiveScript',
164
- Logtalk = 'Logtalk',
165
- Lua = 'Lua',
166
- Lucius = 'Lucius',
167
- Madlang = 'Madlang',
168
- Makefile = 'Makefile',
169
- Markdown = 'Markdown',
170
- Meson = 'Meson',
171
- Mint = 'Mint',
172
- ModuleDef = 'ModuleDef',
173
- MoonScript = 'MoonScript',
174
- MsBuild = 'MsBuild',
175
- Mustache = 'Mustache',
176
- Nim = 'Nim',
177
- Nix = 'Nix',
178
- NotQuitePerl = 'NotQuitePerl',
179
- OCaml = 'OCaml',
180
- ObjectiveC = 'ObjectiveC',
181
- ObjectiveCpp = 'ObjectiveCpp',
182
- Odin = 'Odin',
183
- OpenType = 'OpenType',
184
- Org = 'Org',
185
- Oz = 'Oz',
186
- PSL = 'PSL',
187
- Pan = 'Pan',
188
- Pascal = 'Pascal',
189
- Perl = 'Perl',
190
- Perl6 = 'Perl6',
191
- Pest = 'Pest',
192
- Php = 'Php',
193
- Polly = 'Polly',
194
- Pony = 'Pony',
195
- PostCss = 'PostCss',
196
- PowerShell = 'PowerShell',
197
- Processing = 'Processing',
198
- Prolog = 'Prolog',
199
- Protobuf = 'Protobuf',
200
- Pug = 'Pug',
201
- PureScript = 'PureScript',
202
- Python = 'Python',
203
- Q = 'Q',
204
- Qcl = 'Qcl',
205
- Qml = 'Qml',
206
- R = 'R',
207
- RON = 'RON',
208
- RPMSpecfile = 'RPMSpecfile',
209
- Racket = 'Racket',
210
- Rakefile = 'Rakefile',
211
- Razor = 'Razor',
212
- ReStructuredText = 'ReStructuredText',
213
- Renpy = 'Renpy',
214
- Ruby = 'Ruby',
215
- RubyHtml = 'RubyHtml',
216
- Rust = 'Rust',
217
- SRecode = 'SRecode',
218
- Sass = 'Sass',
219
- Scala = 'Scala',
220
- Scheme = 'Scheme',
221
- Scons = 'Scons',
222
- Sh = 'Sh',
223
- Sml = 'Sml',
224
- Solidity = 'Solidity',
225
- SpecmanE = 'SpecmanE',
226
- Spice = 'Spice',
227
- Sql = 'Sql',
228
- Stan = 'Stan',
229
- Stratego = 'Stratego',
230
- Stylus = 'Stylus',
231
- Svelte = 'Svelte',
232
- Svg = 'Svg',
233
- Swift = 'Swift',
234
- Swig = 'Swig',
235
- SystemVerilog = 'SystemVerilog',
236
- Tcl = 'Tcl',
237
- Tera = 'Tera',
238
- Tex = 'Tex',
239
- Text = 'Text',
240
- Thrift = 'Thrift',
241
- Toml = 'Toml',
242
- Tsx = 'Tsx',
243
- Ttcn = 'Ttcn',
244
- Twig = 'Twig',
245
- TypeScript = 'TypeScript',
246
- UnrealDeveloperMarkdown = 'UnrealDeveloperMarkdown',
247
- UnrealPlugin = 'UnrealPlugin',
248
- UnrealProject = 'UnrealProject',
249
- UnrealScript = 'UnrealScript',
250
- UnrealShader = 'UnrealShader',
251
- UnrealShaderHeader = 'UnrealShaderHeader',
252
- UrWeb = 'UrWeb',
253
- UrWebProject = 'UrWebProject',
254
- VB6 = 'VB6',
255
- VBScript = 'VBScript',
256
- Vala = 'Vala',
257
- Velocity = 'Velocity',
258
- Verilog = 'Verilog',
259
- VerilogArgsFile = 'VerilogArgsFile',
260
- Vhdl = 'Vhdl',
261
- VimScript = 'VimScript',
262
- VisualBasic = 'VisualBasic',
263
- VisualStudioProject = 'VisualStudioProject',
264
- VisualStudioSolution = 'VisualStudioSolution',
265
- Vue = 'Vue',
266
- WebAssembly = 'WebAssembly',
267
- Wolfram = 'Wolfram',
268
- XSL = 'XSL',
269
- Xaml = 'Xaml',
270
- XcodeConfig = 'XcodeConfig',
271
- Xml = 'Xml',
272
- Xtend = 'Xtend',
273
- Yaml = 'Yaml',
274
- Zig = 'Zig',
275
- Zsh = 'Zsh'
276
- }
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
- export interface NapiMessages {
311
- sourcePath: string
312
- diagnostics: Array<NapiDiagnostics>
313
- }
314
-
315
- export declare const enum NapiSeverity {
316
- Error = 'Error',
317
- Warning = 'Warning',
318
- Advice = 'Advice'
319
- }
320
-
321
- export interface NapiSourceSpan {
322
- offset: number
323
- length: number
324
- }
325
-
326
- export interface Position {
327
- line: number
328
- col: number
329
- }
330
-
331
- export interface Response {
332
- rc: string
333
- map: Record<string, number>
334
- }
335
-
336
- export interface Span {
337
- offset: number
338
- length: number
339
- }
package/index.js DELETED
@@ -1,385 +0,0 @@
1
- // prettier-ignore
2
- /* eslint-disable */
3
- // @ts-nocheck
4
- /* auto-generated by NAPI-RS */
5
-
6
- const { createRequire } = require('node:module')
7
- require = createRequire(__filename)
8
-
9
- const { readFileSync } = require('node:fs')
10
- let nativeBinding = null
11
- const loadErrors = []
12
-
13
- const isMusl = () => {
14
- let musl = false
15
- if (process.platform === 'linux') {
16
- musl = isMuslFromFilesystem()
17
- if (musl === null) {
18
- musl = isMuslFromReport()
19
- }
20
- if (musl === null) {
21
- musl = isMuslFromChildProcess()
22
- }
23
- }
24
- return musl
25
- }
26
-
27
- const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
28
-
29
- const isMuslFromFilesystem = () => {
30
- try {
31
- return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
32
- } catch {
33
- return null
34
- }
35
- }
36
-
37
- const isMuslFromReport = () => {
38
- let report = null
39
- if (typeof process.report?.getReport === 'function') {
40
- process.report.excludeNetwork = true
41
- report = process.report.getReport()
42
- }
43
- if (!report) {
44
- return null
45
- }
46
- if (report.header && report.header.glibcVersionRuntime) {
47
- return false
48
- }
49
- if (Array.isArray(report.sharedObjects)) {
50
- if (report.sharedObjects.some(isFileMusl)) {
51
- return true
52
- }
53
- }
54
- return false
55
- }
56
-
57
- const isMuslFromChildProcess = () => {
58
- try {
59
- return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
60
- } catch (e) {
61
- // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
62
- return false
63
- }
64
- }
65
-
66
- function requireNative() {
67
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
68
- try {
69
- nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
70
- } catch (err) {
71
- loadErrors.push(err);
72
- }
73
- } else if (process.platform === 'android') {
74
- if (process.arch === 'arm64') {
75
- try {
76
- return require('./doctor.android-arm64.node')
77
- } catch (e) {
78
- loadErrors.push(e)
79
- }
80
- try {
81
- return require('@shined/doctor-android-arm64')
82
- } catch (e) {
83
- loadErrors.push(e)
84
- }
85
-
86
- } else if (process.arch === 'arm') {
87
- try {
88
- return require('./doctor.android-arm-eabi.node')
89
- } catch (e) {
90
- loadErrors.push(e)
91
- }
92
- try {
93
- return require('@shined/doctor-android-arm-eabi')
94
- } catch (e) {
95
- loadErrors.push(e)
96
- }
97
-
98
- } else {
99
- loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
100
- }
101
- } else if (process.platform === 'win32') {
102
- if (process.arch === 'x64') {
103
- try {
104
- return require('./doctor.win32-x64-msvc.node')
105
- } catch (e) {
106
- loadErrors.push(e)
107
- }
108
- try {
109
- return require('@shined/doctor-win32-x64-msvc')
110
- } catch (e) {
111
- loadErrors.push(e)
112
- }
113
-
114
- } else if (process.arch === 'ia32') {
115
- try {
116
- return require('./doctor.win32-ia32-msvc.node')
117
- } catch (e) {
118
- loadErrors.push(e)
119
- }
120
- try {
121
- return require('@shined/doctor-win32-ia32-msvc')
122
- } catch (e) {
123
- loadErrors.push(e)
124
- }
125
-
126
- } else if (process.arch === 'arm64') {
127
- try {
128
- return require('./doctor.win32-arm64-msvc.node')
129
- } catch (e) {
130
- loadErrors.push(e)
131
- }
132
- try {
133
- return require('@shined/doctor-win32-arm64-msvc')
134
- } catch (e) {
135
- loadErrors.push(e)
136
- }
137
-
138
- } else {
139
- loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
140
- }
141
- } else if (process.platform === 'darwin') {
142
- try {
143
- return require('./doctor.darwin-universal.node')
144
- } catch (e) {
145
- loadErrors.push(e)
146
- }
147
- try {
148
- return require('@shined/doctor-darwin-universal')
149
- } catch (e) {
150
- loadErrors.push(e)
151
- }
152
-
153
- if (process.arch === 'x64') {
154
- try {
155
- return require('./doctor.darwin-x64.node')
156
- } catch (e) {
157
- loadErrors.push(e)
158
- }
159
- try {
160
- return require('@shined/doctor-darwin-x64')
161
- } catch (e) {
162
- loadErrors.push(e)
163
- }
164
-
165
- } else if (process.arch === 'arm64') {
166
- try {
167
- return require('./doctor.darwin-arm64.node')
168
- } catch (e) {
169
- loadErrors.push(e)
170
- }
171
- try {
172
- return require('@shined/doctor-darwin-arm64')
173
- } catch (e) {
174
- loadErrors.push(e)
175
- }
176
-
177
- } else {
178
- loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
179
- }
180
- } else if (process.platform === 'freebsd') {
181
- if (process.arch === 'x64') {
182
- try {
183
- return require('./doctor.freebsd-x64.node')
184
- } catch (e) {
185
- loadErrors.push(e)
186
- }
187
- try {
188
- return require('@shined/doctor-freebsd-x64')
189
- } catch (e) {
190
- loadErrors.push(e)
191
- }
192
-
193
- } else if (process.arch === 'arm64') {
194
- try {
195
- return require('./doctor.freebsd-arm64.node')
196
- } catch (e) {
197
- loadErrors.push(e)
198
- }
199
- try {
200
- return require('@shined/doctor-freebsd-arm64')
201
- } catch (e) {
202
- loadErrors.push(e)
203
- }
204
-
205
- } else {
206
- loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
207
- }
208
- } else if (process.platform === 'linux') {
209
- if (process.arch === 'x64') {
210
- if (isMusl()) {
211
- try {
212
- return require('./doctor.linux-x64-musl.node')
213
- } catch (e) {
214
- loadErrors.push(e)
215
- }
216
- try {
217
- return require('@shined/doctor-linux-x64-musl')
218
- } catch (e) {
219
- loadErrors.push(e)
220
- }
221
-
222
- } else {
223
- try {
224
- return require('./doctor.linux-x64-gnu.node')
225
- } catch (e) {
226
- loadErrors.push(e)
227
- }
228
- try {
229
- return require('@shined/doctor-linux-x64-gnu')
230
- } catch (e) {
231
- loadErrors.push(e)
232
- }
233
-
234
- }
235
- } else if (process.arch === 'arm64') {
236
- if (isMusl()) {
237
- try {
238
- return require('./doctor.linux-arm64-musl.node')
239
- } catch (e) {
240
- loadErrors.push(e)
241
- }
242
- try {
243
- return require('@shined/doctor-linux-arm64-musl')
244
- } catch (e) {
245
- loadErrors.push(e)
246
- }
247
-
248
- } else {
249
- try {
250
- return require('./doctor.linux-arm64-gnu.node')
251
- } catch (e) {
252
- loadErrors.push(e)
253
- }
254
- try {
255
- return require('@shined/doctor-linux-arm64-gnu')
256
- } catch (e) {
257
- loadErrors.push(e)
258
- }
259
-
260
- }
261
- } else if (process.arch === 'arm') {
262
- if (isMusl()) {
263
- try {
264
- return require('./doctor.linux-arm-musleabihf.node')
265
- } catch (e) {
266
- loadErrors.push(e)
267
- }
268
- try {
269
- return require('@shined/doctor-linux-arm-musleabihf')
270
- } catch (e) {
271
- loadErrors.push(e)
272
- }
273
-
274
- } else {
275
- try {
276
- return require('./doctor.linux-arm-gnueabihf.node')
277
- } catch (e) {
278
- loadErrors.push(e)
279
- }
280
- try {
281
- return require('@shined/doctor-linux-arm-gnueabihf')
282
- } catch (e) {
283
- loadErrors.push(e)
284
- }
285
-
286
- }
287
- } else if (process.arch === 'riscv64') {
288
- if (isMusl()) {
289
- try {
290
- return require('./doctor.linux-riscv64-musl.node')
291
- } catch (e) {
292
- loadErrors.push(e)
293
- }
294
- try {
295
- return require('@shined/doctor-linux-riscv64-musl')
296
- } catch (e) {
297
- loadErrors.push(e)
298
- }
299
-
300
- } else {
301
- try {
302
- return require('./doctor.linux-riscv64-gnu.node')
303
- } catch (e) {
304
- loadErrors.push(e)
305
- }
306
- try {
307
- return require('@shined/doctor-linux-riscv64-gnu')
308
- } catch (e) {
309
- loadErrors.push(e)
310
- }
311
-
312
- }
313
- } else if (process.arch === 'ppc64') {
314
- try {
315
- return require('./doctor.linux-ppc64-gnu.node')
316
- } catch (e) {
317
- loadErrors.push(e)
318
- }
319
- try {
320
- return require('@shined/doctor-linux-ppc64-gnu')
321
- } catch (e) {
322
- loadErrors.push(e)
323
- }
324
-
325
- } else if (process.arch === 's390x') {
326
- try {
327
- return require('./doctor.linux-s390x-gnu.node')
328
- } catch (e) {
329
- loadErrors.push(e)
330
- }
331
- try {
332
- return require('@shined/doctor-linux-s390x-gnu')
333
- } catch (e) {
334
- loadErrors.push(e)
335
- }
336
-
337
- } else {
338
- loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
339
- }
340
- } else {
341
- loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
342
- }
343
- }
344
-
345
- nativeBinding = requireNative()
346
-
347
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
348
- try {
349
- nativeBinding = require('./doctor.wasi.cjs')
350
- } catch (err) {
351
- if (process.env.NAPI_RS_FORCE_WASI) {
352
- loadErrors.push(err)
353
- }
354
- }
355
- if (!nativeBinding) {
356
- try {
357
- nativeBinding = require('@shined/doctor-wasm32-wasi')
358
- } catch (err) {
359
- if (process.env.NAPI_RS_FORCE_WASI) {
360
- loadErrors.push(err)
361
- }
362
- }
363
- }
364
- }
365
-
366
- if (!nativeBinding) {
367
- if (loadErrors.length > 0) {
368
- // TODO Link to documentation with potential fixes
369
- // - The package owner could build/publish bindings for this arch
370
- // - The user may need to bundle the correct files
371
- // - The user may need to re-install node_modules to get new packages
372
- throw new Error('Failed to load native binding', { cause: loadErrors })
373
- }
374
- throw new Error(`Failed to load native binding`)
375
- }
376
-
377
- module.exports.doctor = nativeBinding.doctor
378
- module.exports.getLanguagesStatistics = nativeBinding.getLanguagesStatistics
379
- module.exports.initializeLogger = nativeBinding.initializeLogger
380
- module.exports.innerDebugLint = nativeBinding.innerDebugLint
381
- module.exports.innerLint = nativeBinding.innerLint
382
- module.exports.LanguageType = nativeBinding.LanguageType
383
- module.exports.LogLevel = nativeBinding.LogLevel
384
- module.exports.NaPiCategory = nativeBinding.NaPiCategory
385
- module.exports.NapiSeverity = nativeBinding.NapiSeverity