dslinter 0.1.4 → 0.1.13
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/CHANGELOG.md +80 -1
- package/README.md +46 -35
- package/bin/lib/project-root.mjs +20 -14
- package/bin/lib/project-root.test.mjs +21 -0
- package/bin/lib/scaffold-config.mjs +75 -0
- package/bin/lib/scaffold-config.test.mjs +33 -0
- package/bin/modes/build.mjs +6 -0
- package/bin/modes/dev.mjs +26 -2
- package/bin/modes/init.mjs +39 -36
- package/bin/modes/init.test.mjs +16 -0
- package/dashboard-dist/assets/DashboardLayoutAuto-Bm7yfyC-.css +1 -0
- package/dashboard-dist/assets/DashboardLayoutAuto-DgwO_itB.js +1 -0
- package/dashboard-dist/assets/index-Cbv7vXvH.css +1 -0
- package/dashboard-dist/assets/index-e20cwqnb.js +206 -0
- package/dashboard-dist/index.html +2 -2
- package/index.cjs +52 -52
- package/package.json +16 -7
- package/src/components/ComponentInspectPane.tsx +7 -11
- package/src/dashboard/ComponentUsageDetails.tsx +9 -3
- package/src/index.ts +1 -0
- package/src/playground/scanPlaygroundModules.ts +1 -0
- package/src/playground/usePlaygroundFromReport.test.ts +37 -0
- package/src/playground/usePlaygroundFromReport.ts +23 -0
- package/src/playground/virtual-playground-modules.d.ts +6 -0
- package/src/shell/DashboardLayout.tsx +37 -4
- package/src/shell/DashboardLayoutAuto.tsx +20 -0
- package/templates/vite.dslint-scan-alias.snippet.ts +2 -12
- package/templates/vite.dslinter.snippet.ts +11 -19
- package/vite/collectScanModules.test.ts +42 -0
- package/vite/collectScanModules.ts +60 -0
- package/vite/consumer.config.mjs +22 -0
- package/vite/plugin.ts +140 -0
- package/dashboard-dist/assets/index-BhDQfrwA.css +0 -1
- package/dashboard-dist/assets/index-DGUG_3SK.js +0 -205
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>DSLinter</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-e20cwqnb.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cbv7vXvH.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="bg-background antialiased">
|
|
11
11
|
<div id="root"></div>
|
package/index.cjs
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@dslinter/binding-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@dslinter/binding-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.1.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
80
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@dslinter/binding-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@dslinter/binding-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.1.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
96
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@dslinter/binding-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@dslinter/binding-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.1.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
117
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@dslinter/binding-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@dslinter/binding-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.1.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
133
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@dslinter/binding-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@dslinter/binding-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.1.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
150
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@dslinter/binding-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@dslinter/binding-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.1.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
166
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@dslinter/binding-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@dslinter/binding-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.1.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
185
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@dslinter/binding-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@dslinter/binding-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.1.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
201
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@dslinter/binding-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@dslinter/binding-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.1.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
217
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@dslinter/binding-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@dslinter/binding-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.1.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
237
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@dslinter/binding-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@dslinter/binding-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.1.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
253
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@dslinter/binding-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@dslinter/binding-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.1.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
274
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@dslinter/binding-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@dslinter/binding-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.1.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
290
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@dslinter/binding-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@dslinter/binding-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.1.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
308
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@dslinter/binding-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@dslinter/binding-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.1.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
324
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@dslinter/binding-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@dslinter/binding-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.1.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
342
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@dslinter/binding-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@dslinter/binding-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.1.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
358
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@dslinter/binding-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@dslinter/binding-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.1.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
376
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@dslinter/binding-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@dslinter/binding-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.1.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
392
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@dslinter/binding-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@dslinter/binding-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.1.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
410
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@dslinter/binding-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@dslinter/binding-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.1.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
426
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@dslinter/binding-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@dslinter/binding-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.1.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
443
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@dslinter/binding-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@dslinter/binding-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.1.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
459
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@dslinter/binding-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@dslinter/binding-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.1.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
479
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@dslinter/binding-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@dslinter/binding-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.1.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
495
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@dslinter/binding-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@dslinter/binding-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.1.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
511
|
+
if (bindingPackageVersion !== '0.1.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dslinter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "DSLinter dashboard UI: playground shell, token wall, and governance panels (consumes dslint-report.json).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,15 @@
|
|
|
57
57
|
"types": "./src/index.ts",
|
|
58
58
|
"default": "./src/index.ts"
|
|
59
59
|
},
|
|
60
|
-
"./theme.css": "./src/styles/dashboard-theme.css"
|
|
60
|
+
"./theme.css": "./src/styles/dashboard-theme.css",
|
|
61
|
+
"./vite": {
|
|
62
|
+
"types": "./vite/plugin.ts",
|
|
63
|
+
"default": "./vite/plugin.ts"
|
|
64
|
+
},
|
|
65
|
+
"./playground-modules": {
|
|
66
|
+
"types": "./src/playground/scanPlaygroundModules.ts",
|
|
67
|
+
"default": "./src/playground/scanPlaygroundModules.ts"
|
|
68
|
+
}
|
|
61
69
|
},
|
|
62
70
|
"types": "./src/index.ts",
|
|
63
71
|
"files": [
|
|
@@ -66,6 +74,7 @@
|
|
|
66
74
|
"index.cjs",
|
|
67
75
|
"index.d.ts",
|
|
68
76
|
"src",
|
|
77
|
+
"vite",
|
|
69
78
|
"templates",
|
|
70
79
|
"components.json",
|
|
71
80
|
"README.md",
|
|
@@ -109,11 +118,11 @@
|
|
|
109
118
|
"vitest": "^3.2.4"
|
|
110
119
|
},
|
|
111
120
|
"optionalDependencies": {
|
|
112
|
-
"@dslinter/binding-darwin-arm64": "0.1.
|
|
113
|
-
"@dslinter/binding-darwin-x64": "0.1.
|
|
114
|
-
"@dslinter/binding-linux-arm64-gnu": "0.1.
|
|
115
|
-
"@dslinter/binding-linux-x64-gnu": "0.1.
|
|
116
|
-
"@dslinter/binding-win32-x64-msvc": "0.1.
|
|
121
|
+
"@dslinter/binding-darwin-arm64": "0.1.13",
|
|
122
|
+
"@dslinter/binding-darwin-x64": "0.1.13",
|
|
123
|
+
"@dslinter/binding-linux-arm64-gnu": "0.1.13",
|
|
124
|
+
"@dslinter/binding-linux-x64-gnu": "0.1.13",
|
|
125
|
+
"@dslinter/binding-win32-x64-msvc": "0.1.13"
|
|
117
126
|
},
|
|
118
127
|
"scripts": {
|
|
119
128
|
"build:napi": "napi build --platform --release --cwd ../.. --output-dir packages/dashboard --package-json-path packages/dashboard/package.json --js-package-name @dslinter/binding --js index.cjs --no-default-features --features napi",
|
|
@@ -76,23 +76,19 @@ export function ComponentInspectPane({
|
|
|
76
76
|
if (playgroundJoinSkip?.reason === "module_not_found") {
|
|
77
77
|
const { globKey, rel_path } = playgroundJoinSkip;
|
|
78
78
|
if (globKey.startsWith("@dslint-scan/")) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`Or add resolve.alias "@dslint-scan" → project root and import.meta.glob("@dslint-scan/**/*.{tsx,jsx}", { eager: true }) in App.`,
|
|
85
|
-
].join(" ");
|
|
86
|
-
}
|
|
87
|
-
return `Vite glob is missing key "${globKey}" for "${rel_path}". Add resolve.alias "@dslint-scan" → scan root in vite.config.ts, or use npx dslinter init and a relative import.meta.glob in buildRegistry.ts.`;
|
|
79
|
+
return [
|
|
80
|
+
`Expected module key "${globKey}" but the dslinter Vite plugin did not load it.`,
|
|
81
|
+
`Use <DashboardLayout autoPlayground /> and run via npx dslinter (zero vite.config changes), or add plugins: [dslinter()] from dslinter/vite to vite.config.ts.`,
|
|
82
|
+
`Run the scanner from the project root so rel_path "${rel_path}" matches files under DSLINT_SCAN_ROOT.`,
|
|
83
|
+
].join(" ");
|
|
88
84
|
}
|
|
89
|
-
return `Vite glob is missing key "${globKey}" for report path "${rel_path}".
|
|
85
|
+
return `Vite glob is missing key "${globKey}" for report path "${rel_path}". Use autoPlayground + dslinter/vite, or run npx dslinter init for a custom buildRegistry.ts glob.`;
|
|
90
86
|
}
|
|
91
87
|
if (playgroundJoinSkip?.reason === "export_not_found") {
|
|
92
88
|
return `Module loaded but named export "${playgroundJoinSkip.export_name}" was not found. Use export function ${playgroundJoinSkip.export_name}(…) in ${playgroundJoinSkip.rel_path}.`;
|
|
93
89
|
}
|
|
94
90
|
if (playgroundSpec) {
|
|
95
|
-
return `Report path: ${playgroundSpec.rel_path} (export ${playgroundSpec.export_name}).
|
|
91
|
+
return `Report path: ${playgroundSpec.rel_path} (export ${playgroundSpec.export_name}). Use autoPlayground with dslinter/vite, or ensure buildRegistry.ts glob covers this file.`;
|
|
96
92
|
}
|
|
97
93
|
return null;
|
|
98
94
|
})();
|
|
@@ -76,18 +76,24 @@ export function ComponentUsageDetails({
|
|
|
76
76
|
<Table className="[&>table]:table-fixed [&>table]:w-full">
|
|
77
77
|
<TableHeader>
|
|
78
78
|
<TableRow>
|
|
79
|
-
<TableHead className="w-[40%]">File</TableHead>
|
|
79
|
+
<TableHead className="w-[40%] min-w-0">File</TableHead>
|
|
80
80
|
<TableHead className="w-14 whitespace-nowrap">Line</TableHead>
|
|
81
81
|
<TableHead className="min-w-0">Props at this call site</TableHead>
|
|
82
82
|
</TableRow>
|
|
83
83
|
</TableHeader>
|
|
84
84
|
<TableBody>
|
|
85
85
|
{rows.map((loc, i) => {
|
|
86
|
+
const fileText = shortPath(report.root, loc.path);
|
|
86
87
|
const propsText = formatCallSiteProps(loc);
|
|
87
88
|
return (
|
|
88
89
|
<TableRow key={`${loc.path}-${loc.line}-${i}`}>
|
|
89
|
-
<TableCell className="
|
|
90
|
-
|
|
90
|
+
<TableCell className="min-w-0 max-w-0">
|
|
91
|
+
<span
|
|
92
|
+
className="block truncate font-mono text-xs text-foreground"
|
|
93
|
+
title={fileText}
|
|
94
|
+
>
|
|
95
|
+
{fileText}
|
|
96
|
+
</span>
|
|
91
97
|
</TableCell>
|
|
92
98
|
<TableCell className="tabular-nums text-muted-foreground">
|
|
93
99
|
{loc.line}
|
package/src/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ export {
|
|
|
39
39
|
createPlaygroundRegistry,
|
|
40
40
|
createPlaygroundRegistryEntriesOnly,
|
|
41
41
|
} from "./playground/createPlaygroundRegistry";
|
|
42
|
+
export { usePlaygroundFromReport } from "./playground/usePlaygroundFromReport";
|
|
42
43
|
export type { CreatePlaygroundRegistryOptions } from "./playground/createPlaygroundRegistry";
|
|
43
44
|
export type { DefinedPlayground } from "./playground/definePlayground";
|
|
44
45
|
export type { PlaygroundPreviewProps, PlaygroundPreviewComponent } from "./types/preview";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { scanPlaygroundModules } from "virtual:dslinter/playground-modules";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { embedGlobKeyFromRelPath } from "../../vite/collectScanModules";
|
|
3
|
+
import { buildPlaygroundEntriesFromReportWithSkips } from "./buildPlaygroundEntriesFromReport";
|
|
4
|
+
|
|
5
|
+
describe("autoPlayground join (embed glob keys)", () => {
|
|
6
|
+
it("joins report playgrounds to virtual module keys", () => {
|
|
7
|
+
const relPath =
|
|
8
|
+
"resources/js/Components/Billing/AdditionalEventLimitModal.tsx";
|
|
9
|
+
const globKey = embedGlobKeyFromRelPath(relPath);
|
|
10
|
+
const modules = {
|
|
11
|
+
[globKey]: {
|
|
12
|
+
AdditionalEventLimitModal: function AdditionalEventLimitModal() {
|
|
13
|
+
return null;
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const report = {
|
|
18
|
+
playgrounds: [
|
|
19
|
+
{
|
|
20
|
+
id: "AdditionalEventLimitModal",
|
|
21
|
+
export_name: "AdditionalEventLimitModal",
|
|
22
|
+
rel_path: relPath,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const { entries, skipped } = buildPlaygroundEntriesFromReportWithSkips(
|
|
28
|
+
report,
|
|
29
|
+
modules,
|
|
30
|
+
{ logJoinSkips: false },
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
expect(skipped).toHaveLength(0);
|
|
34
|
+
expect(entries).toHaveLength(1);
|
|
35
|
+
expect(entries[0]?.modulePath).toBe(globKey);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import type { WorkspaceReport } from "../types/report";
|
|
3
|
+
import { buildPlaygroundEntriesFromReportWithSkips } from "./buildPlaygroundEntriesFromReport";
|
|
4
|
+
import type { BuildPlaygroundResult } from "./buildPlaygroundEntriesFromReport";
|
|
5
|
+
import { scanPlaygroundModules } from "./scanPlaygroundModules";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Join scanner `playgrounds` to eager modules from the dslinter Vite plugin
|
|
9
|
+
* (`virtual:dslinter/playground-modules`). Requires `plugins: [dslinter()]` from
|
|
10
|
+
* `dslinter/vite`, or `npx dslinter` which merges the plugin automatically.
|
|
11
|
+
*/
|
|
12
|
+
export function usePlaygroundFromReport(
|
|
13
|
+
report: WorkspaceReport | null | undefined,
|
|
14
|
+
): BuildPlaygroundResult {
|
|
15
|
+
return useMemo(
|
|
16
|
+
() =>
|
|
17
|
+
buildPlaygroundEntriesFromReportWithSkips(
|
|
18
|
+
report,
|
|
19
|
+
scanPlaygroundModules,
|
|
20
|
+
),
|
|
21
|
+
[report],
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import {
|
|
3
3
|
createContext,
|
|
4
|
+
lazy,
|
|
5
|
+
Suspense,
|
|
4
6
|
useCallback,
|
|
5
7
|
useContext,
|
|
6
8
|
useEffect,
|
|
@@ -26,6 +28,8 @@ import {
|
|
|
26
28
|
} from "../playground/playgroundJoin";
|
|
27
29
|
import { useHashRoute } from "./useHashRoute";
|
|
28
30
|
|
|
31
|
+
const DashboardLayoutAuto = lazy(() => import("./DashboardLayoutAuto"));
|
|
32
|
+
|
|
29
33
|
const STORAGE_KEY = "dslinter-dashboard-theme";
|
|
30
34
|
|
|
31
35
|
export type DashboardThemePreference = "light" | "dark";
|
|
@@ -124,7 +128,14 @@ export function useDashboardTheme(): DashboardThemeContextValue {
|
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
export type DashboardLayoutProps = {
|
|
127
|
-
|
|
131
|
+
/**
|
|
132
|
+
* When true, loads playground modules from the dslinter Vite plugin
|
|
133
|
+
* (`virtual:dslinter/playground-modules`). Requires `plugins: [dslinter()]`
|
|
134
|
+
* from `dslinter/vite`, or running via `npx dslinter`.
|
|
135
|
+
*/
|
|
136
|
+
autoPlayground?: boolean;
|
|
137
|
+
/** Required unless `autoPlayground` is true. */
|
|
138
|
+
playgroundEntries?: PlaygroundEntry[];
|
|
128
139
|
/** Join failures from `buildPlaygroundEntriesFromReportWithSkips` — powers inspect-pane hints. */
|
|
129
140
|
playgroundJoinSkips?: PlaygroundJoinSkip[];
|
|
130
141
|
tokenCatalog?: TokenCatalog;
|
|
@@ -140,7 +151,15 @@ export type DashboardLayoutProps = {
|
|
|
140
151
|
dslinterReport: DslinterReportState;
|
|
141
152
|
};
|
|
142
153
|
|
|
143
|
-
|
|
154
|
+
export type DashboardLayoutInnerProps = Omit<
|
|
155
|
+
DashboardLayoutProps,
|
|
156
|
+
"autoPlayground" | "playgroundEntries" | "playgroundJoinSkips"
|
|
157
|
+
> & {
|
|
158
|
+
playgroundEntries: PlaygroundEntry[];
|
|
159
|
+
playgroundJoinSkips?: PlaygroundJoinSkip[];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export function DashboardLayoutInner({
|
|
144
163
|
playgroundEntries,
|
|
145
164
|
playgroundJoinSkips,
|
|
146
165
|
tokenCatalog,
|
|
@@ -149,7 +168,7 @@ function DashboardLayoutInner({
|
|
|
149
168
|
dslinterReportHint,
|
|
150
169
|
formatModulePath,
|
|
151
170
|
dslinterReport,
|
|
152
|
-
}:
|
|
171
|
+
}: DashboardLayoutInnerProps) {
|
|
153
172
|
const [route, navigate] = useHashRoute();
|
|
154
173
|
const [commandPaletteOpen, setCommandPaletteOpen] = useState(false);
|
|
155
174
|
const { theme, setTheme, resolvedTheme } = useDashboardTheme();
|
|
@@ -267,9 +286,23 @@ function DashboardLayoutInner({
|
|
|
267
286
|
}
|
|
268
287
|
|
|
269
288
|
export function DashboardLayout(props: DashboardLayoutProps) {
|
|
289
|
+
if (props.autoPlayground) {
|
|
290
|
+
return (
|
|
291
|
+
<DashboardThemeProvider>
|
|
292
|
+
<Suspense fallback={null}>
|
|
293
|
+
<DashboardLayoutAuto {...props} />
|
|
294
|
+
</Suspense>
|
|
295
|
+
</DashboardThemeProvider>
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
270
299
|
return (
|
|
271
300
|
<DashboardThemeProvider>
|
|
272
|
-
<DashboardLayoutInner
|
|
301
|
+
<DashboardLayoutInner
|
|
302
|
+
{...props}
|
|
303
|
+
playgroundEntries={props.playgroundEntries ?? []}
|
|
304
|
+
playgroundJoinSkips={props.playgroundJoinSkips}
|
|
305
|
+
/>
|
|
273
306
|
</DashboardThemeProvider>
|
|
274
307
|
);
|
|
275
308
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DashboardLayoutProps } from "./DashboardLayout";
|
|
2
|
+
import { usePlaygroundFromReport } from "../playground/usePlaygroundFromReport";
|
|
3
|
+
import { DashboardLayoutInner } from "./DashboardLayout";
|
|
4
|
+
|
|
5
|
+
/** Loaded via `React.lazy` when `autoPlayground` is set (pulls virtual playground modules). */
|
|
6
|
+
export default function DashboardLayoutAuto(props: DashboardLayoutProps) {
|
|
7
|
+
const autoPlaygroundBuild = usePlaygroundFromReport(props.dslinterReport.report);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<DashboardLayoutInner
|
|
11
|
+
{...props}
|
|
12
|
+
playgroundEntries={autoPlaygroundBuild.entries}
|
|
13
|
+
playgroundJoinSkips={autoPlaygroundBuild.skipped}
|
|
14
|
+
formatModulePath={
|
|
15
|
+
props.formatModulePath ??
|
|
16
|
+
((modulePath: string) => modulePath.replace(/^@dslint-scan\//, ""))
|
|
17
|
+
}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// import path from "node:path";
|
|
4
|
-
// const scanRoot = path.resolve(process.env.DSLINT_SCAN_ROOT ?? ".");
|
|
5
|
-
//
|
|
6
|
-
// resolve: { alias: { "@dslint-scan": scanRoot } },
|
|
7
|
-
// server: { fs: { allow: [scanRoot] } },
|
|
8
|
-
//
|
|
9
|
-
// App — glob every .tsx/.jsx under @dslint-scan (use ** recursive glob in import.meta.glob).
|
|
10
|
-
// buildPlaygroundEntriesFromReport(report, modules);
|
|
11
|
-
//
|
|
12
|
-
// Prefer: npx dslinter init --laravel (relative glob) for Inertia resources/js layouts.
|
|
1
|
+
// Deprecated — use `import dslinter from "dslinter/vite"` instead.
|
|
2
|
+
// The plugin generates virtual playground modules; no @dslint-scan alias required.
|
|
13
3
|
|
|
14
4
|
export {};
|