deslop-js 0.6.3 → 0.7.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.
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_constants = require('./constants-CD9NXHxi.cjs');
3
+
4
+ exports.ANALYZED_MANIFEST_FILENAMES = require_constants.ANALYZED_MANIFEST_FILENAMES;
5
+ exports.DEFAULT_EXTENSIONS = require_constants.DEFAULT_EXTENSIONS;
@@ -0,0 +1,5 @@
1
+ //#region src/constants.d.ts
2
+ declare const DEFAULT_EXTENSIONS: string[];
3
+ declare const ANALYZED_MANIFEST_FILENAMES: string[];
4
+ //#endregion
5
+ export { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS };
@@ -0,0 +1,5 @@
1
+ //#region src/constants.d.ts
2
+ declare const DEFAULT_EXTENSIONS: string[];
3
+ declare const ANALYZED_MANIFEST_FILENAMES: string[];
4
+ //#endregion
5
+ export { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS };
@@ -0,0 +1,3 @@
1
+ import { o as DEFAULT_EXTENSIONS, t as ANALYZED_MANIFEST_FILENAMES } from "./constants-oYYofMhb.mjs";
2
+
3
+ export { ANALYZED_MANIFEST_FILENAMES, DEFAULT_EXTENSIONS };
@@ -0,0 +1,530 @@
1
+
2
+ //#region src/constants.ts
3
+ const DEFAULT_EXTENSIONS = [
4
+ ".ts",
5
+ ".tsx",
6
+ ".js",
7
+ ".jsx",
8
+ ".mts",
9
+ ".mjs",
10
+ ".cts",
11
+ ".cjs",
12
+ ".mdx",
13
+ ".astro",
14
+ ".graphql",
15
+ ".gql",
16
+ ".css",
17
+ ".scss",
18
+ ".vue",
19
+ ".svelte"
20
+ ];
21
+ const STANDALONE_PROJECT_LOCKFILES = [
22
+ "package-lock.json",
23
+ "yarn.lock",
24
+ "pnpm-lock.yaml",
25
+ "bun.lockb"
26
+ ];
27
+ const MONOREPO_ROOT_MARKERS = [
28
+ "pnpm-workspace.yaml",
29
+ "pnpm-workspace.yml",
30
+ "lerna.json",
31
+ "nx.json",
32
+ "turbo.json",
33
+ "rush.json"
34
+ ];
35
+ const LOCKFILE_MARKERS = [
36
+ "pnpm-lock.yaml",
37
+ "yarn.lock",
38
+ "package-lock.json",
39
+ "bun.lockb",
40
+ "bun.lock"
41
+ ];
42
+ const ANALYZED_MANIFEST_FILENAMES = [...new Set([
43
+ "package.json",
44
+ "pnpm-workspace.yaml",
45
+ "lerna.json",
46
+ "app.json",
47
+ "ng-package.json",
48
+ ".gitignore",
49
+ ...STANDALONE_PROJECT_LOCKFILES,
50
+ ...MONOREPO_ROOT_MARKERS,
51
+ ...LOCKFILE_MARKERS
52
+ ])];
53
+ const HIDDEN_DIRECTORY_ALLOWLIST = [
54
+ ".storybook",
55
+ ".vitepress",
56
+ ".well-known",
57
+ ".changeset",
58
+ ".github",
59
+ ".client",
60
+ ".server"
61
+ ];
62
+ const OUTPUT_DIRECTORIES = [
63
+ "dist",
64
+ "build",
65
+ "out",
66
+ "esm",
67
+ "cjs"
68
+ ];
69
+ const SOURCE_EXTENSIONS = [
70
+ "ts",
71
+ "tsx",
72
+ "mts",
73
+ "cts",
74
+ "js",
75
+ "jsx",
76
+ "mjs",
77
+ "cjs"
78
+ ];
79
+ const DEFAULT_EXCLUSIONS = [
80
+ "**/node_modules/**",
81
+ "**/.git/**",
82
+ "**/coverage/**",
83
+ "**/*.min.js",
84
+ "**/*.min.mjs",
85
+ "**/mockServiceWorker.js"
86
+ ];
87
+ const SCRIPT_FILE_PATTERN = /(?:^|\s)(?:node|tsx|ts-node|tsc|npx|bun|esr|esno|jiti|babel-node|zx)\s+(?:\S+\s+)*?([\w./@-]+\.(?:ts|tsx|js|jsx|mts|mjs|cts|cjs))(?:\s|$)/;
88
+ const SCRIPT_EXTENSIONLESS_FILE_PATTERN = /(?:^|\s)(?:node|tsx|ts-node|bun|esr|esno|jiti|babel-node|zx)\s+(?:\S+\s+)*?((?:[./]|[\w@][\w@-]*\/)[\w./@-]+)(?:\s|$)/;
89
+ const SCRIPT_CONFIG_FILE_PATTERN = /--config\s+([\w./@-]+\.(?:ts|tsx|js|jsx|mts|mjs|cts|cjs))/;
90
+ const SCRIPT_ENTRY_PATTERNS = [];
91
+ const DEFAULT_ENTRY_GLOBS = [
92
+ "src/index.{ts,tsx,js,jsx}",
93
+ "src/main.{ts,tsx,js,jsx}",
94
+ "index.{ts,tsx,js,jsx}",
95
+ "main.{ts,tsx,js,jsx}"
96
+ ];
97
+ const KNOWN_CONFIG_PREFIXES = [
98
+ "babel.config.",
99
+ "rollup.config.",
100
+ "webpack.config.",
101
+ "postcss.config.",
102
+ "stencil.config.",
103
+ "remotion.config.",
104
+ "metro.config.",
105
+ "tsup.config.",
106
+ "tsdown.config.",
107
+ "unbuild.config.",
108
+ "esbuild.config.",
109
+ "swc.config.",
110
+ "turbo.",
111
+ "jest.config.",
112
+ "jest.setup.",
113
+ "vitest.config.",
114
+ "vitest.ci.config.",
115
+ "vitest.setup.",
116
+ "vitest.workspace.",
117
+ "playwright.config.",
118
+ "cypress.config.",
119
+ "karma.conf.",
120
+ "eslint.config.",
121
+ "prettier.config.",
122
+ "stylelint.config.",
123
+ "lint-staged.config.",
124
+ "commitlint.config.",
125
+ "next.config.",
126
+ "next-sitemap.config.",
127
+ "nuxt.config.",
128
+ "astro.config.",
129
+ "sanity.config.",
130
+ "vite.config.",
131
+ "tailwind.config.",
132
+ "drizzle.config.",
133
+ "knexfile.",
134
+ "sentry.client.config.",
135
+ "sentry.server.config.",
136
+ "sentry.edge.config.",
137
+ "react-router.config.",
138
+ "typedoc.",
139
+ "deslop.config.",
140
+ "i18next-parser.config.",
141
+ "codegen.config.",
142
+ "graphql.config.",
143
+ "npmpackagejsonlint.config.",
144
+ "release-it.",
145
+ "release.config.",
146
+ "contentlayer.config.",
147
+ "rspack.config.",
148
+ "rsbuild.config.",
149
+ "module-federation.config.",
150
+ "vercel.",
151
+ "next-env.d.",
152
+ "env.d.",
153
+ "vite-env.d."
154
+ ];
155
+ const IMPLICIT_DEPENDENCIES = new Set([
156
+ "typescript",
157
+ "@types/node",
158
+ "@types/react",
159
+ "@types/react-dom",
160
+ "eslint",
161
+ "prettier",
162
+ "husky",
163
+ "lint-staged",
164
+ "tslib",
165
+ "@babel/core",
166
+ "@babel/runtime",
167
+ "babel-core",
168
+ "babel-jest",
169
+ "babel-loader",
170
+ "postcss",
171
+ "cross-env",
172
+ "sass",
173
+ "node-sass",
174
+ "less",
175
+ "oxlint",
176
+ "biome",
177
+ "@biomejs/biome",
178
+ "patch-package",
179
+ "simple-git-hooks",
180
+ "lefthook",
181
+ "ts-node",
182
+ "ts-jest",
183
+ "tsx",
184
+ "jsdom",
185
+ "rimraf",
186
+ "concurrently",
187
+ "npm-run-all",
188
+ "npm-run-all2",
189
+ "dotenv-cli",
190
+ "webpack",
191
+ "rollup",
192
+ "terser",
193
+ "autoprefixer",
194
+ "tailwindcss",
195
+ "react-test-renderer",
196
+ "esbuild",
197
+ "typedoc",
198
+ "commitizen",
199
+ "cz-conventional-changelog"
200
+ ]);
201
+ const BUILTIN_MODULES = new Set([
202
+ "assert",
203
+ "async_hooks",
204
+ "buffer",
205
+ "child_process",
206
+ "cluster",
207
+ "console",
208
+ "constants",
209
+ "crypto",
210
+ "dgram",
211
+ "diagnostics_channel",
212
+ "dns",
213
+ "domain",
214
+ "events",
215
+ "fs",
216
+ "http",
217
+ "http2",
218
+ "https",
219
+ "inspector",
220
+ "module",
221
+ "net",
222
+ "os",
223
+ "path",
224
+ "perf_hooks",
225
+ "process",
226
+ "punycode",
227
+ "querystring",
228
+ "readline",
229
+ "repl",
230
+ "stream",
231
+ "string_decoder",
232
+ "sys",
233
+ "timers",
234
+ "tls",
235
+ "trace_events",
236
+ "tty",
237
+ "url",
238
+ "util",
239
+ "v8",
240
+ "vm",
241
+ "wasi",
242
+ "worker_threads",
243
+ "zlib"
244
+ ]);
245
+ const PLATFORM_SUFFIXES = [
246
+ ".web",
247
+ ".react-native",
248
+ ".native",
249
+ ".ios",
250
+ ".android",
251
+ ".desktop",
252
+ ".windows",
253
+ ".macos",
254
+ ".any",
255
+ ".react-server",
256
+ ".server",
257
+ ".client"
258
+ ];
259
+ const REACT_NATIVE_PLATFORM_EXTENSIONS = [
260
+ ".web.ts",
261
+ ".web.tsx",
262
+ ".web.js",
263
+ ".web.jsx",
264
+ ".native.ts",
265
+ ".native.tsx",
266
+ ".native.js",
267
+ ".native.jsx",
268
+ ".ios.ts",
269
+ ".ios.tsx",
270
+ ".ios.js",
271
+ ".ios.jsx",
272
+ ".android.ts",
273
+ ".android.tsx",
274
+ ".android.js",
275
+ ".android.jsx"
276
+ ];
277
+ const RESOLVER_EXTENSIONS = [
278
+ ...DEFAULT_EXTENSIONS,
279
+ ".d.ts",
280
+ ".d.mts",
281
+ ".d.cts",
282
+ ".json",
283
+ ".node",
284
+ ".css",
285
+ ".scss",
286
+ ".less",
287
+ ".svg",
288
+ ".png",
289
+ ".jpg",
290
+ ".graphql",
291
+ ".gql"
292
+ ];
293
+ const SEMANTIC_MAX_PROGRAM_FILES = 5e3;
294
+ const MAX_PARSE_FILE_SIZE_BYTES = 2e6;
295
+ const MAX_ANALYSIS_ERRORS = 5e3;
296
+ const MAX_ERROR_DETAIL_LENGTH = 1e3;
297
+ const SUMMARY_CACHE_MAX_BYTES = 256 * 1024 * 1024;
298
+ const BINARY_DETECTION_SAMPLE_BYTES = 2048;
299
+ const MINIFIED_DETECTION_MIN_BYTES = 5e3;
300
+ /**
301
+ * Numeric literals below 1000 are dominated by indices, counters, small
302
+ * ranges, ports, percentages, and array sizes that coincide by accident
303
+ * (every `MAX_RETRIES = 3` is not a duplicate of every `LIMIT = 3`).
304
+ * 1000 admits real shared constants (timeouts in ms, byte sizes, polling
305
+ * intervals) without producing the noise floor that smaller magnitudes do.
306
+ * NOTE: even at 1000, the rule still produces medium-confidence false
307
+ * positives when constants share a value coincidentally with different
308
+ * names (e.g. `STEP_DELAY_MS` vs `MINIMUM_TOKENS`); the report explicitly
309
+ * downgrades those to `confidence: "medium"`.
310
+ */
311
+ const MIN_NUMERIC_LITERAL_MAGNITUDE_FOR_DUPLICATE = 1e3;
312
+ const DEFAULT_SEMANTIC_DECORATOR_ALLOWLIST = [
313
+ "Component",
314
+ "Injectable",
315
+ "NgModule",
316
+ "Pipe",
317
+ "Directive",
318
+ "Controller",
319
+ "Module",
320
+ "Resolver",
321
+ "Query",
322
+ "Mutation",
323
+ "Get",
324
+ "Post",
325
+ "Put",
326
+ "Patch",
327
+ "Delete",
328
+ "Head",
329
+ "Options",
330
+ "All",
331
+ "Sse",
332
+ "WebSocketGateway",
333
+ "SubscribeMessage"
334
+ ];
335
+ const DEFAULT_SEMANTIC_TSCONFIG_NAMES = [
336
+ "tsconfig.json",
337
+ "tsconfig.app.json",
338
+ "tsconfig.build.json",
339
+ "tsconfig.src.json",
340
+ "jsconfig.json"
341
+ ];
342
+ const GIT_CHECK_IGNORE_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
343
+
344
+ //#endregion
345
+ Object.defineProperty(exports, 'ANALYZED_MANIFEST_FILENAMES', {
346
+ enumerable: true,
347
+ get: function () {
348
+ return ANALYZED_MANIFEST_FILENAMES;
349
+ }
350
+ });
351
+ Object.defineProperty(exports, 'BINARY_DETECTION_SAMPLE_BYTES', {
352
+ enumerable: true,
353
+ get: function () {
354
+ return BINARY_DETECTION_SAMPLE_BYTES;
355
+ }
356
+ });
357
+ Object.defineProperty(exports, 'BUILTIN_MODULES', {
358
+ enumerable: true,
359
+ get: function () {
360
+ return BUILTIN_MODULES;
361
+ }
362
+ });
363
+ Object.defineProperty(exports, 'DEFAULT_ENTRY_GLOBS', {
364
+ enumerable: true,
365
+ get: function () {
366
+ return DEFAULT_ENTRY_GLOBS;
367
+ }
368
+ });
369
+ Object.defineProperty(exports, 'DEFAULT_EXCLUSIONS', {
370
+ enumerable: true,
371
+ get: function () {
372
+ return DEFAULT_EXCLUSIONS;
373
+ }
374
+ });
375
+ Object.defineProperty(exports, 'DEFAULT_EXTENSIONS', {
376
+ enumerable: true,
377
+ get: function () {
378
+ return DEFAULT_EXTENSIONS;
379
+ }
380
+ });
381
+ Object.defineProperty(exports, 'DEFAULT_SEMANTIC_DECORATOR_ALLOWLIST', {
382
+ enumerable: true,
383
+ get: function () {
384
+ return DEFAULT_SEMANTIC_DECORATOR_ALLOWLIST;
385
+ }
386
+ });
387
+ Object.defineProperty(exports, 'DEFAULT_SEMANTIC_TSCONFIG_NAMES', {
388
+ enumerable: true,
389
+ get: function () {
390
+ return DEFAULT_SEMANTIC_TSCONFIG_NAMES;
391
+ }
392
+ });
393
+ Object.defineProperty(exports, 'GIT_CHECK_IGNORE_MAX_BUFFER_BYTES', {
394
+ enumerable: true,
395
+ get: function () {
396
+ return GIT_CHECK_IGNORE_MAX_BUFFER_BYTES;
397
+ }
398
+ });
399
+ Object.defineProperty(exports, 'HIDDEN_DIRECTORY_ALLOWLIST', {
400
+ enumerable: true,
401
+ get: function () {
402
+ return HIDDEN_DIRECTORY_ALLOWLIST;
403
+ }
404
+ });
405
+ Object.defineProperty(exports, 'IMPLICIT_DEPENDENCIES', {
406
+ enumerable: true,
407
+ get: function () {
408
+ return IMPLICIT_DEPENDENCIES;
409
+ }
410
+ });
411
+ Object.defineProperty(exports, 'KNOWN_CONFIG_PREFIXES', {
412
+ enumerable: true,
413
+ get: function () {
414
+ return KNOWN_CONFIG_PREFIXES;
415
+ }
416
+ });
417
+ Object.defineProperty(exports, 'LOCKFILE_MARKERS', {
418
+ enumerable: true,
419
+ get: function () {
420
+ return LOCKFILE_MARKERS;
421
+ }
422
+ });
423
+ Object.defineProperty(exports, 'MAX_ANALYSIS_ERRORS', {
424
+ enumerable: true,
425
+ get: function () {
426
+ return MAX_ANALYSIS_ERRORS;
427
+ }
428
+ });
429
+ Object.defineProperty(exports, 'MAX_ERROR_DETAIL_LENGTH', {
430
+ enumerable: true,
431
+ get: function () {
432
+ return MAX_ERROR_DETAIL_LENGTH;
433
+ }
434
+ });
435
+ Object.defineProperty(exports, 'MAX_PARSE_FILE_SIZE_BYTES', {
436
+ enumerable: true,
437
+ get: function () {
438
+ return MAX_PARSE_FILE_SIZE_BYTES;
439
+ }
440
+ });
441
+ Object.defineProperty(exports, 'MINIFIED_DETECTION_MIN_BYTES', {
442
+ enumerable: true,
443
+ get: function () {
444
+ return MINIFIED_DETECTION_MIN_BYTES;
445
+ }
446
+ });
447
+ Object.defineProperty(exports, 'MIN_NUMERIC_LITERAL_MAGNITUDE_FOR_DUPLICATE', {
448
+ enumerable: true,
449
+ get: function () {
450
+ return MIN_NUMERIC_LITERAL_MAGNITUDE_FOR_DUPLICATE;
451
+ }
452
+ });
453
+ Object.defineProperty(exports, 'MONOREPO_ROOT_MARKERS', {
454
+ enumerable: true,
455
+ get: function () {
456
+ return MONOREPO_ROOT_MARKERS;
457
+ }
458
+ });
459
+ Object.defineProperty(exports, 'OUTPUT_DIRECTORIES', {
460
+ enumerable: true,
461
+ get: function () {
462
+ return OUTPUT_DIRECTORIES;
463
+ }
464
+ });
465
+ Object.defineProperty(exports, 'PLATFORM_SUFFIXES', {
466
+ enumerable: true,
467
+ get: function () {
468
+ return PLATFORM_SUFFIXES;
469
+ }
470
+ });
471
+ Object.defineProperty(exports, 'REACT_NATIVE_PLATFORM_EXTENSIONS', {
472
+ enumerable: true,
473
+ get: function () {
474
+ return REACT_NATIVE_PLATFORM_EXTENSIONS;
475
+ }
476
+ });
477
+ Object.defineProperty(exports, 'RESOLVER_EXTENSIONS', {
478
+ enumerable: true,
479
+ get: function () {
480
+ return RESOLVER_EXTENSIONS;
481
+ }
482
+ });
483
+ Object.defineProperty(exports, 'SCRIPT_CONFIG_FILE_PATTERN', {
484
+ enumerable: true,
485
+ get: function () {
486
+ return SCRIPT_CONFIG_FILE_PATTERN;
487
+ }
488
+ });
489
+ Object.defineProperty(exports, 'SCRIPT_ENTRY_PATTERNS', {
490
+ enumerable: true,
491
+ get: function () {
492
+ return SCRIPT_ENTRY_PATTERNS;
493
+ }
494
+ });
495
+ Object.defineProperty(exports, 'SCRIPT_EXTENSIONLESS_FILE_PATTERN', {
496
+ enumerable: true,
497
+ get: function () {
498
+ return SCRIPT_EXTENSIONLESS_FILE_PATTERN;
499
+ }
500
+ });
501
+ Object.defineProperty(exports, 'SCRIPT_FILE_PATTERN', {
502
+ enumerable: true,
503
+ get: function () {
504
+ return SCRIPT_FILE_PATTERN;
505
+ }
506
+ });
507
+ Object.defineProperty(exports, 'SEMANTIC_MAX_PROGRAM_FILES', {
508
+ enumerable: true,
509
+ get: function () {
510
+ return SEMANTIC_MAX_PROGRAM_FILES;
511
+ }
512
+ });
513
+ Object.defineProperty(exports, 'SOURCE_EXTENSIONS', {
514
+ enumerable: true,
515
+ get: function () {
516
+ return SOURCE_EXTENSIONS;
517
+ }
518
+ });
519
+ Object.defineProperty(exports, 'STANDALONE_PROJECT_LOCKFILES', {
520
+ enumerable: true,
521
+ get: function () {
522
+ return STANDALONE_PROJECT_LOCKFILES;
523
+ }
524
+ });
525
+ Object.defineProperty(exports, 'SUMMARY_CACHE_MAX_BYTES', {
526
+ enumerable: true,
527
+ get: function () {
528
+ return SUMMARY_CACHE_MAX_BYTES;
529
+ }
530
+ });