@reliverse/dler 1.7.6 → 1.7.8

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 (109) hide show
  1. package/LICENSES +1 -0
  2. package/README.md +1 -1
  3. package/bin/app/agg/impl.js +9 -25
  4. package/bin/app/agg/run.js +1 -6
  5. package/bin/app/build/impl.js +3 -17
  6. package/bin/app/check/cmd.js +3 -12
  7. package/bin/app/conv/cmd.js +7 -25
  8. package/bin/app/copy/cmd.js +2 -7
  9. package/bin/app/init/cmd.js +1 -5
  10. package/bin/app/init/init-const.js +2 -11
  11. package/bin/app/init/init-impl.js +9 -30
  12. package/bin/app/init/{templates/t-readme.d.ts → init-tmpl.d.ts} +2 -0
  13. package/bin/app/init/{templates/t-readme.js → init-tmpl.js} +27 -0
  14. package/bin/app/inject/impl.js +4 -7
  15. package/bin/app/libs/cmd.js +4 -13
  16. package/bin/app/merge/cmd.js +8 -28
  17. package/bin/app/migrate/cmd.js +11 -44
  18. package/bin/app/migrate/codemods/anything-bun.js +13 -34
  19. package/bin/app/migrate/codemods/commander-rempts.js +4 -12
  20. package/bin/app/migrate/codemods/console-relinka.js +12 -27
  21. package/bin/app/migrate/codemods/fs-relifso.js +20 -43
  22. package/bin/app/migrate/codemods/nodenext-bundler.js +6 -14
  23. package/bin/app/migrate/codemods/path-pathkit.js +16 -42
  24. package/bin/app/migrate/codemods/readdir-glob.js +11 -22
  25. package/bin/app/mkdist/cmd.d.ts +83 -0
  26. package/bin/app/mkdist/cmd.js +121 -0
  27. package/bin/app/rempts/cmd.js +13 -35
  28. package/bin/app/rename/cmd.js +6 -15
  29. package/bin/app/spell/cmd.js +1 -3
  30. package/bin/app/split/cmd.js +1 -5
  31. package/bin/app/split/impl.js +1 -6
  32. package/bin/libs/sdk/sdk-impl/build/build-library.js +36 -123
  33. package/bin/libs/sdk/sdk-impl/build/build-regular.d.ts +2 -2
  34. package/bin/libs/sdk/sdk-impl/build/build-regular.js +28 -66
  35. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/auto.js +4 -16
  36. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.d.ts +1 -1
  37. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +97 -89
  38. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/{copy.js → copy-mod.js} +4 -18
  39. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loader.d.ts +4 -0
  40. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loader.js +26 -0
  41. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/js.d.ts +2 -0
  42. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/js.js +49 -0
  43. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/loaders-mod.d.ts +12 -0
  44. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/loaders-mod.js +30 -0
  45. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/postcss.d.ts +3 -0
  46. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/postcss.js +28 -0
  47. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/sass.d.ts +2 -0
  48. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/sass.js +31 -0
  49. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.d.ts +17 -0
  50. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.js +145 -0
  51. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.d.ts +8 -0
  52. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js +133 -0
  53. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.d.ts +11 -0
  54. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/dts.js +94 -0
  55. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/fs.d.ts +1 -0
  56. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/fs.js +15 -0
  57. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/vue-dts.d.ts +3 -0
  58. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/vue-dts.js +175 -0
  59. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/{mkdist.js → mkdist-mod.js} +5 -19
  60. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/build.js +2 -7
  61. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/config.js +2 -9
  62. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/stub.js +8 -26
  63. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/utils.js +1 -4
  64. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/watch.js +1 -4
  65. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/{index.js → untyped-mod.js} +8 -22
  66. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.js +3 -11
  67. package/bin/libs/sdk/sdk-impl/build/bundlers/unified/validate.js +4 -15
  68. package/bin/libs/sdk/sdk-impl/cfg/default.js +1 -9
  69. package/bin/libs/sdk/sdk-impl/cfg/info.js +1 -1
  70. package/bin/libs/sdk/sdk-impl/cfg/init.js +101 -102
  71. package/bin/libs/sdk/sdk-impl/cfg/load.js +1 -4
  72. package/bin/libs/sdk/sdk-impl/library-flow.js +3 -11
  73. package/bin/libs/sdk/sdk-impl/pub/pub-library.js +5 -22
  74. package/bin/libs/sdk/sdk-impl/pub/pub-regular.d.ts +2 -2
  75. package/bin/libs/sdk/sdk-impl/pub/pub-regular.js +3 -6
  76. package/bin/libs/sdk/sdk-impl/regular-flow.js +8 -26
  77. package/bin/libs/sdk/sdk-impl/rules/reliverse/file-extensions/file-extensions.js +1 -5
  78. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/analyzer.js +2 -9
  79. package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/formatter.js +8 -20
  80. package/bin/libs/sdk/sdk-impl/rules/reliverse/package-json-health/package-json-health.js +1 -7
  81. package/bin/libs/sdk/sdk-impl/rules/reliverse/path-extensions/path-extensions.js +2 -5
  82. package/bin/libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.js +3 -8
  83. package/bin/libs/sdk/sdk-impl/rules/rules-mod.js +4 -14
  84. package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.js +4 -8
  85. package/bin/libs/sdk/sdk-impl/spell/spell-parser.js +1 -3
  86. package/bin/libs/sdk/sdk-impl/utils/finalize.js +3 -14
  87. package/bin/libs/sdk/sdk-impl/utils/tools/tools-agg.js +5 -16
  88. package/bin/libs/sdk/sdk-impl/utils/utils-build.js +3 -11
  89. package/bin/libs/sdk/sdk-impl/utils/utils-clean.js +2 -5
  90. package/bin/libs/sdk/sdk-impl/utils/utils-consts.js +1 -8
  91. package/bin/libs/sdk/sdk-impl/utils/utils-cwd.js +1 -4
  92. package/bin/libs/sdk/sdk-impl/utils/utils-deps.js +14 -25
  93. package/bin/libs/sdk/sdk-impl/utils/utils-error.js +1 -5
  94. package/bin/libs/sdk/sdk-impl/utils/utils-fs.d.ts +14 -0
  95. package/bin/libs/sdk/sdk-impl/utils/utils-fs.js +100 -37
  96. package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.js +2 -7
  97. package/bin/libs/sdk/sdk-impl/utils/utils-package-json-libraries.js +32 -86
  98. package/bin/libs/sdk/sdk-impl/utils/utils-package-json-regular.js +13 -61
  99. package/bin/libs/sdk/sdk-mod.d.ts +3 -3
  100. package/bin/libs/sdk/sdk-mod.js +3 -3
  101. package/bin/libs/sdk/sdk-types.d.ts +76 -12
  102. package/package.json +8 -3
  103. package/bin/app/init/templates/t-gitignore.d.ts +0 -1
  104. package/bin/app/init/templates/t-gitignore.js +0 -9
  105. package/bin/app/init/templates/t-license.d.ts +0 -1
  106. package/bin/app/init/templates/t-license.js +0 -18
  107. /package/bin/libs/sdk/sdk-impl/build/bundlers/unified/copy/{copy.d.ts → copy-mod.d.ts} +0 -0
  108. /package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/{mkdist.d.ts → mkdist-mod.d.ts} +0 -0
  109. /package/bin/libs/sdk/sdk-impl/build/bundlers/unified/untyped/{index.d.ts → untyped-mod.d.ts} +0 -0
@@ -35,9 +35,7 @@ export function inferPkgExternals(pkg) {
35
35
  const externals = [
36
36
  ...Object.keys(pkg.dependencies || {}),
37
37
  ...Object.keys(pkg.peerDependencies || {}),
38
- ...Object.keys(pkg.devDependencies || {}).filter(
39
- (dep) => dep.startsWith("@types/")
40
- ),
38
+ ...Object.keys(pkg.devDependencies || {}).filter((dep) => dep.startsWith("@types/")),
41
39
  ...Object.keys(pkg.optionalDependencies || {})
42
40
  ];
43
41
  if (pkg.name) {
@@ -141,16 +139,10 @@ function inferExportType(condition, previousConditions = [], filename = "") {
141
139
  return "esm";
142
140
  }
143
141
  const [newCondition] = previousConditions;
144
- return inferExportType(
145
- newCondition || "import",
146
- previousConditions.slice(1),
147
- filename
148
- );
142
+ return inferExportType(newCondition || "import", previousConditions.slice(1), filename);
149
143
  }
150
144
  }
151
145
  }
152
146
  function pathToRegex(path) {
153
- return path.includes("*") ? new RegExp(
154
- `^${path.replace(/\./g, String.raw`\.`).replace(/\*/g, ".*")}$`
155
- ) : path;
147
+ return path.includes("*") ? new RegExp(`^${path.replace(/\./g, String.raw`\.`).replace(/\*/g, ".*")}$`) : path;
156
148
  }
@@ -3,9 +3,7 @@ import { existsSync } from "node:fs";
3
3
  import { arrayIncludes, extractExportFilenames, getpkg, warn } from "./utils.js";
4
4
  export function validateDependencies(ctx) {
5
5
  const usedDependencies = /* @__PURE__ */ new Set();
6
- const unusedDependencies = new Set(
7
- Object.keys(ctx.pkg.dependencies || {})
8
- );
6
+ const unusedDependencies = new Set(Object.keys(ctx.pkg.dependencies || {}));
9
7
  const implicitDependencies = /* @__PURE__ */ new Set();
10
8
  for (const id of ctx.usedImports) {
11
9
  unusedDependencies.delete(id);
@@ -22,16 +20,10 @@ export function validateDependencies(ctx) {
22
20
  }
23
21
  }
24
22
  if (unusedDependencies.size > 0) {
25
- warn(
26
- ctx,
27
- `Potential unused dependencies found: ${[...unusedDependencies].join(", ")}`
28
- );
23
+ warn(ctx, `Potential unused dependencies found: ${[...unusedDependencies].join(", ")}`);
29
24
  }
30
25
  if (implicitDependencies.size > 0 && !ctx.options.rollup.inlineDependencies) {
31
- warn(
32
- ctx,
33
- `Potential implicit dependencies found: ${[...implicitDependencies].join(", ")}`
34
- );
26
+ warn(ctx, `Potential implicit dependencies found: ${[...implicitDependencies].join(", ")}`);
35
27
  }
36
28
  }
37
29
  export function validatePackage(pkg, rootDir, ctx) {
@@ -55,9 +47,6 @@ export function validatePackage(pkg, rootDir, ctx) {
55
47
  }
56
48
  }
57
49
  if (missingOutputs.length > 0) {
58
- warn(
59
- ctx,
60
- `Potential missing package.json files: ${missingOutputs.join(", ")}`
61
- );
50
+ warn(ctx, `Potential missing package.json files: ${missingOutputs.join(", ")}`);
62
51
  }
63
52
  }
@@ -34,15 +34,7 @@ export const DEFAULT_CONFIG = {
34
34
  logsFreshFile: true,
35
35
  // Dependency filtering
36
36
  filterDepsPatterns: {
37
- global: [
38
- "@types",
39
- "biome",
40
- "eslint",
41
- "knip",
42
- "prettier",
43
- "typescript",
44
- "@reliverse/dler"
45
- ],
37
+ global: ["@types", "biome", "eslint", "knip", "prettier", "typescript", "@reliverse/dler"],
46
38
  "dist-npm": [],
47
39
  "dist-jsr": [],
48
40
  "dist-libs": {
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.6";
2
+ const version = "1.7.8";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -18,7 +18,7 @@ export async function ensureDlerConfig(isDev) {
18
18
  } catch {
19
19
  }
20
20
  const configContent = generateConfig(isDev, pkgDescription);
21
- await fs.outputFile(configPath, configContent, "utf-8");
21
+ await fs.outputFile(configPath, configContent, { encoding: "utf8" });
22
22
  relinka("success", `Config was created at ${configPath}`);
23
23
  relinka("log", "Edit this file to customize build and publish settings");
24
24
  if (!isDev) {
@@ -115,26 +115,14 @@ function generateConfig(isDev, pkgDescription) {
115
115
  const importDefineConfigStatement = isDev ? `import { defineConfig } from "../../../../mod.js";` : `import { defineConfig } from "@reliverse/dler";`;
116
116
  const verboseValue = getValue(isDev, true, DEFAULT_CONFIG.commonVerbose);
117
117
  const coreIsCLI = getCoreIsCLI(isDev);
118
- const registryValue = getValue(
119
- isDev,
120
- "npm-jsr",
121
- DEFAULT_CONFIG.commonPubRegistry
122
- );
123
- const pausePublishValue = getValue(
124
- isDev,
125
- false,
126
- DEFAULT_CONFIG.commonPubPause
127
- );
118
+ const registryValue = getValue(isDev, "npm-jsr", DEFAULT_CONFIG.commonPubRegistry);
119
+ const pausePublishValue = getValue(isDev, false, DEFAULT_CONFIG.commonPubPause);
128
120
  const coreDescriptionValue = getValue(
129
121
  isDev,
130
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.",
131
123
  pkgDescription || DEFAULT_CONFIG.coreDescription
132
124
  );
133
- const libsActModeValue = getValue(
134
- isDev,
135
- "main-and-libs",
136
- DEFAULT_CONFIG.libsActMode
137
- );
125
+ const libsActModeValue = getValue(isDev, "main-and-libs", DEFAULT_CONFIG.libsActMode);
138
126
  const libsObject = isDev ? `{
139
127
  "@reliverse/dler-sdk": {
140
128
  libDeclarations: true,
@@ -158,91 +146,102 @@ function generateConfig(isDev, pkgDescription) {
158
146
  // libPubRegistry: "npm-jsr",
159
147
  // },
160
148
  }`;
161
- const configTemplate = `${importDefineConfigStatement}
162
- /**
163
- * Reliverse Bundler Configuration
164
- * Hover over a field to see more details
165
- * @see https://github.com/reliverse/dler
166
- */
167
- export default defineConfig({
168
- // Bump configuration
169
- bumpDisable: ${DEFAULT_CONFIG.bumpDisable},
170
- bumpFilter: ${getBumpFilter(isDev)},
171
- bumpMode: "${DEFAULT_CONFIG.bumpMode}",
172
- // Common configuration
173
- commonPubPause: ${pausePublishValue},
174
- commonPubRegistry: "${registryValue}",
175
- commonVerbose: ${verboseValue},
176
- // Core configuration
177
- coreBuildOutDir: "${DEFAULT_CONFIG.coreBuildOutDir}",
178
- coreDeclarations: ${DEFAULT_CONFIG.coreDeclarations},
179
- coreDescription: ${JSON.stringify(coreDescriptionValue)},
180
- coreEntryFile: "${DEFAULT_CONFIG.coreEntryFile}",
181
- coreEntrySrcDir: "${DEFAULT_CONFIG.coreEntrySrcDir}",
182
- ${coreIsCLI}
183
- // JSR-only config
184
- distJsrAllowDirty: ${DEFAULT_CONFIG.distJsrAllowDirty},
185
- distJsrBuilder: "${DEFAULT_CONFIG.distJsrBuilder}",
186
- distJsrDirName: "${DEFAULT_CONFIG.distJsrDirName}",
187
- distJsrDryRun: ${DEFAULT_CONFIG.distJsrDryRun},
188
- distJsrFailOnWarn: ${DEFAULT_CONFIG.distJsrFailOnWarn},
189
- distJsrGenTsconfig: ${DEFAULT_CONFIG.distJsrGenTsconfig},
190
- distJsrOutFilesExt: "${DEFAULT_CONFIG.distJsrOutFilesExt}",
191
- distJsrSlowTypes: ${DEFAULT_CONFIG.distJsrSlowTypes},
192
- // NPM-only config
193
- distNpmBuilder: "${DEFAULT_CONFIG.distNpmBuilder}",
194
- distNpmDirName: "${DEFAULT_CONFIG.distNpmDirName}",
195
- distNpmOutFilesExt: "${DEFAULT_CONFIG.distNpmOutFilesExt}",
196
- // Libraries Dler Plugin
197
- // Publish specific dirs as separate packages
198
- // This feature is experimental at the moment
199
- // Please commit your changes before using it
200
- libsActMode: "${libsActModeValue}",
201
- libsDirDist: "${DEFAULT_CONFIG.libsDirDist}",
202
- libsDirSrc: "${DEFAULT_CONFIG.libsDirSrc}",
203
- libsList: ${libsObject},
204
- // @reliverse/relinka logger setup
205
- logsFileName: "${DEFAULT_CONFIG.logsFileName}",
206
- logsFreshFile: ${DEFAULT_CONFIG.logsFreshFile},
207
- // Specifies what resources to send to npm and jsr registries.
208
- // coreBuildOutDir (e.g. "bin") dir is automatically included.
209
- // The following is also included if publishArtifacts is {}:
210
- // - global: ["package.json", "README.md", "LICENSE"]
211
- // - dist-jsr,dist-libs/jsr: ["jsr.json"]
212
- publishArtifacts: ${getPublishArtifacts(isDev)},
213
- // Dependency filtering
214
- // Global is always applied
215
- filterDepsPatterns: ${getFilterDepsPatterns(isDev)},
216
- // Build setup
217
- // transpileAlias: {},
218
- // transpileClean: true,
219
- // transpileEntries: [],
220
- transpileEsbuild: "${DEFAULT_CONFIG.transpileEsbuild}",
221
- // transpileExternals: [],
222
- transpileFailOnWarn: ${DEFAULT_CONFIG.transpileFailOnWarn},
223
- transpileFormat: "${DEFAULT_CONFIG.transpileFormat}",
224
- transpileMinify: ${DEFAULT_CONFIG.transpileMinify},
225
- // transpileParallel: false,
226
- transpilePublicPath: "${DEFAULT_CONFIG.transpilePublicPath}",
227
- // transpileReplace: {},
228
- // transpileRollup: {
229
- // alias: {},
230
- // commonjs: {},
231
- // dts: {},
232
- // esbuild: {},
233
- // json: {},
234
- // replace: {},
235
- // resolve: {},
236
- // },
237
- // transpileShowOutLog: false,
238
- transpileSourcemap: "${DEFAULT_CONFIG.transpileSourcemap}",
239
- transpileSplitting: ${DEFAULT_CONFIG.transpileSplitting},
240
- transpileStub: ${DEFAULT_CONFIG.transpileStub},
241
- // transpileStubOptions: { jiti: {} },
242
- transpileTarget: "${DEFAULT_CONFIG.transpileTarget}",
243
- transpileWatch: ${DEFAULT_CONFIG.transpileWatch},
244
- // transpileWatchOptions: undefined,
245
- });
246
- `;
149
+ const configTemplate = [
150
+ importDefineConfigStatement,
151
+ "",
152
+ "/**",
153
+ " * Reliverse Bundler Configuration",
154
+ " * Hover over a field to see more details",
155
+ " * @see https://github.com/reliverse/dler",
156
+ " */",
157
+ "export default defineConfig({",
158
+ " // Bump configuration",
159
+ " bumpDisable: " + DEFAULT_CONFIG.bumpDisable + ",",
160
+ " bumpFilter: " + getBumpFilter(isDev) + ",",
161
+ ' bumpMode: "' + DEFAULT_CONFIG.bumpMode + '",',
162
+ "",
163
+ " // Common configuration",
164
+ " commonPubPause: " + pausePublishValue + ",",
165
+ ' commonPubRegistry: "' + registryValue + '",',
166
+ " commonVerbose: " + verboseValue + ",",
167
+ "",
168
+ " // Core configuration",
169
+ ' coreBuildOutDir: "' + DEFAULT_CONFIG.coreBuildOutDir + '",',
170
+ " coreDeclarations: " + DEFAULT_CONFIG.coreDeclarations + ",",
171
+ " coreDescription: " + JSON.stringify(coreDescriptionValue) + ",",
172
+ ' coreEntryFile: "' + DEFAULT_CONFIG.coreEntryFile + '",',
173
+ ' coreEntrySrcDir: "' + DEFAULT_CONFIG.coreEntrySrcDir + '",',
174
+ " " + coreIsCLI,
175
+ "",
176
+ " // 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 + ",",
185
+ "",
186
+ " // NPM-only config",
187
+ ' distNpmBuilder: "' + DEFAULT_CONFIG.distNpmBuilder + '",',
188
+ ' distNpmDirName: "' + DEFAULT_CONFIG.distNpmDirName + '",',
189
+ ' distNpmOutFilesExt: "' + DEFAULT_CONFIG.distNpmOutFilesExt + '",',
190
+ "",
191
+ " // Libraries Dler Plugin",
192
+ " // Publish specific dirs as separate packages",
193
+ " // This feature is experimental at the moment",
194
+ " // Please commit your changes before using it",
195
+ ' libsActMode: "' + libsActModeValue + '",',
196
+ ' libsDirDist: "' + DEFAULT_CONFIG.libsDirDist + '",',
197
+ ' libsDirSrc: "' + DEFAULT_CONFIG.libsDirSrc + '",',
198
+ " libsList: " + libsObject + ",",
199
+ "",
200
+ " // @reliverse/relinka logger setup",
201
+ ' logsFileName: "' + DEFAULT_CONFIG.logsFileName + '",',
202
+ " logsFreshFile: " + DEFAULT_CONFIG.logsFreshFile + ",",
203
+ "",
204
+ " // Specifies what resources to send to npm and jsr registries.",
205
+ ' // coreBuildOutDir (e.g. "bin") dir is automatically included.',
206
+ " // The following is also included if publishArtifacts is {}:",
207
+ ' // - global: ["package.json", "README.md", "LICENSE"]',
208
+ ' // - dist-jsr,dist-libs/jsr: ["jsr.json"]',
209
+ " publishArtifacts: " + getPublishArtifacts(isDev) + ",",
210
+ "",
211
+ " // Dependency filtering",
212
+ " // Global is always applied",
213
+ " filterDepsPatterns: " + getFilterDepsPatterns(isDev) + ",",
214
+ "",
215
+ " // Build setup",
216
+ " // transpileAlias: {},",
217
+ " // transpileClean: true,",
218
+ " // transpileEntries: [],",
219
+ ' transpileEsbuild: "' + DEFAULT_CONFIG.transpileEsbuild + '",',
220
+ " // transpileExternals: [],",
221
+ " transpileFailOnWarn: " + DEFAULT_CONFIG.transpileFailOnWarn + ",",
222
+ ' transpileFormat: "' + DEFAULT_CONFIG.transpileFormat + '",',
223
+ " transpileMinify: " + DEFAULT_CONFIG.transpileMinify + ",",
224
+ " // transpileParallel: false,",
225
+ ' transpilePublicPath: "' + DEFAULT_CONFIG.transpilePublicPath + '",',
226
+ " // transpileReplace: {},",
227
+ " // transpileRollup: {",
228
+ " // alias: {},",
229
+ " // commonjs: {},",
230
+ " // dts: {},",
231
+ " // esbuild: {},",
232
+ " // json: {},",
233
+ " // replace: {},",
234
+ " // resolve: {},",
235
+ " // },",
236
+ " // transpileShowOutLog: false,",
237
+ ' transpileSourcemap: "' + DEFAULT_CONFIG.transpileSourcemap + '",',
238
+ " transpileSplitting: " + DEFAULT_CONFIG.transpileSplitting + ",",
239
+ " transpileStub: " + DEFAULT_CONFIG.transpileStub + ",",
240
+ " // transpileStubOptions: { jiti: {} },",
241
+ ' transpileTarget: "' + DEFAULT_CONFIG.transpileTarget + '",',
242
+ " transpileWatch: " + DEFAULT_CONFIG.transpileWatch + ",",
243
+ " // transpileWatchOptions: undefined,",
244
+ "});"
245
+ ].join("\n");
247
246
  return configTemplate;
248
247
  }
@@ -28,9 +28,6 @@ export async function loadConfig() {
28
28
  relinka("error", `Error loading config from ${configPath}:`, error);
29
29
  }
30
30
  }
31
- relinka(
32
- "log",
33
- `Config file not found at ${configPath}. Using default configuration.`
34
- );
31
+ relinka("log", `Config file not found at ${configPath}. Using default configuration.`);
35
32
  return defineConfig();
36
33
  }
@@ -6,10 +6,7 @@ import { library_publishLibrary } from "./pub/pub-library.js";
6
6
  import { CONCURRENCY_DEFAULT, PROJECT_ROOT } from "./utils/utils-consts.js";
7
7
  export async function processLibraryFlow(timer, isDev, config) {
8
8
  if (config.libsActMode !== "libs-only" && config.libsActMode !== "main-and-libs") {
9
- relinka(
10
- "verbose",
11
- "Skipping libs build/publish as libsActMode is set to 'main-project-only'"
12
- );
9
+ relinka("verbose", "Skipping libs build/publish as libsActMode is set to 'main-project-only'");
13
10
  return;
14
11
  }
15
12
  await libraries_buildPublish(
@@ -67,9 +64,7 @@ export async function libraries_buildPublish(isDev, timer, libsList, distJsrDryR
67
64
  return async () => {
68
65
  try {
69
66
  if (!libConfig.libMainFile) {
70
- throw new Error(
71
- `Library ${libName} is missing "libMainFile" property.`
72
- );
67
+ throw new Error(`Library ${libName} is missing "libMainFile" property.`);
73
68
  }
74
69
  const folderName = extractFolderName(libName, libConfig);
75
70
  const libBaseDir = path.resolve(PROJECT_ROOT, libsDirDist, folderName);
@@ -136,10 +131,7 @@ export async function libraries_buildPublish(isDev, timer, libsList, distJsrDryR
136
131
  timer
137
132
  );
138
133
  } else if (libConfig.libPubPause && !commonPubPause) {
139
- relinka(
140
- "log",
141
- `Publishing is paused for lib ${libName} (libPubPause: true)`
142
- );
134
+ relinka("log", `Publishing is paused for lib ${libName} (libPubPause: true)`);
143
135
  }
144
136
  } catch (error) {
145
137
  relinka(
@@ -3,10 +3,7 @@ import { execaCommand } from "execa";
3
3
  import pAll from "p-all";
4
4
  import { CONCURRENCY_DEFAULT } from "../utils/utils-consts.js";
5
5
  import { withWorkingDirectory } from "../utils/utils-cwd.js";
6
- import {
7
- pausePerfTimer,
8
- resumePerfTimer
9
- } from "../utils/utils-perf.js";
6
+ import { pausePerfTimer, resumePerfTimer } from "../utils/utils-perf.js";
10
7
  export async function library_publishLibrary(effectivePubRegistry, libName, npmOutDir, jsrOutDir, distJsrDryRun, distJsrFailOnWarn, distJsrAllowDirty, distJsrSlowTypes, isDev, timer) {
11
8
  switch (effectivePubRegistry) {
12
9
  case "jsr":
@@ -24,26 +21,12 @@ export async function library_publishLibrary(effectivePubRegistry, libName, npmO
24
21
  break;
25
22
  case "npm":
26
23
  relinka("log", `Publishing lib ${libName} to NPM only...`);
27
- await library_pubToNpm(
28
- npmOutDir,
29
- distJsrDryRun,
30
- distJsrFailOnWarn,
31
- libName,
32
- isDev,
33
- timer
34
- );
24
+ await library_pubToNpm(npmOutDir, distJsrDryRun, distJsrFailOnWarn, libName, isDev, timer);
35
25
  break;
36
26
  case "npm-jsr": {
37
27
  relinka("log", `Publishing lib ${libName} to both NPM and JSR...`);
38
28
  const publishTasks = [
39
- () => library_pubToNpm(
40
- npmOutDir,
41
- distJsrDryRun,
42
- distJsrFailOnWarn,
43
- libName,
44
- isDev,
45
- timer
46
- ),
29
+ () => library_pubToNpm(npmOutDir, distJsrDryRun, distJsrFailOnWarn, libName, isDev, timer),
47
30
  () => library_pubToJsr(
48
31
  jsrOutDir,
49
32
  distJsrDryRun,
@@ -65,7 +48,7 @@ export async function library_publishLibrary(effectivePubRegistry, libName, npmO
65
48
  );
66
49
  }
67
50
  }
68
- async function library_pubToJsr(libOutDir, distJsrDryRun, distJsrFailOnWarn, distJsrAllowDirty, distJsrSlowTypes, libName, isDev, timer) {
51
+ async function library_pubToJsr(libOutDir, distJsrDryRun, distJsrFailOnWarn, distJsrAllowDirty, distJsrSlowTypes, libName, _isDev, timer) {
69
52
  relinka("verbose", `Starting library_pubToJsr for lib: ${libName}`);
70
53
  try {
71
54
  if (timer) pausePerfTimer(timer);
@@ -98,7 +81,7 @@ async function library_pubToJsr(libOutDir, distJsrDryRun, distJsrFailOnWarn, dis
98
81
  relinka("verbose", `Exiting library_pubToJsr for lib: ${libName}`);
99
82
  }
100
83
  }
101
- async function library_pubToNpm(libOutDir, distJsrDryRun, distJsrFailOnWarn, libName, isDev, timer) {
84
+ async function library_pubToNpm(libOutDir, distJsrDryRun, _distJsrFailOnWarn, libName, _isDev, timer) {
102
85
  relinka("verbose", `Starting library_pubToNpm for lib: ${libName}`);
103
86
  try {
104
87
  if (timer) pausePerfTimer(timer);
@@ -2,8 +2,8 @@ import type { PerfTimer } from "../../sdk-types.js";
2
2
  /**
3
3
  * Publishes the JSR distribution.
4
4
  */
5
- export declare function regular_pubToJsr(distJsrDryRun: boolean, distJsrFailOnWarn: boolean, isDev: boolean, commonPubPause: boolean, distJsrDirName: string, distJsrAllowDirty: boolean, distJsrSlowTypes: boolean, timer: PerfTimer): Promise<void>;
5
+ export declare function regular_pubToJsr(distJsrDryRun: boolean, distJsrFailOnWarn: boolean, _isDev: boolean, commonPubPause: boolean, distJsrDirName: string, distJsrAllowDirty: boolean, distJsrSlowTypes: boolean, timer: PerfTimer): Promise<void>;
6
6
  /**
7
7
  * Publishes the NPM distribution.
8
8
  */
9
- export declare function regular_pubToNpm(distJsrDryRun: boolean, isDev: boolean, commonPubPause: boolean, distNpmDirName: string, timer: PerfTimer): Promise<void>;
9
+ export declare function regular_pubToNpm(distJsrDryRun: boolean, _isDev: boolean, commonPubPause: boolean, distNpmDirName: string, timer: PerfTimer): Promise<void>;
@@ -3,11 +3,8 @@ import { relinka } from "@reliverse/relinka";
3
3
  import { execaCommand } from "execa";
4
4
  import { PROJECT_ROOT } from "../utils/utils-consts.js";
5
5
  import { withWorkingDirectory } from "../utils/utils-cwd.js";
6
- import {
7
- pausePerfTimer,
8
- resumePerfTimer
9
- } from "../utils/utils-perf.js";
10
- export async function regular_pubToJsr(distJsrDryRun, distJsrFailOnWarn, isDev, commonPubPause, distJsrDirName, distJsrAllowDirty, distJsrSlowTypes, timer) {
6
+ import { pausePerfTimer, resumePerfTimer } from "../utils/utils-perf.js";
7
+ export async function regular_pubToJsr(distJsrDryRun, distJsrFailOnWarn, _isDev, commonPubPause, distJsrDirName, distJsrAllowDirty, distJsrSlowTypes, timer) {
11
8
  try {
12
9
  if (!commonPubPause) {
13
10
  relinka("log", "Publishing to JSR...");
@@ -41,7 +38,7 @@ export async function regular_pubToJsr(distJsrDryRun, distJsrFailOnWarn, isDev,
41
38
  throw error;
42
39
  }
43
40
  }
44
- export async function regular_pubToNpm(distJsrDryRun, isDev, commonPubPause, distNpmDirName, timer) {
41
+ export async function regular_pubToNpm(distJsrDryRun, _isDev, commonPubPause, distNpmDirName, timer) {
45
42
  try {
46
43
  if (!commonPubPause) {
47
44
  relinka("log", "Publishing to NPM...");
@@ -1,25 +1,16 @@
1
1
  import { relinka } from "@reliverse/relinka";
2
2
  import pAll from "p-all";
3
- import {
4
- regular_buildJsrDist,
5
- regular_buildNpmDist
6
- } from "./build/build-regular.js";
3
+ import { regular_buildJsrDist, regular_buildNpmDist } from "./build/build-regular.js";
7
4
  import { regular_pubToJsr, regular_pubToNpm } from "./pub/pub-regular.js";
8
5
  import { CONCURRENCY_DEFAULT } from "./utils/utils-consts.js";
9
6
  export async function processRegularFlow(timer, isDev, config) {
10
7
  if (config.libsActMode === "libs-only") {
11
- relinka(
12
- "log",
13
- "Skipping main project build/publish as libsActMode is set to 'libs-only'"
14
- );
8
+ relinka("log", "Skipping main project build/publish as libsActMode is set to 'libs-only'");
15
9
  return;
16
10
  }
17
11
  switch (config.commonPubRegistry) {
18
12
  case "jsr":
19
- relinka(
20
- "log",
21
- "Initializing build process for main project to JSR only..."
22
- );
13
+ relinka("log", "Initializing build process for main project to JSR only...");
23
14
  await regular_buildJsrDist(
24
15
  isDev,
25
16
  true,
@@ -54,19 +45,16 @@ export async function processRegularFlow(timer, isDev, config) {
54
45
  );
55
46
  break;
56
47
  case "npm":
57
- relinka(
58
- "log",
59
- "Initializing build process for main project to NPM only..."
60
- );
48
+ relinka("log", "Initializing build process for main project to NPM only...");
61
49
  await regular_buildNpmDist(
62
50
  isDev,
51
+ config.coreIsCLI,
63
52
  config.coreEntrySrcDir,
64
53
  config.distNpmDirName,
65
54
  config.distNpmBuilder,
66
55
  config.coreEntryFile,
67
56
  config.distNpmOutFilesExt,
68
57
  config,
69
- config.coreIsCLI,
70
58
  config.transpileTarget,
71
59
  config.transpileFormat,
72
60
  config.transpileSplitting,
@@ -87,10 +75,7 @@ export async function processRegularFlow(timer, isDev, config) {
87
75
  );
88
76
  break;
89
77
  case "npm-jsr": {
90
- relinka(
91
- "log",
92
- "Initializing build process for main project to both NPM and JSR..."
93
- );
78
+ relinka("log", "Initializing build process for main project to both NPM and JSR...");
94
79
  const buildTasks = [
95
80
  () => regular_buildJsrDist(
96
81
  isDev,
@@ -116,13 +101,13 @@ export async function processRegularFlow(timer, isDev, config) {
116
101
  ),
117
102
  () => regular_buildNpmDist(
118
103
  isDev,
104
+ config.coreIsCLI,
119
105
  config.coreEntrySrcDir,
120
106
  config.distNpmDirName,
121
107
  config.distNpmBuilder,
122
108
  config.coreEntryFile,
123
109
  config.distNpmOutFilesExt,
124
110
  config,
125
- config.coreIsCLI,
126
111
  config.transpileTarget,
127
112
  config.transpileFormat,
128
113
  config.transpileSplitting,
@@ -159,10 +144,7 @@ export async function processRegularFlow(timer, isDev, config) {
159
144
  break;
160
145
  }
161
146
  default:
162
- relinka(
163
- "error",
164
- `Invalid commonPubRegistry: ${config.commonPubRegistry}`
165
- );
147
+ relinka("error", `Invalid commonPubRegistry: ${config.commonPubRegistry}`);
166
148
  throw new Error(`Invalid commonPubRegistry: ${config.commonPubRegistry}`);
167
149
  }
168
150
  }
@@ -17,11 +17,7 @@ export async function checkFileExtensions(options) {
17
17
  const startTime = Date.now();
18
18
  const issues = [];
19
19
  const { directory, strict, moduleResolution, onProgress } = options;
20
- const allowedExts = getAllowedFileExtensions(
21
- directory,
22
- strict,
23
- moduleResolution
24
- );
20
+ const allowedExts = getAllowedFileExtensions(directory, strict, moduleResolution);
25
21
  try {
26
22
  const files = await getAllFiles(directory, onProgress);
27
23
  const batchSize = 50;
@@ -1,16 +1,9 @@
1
1
  import { readFile, findSourceFiles, readPackageJson } from "./filesystem.js";
2
- import {
3
- extractPackageNames,
4
- getListedDependencies,
5
- getBuiltinModules
6
- } from "./parser.js";
2
+ import { extractPackageNames, getListedDependencies, getBuiltinModules } from "./parser.js";
7
3
  export const analyzeDependencies = async (options) => {
8
4
  const packageJson = await readPackageJson(options.directory);
9
5
  const listedDependencies = getListedDependencies(packageJson);
10
- const sourceFiles = await findSourceFiles(
11
- options.directory,
12
- options.ignorePatterns
13
- );
6
+ const sourceFiles = await findSourceFiles(options.directory, options.ignorePatterns);
14
7
  const builtinModules = getBuiltinModules();
15
8
  const allDependencies = /* @__PURE__ */ new Set();
16
9
  const devOnlyDependencies = /* @__PURE__ */ new Set();