@reliverse/dler 1.2.5 → 1.3.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.
Files changed (148) hide show
  1. package/README.md +36 -41
  2. package/bin/addons.d.ts +1 -0
  3. package/bin/addons.js +83 -0
  4. package/bin/app/agg/cmd.d.ts +35 -0
  5. package/bin/app/agg/cmd.js +49 -0
  6. package/bin/app/agg/impl.d.ts +36 -0
  7. package/bin/app/{tools → agg}/impl.js +1 -2
  8. package/bin/app/build/cmd.d.ts +7 -0
  9. package/bin/app/build/cmd.js +3 -1
  10. package/bin/app/cmds.d.ts +100 -0
  11. package/bin/app/cmds.js +11 -2
  12. package/bin/app/conv/cmd.d.ts +0 -0
  13. package/bin/app/deps/cmd.d.ts +28 -0
  14. package/bin/app/deps/cmd.js +62 -0
  15. package/bin/app/deps/impl/analyzer.d.ts +2 -0
  16. package/bin/app/deps/impl/analyzer.js +1 -1
  17. package/bin/app/deps/impl/filesystem.d.ts +4 -0
  18. package/bin/app/deps/impl/filesystem.js +2 -4
  19. package/bin/app/deps/impl/formatter.d.ts +2 -0
  20. package/bin/app/deps/impl/formatter.js +2 -2
  21. package/bin/app/deps/impl/parser.d.ts +5 -0
  22. package/bin/app/deps/impl/types.d.ts +21 -0
  23. package/bin/app/inject/README.md +3 -12
  24. package/bin/app/inject/cmd.d.ts +12 -0
  25. package/bin/app/inject/cmd.js +2 -2
  26. package/bin/app/inject/expect/cmd.d.ts +20 -0
  27. package/bin/app/inject/expect/impl.d.ts +5 -0
  28. package/bin/app/libs/cmd.d.ts +0 -0
  29. package/bin/app/merge/cmd.txt +1 -1
  30. package/bin/app/mono/cmd.d.ts +0 -0
  31. package/bin/app/pub/cmd.d.ts +7 -0
  32. package/bin/app/pub/cmd.js +3 -1
  33. package/bin/app/relifso/cmd.d.ts +12 -0
  34. package/bin/app/relifso/cmd.js +2 -2
  35. package/bin/app/relifso/init/cmd.d.ts +36 -0
  36. package/bin/app/relifso/init/impl/const.d.ts +34 -0
  37. package/bin/app/relifso/init/impl/const.js +1 -1
  38. package/bin/app/relifso/init/impl/mod.d.ts +17 -0
  39. package/bin/app/relifso/init/impl/templates/t-gitignore.d.ts +1 -0
  40. package/bin/app/relifso/init/impl/templates/t-license.d.ts +1 -0
  41. package/bin/app/relifso/init/impl/templates/t-readme.d.ts +1 -0
  42. package/bin/app/relifso/init/impl/types.d.ts +41 -0
  43. package/bin/app/relifso/init/impl/utils.d.ts +5 -0
  44. package/bin/app/relinka/cmd.d.ts +0 -0
  45. package/bin/app/rempts/init/cmd/cmd.d.ts +14 -0
  46. package/bin/app/rempts/init/cmd/cmd.js +3 -1
  47. package/bin/app/rempts/init/cmds/cmd.d.ts +19 -0
  48. package/bin/app/rempts/migrate/cmd.d.ts +14 -0
  49. package/bin/app/rempts/migrate/impl/commander.d.ts +4 -0
  50. package/bin/app/spell/cmd.d.ts +18 -0
  51. package/bin/app/spell/cmd.js +51 -0
  52. package/bin/app/split/cmd.d.ts +11 -0
  53. package/bin/app/split/impl.d.ts +25 -0
  54. package/bin/default.d.ts +5 -0
  55. package/bin/{libs/cfg/cfg-default.js → default.js} +6 -4
  56. package/bin/dler.d.ts +1 -0
  57. package/bin/dler.js +60 -0
  58. package/bin/impl.d.ts +10 -0
  59. package/bin/{cli.js → impl.js} +15 -27
  60. package/bin/info.d.ts +2 -0
  61. package/bin/info.js +21 -0
  62. package/bin/init.d.ts +1 -0
  63. package/bin/init.js +20 -27
  64. package/bin/libs/sdk/sdk-impl/build/build-library.d.ts +51 -0
  65. package/bin/libs/sdk/sdk-impl/build/build-library.js +45 -66
  66. package/bin/libs/sdk/sdk-impl/build/build-regular.d.ts +26 -0
  67. package/bin/libs/sdk/sdk-impl/build/build-regular.js +28 -18
  68. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.d.ts +2 -0
  69. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.js +8 -3
  70. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.d.ts +5 -0
  71. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +12 -7
  72. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/copy.d.ts +2 -0
  73. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/copy.js +2 -1
  74. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/types.d.ts +9 -0
  75. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist.d.ts +2 -0
  76. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist.js +22 -6
  77. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/types.d.ts +15 -0
  78. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/build.d.ts +2 -0
  79. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/build.js +2 -1
  80. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/config.d.ts +2 -0
  81. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/cjs.d.ts +4 -0
  82. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/esbuild.d.ts +13 -0
  83. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/json.d.ts +3 -0
  84. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/raw.d.ts +8 -0
  85. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/shebang.d.ts +5 -0
  86. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/stub.d.ts +2 -0
  87. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/types.d.ts +95 -0
  88. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/utils.d.ts +5 -0
  89. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/watch.d.ts +2 -0
  90. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/types.d.ts +176 -0
  91. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/index.d.ts +2 -0
  92. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/index.js +2 -2
  93. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/types.d.ts +23 -0
  94. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.d.ts +20 -0
  95. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/validate.d.ts +4 -0
  96. package/bin/libs/sdk/sdk-impl/library-flow.d.ts +11 -0
  97. package/bin/libs/sdk/sdk-impl/library-flow.js +6 -1
  98. package/bin/libs/sdk/sdk-impl/pub/pub-library.d.ts +5 -0
  99. package/bin/libs/sdk/sdk-impl/pub/pub-library.js +6 -16
  100. package/bin/libs/sdk/sdk-impl/pub/pub-regular.d.ts +9 -0
  101. package/bin/libs/sdk/sdk-impl/pub/pub-regular.js +12 -10
  102. package/bin/libs/sdk/sdk-impl/regular-flow.d.ts +12 -0
  103. package/bin/libs/sdk/sdk-impl/regular-flow.js +45 -51
  104. package/bin/libs/sdk/sdk-impl/spell/spell-executors.d.ts +10 -0
  105. package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.d.ts +7 -0
  106. package/bin/libs/sdk/sdk-impl/spell/spell-mod.d.ts +4 -0
  107. package/bin/libs/sdk/sdk-impl/spell/spell-parser.d.ts +4 -0
  108. package/bin/libs/sdk/sdk-impl/spell/spell-types.d.ts +34 -0
  109. package/bin/libs/sdk/sdk-impl/utils/tools/tools-agg.d.ts +14 -0
  110. package/bin/libs/sdk/sdk-impl/utils/tools/tools-agg.js +8 -6
  111. package/bin/libs/sdk/sdk-impl/utils/tools/tools-impl.d.ts +4 -0
  112. package/bin/libs/sdk/sdk-impl/utils/utils-build.d.ts +28 -0
  113. package/bin/libs/sdk/sdk-impl/utils/utils-build.js +3 -3
  114. package/bin/libs/sdk/sdk-impl/utils/utils-bump.d.ts +9 -0
  115. package/bin/libs/sdk/sdk-impl/utils/utils-bump.js +5 -7
  116. package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +5 -0
  117. package/bin/libs/sdk/sdk-impl/utils/utils-consts.d.ts +9 -0
  118. package/bin/libs/sdk/sdk-impl/utils/utils-cwd.d.ts +10 -0
  119. package/bin/libs/sdk/sdk-impl/utils/utils-deps.d.ts +5 -0
  120. package/bin/libs/sdk/sdk-impl/utils/utils-determine.d.ts +12 -0
  121. package/bin/libs/sdk/sdk-impl/utils/utils-error.d.ts +5 -0
  122. package/bin/libs/sdk/sdk-impl/utils/utils-fs.d.ts +24 -0
  123. package/bin/libs/sdk/sdk-impl/utils/utils-fs.js +4 -1
  124. package/bin/libs/sdk/sdk-impl/utils/utils-info.d.ts +6 -0
  125. package/bin/libs/sdk/sdk-impl/utils/utils-info.js +7 -14
  126. package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.d.ts +8 -0
  127. package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.js +2 -4
  128. package/bin/libs/sdk/sdk-impl/utils/utils-paths.d.ts +55 -0
  129. package/bin/libs/sdk/sdk-impl/utils/utils-paths.js +33 -24
  130. package/bin/libs/sdk/sdk-impl/utils/utils-perf.d.ts +9 -0
  131. package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-libs.d.ts +5 -0
  132. package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-reg.d.ts +8 -0
  133. package/bin/libs/sdk/sdk-impl/utils/utils-pkg-json-reg.js +36 -27
  134. package/bin/libs/sdk/sdk-impl/utils/utils-tsconfig.d.ts +4 -0
  135. package/bin/libs/sdk/sdk-mod.d.ts +56 -0
  136. package/bin/libs/sdk/sdk-mod.js +42 -9
  137. package/bin/libs/sdk/sdk-types.d.ts +469 -0
  138. package/bin/libs/sdk/sdk-types.js +0 -1
  139. package/bin/load.d.ts +6 -0
  140. package/bin/load.js +1 -1
  141. package/bin/mod.d.ts +48 -0
  142. package/bin/mod.js +4 -14
  143. package/bin/types.d.ts +469 -0
  144. package/package.json +6 -5
  145. package/bin/app/tools/cmd.js +0 -81
  146. package/bin/app/tools/tools.txt +0 -92
  147. package/bin/libs/cfg/cfg-mod.js +0 -4
  148. package/bin/libs/cfg/cfg-types.js +0 -1
@@ -0,0 +1,469 @@
1
+ /**
2
+ * Defines the configuration for building and publishing packages. This includes: versioning,
3
+ * build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
4
+ * It customizes the build and publish pipeline for both NPM and JSR registries.
5
+ */
6
+ export type BuildPublishConfig = {
7
+ /**
8
+ * When `true`, disables version bumping.
9
+ * Useful when retrying a failed publish with an already bumped version.
10
+ *
11
+ * @default false
12
+ */
13
+ bumpDisable: boolean;
14
+ /**
15
+ * Controls which files will have their version numbers updated during version bumping.
16
+ *
17
+ * Accepts:
18
+ * - Standard file types like "package.json"
19
+ * - Relative paths like "src/constants.ts"
20
+ * - [Globbing patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax)
21
+ *
22
+ * When empty, falls back to only updating "package.json".
23
+ * Respects: .gitignore patterns, hidden files, .git & node_modules.
24
+ *
25
+ * @default ["package.json", ".config/rse.ts"]
26
+ */
27
+ bumpFilter: string[];
28
+ /**
29
+ * Specifies how the version number should be incremented automatically:
30
+ * - `autoPatch`: Increments the patch version for backwards-compatible bug fixes (1.2.3 → 1.2.4).
31
+ * - `autoMinor`: Increments the minor version for new backwards-compatible features (1.2.3 → 1.3.0).
32
+ * - `autoMajor`: Increments the major version for breaking changes (1.2.3 → 2.0.0).
33
+ *
34
+ * Please note: `dler` infers the version from the `package.json` file.
35
+ *
36
+ * @default "autoPatch"
37
+ */
38
+ bumpMode: BumpMode;
39
+ /**
40
+ * When `true`, stops after building and retains distribution folders.
41
+ * Useful for development or inspecting the build output.
42
+ *
43
+ * @default true
44
+ */
45
+ commonPubPause: boolean;
46
+ /**
47
+ * Specifies which package registries to publish to:
48
+ * - `npm`: Publish only to the NPM commonPubRegistry.
49
+ * - `jsr`: Publish only to the JSR commonPubRegistry.
50
+ * - `npm-jsr`: Publish to both NPM and JSR registries.
51
+ *
52
+ * @default "npm"
53
+ */
54
+ commonPubRegistry: "jsr" | "npm" | "npm-jsr";
55
+ /**
56
+ * When `true`, enables detailed logs during the build and publish process.
57
+ * Useful for debugging or understanding the build flow.
58
+ *
59
+ * @default false
60
+ */
61
+ commonVerbose: boolean;
62
+ /**
63
+ * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
64
+ * Essential for providing type intranspileFormation to TypeScript users.
65
+ * Tip: set to `false` if your main project is a CLI to reduce bundle size.
66
+ *
67
+ * @default true
68
+ */
69
+ coreDeclarations: boolean;
70
+ /**
71
+ * Path to the project's main entry file.
72
+ * Used as the entry point for the NPM package.
73
+ *
74
+ * @default "mod.ts"
75
+ */
76
+ coreEntryFile: string;
77
+ /**
78
+ * Base directory containing the source entry files.
79
+ * All paths are resolved relative to this directory.
80
+ * Set to `"."` if entry files are in the project root.
81
+ *
82
+ * @default "src"
83
+ */
84
+ coreEntrySrcDir: string;
85
+ /**
86
+ * Directory where built files will be placed within the distribution directory.
87
+ * For example, if set to "bin", CLI scripts will be placed in "dist-npm/bin" or "dist-jsr/bin".
88
+ *
89
+ * @default "bin"
90
+ */
91
+ coreBuildOutDir: string;
92
+ /**
93
+ * Configuration for CLI functionality:
94
+ * - enabled: When `true`, indicates that the package has CLI capabilities
95
+ * - scripts: Map of CLI script names to their entry file paths
96
+ * The key will be used as the command name in package.json's bin field
97
+ * The value should be the path to the executable script (e.g. "cli.ts")
98
+ *
99
+ * **The source scripts should be in your "coreEntrySrcDir" directory (by default "src")**
100
+ *
101
+ * @example
102
+ * {
103
+ * enabled: true,
104
+ * scripts: {
105
+ * "mycli": "cli.ts",
106
+ * "othercmd": "other-cmd.ts"
107
+ * }
108
+ * }
109
+ *
110
+ * @default { enabled: false, scripts: {} }
111
+ */
112
+ coreIsCLI: {
113
+ enabled: boolean;
114
+ scripts: Record<string, string>;
115
+ };
116
+ /**
117
+ * Optional description that overrides the description from package.json.
118
+ * When provided, this description will be used in the dist's package.json.
119
+ * If not provided, the description from the original package.json will be used.
120
+ *
121
+ * @default `package.json`'s "description"
122
+ */
123
+ coreDescription: string;
124
+ /**
125
+ * When `true`, allows JSR publishing even with uncommitted changes.
126
+ * Use with caution, as it may lead to inconsistent published versions.
127
+ *
128
+ * It is `true` by default to make it easier for new `dler` users to publish their projects.
129
+ *
130
+ * @default true
131
+ */
132
+ distJsrAllowDirty: boolean;
133
+ /**
134
+ * The bundler to use for creating JSR-compatible packages.
135
+ * JSR's native bundler is recommended for best compatibility.
136
+ *
137
+ * @default "jsr"
138
+ */
139
+ distJsrBuilder: BundlerName;
140
+ /**
141
+ * Files to copy to the JSR distribution directory.
142
+ * Useful for including additional files like configuration or documentation.
143
+ *
144
+ * @default ["README.md", "LICENSE"]
145
+ */
146
+ distJsrCopyRootFiles: string[];
147
+ /**
148
+ * Directory where JSR build artifacts are generated.
149
+ * This directory will contain the package ready for JSR publishing.
150
+ *
151
+ * @default "dist-jsr"
152
+ */
153
+ distJsrDirName: string;
154
+ /**
155
+ * When `true`, simulates the publishing process without actually publishing.
156
+ * Useful for testing the build and publish pipeline without side effects.
157
+ *
158
+ * @default false
159
+ */
160
+ distJsrDryRun: boolean;
161
+ /**
162
+ * When `true`, fails the build if warnings are detected.
163
+ * Use with caution, as it may lead to inconsistent published versions.
164
+ *
165
+ * @default false
166
+ */
167
+ distJsrFailOnWarn: boolean;
168
+ /**
169
+ * When `true`, generates a `jsconfig.json` file for JSR's dist.
170
+ *
171
+ * @default false
172
+ */
173
+ distJsrGenTsconfig: boolean;
174
+ /**
175
+ * The file extension for output files in JSR packages.
176
+ *
177
+ * @default "ts"
178
+ */
179
+ distJsrOutFilesExt: NpmOutExt;
180
+ /**
181
+ * When `true`, enables JSR to process complex types, which may impact performance.
182
+ * Enable this only if you cannot simplify or explicitly define exported types.
183
+ *
184
+ * JSR requires exported functions, classes, variables, and type aliases to have
185
+ * explicitly written or easily inferred types. Otherwise, it may be unable to
186
+ * generate documentation, type declarations for npm compatibility, or efficient
187
+ * type checking for consumers.
188
+ *
189
+ * If "slow types" are present, type checking performance may degrade, and some
190
+ * features may not work as expected.
191
+ *
192
+ * It is `true` by default to make it easier for new `dler` users to publish their projects.
193
+ *
194
+ * @see https://jsr.io/docs/about-slow-types
195
+ * @default true
196
+ */
197
+ distJsrSlowTypes: boolean;
198
+ /**
199
+ * The bundler to use for creating NPM-compatible packages.
200
+ *
201
+ * @default "mkdist"
202
+ */
203
+ distNpmBuilder: BundlerName;
204
+ /**
205
+ * Files to copy to the NPM distribution directory.
206
+ * Useful for including additional files like configuration or documentation.
207
+ *
208
+ * @default ["README.md", "LICENSE"]
209
+ */
210
+ distNpmCopyRootFiles: string[];
211
+ /**
212
+ * Directory where NPM build artifacts are generated.
213
+ * This directory will contain the package ready for NPM publishing.
214
+ *
215
+ * @default "dist-npm"
216
+ */
217
+ distNpmDirName: string;
218
+ /**
219
+ * Specifies the file extension for output files in NPM packages.
220
+ * Determines the extension of compiled files in the NPM distribution.
221
+ * We strongly recommend using `"js"` with the `"esm"` transpileFormat.
222
+ *
223
+ * @default "js"
224
+ */
225
+ distNpmOutFilesExt: NpmOutExt;
226
+ /**
227
+ * !! EXPERIMENTAL !!
228
+ * Controls which parts of the project are built and published:
229
+ * - `main-project-only`: Builds/publishes only the main package.
230
+ * - `main-and-libs`: Builds/publishes both the main package and libraries.
231
+ * - `libs-only`: Builds/publishes only the libraries.
232
+ *
233
+ * @default "main-project-only"
234
+ */
235
+ libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
236
+ /**
237
+ * The directory where built libraries are stored before publishing.
238
+ *
239
+ * @default "dist-libs"
240
+ */
241
+ libsDirDist: string;
242
+ /**
243
+ * The directory containing library source files.
244
+ *
245
+ * @default "src/libs"
246
+ */
247
+ libsDirSrc: string;
248
+ /**
249
+ * !! EXPERIMENTAL !!
250
+ * Configuration for building and publishing multiple libraries.
251
+ * Each key represents a package name, and its value contains the configuration.
252
+ *
253
+ * @example
254
+ * {
255
+ * "@myorg/ml1": { main: "my-lib-1/mod.ts" },
256
+ * "@myorg/ml2": { main: "my-lib-2/ml2-mod.ts" },
257
+ * "@myorg/ml3": { main: "src/libs/my-lib-3/index.js" }
258
+ * }
259
+ */
260
+ libsList: Record<string, LibConfig>;
261
+ /**
262
+ * The name of the log file. dler uses `@reliverse/relinka` for logging.
263
+ *
264
+ * @default "logs/relinka.log"
265
+ */
266
+ logsFileName: string;
267
+ /**
268
+ * When `true`, cleans up the log file from previous runs.
269
+ *
270
+ * @default false
271
+ */
272
+ logsFreshFile: boolean;
273
+ /**
274
+ * Controls how dependencies are excluded from the final package:
275
+ * - `patterns-and-devdeps`: Excludes all `devDependencies` and dependencies matching specified patterns.
276
+ * - `patterns-only`: Excludes only dependencies matching `rmDepsPatterns`.
277
+ *
278
+ * @default "patterns-and-devdeps"
279
+ */
280
+ rmDepsMode: ExcludeMode;
281
+ /**
282
+ * A list of dependency name patterns to exclude when filtering `dependencies` and `devDependencies`.
283
+ * Any dependency whose name matches or contains any of these patterns will be excluded from the final package.
284
+ * Helps prevent known `devDependencies` from being mistakenly included in `dependencies`.
285
+ *
286
+ * @example ["eslint", "prettier", "test"]
287
+ * @default ["eslint", "prettier", "biome"]
288
+ */
289
+ rmDepsPatterns: string[];
290
+ /**
291
+ * The transpileTarget runtime environment for the built package.
292
+ *
293
+ * @default "es2023"
294
+ */
295
+ transpileEsbuild: Esbuild;
296
+ /**
297
+ * Output module transpileFormat for built files:
298
+ * - `esm`: ECMAScript modules (import/export)
299
+ * - `cjs`: CommonJS modules (require/exports)
300
+ * - `iife`: Immediately Invoked Function Expression (for browsers)
301
+ *
302
+ * @default "esm"
303
+ */
304
+ transpileFormat: transpileFormat;
305
+ /**
306
+ * When `true`, minifies the output to reduce bundle size.
307
+ * Recommended for production builds but may increase build time.
308
+ *
309
+ * @default true
310
+ */
311
+ transpileMinify: boolean;
312
+ /**
313
+ * The base URL for loading assets in the built package.
314
+ * Important for packages that include assets like images or fonts.
315
+ *
316
+ * @default "/"
317
+ */
318
+ transpilePublicPath: string;
319
+ /**
320
+ * Controls source map generation for debugging (experimental):
321
+ * - `true/false`: Enable/disable source maps.
322
+ * - `"inline"`: Include source maps within output files.
323
+ * - `"none"`: Do not generate source maps.
324
+ * - `"linked"`: Generate separate source map files with links.
325
+ * - `"external"`: Generate separate source map files.
326
+ *
327
+ * @default false
328
+ */
329
+ transpileSourcemap: Sourcemap;
330
+ /**
331
+ * When `true`, enables code transpileSplitting for improved load-time performance.
332
+ * Useful for large applications but may not be needed for small projects.
333
+ *
334
+ * @default false
335
+ */
336
+ transpileSplitting: boolean;
337
+ /**
338
+ * Stub the package for JIT compilation.
339
+ *
340
+ * @default false
341
+ */
342
+ transpileStub: boolean;
343
+ /**
344
+ * Defines the transpileTarget runtime environment:
345
+ * - `node`: Optimized for Node.js.
346
+ * - `bun`: Optimized for Bun.
347
+ * - `browser`: Optimized for web browsers.
348
+ *
349
+ * @default "node"
350
+ */
351
+ transpileTarget: transpileTarget;
352
+ /**
353
+ * Watch the src dir and rebuild on change (experimental).
354
+ *
355
+ * @default false
356
+ */
357
+ transpileWatch: boolean;
358
+ };
359
+ /**
360
+ * Supported bump modes for versioning:
361
+ * - autoPatch: 1.2.3 → 1.2.4
362
+ * - autoMinor: 1.2.3 → 1.3.0
363
+ * - autoMajor: 1.2.3 → 2.0.0
364
+ */
365
+ export type BumpMode = "autoMajor" | "autoMinor" | "autoPatch";
366
+ /**
367
+ * Supported bundler names for building packages:
368
+ * - bun: Bun's built-in bundler for fast builds
369
+ * - copy: A simple file copy without bundling
370
+ * - jsr: Similar to copy but optimized for the JSR commonPubRegistry
371
+ * - mkdist: A lightweight bundler focused on TypeScript/ESM
372
+ * - rollup: A traditional bundler with an extensive plugin ecosystem
373
+ * - untyped: Types and markdown generation from a config object
374
+ */
375
+ export type BundlerName = "bun" | "copy" | "jsr" | "mkdist" | "rollup" | "untyped";
376
+ export type Esbuild = "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
377
+ /**
378
+ * Supported modes for filtering dependencies.
379
+ * - patterns-and-devdeps: Excludes all `devDependencies` and dependencies matching specified patterns.
380
+ * - patterns-only: Excludes only dependencies matching `rmDepsPatterns`.
381
+ */
382
+ export type ExcludeMode = "patterns-and-devdeps" | "patterns-only";
383
+ /**
384
+ * Configuration for a library to be built and published as a separate package.
385
+ * Used when publishing multiple packages from a single repository.
386
+ */
387
+ export type LibConfig = {
388
+ /**
389
+ * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
390
+ */
391
+ libDeclarations: boolean;
392
+ /**
393
+ * An optional description of the library, included in the dist's package.json.
394
+ * Provides users with an overview of the library's purpose.
395
+ *
396
+ * @example "Utility functions for data manipulation"
397
+ * @example "Core configuration module for the framework"
398
+ *
399
+ * @default `package.json`'s "description"
400
+ */
401
+ libDescription: string;
402
+ /**
403
+ * The directory where the library's dist files are stored.
404
+ *
405
+ * @default name is derived from the library's name after slash
406
+ */
407
+ libDirName: string;
408
+ /**
409
+ * The path to the library's main entry file.
410
+ * This file serves as the primary entry point for imports.
411
+ * The path should be relative to the project root.
412
+ * The full path to the library's main file is derived by joining `libsDirDist` with `main`.
413
+ *
414
+ * @example "my-lib-1/mod.ts"
415
+ * @example "my-lib-2/ml2-mod.ts"
416
+ * @example "src/libs/my-lib-3/index.js"
417
+ */
418
+ libMainFile: string;
419
+ /**
420
+ * Dependencies to include in the dist's package.json.
421
+ * The final output may vary based on `rmDepsMode` and `rmDepsPatterns`.
422
+ * Defines how dependencies are handled during publishing:
423
+ * - `string[]`: Includes only the specified dependencies.
424
+ * - `true`: Includes all dependencies from the main package.json.
425
+ * - `false` or `undefined`: Automatically determines dependencies based on imports.
426
+ *
427
+ * @example ["pathe", "fs-extra"] - Only include these specific dependencies.
428
+ * @example true - Include all `dependencies` from the main package.json.
429
+ */
430
+ libPkgKeepDeps: boolean | string[];
431
+ /**
432
+ * When `true`, minifies the output to reduce bundle size.
433
+ * Recommended for production builds but may increase build time.
434
+ *
435
+ * @default true
436
+ */
437
+ libTranspileMinify: boolean;
438
+ /**
439
+ * When true, pauses publishing for this specific library (overridden by commonPubPause).
440
+ * If true, this library will be built but not published, even if other libs are published.
441
+ *
442
+ * @default false
443
+ */
444
+ libPubPause?: boolean;
445
+ };
446
+ export type NpmOutExt = "cjs" | "cts" | "js" | "mjs" | "mts" | "ts";
447
+ /**
448
+ * Supported source map options for built packages.
449
+ * - boolean: Enable/disable source maps.
450
+ * - "inline": Include source maps within output files.
451
+ * - "none": Do not generate source maps.
452
+ * - "linked": Generate separate source map files with links.
453
+ * - "external": Generate separate source map files.
454
+ */
455
+ export type Sourcemap = "external" | "inline" | "linked" | "none" | boolean;
456
+ /**
457
+ * Supported output module transpileFormats for built packages.
458
+ * - esm: ECMAScript modules (import/export)
459
+ * - cjs: CommonJS modules (require/exports)
460
+ * - iife: Immediately Invoked Function Expression (for browsers)
461
+ */
462
+ export type transpileFormat = "cjs" | "esm" | "iife";
463
+ /**
464
+ * Supported transpileTarget runtime environments for built packages.
465
+ * - node: Optimized for Node.js.
466
+ * - bun: Optimized for Bun.
467
+ * - browser: Optimized for web browsers.
468
+ */
469
+ export type transpileTarget = "browser" | "bun" | "node";
@@ -1 +0,0 @@
1
- export * from "../../types.js";
package/bin/load.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { BuildPublishConfig } from "./libs/sdk/sdk-types.js";
2
+ /**
3
+ * Searches for and loads the configuration file `.config/dler.ts`.
4
+ * Falls back to default configuration if the file is not found.
5
+ */
6
+ export declare function loadConfig(): Promise<BuildPublishConfig>;
package/bin/load.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { relinka } from "@reliverse/relinka";
2
2
  import fs from "fs-extra";
3
3
  import { resolve } from "node:path";
4
- import { defineConfig } from "./libs/cfg/cfg-mod.js";
4
+ import { defineConfig } from "./mod.js";
5
5
  const CONFIG_FILENAME = ".config/dler.ts";
6
6
  export async function loadConfig() {
7
7
  const cwd = process.cwd();
package/bin/mod.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import type { BuildPublishConfig } from "./types.js";
2
+ export declare const defineConfig: (userConfig?: Partial<BuildPublishConfig>) => {
3
+ bumpDisable: boolean;
4
+ bumpFilter: string[];
5
+ bumpMode: import("./types.js").BumpMode;
6
+ commonPubPause: boolean;
7
+ commonPubRegistry: "jsr" | "npm" | "npm-jsr";
8
+ commonVerbose: boolean;
9
+ coreDeclarations: boolean;
10
+ coreEntryFile: string;
11
+ coreEntrySrcDir: string;
12
+ coreBuildOutDir: string;
13
+ coreIsCLI: {
14
+ enabled: boolean;
15
+ scripts: Record<string, string>;
16
+ };
17
+ coreDescription: string;
18
+ distJsrAllowDirty: boolean;
19
+ distJsrBuilder: import("./types.js").BundlerName;
20
+ distJsrCopyRootFiles: string[];
21
+ distJsrDirName: string;
22
+ distJsrDryRun: boolean;
23
+ distJsrFailOnWarn: boolean;
24
+ distJsrGenTsconfig: boolean;
25
+ distJsrOutFilesExt: import("./types.js").NpmOutExt;
26
+ distJsrSlowTypes: boolean;
27
+ distNpmBuilder: import("./types.js").BundlerName;
28
+ distNpmCopyRootFiles: string[];
29
+ distNpmDirName: string;
30
+ distNpmOutFilesExt: import("./types.js").NpmOutExt;
31
+ libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
32
+ libsDirDist: string;
33
+ libsDirSrc: string;
34
+ libsList: Record<string, import("./types.js").LibConfig>;
35
+ logsFileName: string;
36
+ logsFreshFile: boolean;
37
+ rmDepsMode: import("./types.js").ExcludeMode;
38
+ rmDepsPatterns: string[];
39
+ transpileEsbuild: import("./types.js").Esbuild;
40
+ transpileFormat: import("./types.js").transpileFormat;
41
+ transpileMinify: boolean;
42
+ transpilePublicPath: string;
43
+ transpileSourcemap: import("./types.js").Sourcemap;
44
+ transpileSplitting: boolean;
45
+ transpileStub: boolean;
46
+ transpileTarget: import("./types.js").transpileTarget;
47
+ transpileWatch: boolean;
48
+ };
package/bin/mod.js CHANGED
@@ -1,14 +1,4 @@
1
- import { runMain, defineCommand, defineArgs } from "@reliverse/rempts";
2
- import { initDlerConfig } from "./init.js";
3
- const main = defineCommand({
4
- args: defineArgs({
5
- dev: {
6
- type: "boolean",
7
- description: "Runs the CLI in dev mode"
8
- }
9
- }),
10
- async onCmdInit({ args }) {
11
- await initDlerConfig(args.dev);
12
- }
13
- });
14
- await runMain(main);
1
+ import { DEFAULT_CONFIG } from "./default.js";
2
+ export const defineConfig = (userConfig = {}) => {
3
+ return { ...DEFAULT_CONFIG, ...userConfig };
4
+ };