@reliverse/dler 1.7.16 → 1.7.18

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 (165) hide show
  1. package/README.md +134 -206
  2. package/bin/app/agg/run.js +2 -8
  3. package/bin/app/build/cmd.js +4 -4
  4. package/bin/app/build/impl.d.ts +2 -6
  5. package/bin/app/build/impl.js +2 -46
  6. package/bin/app/conv/cmd.d.ts +8 -33
  7. package/bin/app/conv/cmd.js +185 -163
  8. package/bin/app/copy/cmd.js +1 -1
  9. package/bin/app/init/init-impl.js +3 -3
  10. package/bin/app/init/init-types.d.ts +8 -8
  11. package/bin/app/merge/cmd.d.ts +10 -24
  12. package/bin/app/merge/cmd.js +47 -464
  13. package/bin/app/migrate/codemods/anything-bun.js +1 -1
  14. package/bin/app/migrate/codemods/fs-relifso.d.ts +2 -2
  15. package/bin/app/migrate/codemods/fs-relifso.js +1 -1
  16. package/bin/app/migrate/codemods/nodenext-bundler.d.ts +2 -2
  17. package/bin/app/migrate/codemods/nodenext-bundler.js +1 -1
  18. package/bin/app/migrate/codemods/path-pathkit.d.ts +2 -2
  19. package/bin/app/migrate/codemods/path-pathkit.js +1 -1
  20. package/bin/app/migrate/codemods/readdir-glob.d.ts +2 -2
  21. package/bin/app/migrate/codemods/readdir-glob.js +1 -1
  22. package/bin/app/mkdist/cmd.js +4 -2
  23. package/bin/app/pack/cmd.d.ts +44 -0
  24. package/bin/app/pack/cmd.js +313 -0
  25. package/bin/app/pub/cmd.js +4 -4
  26. package/bin/app/pub/impl.d.ts +7 -0
  27. package/bin/app/pub/impl.js +97 -0
  28. package/bin/app/rename/cmd.js +1 -1
  29. package/bin/app/spell/cmd.d.ts +14 -5
  30. package/bin/app/spell/cmd.js +33 -33
  31. package/bin/app/spell/old.js +0 -0
  32. package/bin/app/{mock → unpack}/cmd.d.ts +10 -14
  33. package/bin/app/unpack/cmd.js +200 -0
  34. package/bin/cli.js +2 -2
  35. package/bin/libs/cfg/cfg-mod.d.ts +69 -0
  36. package/bin/libs/cfg/cfg-mod.js +61 -0
  37. package/bin/libs/cfg/rse/rse-impl/rse-biome.d.ts +2 -0
  38. package/bin/libs/cfg/rse/rse-impl/rse-biome.js +34 -0
  39. package/bin/libs/cfg/rse/rse-impl/rse-consts.d.ts +35 -0
  40. package/bin/libs/cfg/rse/rse-impl/rse-consts.js +37 -0
  41. package/bin/libs/cfg/rse/rse-impl/rse-content.d.ts +14 -0
  42. package/bin/libs/cfg/rse/rse-impl/rse-content.js +15 -0
  43. package/bin/libs/cfg/rse/rse-impl/rse-core.d.ts +14 -0
  44. package/bin/libs/cfg/rse/rse-impl/rse-core.js +63 -0
  45. package/bin/libs/cfg/rse/rse-impl/rse-create.d.ts +36 -0
  46. package/bin/libs/cfg/rse/rse-impl/rse-create.js +254 -0
  47. package/bin/libs/cfg/rse/rse-impl/rse-def-utils.d.ts +6 -0
  48. package/bin/libs/cfg/rse/rse-impl/rse-def-utils.js +225 -0
  49. package/bin/libs/cfg/rse/rse-impl/rse-default.d.ts +3 -0
  50. package/bin/libs/cfg/rse/rse-impl/rse-default.js +155 -0
  51. package/bin/libs/cfg/rse/rse-impl/rse-define.d.ts +125 -0
  52. package/bin/libs/cfg/rse/rse-impl/rse-define.js +4 -0
  53. package/bin/libs/cfg/rse/rse-impl/rse-detect.d.ts +23 -0
  54. package/bin/libs/cfg/rse/rse-impl/rse-detect.js +347 -0
  55. package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.d.ts +3 -0
  56. package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.js +186 -0
  57. package/bin/libs/cfg/rse/rse-impl/rse-inject.d.ts +1 -0
  58. package/bin/libs/cfg/rse/rse-impl/rse-inject.js +57 -0
  59. package/bin/libs/cfg/rse/rse-impl/rse-migrate.d.ts +5 -0
  60. package/bin/libs/cfg/rse/rse-impl/rse-migrate.js +56 -0
  61. package/bin/libs/cfg/rse/rse-impl/rse-path.d.ts +11 -0
  62. package/bin/libs/cfg/rse/rse-impl/rse-path.js +33 -0
  63. package/bin/libs/cfg/rse/rse-impl/rse-prompts.d.ts +5 -0
  64. package/bin/libs/cfg/rse/rse-impl/rse-prompts.js +12 -0
  65. package/bin/libs/cfg/rse/rse-impl/rse-read.d.ts +11 -0
  66. package/bin/libs/cfg/rse/rse-impl/rse-read.js +84 -0
  67. package/bin/libs/cfg/rse/rse-impl/rse-repair.d.ts +16 -0
  68. package/bin/libs/cfg/rse/rse-impl/rse-repair.js +137 -0
  69. package/bin/libs/cfg/rse/rse-impl/rse-schema.d.ts +130 -0
  70. package/bin/libs/cfg/rse/rse-impl/rse-schema.js +444 -0
  71. package/bin/libs/cfg/rse/rse-impl/rse-types.d.ts +75 -0
  72. package/bin/libs/cfg/rse/rse-impl/rse-types.js +0 -0
  73. package/bin/libs/cfg/rse/rse-impl/rse-unstable.d.ts +11 -0
  74. package/bin/libs/cfg/rse/rse-impl/rse-unstable.js +41 -0
  75. package/bin/libs/cfg/rse/rse-impl/rse-update.d.ts +10 -0
  76. package/bin/libs/cfg/rse/rse-impl/rse-update.js +152 -0
  77. package/bin/libs/cfg/rse/rse-impl/rse-utils.d.ts +17 -0
  78. package/bin/libs/cfg/rse/rse-impl/rse-utils.js +86 -0
  79. package/bin/libs/cfg/rse/rse-mod.d.ts +20 -0
  80. package/bin/libs/cfg/rse/rse-mod.js +20 -0
  81. package/bin/libs/cfg/types.d.ts +533 -0
  82. package/bin/libs/cfg/types.js +0 -0
  83. package/bin/libs/sdk/sdk-impl/build/build-library.d.ts +5 -5
  84. package/bin/libs/sdk/sdk-impl/build/build-library.js +1 -174
  85. package/bin/libs/sdk/sdk-impl/build/build-regular.d.ts +2 -1
  86. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +287 -240
  87. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.d.ts +4 -4
  88. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.d.ts +8 -5
  89. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js +199 -119
  90. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.d.ts +99 -0
  91. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.js +206 -0
  92. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-mod.js +92 -46
  93. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/raw.d.ts +2 -2
  94. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.d.ts +2 -2
  95. package/bin/libs/sdk/sdk-impl/config/default.d.ts +6 -0
  96. package/bin/libs/sdk/sdk-impl/{cfg → config}/default.js +8 -18
  97. package/bin/libs/sdk/sdk-impl/{cfg → config}/info.js +1 -1
  98. package/bin/libs/sdk/sdk-impl/{cfg → config}/init.js +53 -43
  99. package/bin/libs/sdk/sdk-impl/{cfg → config}/load.d.ts +2 -2
  100. package/bin/libs/sdk/sdk-impl/{cfg → config}/load.js +6 -6
  101. package/bin/libs/sdk/sdk-impl/config/types.d.ts +533 -0
  102. package/bin/libs/sdk/sdk-impl/config/types.js +0 -0
  103. package/bin/libs/sdk/sdk-impl/library-flow.d.ts +2 -1
  104. package/bin/libs/sdk/sdk-impl/regular-flow.d.ts +2 -1
  105. package/bin/libs/sdk/sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js +2 -2
  106. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-types.d.ts +6 -6
  107. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/filesystem.js +1 -1
  108. package/bin/libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.js +1 -1
  109. package/bin/libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.js +2 -2
  110. package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.d.ts +38 -0
  111. package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.js +474 -0
  112. package/bin/libs/sdk/sdk-impl/spell/spells.d.ts +31 -0
  113. package/bin/libs/sdk/sdk-impl/spell/spells.js +85 -0
  114. package/bin/libs/sdk/sdk-impl/utils/binary.js +1 -1
  115. package/bin/libs/sdk/sdk-impl/utils/comments.d.ts +6 -0
  116. package/bin/libs/sdk/sdk-impl/utils/comments.js +41 -0
  117. package/bin/libs/sdk/sdk-impl/utils/finalize.d.ts +2 -1
  118. package/bin/libs/sdk/sdk-impl/utils/finalize.js +1 -0
  119. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.d.ts +6 -0
  120. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.js +7 -0
  121. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.d.ts +5 -0
  122. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.js +40 -0
  123. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.d.ts +24 -0
  124. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.js +0 -0
  125. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.d.ts +17 -0
  126. package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.js +46 -0
  127. package/bin/libs/sdk/sdk-impl/utils/replacements.d.ts +0 -0
  128. package/bin/libs/sdk/sdk-impl/utils/replacements.js +0 -0
  129. package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.d.ts +3 -0
  130. package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.js +194 -0
  131. package/bin/libs/sdk/sdk-impl/utils/utils-build.d.ts +1 -2
  132. package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +1 -1
  133. package/bin/libs/sdk/sdk-impl/utils/utils-deps.d.ts +1 -1
  134. package/bin/libs/sdk/sdk-impl/utils/utils-determine.d.ts +1 -1
  135. package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.d.ts +4 -0
  136. package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.js +1 -0
  137. package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.d.ts +1 -1
  138. package/bin/libs/sdk/sdk-impl/utils/utils-package-json-libraries.d.ts +1 -1
  139. package/bin/libs/sdk/sdk-impl/utils/utils-package-json-regular.d.ts +1 -1
  140. package/bin/libs/sdk/sdk-impl/utils/utils-security.d.ts +1 -3
  141. package/bin/libs/sdk/sdk-impl/utils/utils-security.js +11 -10
  142. package/bin/libs/sdk/sdk-mod.d.ts +1 -6
  143. package/bin/libs/sdk/sdk-mod.js +0 -31
  144. package/bin/libs/sdk/sdk-types.d.ts +39 -582
  145. package/bin/mod.d.ts +1 -1
  146. package/bin/mod.js +1 -1
  147. package/package.json +12 -4
  148. package/bin/app/mock/cmd.js +0 -284
  149. package/bin/app/mock/mock.d.ts +0 -11
  150. package/bin/app/mock/mock.js +0 -97
  151. package/bin/libs/sdk/sdk-impl/cfg/default.d.ts +0 -5
  152. package/bin/libs/sdk/sdk-impl/cfg/define.d.ts +0 -2
  153. package/bin/libs/sdk/sdk-impl/cfg/define.js +0 -4
  154. package/bin/libs/sdk/sdk-impl/spell/spell-executors.d.ts +0 -10
  155. package/bin/libs/sdk/sdk-impl/spell/spell-executors.js +0 -307
  156. package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.d.ts +0 -7
  157. package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.js +0 -74
  158. package/bin/libs/sdk/sdk-impl/spell/spell-mod.d.ts +0 -4
  159. package/bin/libs/sdk/sdk-impl/spell/spell-mod.js +0 -87
  160. package/bin/libs/sdk/sdk-impl/spell/spell-parser.d.ts +0 -4
  161. package/bin/libs/sdk/sdk-impl/spell/spell-parser.js +0 -58
  162. package/bin/libs/sdk/sdk-impl/spell/spell-types.d.ts +0 -60
  163. /package/bin/{libs/sdk/sdk-impl/spell/spell-types.js → app/spell/old.d.ts} +0 -0
  164. /package/bin/libs/sdk/sdk-impl/{cfg → config}/info.d.ts +0 -0
  165. /package/bin/libs/sdk/sdk-impl/{cfg → config}/init.d.ts +0 -0
@@ -2,60 +2,106 @@ import { relative, dirname as pathDirname } from "@reliverse/pathkit";
2
2
  import { relinka } from "@reliverse/relinka";
3
3
  import { rmdir, symlink, warn } from "../utils.js";
4
4
  import { mkdist } from "./mkdist-impl/make.js";
5
+ import { useSpinner } from "./mkdist-impl/utils/spinner.js";
5
6
  export async function mkdistBuild(ctx) {
6
7
  const entries = ctx.options.entries.filter((e) => e.builder === "mkdist");
7
- await ctx.hooks.callHook("mkdist:entries", ctx, entries);
8
- for (const entry of entries) {
9
- const distDir = entry.outDir || entry.input;
10
- if (ctx.options.transpileStub) {
11
- await rmdir(distDir);
12
- await symlink(entry.input, distDir);
13
- } else {
14
- let srcDir;
15
- if (typeof entry.input === "string" && !entry.input.endsWith("/")) {
16
- srcDir = ctx.options.isLib ? pathDirname(entry.input) : entry.input;
8
+ if (entries.length === 0) {
9
+ return;
10
+ }
11
+ await useSpinner.promise(
12
+ async (mainSpinner) => {
13
+ await ctx.hooks.callHook("mkdist:entries", ctx, entries);
14
+ let processedEntries = 0;
15
+ let totalWrittenFiles = 0;
16
+ let totalErrors = 0;
17
+ for (const entry of entries) {
18
+ processedEntries++;
19
+ mainSpinner.setProgress({
20
+ current: processedEntries,
21
+ total: entries.length
22
+ });
23
+ mainSpinner.setText(
24
+ `Processing entry ${processedEntries}/${entries.length}: ${entry.input}`
25
+ );
26
+ const distDir = entry.outDir || entry.input;
27
+ if (ctx.options.transpileStub) {
28
+ await rmdir(distDir);
29
+ await symlink(entry.input, distDir);
30
+ continue;
31
+ }
32
+ let srcDir;
33
+ if (typeof entry.input === "string" && !entry.input.endsWith("/")) {
34
+ srcDir = ctx.options.isLib ? pathDirname(entry.input) : entry.input;
35
+ relinka(
36
+ "verbose",
37
+ `[mkdist] Using directory from file path: ${srcDir} (from: ${entry.input})`
38
+ );
39
+ } else {
40
+ srcDir = entry.input;
41
+ relinka("verbose", `[mkdist] Using directory directly: ${srcDir}`);
42
+ }
43
+ const mkdistOptions = {
44
+ cleanDist: false,
45
+ distDir,
46
+ rootDir: ctx.options.rootDir,
47
+ srcDir,
48
+ format: "esm",
49
+ ext: entry.ext || "js",
50
+ ...entry
51
+ };
17
52
  relinka(
18
- "verbose",
19
- `[mkdist] Using directory from file path: ${srcDir} (from: ${entry.input})`
53
+ "info",
54
+ `[mkdist] Building with options: srcDir=${mkdistOptions.srcDir}, distDir=${mkdistOptions.distDir}, rootDir=${mkdistOptions.rootDir}`
20
55
  );
21
- } else {
22
- srcDir = entry.input;
23
- relinka("verbose", `[mkdist] Using directory directly: ${srcDir}`);
24
- }
25
- const mkdistOptions = {
26
- cleanDist: false,
27
- distDir,
28
- rootDir: ctx.options.rootDir,
29
- srcDir,
30
- format: "esm",
31
- ext: entry.ext || "js",
32
- ...entry
33
- };
34
- relinka(
35
- "verbose",
36
- `[mkdist] Building with options: srcDir=${mkdistOptions.srcDir}, distDir=${mkdistOptions.distDir}, rootDir=${mkdistOptions.rootDir}`
37
- );
38
- await ctx.hooks.callHook("mkdist:entry:options", ctx, entry, mkdistOptions);
39
- const output = await mkdist(mkdistOptions);
40
- ctx.buildEntries.push({
41
- chunks: output.writtenFiles.map((p) => relative(ctx.options.outDir, p)),
42
- path: distDir,
43
- isLib: ctx.options.isLib
44
- });
45
- await ctx.hooks.callHook("mkdist:entry:build", ctx, entry, output);
46
- if (output.errors) {
47
- for (const error of output.errors) {
56
+ await ctx.hooks.callHook("mkdist:entry:options", ctx, entry, mkdistOptions);
57
+ try {
58
+ const { result: output, duration } = await mkdist(mkdistOptions);
59
+ relinka("verbose", `[mkdist] Entry ${processedEntries} completed in ${duration}ms`);
60
+ totalWrittenFiles += output.writtenFiles.length;
61
+ ctx.buildEntries.push({
62
+ chunks: output.writtenFiles.map((p) => relative(ctx.options.outDir, p)),
63
+ path: distDir,
64
+ isLib: ctx.options.isLib
65
+ });
66
+ await ctx.hooks.callHook("mkdist:entry:build", ctx, entry, output);
67
+ if (output.errors && output.errors.length > 0) {
68
+ totalErrors += output.errors.length;
69
+ for (const error of output.errors) {
70
+ warn(
71
+ ctx,
72
+ `mkdist build failed for \`${relative(ctx.options.rootDir, error.filename)}\`:
73
+ ${error.errors.map((e) => ` - ${e}`).join("\n")}`
74
+ );
75
+ }
76
+ }
77
+ } catch (error) {
78
+ totalErrors++;
48
79
  warn(
49
80
  ctx,
50
- `mkdist build failed for \`${relative(ctx.options.rootDir, error.filename)}\`:
51
- ${error.errors.map((e) => ` - ${e}`).join("\n")}`
81
+ `mkdist build failed for entry ${entry.input}: ${error instanceof Error ? error.message : "Unknown error"}`
52
82
  );
53
83
  }
54
84
  }
85
+ await ctx.hooks.callHook("mkdist:done", ctx);
86
+ if (entries.length > 0 && ctx.options.transpileWatch) {
87
+ relinka("warn", "`mkdist` builder does not support transpileWatch mode yet.");
88
+ }
89
+ if (totalErrors > 0) {
90
+ mainSpinner.warn(
91
+ `Processed ${entries.length} entries with ${totalErrors} errors. ${totalWrittenFiles} files written.`
92
+ );
93
+ } else {
94
+ mainSpinner.setText(
95
+ `Successfully processed ${entries.length} entries. ${totalWrittenFiles} files written.`
96
+ );
97
+ }
98
+ },
99
+ {
100
+ text: entries.length === 1 ? "Processing mkdist entry..." : `Processing ${entries.length} mkdist entries...`,
101
+ color: "blue",
102
+ successText: entries.length === 1 ? "mkdist entry completed!" : `All ${entries.length} mkdist entries completed!`,
103
+ failText: "mkdist build failed!",
104
+ prefixText: "[mkdist]"
55
105
  }
56
- }
57
- await ctx.hooks.callHook("mkdist:done", ctx);
58
- if (entries.length > 0 && ctx.options.transpileWatch) {
59
- relinka("warn", "`mkdist` builder does not support transpileWatch mode yet.");
60
- }
106
+ );
61
107
  }
@@ -1,8 +1,8 @@
1
1
  import type { FilterPattern } from "@rollup/pluginutils";
2
2
  import type { Plugin } from "rollup";
3
- type RawLoaderOptions = {
3
+ interface RawLoaderOptions {
4
4
  exclude?: FilterPattern;
5
5
  include?: FilterPattern;
6
- };
6
+ }
7
7
  export declare function rawPlugin(opts?: RawLoaderOptions): Plugin;
8
8
  export {};
@@ -1,9 +1,9 @@
1
1
  import type { PackageJson } from "pkg-types";
2
2
  import type { BuildContext, BuildPreset, UnifiedBuildConfig } from "../../../../sdk-types.js";
3
- type OutputDescriptor = {
3
+ interface OutputDescriptor {
4
4
  file: string;
5
5
  type?: "cjs" | "esm";
6
- };
6
+ }
7
7
  export declare function arrayIncludes(arr: (RegExp | string)[], searchElement: string): boolean;
8
8
  export declare function dumpObject(obj: Record<string, any>): string;
9
9
  export declare function extractExportFilenames(exports: PackageJson["exports"], conditions?: string[]): OutputDescriptor[];
@@ -0,0 +1,6 @@
1
+ import type { DlerConfig } from "./types.js";
2
+ /**
3
+ * Default configuration for the build and publish logic.
4
+ */
5
+ export declare const DEFAULT_CONFIG_DLER: DlerConfig;
6
+ export declare const defineConfigDler: (userConfig?: Partial<DlerConfig>) => any;
@@ -1,4 +1,4 @@
1
- export const DEFAULT_CONFIG = {
1
+ export const DEFAULT_CONFIG_DLER = {
2
2
  bumpDisable: false,
3
3
  bumpFilter: ["package.json", ".config/rse.ts"],
4
4
  bumpMode: "patch",
@@ -11,10 +11,7 @@ export const DEFAULT_CONFIG = {
11
11
  coreEntryFile: "mod.ts",
12
12
  coreEntrySrcDir: "src",
13
13
  coreBuildOutDir: "bin",
14
- coreIsCLI: {
15
- enabled: false,
16
- scripts: {}
17
- },
14
+ coreIsCLI: { enabled: false, scripts: {} },
18
15
  distJsrAllowDirty: true,
19
16
  distJsrBuilder: "jsr",
20
17
  distJsrDirName: "dist-jsr",
@@ -37,12 +34,7 @@ export const DEFAULT_CONFIG = {
37
34
  global: ["@types", "biome", "eslint", "knip", "prettier", "typescript", "@reliverse/dler"],
38
35
  "dist-npm": [],
39
36
  "dist-jsr": [],
40
- "dist-libs": {
41
- "@reliverse/dler-sdk": {
42
- npm: [],
43
- jsr: []
44
- }
45
- }
37
+ "dist-libs": {}
46
38
  },
47
39
  // Build setup
48
40
  transpileFailOnWarn: false,
@@ -58,13 +50,11 @@ export const DEFAULT_CONFIG = {
58
50
  // Publish artifacts configuration
59
51
  publishArtifacts: {
60
52
  global: ["package.json", "README.md", "LICENSE"],
61
- "dist-jsr": ["jsr.json"],
53
+ "dist-jsr": [],
62
54
  "dist-npm": [],
63
- "dist-libs": {
64
- "@reliverse/dler-sdk": {
65
- jsr: ["jsr.json"],
66
- npm: []
67
- }
68
- }
55
+ "dist-libs": {}
69
56
  }
70
57
  };
58
+ export const defineConfigDler = (userConfig = {}) => {
59
+ return { ...DEFAULT_CONFIG_DLER, ...userConfig };
60
+ };
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.16";
2
+ const version = "1.7.18";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -2,7 +2,7 @@ import path from "@reliverse/pathkit";
2
2
  import fs from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
4
  import { readPackageJSON } from "pkg-types";
5
- import { DEFAULT_CONFIG } from "./default.js";
5
+ import { DEFAULT_CONFIG_DLER } from "./default.js";
6
6
  const CONFIG_FILENAME = ".config/dler.ts";
7
7
  export async function ensureDlerConfig(isDev) {
8
8
  const configPath = path.resolve(process.cwd(), CONFIG_FILENAME);
@@ -49,7 +49,7 @@ function getBumpFilter(isDev) {
49
49
  return isDev ? `[
50
50
  "package.json",
51
51
  ".config/rse.ts",
52
- "src/libs/sdk/sdk-impl/cfg/info.ts",
52
+ "src/libs/sdk/sdk-impl/config/info.ts",
53
53
  ]` : `["package.json", ".config/rse.ts"]`;
54
54
  }
55
55
  function getPublishArtifacts(isDev) {
@@ -112,17 +112,17 @@ function getFilterDepsPatterns(isDev) {
112
112
  }`;
113
113
  }
114
114
  function generateConfig(isDev, pkgDescription) {
115
- const importDefineConfigStatement = isDev ? `import { defineConfig } from "../../../../mod.js";` : `import { defineConfig } from "@reliverse/dler";`;
116
- const verboseValue = getValue(isDev, true, DEFAULT_CONFIG.commonVerbose);
115
+ const importDefineConfigDlerStatement = isDev ? `import { defineConfigDler } from "../../../../mod.js";` : `import { defineConfigDler } from "@reliverse/cfg";`;
116
+ const verboseValue = getValue(isDev, true, DEFAULT_CONFIG_DLER.commonVerbose);
117
117
  const coreIsCLI = getCoreIsCLI(isDev);
118
- const registryValue = getValue(isDev, "npm-jsr", DEFAULT_CONFIG.commonPubRegistry);
119
- const pausePublishValue = getValue(isDev, false, DEFAULT_CONFIG.commonPubPause);
118
+ const registryValue = getValue(isDev, "npm-jsr", DEFAULT_CONFIG_DLER.commonPubRegistry);
119
+ const pausePublishValue = getValue(isDev, false, DEFAULT_CONFIG_DLER.commonPubPause);
120
120
  const coreDescriptionValue = getValue(
121
121
  isDev,
122
122
  "dler (prev. relidler) is a flexible, unified, and fully automated bundler for TypeScript and JavaScript projects, as well as an NPM and JSR publishing tool.",
123
- pkgDescription || DEFAULT_CONFIG.coreDescription
123
+ pkgDescription || DEFAULT_CONFIG_DLER.coreDescription
124
124
  );
125
- const libsActModeValue = getValue(isDev, "main-and-libs", DEFAULT_CONFIG.libsActMode);
125
+ const libsActModeValue = getValue(isDev, "main-and-libs", DEFAULT_CONFIG_DLER.libsActMode);
126
126
  const libsObject = isDev ? `{
127
127
  "@reliverse/dler-sdk": {
128
128
  libDeclarations: true,
@@ -134,31 +134,41 @@ function generateConfig(isDev, pkgDescription) {
134
134
  libPubPause: false,
135
135
  libPubRegistry: "npm-jsr",
136
136
  },
137
+ "@reliverse/cfg": {
138
+ libDeclarations: true,
139
+ libDescription: "shared config for @reliverse/dler (defineConfigDler) and @reliverse/rse (defineConfigRse)",
140
+ libDirName: "cfg",
141
+ libMainFile: "cfg/cfg-mod.ts",
142
+ libPkgKeepDeps: true,
143
+ libTranspileMinify: true,
144
+ libPubPause: false,
145
+ libPubRegistry: "npm-jsr",
146
+ },
137
147
  }` : `{
138
148
  // "@acme/cli-libName": {
139
149
  // libDeclarations: true,
140
- // libDescription: "@acme/cli defineConfig",
150
+ // libDescription: "@acme/cli defineConfigAcme",
141
151
  // libDirName: "libName",
142
152
  // libMainFile: "libName/libName-mod.ts",
143
153
  // libPkgKeepDeps: true,
144
154
  // libTranspileMinify: true,
145
155
  // libPubPause: false,
146
- // libPubRegistry: "npm-jsr",
156
+ // libPubRegistry: "npm",
147
157
  // },
148
158
  }`;
149
159
  const configTemplate = [
150
- importDefineConfigStatement,
160
+ importDefineConfigDlerStatement,
151
161
  "",
152
162
  "/**",
153
163
  " * Reliverse Bundler Configuration",
154
164
  " * Hover over a field to see more details",
155
165
  " * @see https://github.com/reliverse/dler",
156
166
  " */",
157
- "export default defineConfig({",
167
+ "export default defineConfigDler({",
158
168
  " // Bump configuration",
159
- " bumpDisable: " + DEFAULT_CONFIG.bumpDisable + ",",
169
+ " bumpDisable: " + DEFAULT_CONFIG_DLER.bumpDisable + ",",
160
170
  " bumpFilter: " + getBumpFilter(isDev) + ",",
161
- ' bumpMode: "' + DEFAULT_CONFIG.bumpMode + '",',
171
+ ' bumpMode: "' + DEFAULT_CONFIG_DLER.bumpMode + '",',
162
172
  "",
163
173
  " // Common configuration",
164
174
  " commonPubPause: " + pausePublishValue + ",",
@@ -166,40 +176,40 @@ function generateConfig(isDev, pkgDescription) {
166
176
  " commonVerbose: " + verboseValue + ",",
167
177
  "",
168
178
  " // Core configuration",
169
- ' coreBuildOutDir: "' + DEFAULT_CONFIG.coreBuildOutDir + '",',
170
- " coreDeclarations: " + DEFAULT_CONFIG.coreDeclarations + ",",
179
+ ' coreBuildOutDir: "' + DEFAULT_CONFIG_DLER.coreBuildOutDir + '",',
180
+ " coreDeclarations: " + DEFAULT_CONFIG_DLER.coreDeclarations + ",",
171
181
  " coreDescription: " + JSON.stringify(coreDescriptionValue) + ",",
172
- ' coreEntryFile: "' + DEFAULT_CONFIG.coreEntryFile + '",',
173
- ' coreEntrySrcDir: "' + DEFAULT_CONFIG.coreEntrySrcDir + '",',
182
+ ' coreEntryFile: "' + DEFAULT_CONFIG_DLER.coreEntryFile + '",',
183
+ ' coreEntrySrcDir: "' + DEFAULT_CONFIG_DLER.coreEntrySrcDir + '",',
174
184
  " " + coreIsCLI,
175
185
  "",
176
186
  " // JSR-only config",
177
- " distJsrAllowDirty: " + DEFAULT_CONFIG.distJsrAllowDirty + ",",
178
- ' distJsrBuilder: "' + DEFAULT_CONFIG.distJsrBuilder + '",',
179
- ' distJsrDirName: "' + DEFAULT_CONFIG.distJsrDirName + '",',
180
- " distJsrDryRun: " + DEFAULT_CONFIG.distJsrDryRun + ",",
181
- " distJsrFailOnWarn: " + DEFAULT_CONFIG.distJsrFailOnWarn + ",",
182
- " distJsrGenTsconfig: " + DEFAULT_CONFIG.distJsrGenTsconfig + ",",
183
- ' distJsrOutFilesExt: "' + DEFAULT_CONFIG.distJsrOutFilesExt + '",',
184
- " distJsrSlowTypes: " + DEFAULT_CONFIG.distJsrSlowTypes + ",",
187
+ " distJsrAllowDirty: " + DEFAULT_CONFIG_DLER.distJsrAllowDirty + ",",
188
+ ' distJsrBuilder: "' + DEFAULT_CONFIG_DLER.distJsrBuilder + '",',
189
+ ' distJsrDirName: "' + DEFAULT_CONFIG_DLER.distJsrDirName + '",',
190
+ " distJsrDryRun: " + DEFAULT_CONFIG_DLER.distJsrDryRun + ",",
191
+ " distJsrFailOnWarn: " + DEFAULT_CONFIG_DLER.distJsrFailOnWarn + ",",
192
+ " distJsrGenTsconfig: " + DEFAULT_CONFIG_DLER.distJsrGenTsconfig + ",",
193
+ ' distJsrOutFilesExt: "' + DEFAULT_CONFIG_DLER.distJsrOutFilesExt + '",',
194
+ " distJsrSlowTypes: " + DEFAULT_CONFIG_DLER.distJsrSlowTypes + ",",
185
195
  "",
186
196
  " // NPM-only config",
187
- ' distNpmBuilder: "' + DEFAULT_CONFIG.distNpmBuilder + '",',
188
- ' distNpmDirName: "' + DEFAULT_CONFIG.distNpmDirName + '",',
189
- ' distNpmOutFilesExt: "' + DEFAULT_CONFIG.distNpmOutFilesExt + '",',
197
+ ' distNpmBuilder: "' + DEFAULT_CONFIG_DLER.distNpmBuilder + '",',
198
+ ' distNpmDirName: "' + DEFAULT_CONFIG_DLER.distNpmDirName + '",',
199
+ ' distNpmOutFilesExt: "' + DEFAULT_CONFIG_DLER.distNpmOutFilesExt + '",',
190
200
  "",
191
201
  " // Libraries Dler Plugin",
192
202
  " // Publish specific dirs as separate packages",
193
203
  " // This feature is experimental at the moment",
194
204
  " // Please commit your changes before using it",
195
205
  ' libsActMode: "' + libsActModeValue + '",',
196
- ' libsDirDist: "' + DEFAULT_CONFIG.libsDirDist + '",',
197
- ' libsDirSrc: "' + DEFAULT_CONFIG.libsDirSrc + '",',
206
+ ' libsDirDist: "' + DEFAULT_CONFIG_DLER.libsDirDist + '",',
207
+ ' libsDirSrc: "' + DEFAULT_CONFIG_DLER.libsDirSrc + '",',
198
208
  " libsList: " + libsObject + ",",
199
209
  "",
200
210
  " // @reliverse/relinka logger setup",
201
- ' logsFileName: "' + DEFAULT_CONFIG.logsFileName + '",',
202
- " logsFreshFile: " + DEFAULT_CONFIG.logsFreshFile + ",",
211
+ ' logsFileName: "' + DEFAULT_CONFIG_DLER.logsFileName + '",',
212
+ " logsFreshFile: " + DEFAULT_CONFIG_DLER.logsFreshFile + ",",
203
213
  "",
204
214
  " // Specifies what resources to send to npm and jsr registries.",
205
215
  ' // coreBuildOutDir (e.g. "bin") dir is automatically included.',
@@ -216,13 +226,13 @@ function generateConfig(isDev, pkgDescription) {
216
226
  " // transpileAlias: {},",
217
227
  " // transpileClean: true,",
218
228
  " // transpileEntries: [],",
219
- ' transpileEsbuild: "' + DEFAULT_CONFIG.transpileEsbuild + '",',
229
+ ' transpileEsbuild: "' + DEFAULT_CONFIG_DLER.transpileEsbuild + '",',
220
230
  " // transpileExternals: [],",
221
- " transpileFailOnWarn: " + DEFAULT_CONFIG.transpileFailOnWarn + ",",
222
- ' transpileFormat: "' + DEFAULT_CONFIG.transpileFormat + '",',
223
- " transpileMinify: " + DEFAULT_CONFIG.transpileMinify + ",",
231
+ " transpileFailOnWarn: " + DEFAULT_CONFIG_DLER.transpileFailOnWarn + ",",
232
+ ' transpileFormat: "' + DEFAULT_CONFIG_DLER.transpileFormat + '",',
233
+ " transpileMinify: " + DEFAULT_CONFIG_DLER.transpileMinify + ",",
224
234
  " // transpileParallel: false,",
225
- ' transpilePublicPath: "' + DEFAULT_CONFIG.transpilePublicPath + '",',
235
+ ' transpilePublicPath: "' + DEFAULT_CONFIG_DLER.transpilePublicPath + '",',
226
236
  " // transpileReplace: {},",
227
237
  " // transpileRollup: {",
228
238
  " // alias: {},",
@@ -234,12 +244,12 @@ function generateConfig(isDev, pkgDescription) {
234
244
  " // resolve: {},",
235
245
  " // },",
236
246
  " // transpileShowOutLog: false,",
237
- ' transpileSourcemap: "' + DEFAULT_CONFIG.transpileSourcemap + '",',
238
- " transpileSplitting: " + DEFAULT_CONFIG.transpileSplitting + ",",
239
- " transpileStub: " + DEFAULT_CONFIG.transpileStub + ",",
247
+ ' transpileSourcemap: "' + DEFAULT_CONFIG_DLER.transpileSourcemap + '",',
248
+ " transpileSplitting: " + DEFAULT_CONFIG_DLER.transpileSplitting + ",",
249
+ " transpileStub: " + DEFAULT_CONFIG_DLER.transpileStub + ",",
240
250
  " // transpileStubOptions: { jiti: {} },",
241
- ' transpileTarget: "' + DEFAULT_CONFIG.transpileTarget + '",',
242
- " transpileWatch: " + DEFAULT_CONFIG.transpileWatch + ",",
251
+ ' transpileTarget: "' + DEFAULT_CONFIG_DLER.transpileTarget + '",',
252
+ " transpileWatch: " + DEFAULT_CONFIG_DLER.transpileWatch + ",",
243
253
  " // transpileWatchOptions: undefined,",
244
254
  "});"
245
255
  ].join("\n");
@@ -1,7 +1,7 @@
1
- import type { DlerConfig } from "../../sdk-types.js";
1
+ import type { DlerConfig } from "./types.js";
2
2
  /**
3
3
  * Searches for and loads the configuration file `.config/dler.ts`.
4
4
  * Falls back to default configuration if the file is not found.
5
5
  * Uses jiti for seamless TypeScript and ESM support.
6
6
  */
7
- export declare function loadConfig(): Promise<DlerConfig>;
7
+ export declare function getConfigDler(): Promise<DlerConfig>;
@@ -1,10 +1,10 @@
1
+ import { resolve } from "@reliverse/pathkit";
1
2
  import fs from "@reliverse/relifso";
2
3
  import { relinka } from "@reliverse/relinka";
3
4
  import { createJiti } from "jiti";
4
- import { resolve } from "node:path";
5
- import { defineConfig } from "./define.js";
5
+ import { defineConfigDler } from "./default.js";
6
6
  const CONFIG_FILENAME = ".config/dler.ts";
7
- export async function loadConfig() {
7
+ export async function getConfigDler() {
8
8
  const cwd = process.cwd();
9
9
  const configPath = resolve(cwd, CONFIG_FILENAME);
10
10
  if (await fs.pathExists(configPath)) {
@@ -18,10 +18,10 @@ export async function loadConfig() {
18
18
  if (typeof config === "function") {
19
19
  const result = config();
20
20
  if (result && typeof result === "object") {
21
- return defineConfig(result);
21
+ return defineConfigDler(result);
22
22
  }
23
23
  } else if (config && typeof config === "object") {
24
- return defineConfig(config);
24
+ return defineConfigDler(config);
25
25
  }
26
26
  throw new Error("Invalid config format");
27
27
  } catch (error) {
@@ -29,5 +29,5 @@ export async function loadConfig() {
29
29
  }
30
30
  }
31
31
  relinka("log", `Config file not found at ${configPath}. Using default configuration.`);
32
- return defineConfig();
32
+ return defineConfigDler();
33
33
  }