@reliverse/dler 1.7.1 → 1.7.3

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.
Files changed (120) hide show
  1. package/README.md +134 -87
  2. package/bin/app/agg/run.js +2 -2
  3. package/bin/app/build/cmd.js +1 -1
  4. package/bin/app/build/impl.js +1 -1
  5. package/bin/app/check/cmd.d.ts +37 -0
  6. package/bin/app/check/cmd.js +103 -13
  7. package/bin/app/cmds.d.ts +15 -20
  8. package/bin/app/cmds.js +16 -76
  9. package/bin/app/{deps → copy}/cmd.d.ts +9 -23
  10. package/bin/app/copy/cmd.js +173 -0
  11. package/bin/app/inject/cmd.d.ts +13 -0
  12. package/bin/app/inject/cmd.js +33 -21
  13. package/bin/app/merge/cmd.d.ts +63 -5
  14. package/bin/app/merge/cmd.js +220 -25
  15. package/bin/app/migrate/cmd.d.ts +17 -0
  16. package/bin/app/migrate/cmd.js +68 -17
  17. package/bin/app/migrate/codemods/{anything-to-bun.js → anything-bun.js} +9 -6
  18. package/bin/app/{rempts/migrate/impl/commander.js → migrate/codemods/commander-rempts.js} +2 -8
  19. package/bin/app/migrate/codemods/console-relinka.d.ts +3 -0
  20. package/bin/app/migrate/codemods/console-relinka.js +157 -0
  21. package/bin/app/migrate/codemods/readdir-glob.d.ts +8 -0
  22. package/bin/app/migrate/codemods/readdir-glob.js +144 -0
  23. package/bin/app/pub/cmd.js +1 -1
  24. package/bin/app/rempts/{cmdsTs/cmd.d.ts → cmd.d.ts} +13 -4
  25. package/bin/app/rempts/cmd.js +304 -0
  26. package/bin/cli.js +33 -12
  27. package/bin/libs/sdk/sdk-impl/{config → cfg}/info.js +1 -1
  28. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/dler-config-health}/dler-config-health.d.ts +1 -1
  29. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/dler-config-health}/dler-config-health.js +1 -1
  30. package/bin/libs/sdk/sdk-impl/rules/reliverse/file-extensions/file-extensions.d.ts +2 -0
  31. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/file-extensions}/file-extensions.js +2 -2
  32. package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/analyzer.js +15 -1
  33. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-mod.d.ts +2 -0
  34. package/bin/libs/sdk/sdk-impl/{check/rules/missing-deps.js → rules/reliverse/missing-deps/deps-mod.js} +2 -2
  35. package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/deps-types.d.ts +2 -0
  36. package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/filesystem.js +2 -3
  37. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/formatter.js +113 -0
  38. package/bin/libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.d.ts +2 -0
  39. package/bin/libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.js +31 -0
  40. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/package-json-health}/package-json-health.d.ts +1 -1
  41. package/bin/libs/sdk/sdk-impl/rules/reliverse/path-extensions/path-extensions.d.ts +2 -0
  42. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/path-extensions}/path-extensions.js +2 -2
  43. package/bin/libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.d.ts +2 -0
  44. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/self-include}/self-include.js +2 -2
  45. package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/tsconfig-health}/tsconfig-health.d.ts +1 -1
  46. package/bin/libs/sdk/sdk-impl/{check/check-mod.js → rules/rules-mod.js} +10 -0
  47. package/bin/libs/sdk/sdk-impl/{check/check-utils.d.ts → rules/rules-utils.d.ts} +1 -1
  48. package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-libs.js +6 -4
  49. package/bin/libs/sdk/sdk-types.d.ts +2 -2
  50. package/bin/mod.d.ts +1 -1
  51. package/bin/mod.js +1 -1
  52. package/package.json +2 -4
  53. package/bin/app/deps/cmd.js +0 -84
  54. package/bin/app/inject/README.md +0 -139
  55. package/bin/app/inject/expect/cmd.d.ts +0 -20
  56. package/bin/app/inject/expect/cmd.js +0 -43
  57. package/bin/app/relifso/cmd.d.ts +0 -11
  58. package/bin/app/relifso/cmd.js +0 -47
  59. package/bin/app/relinka/cmd.d.ts +0 -18
  60. package/bin/app/relinka/cmd.js +0 -149
  61. package/bin/app/rempts/README.md +0 -121
  62. package/bin/app/rempts/cmd/cmd.d.ts +0 -16
  63. package/bin/app/rempts/cmd/cmd.js +0 -157
  64. package/bin/app/rempts/cmd/templates.d.ts +0 -2
  65. package/bin/app/rempts/cmd/templates.js +0 -30
  66. package/bin/app/rempts/cmdsTs/cmd.js +0 -96
  67. package/bin/app/rempts/migrate/cmd.d.ts +0 -14
  68. package/bin/app/rempts/migrate/cmd.js +0 -38
  69. package/bin/libs/sdk/sdk-impl/check/rules/deps/formatter.js +0 -64
  70. package/bin/libs/sdk/sdk-impl/check/rules/file-extensions.d.ts +0 -2
  71. package/bin/libs/sdk/sdk-impl/check/rules/missing-deps.d.ts +0 -2
  72. package/bin/libs/sdk/sdk-impl/check/rules/path-extensions.d.ts +0 -2
  73. package/bin/libs/sdk/sdk-impl/check/rules/self-include.d.ts +0 -2
  74. /package/bin/app/{relifso/init → init}/cmd.d.ts +0 -0
  75. /package/bin/app/{relifso/init → init}/cmd.js +0 -0
  76. /package/bin/app/{relifso/init → init}/init-const.d.ts +0 -0
  77. /package/bin/app/{relifso/init → init}/init-const.js +0 -0
  78. /package/bin/app/{relifso/init → init}/init-impl.d.ts +0 -0
  79. /package/bin/app/{relifso/init → init}/init-impl.js +0 -0
  80. /package/bin/app/{relifso/init → init}/init-types.d.ts +0 -0
  81. /package/bin/app/{relifso/init → init}/init-types.js +0 -0
  82. /package/bin/app/{relifso/init → init}/templates/t-gitignore.d.ts +0 -0
  83. /package/bin/app/{relifso/init → init}/templates/t-gitignore.js +0 -0
  84. /package/bin/app/{relifso/init → init}/templates/t-license.d.ts +0 -0
  85. /package/bin/app/{relifso/init → init}/templates/t-license.js +0 -0
  86. /package/bin/app/{relifso/init → init}/templates/t-readme.d.ts +0 -0
  87. /package/bin/app/{relifso/init → init}/templates/t-readme.js +0 -0
  88. /package/bin/app/inject/{expect/impl.d.ts → impl.d.ts} +0 -0
  89. /package/bin/app/inject/{expect/impl.js → impl.js} +0 -0
  90. /package/bin/app/migrate/codemods/{anything-to-bun.d.ts → anything-bun.d.ts} +0 -0
  91. /package/bin/app/{rempts/migrate/impl/commander.d.ts → migrate/codemods/commander-rempts.d.ts} +0 -0
  92. /package/bin/app/migrate/codemods/{fs-to-relifso.d.ts → fs-relifso.d.ts} +0 -0
  93. /package/bin/app/migrate/codemods/{fs-to-relifso.js → fs-relifso.js} +0 -0
  94. /package/bin/app/migrate/codemods/{module-resolution.d.ts → nodenext-bundler.d.ts} +0 -0
  95. /package/bin/app/migrate/codemods/{module-resolution.js → nodenext-bundler.js} +0 -0
  96. /package/bin/app/migrate/codemods/{path-to-pathkit.d.ts → path-pathkit.d.ts} +0 -0
  97. /package/bin/app/migrate/codemods/{path-to-pathkit.js → path-pathkit.js} +0 -0
  98. /package/bin/app/{relifso/rename → rename}/cmd.d.ts +0 -0
  99. /package/bin/app/{relifso/rename → rename}/cmd.js +0 -0
  100. /package/bin/libs/sdk/sdk-impl/{config → cfg}/default.d.ts +0 -0
  101. /package/bin/libs/sdk/sdk-impl/{config → cfg}/default.js +0 -0
  102. /package/bin/libs/sdk/sdk-impl/{config → cfg}/define.d.ts +0 -0
  103. /package/bin/libs/sdk/sdk-impl/{config → cfg}/define.js +0 -0
  104. /package/bin/libs/sdk/sdk-impl/{config → cfg}/info.d.ts +0 -0
  105. /package/bin/libs/sdk/sdk-impl/{config → cfg}/init.d.ts +0 -0
  106. /package/bin/libs/sdk/sdk-impl/{config → cfg}/init.js +0 -0
  107. /package/bin/libs/sdk/sdk-impl/{config → cfg}/load.d.ts +0 -0
  108. /package/bin/libs/sdk/sdk-impl/{config → cfg}/load.js +0 -0
  109. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/analyzer.d.ts +0 -0
  110. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/deps-types.js +0 -0
  111. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/filesystem.d.ts +0 -0
  112. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/formatter.d.ts +0 -0
  113. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/parser.d.ts +0 -0
  114. /package/bin/libs/sdk/sdk-impl/{check/rules/deps → rules/reliverse/missing-deps}/parser.js +0 -0
  115. /package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/package-json-health}/package-json-health.js +0 -0
  116. /package/bin/libs/sdk/sdk-impl/{check/rules → rules/reliverse/tsconfig-health}/tsconfig-health.js +0 -0
  117. /package/bin/libs/sdk/sdk-impl/{check/check-consts.d.ts → rules/rules-consts.d.ts} +0 -0
  118. /package/bin/libs/sdk/sdk-impl/{check/check-consts.js → rules/rules-consts.js} +0 -0
  119. /package/bin/libs/sdk/sdk-impl/{check/check-mod.d.ts → rules/rules-mod.d.ts} +0 -0
  120. /package/bin/libs/sdk/sdk-impl/{check/check-utils.js → rules/rules-utils.js} +0 -0
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  - 🎯 optimized for speed and modern workflows
16
16
  - ✨ packed with powerful features under the hood
17
17
  - 🛠️ converts typescript aliases to relative paths
18
- - 🔌 plugin system with 14 built-in plugins included
18
+ - 🔌 [15 built-in helper dler commands](#-commands) included
19
19
  - 📝 highly configurable flow via a configuration file
20
20
  - 🔜 `libraries` plugin —> dler monorepo implementation
21
21
  - 🧼 cleans up your internal logs from the build dist
@@ -117,17 +117,17 @@ bun dev # bun src/cli.ts --dev
117
117
  dler [build|pub] # if installed globally
118
118
  ```
119
119
 
120
- ## 🔌 plugins
120
+ ## 🔌 commands
121
121
 
122
- dler ships with a flexible plugin system (aka plugins) and **14 built-in plugins** (from [reliverse addons](https://reliverse.org/addons) collection).
122
+ dler ships with a flexible command system (prev. plugins) and **15 built-in commands** (from [reliverse addons](https://reliverse.org/addons) collection).
123
123
 
124
- feel free to create your own plugins. plugins can be implemented as built-in directly in `src/app/<plugin>/impl/*` and then imported from `src/app/<plugin>/cmd.ts`; or implemented in your own library and then imported from `src/app/<plugin>/cmd.ts`.
124
+ feel free to create your own commands. commands can be implemented as built-in directly in `src/app/<command>/impl/*` and then imported from `src/app/<command>/cmd.ts`; or implemented in your own library and then imported from `src/app/<command>/cmd.ts`.
125
125
 
126
- if you run just `dler` — it will display a list of plugins which you can launch interactively.
126
+ if you run just `dler` — it will display a list of commands which you can launch interactively.
127
127
 
128
- ## **available plugins**
128
+ ## **available commands**
129
129
 
130
- [agg](#1-agg), [build](#2-build), [conv](#3-conv), [deps](#4-deps), [inject](#5-inject), [libs](#6-libs), [merge](#7-merge), [migrate](#8-migrate), [pub](#9-pub), [relifso](#10-relifso), [relinka](#11-relinka), [rempts](#12-rempts), [spell](#13-spell), [split](#14-split).
130
+ [agg](#1-agg) [build](#2-build) [check](#3-check) [conv](#4-conv) [copy](#5-copy) [init](#6-init) [inject](#7-inject) [libs](#8-libs) [merge](#9-merge) [migrate](#10-migrate) [pub](#11-pub) [rempts](#13-rempts) [rename](#13-rename) [spell](#14-spell) [split](#15-split)
131
131
 
132
132
  ### 1. `agg`
133
133
 
@@ -150,9 +150,17 @@ bun tools:agg # shortcut for:
150
150
  bun src/cli.ts tools --dev --tool agg --input src/libs/sdk/sdk-impl --out src/libs/sdk/sdk-mod.ts --recursive --named --strip src/libs/sdk
151
151
  ```
152
152
 
153
- ### 1.5. `check`
153
+ ### 2. `build`
154
+
155
+ since dler is fully modular, build command is separated for its own build-in plugin as well.
156
+
157
+ ```bash
158
+ bun dler build ...
159
+ ```
160
+
161
+ ### 3. `check`
154
162
 
155
- checks your project for common issues and potential improvements. This command performs several types of checks:
163
+ checks your project for common issues and potential improvements. This command performs several types of checks (aka rules of dler):
156
164
 
157
165
  - **File Extensions**: Validates that files have the correct extensions based on their location and module resolution strategy
158
166
  - Enforces `.ts` files in source and JSR distributions
@@ -216,19 +224,11 @@ dler check --json
216
224
  **pro tip:**
217
225
  the command will prompt you only for the arguments you haven't provided. for example, if you specify `--directory` but not `--checks`, it will only prompt you to select which checks to run.
218
226
 
219
- ### 2. `build`
220
-
221
- since dler is fully modular, build command is separated for its own build-in plugin as well.
222
-
223
- ```bash
224
- dler build ...
225
- ```
226
-
227
- ### 3. `conv`
227
+ ### 4. `conv`
228
228
 
229
229
  not yet documented.
230
230
 
231
- ### 4. `deps`
231
+ ### 5. `deps`
232
232
 
233
233
  finds missing dependencies in your project by scanning your code for imports and comparing them to your `package.json`. This command is particularly useful for maintaining clean dependency lists and preventing runtime errors.
234
234
 
@@ -246,6 +246,8 @@ finds missing dependencies in your project by scanning your code for imports and
246
246
  - optionally includes node.js built-in modules in the report
247
247
  - outputs results in a readable format or as json
248
248
  - exits with error code 1 if missing dependencies are found
249
+ - detects packages that are only in `devDependencies` but used in production code
250
+ - identifies packages listed in both `dependencies` and `devDependencies`
249
251
 
250
252
  **usage examples:**
251
253
 
@@ -276,11 +278,31 @@ dler deps --all --directory ./src --include-builtins
276
278
  missing dependencies are shown only once, even if used in multiple files.
277
279
  deep imports like `dep/some/file` or `@org/dep/some/thing` are always resolved to their root package.
278
280
 
279
- ### 5. `inject`
281
+ **warning types:**
282
+
283
+ - **Missing Dependencies**: Packages that are imported but not listed in `package.json`
284
+ - **Dev-only Dependencies**: Packages that are only in `devDependencies` but imported in production code
285
+ - **Duplicate Dependencies**: Packages listed in both `dependencies` and `devDependencies`
286
+
287
+ ### 5. `copy`
288
+
289
+ ```bash
290
+ # simple example:
291
+ bun dler copy --s "src/**/*.ts" --d "dist"
292
+
293
+ # advanced example:
294
+ bun dler copy --s ".temp/packages/*/lib/**/*" --d "src/libs/sdk/sdk-impl/rules/external"
295
+ ```
296
+
297
+ ### 6. `init`
298
+
299
+ not yet documented.
300
+
301
+ ### 7. `inject`
280
302
 
281
303
  not yet documented.
282
304
 
283
- ### 6. `libs`
305
+ ### 8. `libs`
284
306
 
285
307
  builds and publishes specific subdirectories of your main project as standalone packages.
286
308
 
@@ -316,20 +338,29 @@ libslist: {
316
338
 
317
339
  - more magic commands coming soon...
318
340
 
319
- ### 7. `merge`
341
+ ### 9. `merge`
320
342
 
321
- not yet documented.
343
+ merges multiple files into a single file.
322
344
 
323
- ### 8. `migrate`
345
+ ```bash
346
+ # simple example:
347
+ bun dler merge --s "src/**/*.ts" --d "dist/merged.ts"
348
+
349
+ # advanced example:
350
+ bun dler merge --s ".temp1/packages/*/lib/**/*" --d ".temp2/merged.ts" --sort "mtime" --header "// Header" --footer "// Footer" --dedupe
351
+ ```
352
+
353
+ ### 10. `migrate`
324
354
 
325
355
  helps migrate between different libraries and module resolution strategies. currently supports:
326
356
 
327
- - `path-to-pathkit`: migrate from node:path and unjs/pathe to pathkit library
328
- - `fs-to-relifso`: migrate from node:fs and fs-extra to relifso library
329
- - `module-resolution`: migrate between module resolution strategies
330
- - `anything-to-bun`: migrate Node.js projects to Bun runtime
357
+ - `anything-bun`: migrate Node.js projects to Bun runtime
358
+ - `path-pathkit`: migrate from node:path and unjs/pathe to pathkit library
359
+ - `fs-relifso`: migrate from node:fs and fs-extra to relifso library
360
+ - `nodenext-bundler`: migrate between module resolution strategies
361
+ - `readdir-glob`: migrate from fs.readdir to globby for better file system operations
331
362
 
332
- **path-to-pathkit features:**
363
+ **path-pathkit features:**
333
364
 
334
365
  - Migrates from both `pathe` and `node:path` to `@reliverse/pathkit`
335
366
  - Handles both default and named exports
@@ -337,7 +368,7 @@ helps migrate between different libraries and module resolution strategies. curr
337
368
  - Converts require statements
338
369
  - Updates package.json dependencies
339
370
 
340
- **fs-to-relifso features:**
371
+ **fs-relifso features:**
341
372
 
342
373
  - Migrates from both `node:fs` and `fs-extra` to `@reliverse/relifso`
343
374
  - Handles both default and named exports
@@ -346,7 +377,7 @@ helps migrate between different libraries and module resolution strategies. curr
346
377
  - Updates package.json dependencies
347
378
  - Preserves import structure and formatting
348
379
 
349
- **anything-to-bun features:**
380
+ **anything-bun features:**
350
381
 
351
382
  - Migrates Node.js imports to use `node:` prefix
352
383
  - Replaces npm/yarn/pnpm features with bun equivalents
@@ -362,17 +393,27 @@ helps migrate between different libraries and module resolution strategies. curr
362
393
  - Generates Bun configuration files
363
394
  - Creates Dockerfile for Bun deployment
364
395
 
365
- **usage example:**
396
+ **readdir-glob features:**
397
+
398
+ - Migrates from `fs.readdir` and `fs.readdirSync` to `globby`
399
+ - Handles both synchronous and asynchronous readdir operations
400
+ - Supports `fs.promises.readdir` migration
401
+ - Adds globby import if not present
402
+ - Updates package.json with globby dependency
403
+ - Preserves target directory paths
404
+ - Maintains async/await usage
405
+
406
+ **usage examples:**
366
407
 
367
408
  ```bash
368
409
  # Preview changes without applying them
369
- dler migrate --lib anything-to-bun --dryRun
410
+ dler migrate --lib readdir-glob --dryRun
370
411
 
371
412
  # Apply changes
372
- dler migrate --lib anything-to-bun
413
+ dler migrate --lib readdir-glob
373
414
 
374
415
  # Migrate specific project
375
- dler migrate --lib anything-to-bun --project ./my-app
416
+ dler migrate --lib readdir-glob --project ./my-app
376
417
  ```
377
418
 
378
419
  **module resolution targets:**
@@ -384,19 +425,19 @@ dler migrate --lib anything-to-bun --project ./my-app
384
425
 
385
426
  ```bash
386
427
  # Migrate from node:path and/or pathe to pathkit
387
- dler migrate --lib path-to-pathkit
428
+ dler migrate --lib path-pathkit
388
429
 
389
430
  # Migrate from node:fs and/or fs-extra to relifso
390
- dler migrate --lib fs-to-relifso
431
+ dler migrate --lib fs-relifso
391
432
 
392
433
  # Migrate to nodenext module resolution
393
- dler migrate --lib module-resolution --target nodenext
434
+ dler migrate --lib nodenext-bundler --target nodenext
394
435
 
395
436
  # Migrate to bundler module resolution
396
- dler migrate --lib module-resolution --target bundler
437
+ dler migrate --lib nodenext-bundler --target bundler
397
438
 
398
439
  # Preview changes without applying them
399
- dler migrate --lib module-resolution --target nodenext --dryRun
440
+ dler migrate --lib nodenext-bundler --target nodenext --dryRun
400
441
  ```
401
442
 
402
443
  **what it does:**
@@ -408,47 +449,7 @@ dler migrate --lib module-resolution --target nodenext --dryRun
408
449
  - handles both relative and alias imports
409
450
  - supports both .ts and .tsx files
410
451
 
411
- **next steps after migration:**
412
-
413
- - for path-to-pathkit:
414
- 1. run 'bun install' to install @reliverse/pathkit
415
- 2. test your application
416
- 3. consider using advanced pathkit features
417
-
418
- - for fs-to-relifso:
419
- 1. run 'bun install' to install @reliverse/relifso
420
- 2. test your application
421
- 3. review any file system operations that might need manual updates
422
-
423
- - for module-resolution:
424
- 1. test your application
425
- 2. ensure your build tools support the new module resolution
426
- 3. review any warnings in the migration output
427
-
428
- - for anything-to-bun:
429
- 1. run 'bun install' to install dependencies with Bun
430
- 2. test your application thoroughly
431
- 3. review async/await usage in converted file operations
432
- 4. update any custom database queries to use Bun.sql syntax
433
- 5. review and update any custom middleware in Express apps
434
-
435
- ### 9. `pub`
436
-
437
- pub command is separated for its own build-in plugin as well.
438
-
439
- it already calls build command by itself, so you don't need to run `dler build` separately.
440
-
441
- ```bash
442
- dler pub ...
443
- ```
444
-
445
- ### 10. `relifso`
446
-
447
- ```bash
448
- dler relifso init ...
449
- ```
450
-
451
- ### 11. `relinka`
452
+ #### `console-relinka`
452
453
 
453
454
  [@reliverse/relinka](https://github.com/reliverse/relinka)'s best friend. Converts between different logging formats (console, consola method/object, and relinka's function/method/object styles).
454
455
 
@@ -487,16 +488,62 @@ dler relinka --input src/app.ts --from relinkaFunction --to consolaObject
487
488
  - Supports conversion between any combination of formats
488
489
  - Supports both consola method and object styles
489
490
 
490
- ### 12. `rempts`
491
+ #### next steps after migration
492
+
493
+ - for path-pathkit:
494
+ 1. run 'bun install' to install @reliverse/pathkit
495
+ 2. test your application
496
+ 3. consider using advanced pathkit features
497
+
498
+ - for fs-relifso:
499
+ 1. run 'bun install' to install @reliverse/relifso
500
+ 2. test your application
501
+ 3. review any file system operations that might need manual updates
502
+
503
+ - for nodenext-bundler:
504
+ 1. test your application
505
+ 2. ensure your build tools support the new module resolution
506
+ 3. review any warnings in the migration output
507
+
508
+ - for anything-bun:
509
+ 1. run 'bun install' to install dependencies with Bun
510
+ 2. test your application thoroughly
511
+ 3. review async/await usage in converted file operations
512
+ 4. update any custom database queries to use Bun.sql syntax
513
+ 5. review and update any custom middleware in Express apps
514
+
515
+ - for readdir-glob:
516
+ 1. run 'bun install' to install globby
517
+ 2. test your application
518
+ 3. review any file system operations that might need manual updates
519
+ 4. consider using globby's advanced features like pattern matching and recursive searching
520
+
521
+ ### 11. `pub`
522
+
523
+ pub command is separated for its own build-in plugin as well.
524
+
525
+ it already calls build command by itself, so you don't need to run `dler build` separately.
526
+
527
+ ```bash
528
+ bun dler pub ...
529
+ ```
530
+
531
+ ### 13. `rempts`
491
532
 
492
533
  @reliverse/rempts's best friend. learn more in its [docs](https://github.com/reliverse/rempts).
493
534
 
494
535
  ```bash
495
- dler rempts init --cmd my-cmd-1
496
- dler rempts init --cmds
536
+ bun dler rempts
537
+ bun dler rempts --init cmd1 cmd2
538
+ ```
539
+
540
+ ### 13. `rename`
541
+
542
+ ```bash
543
+ bun dler rename ...
497
544
  ```
498
545
 
499
- ### 13. `spell`
546
+ ### 14. `spell`
500
547
 
501
548
  **available spell types:**
502
549
 
@@ -565,12 +612,12 @@ files: [] // means all files
565
612
 
566
613
  p.s. [see how rse cli uses hooked=true](https://github.com/reliverse/rse/blob/main/src/postbuild.ts)
567
614
 
568
- ### 14. `split`
615
+ ### 15. `split`
569
616
 
570
617
  splits your code/text file into multiple files.
571
618
 
572
619
  ```bash
573
- dler split ...
620
+ bun dler split ...
574
621
  ```
575
622
 
576
623
  ## api (for advanced users)
@@ -6,7 +6,7 @@ import {
6
6
  } from "@reliverse/rempts";
7
7
  import { existsSync } from "node:fs";
8
8
  import { resolve } from "node:path";
9
- import { getCmdAgg } from "../cmds.js";
9
+ import { getAggCmd } from "../cmds.js";
10
10
  async function loadConfig() {
11
11
  const configPath = resolve(".config/dler.ts");
12
12
  if (!existsSync(configPath)) return null;
@@ -84,7 +84,7 @@ export async function promptAggCommand() {
84
84
  defaultValue: out.replace(/\.(ts|js)$/, ".types.$1")
85
85
  });
86
86
  }
87
- await runCmd(await getCmdAgg(), [
87
+ await runCmd(await getAggCmd(), [
88
88
  `--imports=${imports}`,
89
89
  `--input=${input}`,
90
90
  `--named=${named}`,
@@ -1,6 +1,6 @@
1
1
  import { defineArgs, defineCommand } from "@reliverse/rempts";
2
2
  import { dlerBuild } from "./impl.js";
3
- import { ensureDlerConfig } from "../../libs/sdk/sdk-impl/config/init.js";
3
+ import { ensureDlerConfig } from "../../libs/sdk/sdk-impl/cfg/init.js";
4
4
  export default defineCommand({
5
5
  meta: {
6
6
  name: "build",
@@ -5,7 +5,7 @@ import {
5
5
  } from "@reliverse/bleump";
6
6
  import path from "@reliverse/pathkit";
7
7
  import fs from "@reliverse/relifso";
8
- import { loadConfig } from "../../libs/sdk/sdk-impl/config/load.js";
8
+ import { loadConfig } from "../../libs/sdk/sdk-impl/cfg/load.js";
9
9
  import { processLibraryFlow } from "../../libs/sdk/sdk-impl/library-flow.js";
10
10
  import { processRegularFlow } from "../../libs/sdk/sdk-impl/regular-flow.js";
11
11
  import { finalizeBuildPub } from "../../libs/sdk/sdk-impl/utils/finalize.js";
@@ -15,5 +15,42 @@ declare const _default: import("@reliverse/rempts").Command<{
15
15
  type: "boolean";
16
16
  description: string;
17
17
  };
18
+ deps: {
19
+ type: "boolean";
20
+ description: string;
21
+ };
22
+ all: {
23
+ type: "boolean";
24
+ description: string;
25
+ };
26
+ ignore: {
27
+ type: "string";
28
+ description: string;
29
+ };
30
+ builtins: {
31
+ type: "boolean";
32
+ description: string;
33
+ };
34
+ dev: {
35
+ type: "boolean";
36
+ description: string;
37
+ };
38
+ peer: {
39
+ type: "boolean";
40
+ description: string;
41
+ };
42
+ optional: {
43
+ type: "boolean";
44
+ description: string;
45
+ };
46
+ fix: {
47
+ type: "boolean";
48
+ description: string;
49
+ };
50
+ depth: {
51
+ type: "number";
52
+ description: string;
53
+ default: number;
54
+ };
18
55
  }>;
19
56
  export default _default;
@@ -1,3 +1,5 @@
1
+ import path from "@reliverse/pathkit";
2
+ import { re } from "@reliverse/relico";
1
3
  import { relinka } from "@reliverse/relinka";
2
4
  import {
3
5
  defineCommand,
@@ -6,28 +8,32 @@ import {
6
8
  confirmPrompt,
7
9
  defineArgs
8
10
  } from "@reliverse/rempts";
9
- import { displayCheckResults } from "../../libs/sdk/sdk-impl/check/check-mod.js";
10
- import { checkDlerConfigHealth } from "../../libs/sdk/sdk-impl/check/rules/dler-config-health.js";
11
- import { checkFileExtensions } from "../../libs/sdk/sdk-impl/check/rules/file-extensions.js";
12
- import { checkMissingDependencies } from "../../libs/sdk/sdk-impl/check/rules/missing-deps.js";
13
- import { checkPackageJsonHealth } from "../../libs/sdk/sdk-impl/check/rules/package-json-health.js";
14
- import { checkPathExtensions } from "../../libs/sdk/sdk-impl/check/rules/path-extensions.js";
15
- import { checkSelfInclude } from "../../libs/sdk/sdk-impl/check/rules/self-include.js";
16
- import { checkTsConfigHealth } from "../../libs/sdk/sdk-impl/check/rules/tsconfig-health.js";
11
+ import { checkDlerConfigHealth } from "../../libs/sdk/sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js";
12
+ import { checkFileExtensions } from "../../libs/sdk/sdk-impl/rules/reliverse/file-extensions/file-extensions.js";
13
+ import { analyzeDependencies } from "../../libs/sdk/sdk-impl/rules/reliverse/missing-deps/analyzer.js";
14
+ import { checkMissingDependencies } from "../../libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-mod.js";
15
+ import { formatOutput } from "../../libs/sdk/sdk-impl/rules/reliverse/missing-deps/formatter.js";
16
+ import { checkNoIndexFiles } from "../../libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.js";
17
+ import { checkPackageJsonHealth } from "../../libs/sdk/sdk-impl/rules/reliverse/package-json-health/package-json-health.js";
18
+ import { checkPathExtensions } from "../../libs/sdk/sdk-impl/rules/reliverse/path-extensions/path-extensions.js";
19
+ import { checkSelfInclude } from "../../libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.js";
20
+ import { checkTsConfigHealth } from "../../libs/sdk/sdk-impl/rules/reliverse/tsconfig-health/tsconfig-health.js";
21
+ import { displayCheckResults } from "../../libs/sdk/sdk-impl/rules/rules-mod.js";
17
22
  export default defineCommand({
18
23
  meta: {
19
24
  name: "check",
20
- version: "1.0.0",
21
- description: "check your codebase source and dists for any issues."
25
+ version: "2.0.0",
26
+ description: "Check your codebase for issues (deps, extensions, config, etc) or analyze dependencies."
22
27
  },
23
28
  args: defineArgs({
29
+ // --- check args ---
24
30
  directory: {
25
31
  type: "string",
26
32
  description: "directory to check (src, dist-npm, dist-jsr, dist-libs/npm, dist-libs/jsr, or all)"
27
33
  },
28
34
  checks: {
29
35
  type: "string",
30
- description: "comma-separated list of checks to run (missing-deps,file-extensions,path-extensions,dler-config-health,self-include,tsconfig-health,package-json-health)"
36
+ description: "comma-separated list of checks to run (missing-deps,file-extensions,path-extensions,dler-config-health,self-include,tsconfig-health,package-json-health,no-index-files)"
31
37
  },
32
38
  strict: {
33
39
  type: "boolean",
@@ -36,9 +42,76 @@ export default defineCommand({
36
42
  json: {
37
43
  type: "boolean",
38
44
  description: "output results in JSON format"
45
+ },
46
+ // --- deps args ---
47
+ deps: {
48
+ type: "boolean",
49
+ description: "run dependency analysis instead of codebase checks"
50
+ },
51
+ all: {
52
+ type: "boolean",
53
+ description: "show all dependencies (both listed and not listed)"
54
+ },
55
+ ignore: {
56
+ type: "string",
57
+ description: "comma-separated patterns to ignore (for deps)"
58
+ },
59
+ builtins: {
60
+ type: "boolean",
61
+ description: "include Node.js built-in modules in the output (for deps)"
62
+ },
63
+ dev: {
64
+ type: "boolean",
65
+ description: "check devDependencies instead of dependencies (for deps)"
66
+ },
67
+ peer: {
68
+ type: "boolean",
69
+ description: "check peerDependencies instead of dependencies (for deps)"
70
+ },
71
+ optional: {
72
+ type: "boolean",
73
+ description: "check optionalDependencies instead of dependencies (for deps)"
74
+ },
75
+ fix: {
76
+ type: "boolean",
77
+ description: "automatically add missing dependencies to package.json (for deps)"
78
+ },
79
+ depth: {
80
+ type: "number",
81
+ description: "maximum directory depth to scan (0 for unlimited, for deps)",
82
+ default: 0
39
83
  }
40
84
  }),
41
85
  async run({ args }) {
86
+ if (args.deps) {
87
+ try {
88
+ const directory = path.resolve(args.directory ?? ".");
89
+ const ignorePatterns = args.ignore ? args.ignore.split(",") : [];
90
+ const options = {
91
+ directory,
92
+ showAll: args.all,
93
+ ignorePatterns,
94
+ json: args.json,
95
+ builtins: args.builtins,
96
+ dev: args.dev,
97
+ peer: args.peer,
98
+ optional: args.optional,
99
+ fix: args.fix,
100
+ depth: args.depth
101
+ };
102
+ console.log(re.gray(`Scanning directory: ${directory}`));
103
+ const result = await analyzeDependencies(options);
104
+ const output = formatOutput(result, options);
105
+ console.log(output);
106
+ if (result.missingDependencies.length > 0) {
107
+ process.exit(1);
108
+ }
109
+ } catch (error) {
110
+ console.error("Error:", error);
111
+ process.exit(1);
112
+ }
113
+ return;
114
+ }
42
115
  relinka(
43
116
  "info",
44
117
  "this command checks your codebase for extension and dependency issues."
@@ -55,6 +128,10 @@ export default defineCommand({
55
128
  "info",
56
129
  "\u{1F504} self-include rules: no importing from main package or self-imports in libs"
57
130
  );
131
+ relinka(
132
+ "info",
133
+ "\u{1F4DA} index files: avoid using index.{ts,js} files to prevent module resolution confusion"
134
+ );
58
135
  let dir;
59
136
  let checks;
60
137
  let strict;
@@ -65,9 +142,7 @@ export default defineCommand({
65
142
  title: "select a directory to check",
66
143
  options: [
67
144
  { label: "all directories", value: "all" },
68
- // TODO: run this automatically BEFORE `dler build`
69
145
  { label: "src (typescript source)", value: "src" },
70
- // TODO: run this automatically AFTER `dler build`
71
146
  { label: "dist-npm (compiled js)", value: "dist-npm" },
72
147
  { label: "dist-jsr (typescript)", value: "dist-jsr" },
73
148
  { label: "dist-libs/npm (compiled js)", value: "dist-libs/npm" },
@@ -105,6 +180,10 @@ export default defineCommand({
105
180
  {
106
181
  label: "package.json validation",
107
182
  value: "package-json-health"
183
+ },
184
+ {
185
+ label: "no index files",
186
+ value: "no-index-files"
108
187
  }
109
188
  ]
110
189
  });
@@ -201,6 +280,17 @@ checking directory: ${directory}`);
201
280
  process.stdout.write("\r");
202
281
  displayCheckResults("self-includes", directory, result);
203
282
  }
283
+ if (checks.includes("no-index-files")) {
284
+ process.stdout.write(" checking for index files...\n");
285
+ const result = await checkNoIndexFiles({
286
+ directory,
287
+ strict,
288
+ moduleResolution: "bundler",
289
+ onProgress
290
+ });
291
+ process.stdout.write("\r");
292
+ displayCheckResults("no index files", directory, result);
293
+ }
204
294
  } catch (error) {
205
295
  relinka(
206
296
  "error",
package/bin/app/cmds.d.ts CHANGED
@@ -1,21 +1,16 @@
1
1
  import type { Command } from "@reliverse/rempts";
2
- export declare const getCmdAgg: () => Promise<Command>;
3
- export declare function getCmdBuild(): Promise<Command>;
4
- export declare function getCmdCheck(): Promise<Command>;
5
- export declare function getCmdConv(): Promise<Command>;
6
- export declare function getCmdDeps(): Promise<Command>;
7
- export declare function getCmdInject(): Promise<Command>;
8
- export declare function getCmdInjectExpect(): Promise<Command>;
9
- export declare function getCmdLibs(): Promise<Command>;
10
- export declare function getCmdMerge(): Promise<Command>;
11
- export declare function getCmdMigrate(): Promise<Command>;
12
- export declare function getCmdPub(): Promise<Command>;
13
- export declare function getCmdRelifso(): Promise<Command>;
14
- export declare function getCmdRelifsoInit(): Promise<Command>;
15
- export declare function getCmdRelifsoRename(): Promise<Command>;
16
- export declare function getCmdRelinka(): Promise<Command>;
17
- export declare function getCmdRemptsCmd(): Promise<Command>;
18
- export declare function getCmdRemptsCmdsTs(): Promise<Command>;
19
- export declare function getCmdRemptsMigrate(): Promise<Command>;
20
- export declare function getCmdSpell(): Promise<Command>;
21
- export declare function getCmdSplit(): Promise<Command>;
2
+ export declare const getAggCmd: () => Promise<Command>;
3
+ export declare const getBuildCmd: () => Promise<Command>;
4
+ export declare const getCheckCmd: () => Promise<Command>;
5
+ export declare const getConvCmd: () => Promise<Command>;
6
+ export declare const getCopyCmd: () => Promise<Command>;
7
+ export declare const getInitCmd: () => Promise<Command>;
8
+ export declare const getInjectCmd: () => Promise<Command>;
9
+ export declare const getLibsCmd: () => Promise<Command>;
10
+ export declare const getMergeCmd: () => Promise<Command>;
11
+ export declare const getMigrateCmd: () => Promise<Command>;
12
+ export declare const getPubCmd: () => Promise<Command>;
13
+ export declare const getRemptsCmd: () => Promise<Command>;
14
+ export declare const getRenameCmd: () => Promise<Command>;
15
+ export declare const getSpellCmd: () => Promise<Command>;
16
+ export declare const getSplitCmd: () => Promise<Command>;