@reliverse/dler 1.7.5 → 1.7.7

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.
@@ -1,5 +1,5 @@
1
1
  import { endPrompt, startPrompt } from "@reliverse/rempts";
2
- const version = "1.7.5";
2
+ const version = "1.7.7";
3
3
  export async function showStartPrompt(isDev) {
4
4
  await startPrompt({
5
5
  titleColor: "inverse",
@@ -37,14 +37,80 @@ export async function ensureDlerConfig(isDev) {
37
37
  }
38
38
  }
39
39
  function getCoreIsCLI(isDev) {
40
- return isDev ? `coreIsCLI: {
41
- enabled: true,
42
- scripts: { dler: "dler.ts" },
43
- },` : `// coreIsCLI: {
40
+ return isDev ? `coreIsCLI: { enabled: true, scripts: { dler: "cli.ts" } },` : `// coreIsCLI: {
44
41
  // enabled: false,
45
42
  // scripts: { mycli: "mycli.ts" },
46
43
  // },`;
47
44
  }
45
+ function getValue(isDev, devValue, prodValue) {
46
+ return isDev ? devValue : prodValue;
47
+ }
48
+ function getBumpFilter(isDev) {
49
+ return isDev ? `[
50
+ "package.json",
51
+ ".config/rse.ts",
52
+ "src/libs/sdk/sdk-impl/cfg/info.ts",
53
+ ]` : `["package.json", ".config/rse.ts"]`;
54
+ }
55
+ function getPublishArtifacts(isDev) {
56
+ return isDev ? `{
57
+ global: ["package.json", "README.md", "LICENSE", "LICENSES"],
58
+ "dist-jsr": [],
59
+ "dist-npm": [],
60
+ "dist-libs": {
61
+ "@reliverse/dler-sdk": {
62
+ jsr: [],
63
+ npm: [],
64
+ },
65
+ },
66
+ }` : `{
67
+ global: ["package.json", "README.md", "LICENSE"],
68
+ "dist-jsr": [],
69
+ "dist-npm": [],
70
+ "dist-libs": {},
71
+ }`;
72
+ }
73
+ function getFilterDepsPatterns(isDev) {
74
+ return isDev ? `{
75
+ global: [
76
+ "bun",
77
+ "@types",
78
+ "biome",
79
+ "eslint",
80
+ "knip",
81
+ "prettier",
82
+ "typescript",
83
+ "@reliverse/rse",
84
+ "@reliverse/dler",
85
+ "!@reliverse/rse-sdk",
86
+ "!@reliverse/dler-sdk",
87
+ ],
88
+ "dist-npm": [],
89
+ "dist-jsr": [],
90
+ "dist-libs": {
91
+ "@reliverse/dler-sdk": {
92
+ jsr: ["!bun"],
93
+ npm: [],
94
+ },
95
+ },
96
+ }` : `{
97
+ global: [
98
+ "@types",
99
+ "biome",
100
+ "eslint",
101
+ "knip",
102
+ "prettier",
103
+ "typescript",
104
+ "@reliverse/rse",
105
+ "@reliverse/dler",
106
+ "!@reliverse/rse-sdk",
107
+ "!@reliverse/dler-sdk",
108
+ ],
109
+ "dist-npm": [],
110
+ "dist-jsr": [],
111
+ "dist-libs": {},
112
+ }`;
113
+ }
48
114
  function generateConfig(isDev, pkgDescription) {
49
115
  const importDefineConfigStatement = isDev ? `import { defineConfig } from "../../../../mod.js";` : `import { defineConfig } from "@reliverse/dler";`;
50
116
  const verboseValue = getValue(isDev, true, DEFAULT_CONFIG.commonVerbose);
@@ -61,7 +127,6 @@ function generateConfig(isDev, pkgDescription) {
61
127
  );
62
128
  const coreDescriptionValue = getValue(
63
129
  isDev,
64
- // TODO: remove `description` from dler's `package.json` when ensured that whole dler's codebase can optionally read dler.ts' `coreDescription`
65
130
  "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.",
66
131
  pkgDescription || DEFAULT_CONFIG.coreDescription
67
132
  );
@@ -75,127 +140,120 @@ function generateConfig(isDev, pkgDescription) {
75
140
  libDeclarations: true,
76
141
  libDescription: "@reliverse/dler without cli",
77
142
  libDirName: "sdk",
78
- libMainFile: "sdk-mod.ts",
143
+ libMainFile: "sdk/sdk-mod.ts",
79
144
  libPkgKeepDeps: true,
80
145
  libTranspileMinify: true,
81
146
  libPubPause: false,
147
+ libPubRegistry: "npm-jsr",
82
148
  },
83
149
  }` : `{
84
150
  // "@acme/cli-libName": {
85
151
  // libDeclarations: true,
86
152
  // libDescription: "@acme/cli defineConfig",
87
153
  // libDirName: "libName",
88
- // libMainFile: "libName-mod.ts",
154
+ // libMainFile: "libName/libName-mod.ts",
89
155
  // libPkgKeepDeps: true,
90
156
  // libTranspileMinify: true,
91
157
  // libPubPause: false,
158
+ // libPubRegistry: "npm-jsr",
92
159
  // },
93
160
  }`;
94
- const configTemplate = `${importDefineConfigStatement}
95
- /**
96
- * Reliverse Bundler Configuration
97
- * Hover over a field to see more details
98
- * @see https://github.com/reliverse/dler
99
- */
100
- export default defineConfig({
101
- // Bump configuration
102
- bumpDisable: ${DEFAULT_CONFIG.bumpDisable},
103
- bumpFilter: ${JSON.stringify(DEFAULT_CONFIG.bumpFilter)},
104
- bumpMode: "${DEFAULT_CONFIG.bumpMode}",
105
- // Common configuration
106
- commonPubPause: ${pausePublishValue},
107
- commonPubRegistry: "${registryValue}",
108
- commonVerbose: ${verboseValue},
109
- // Core configuration
110
- coreDeclarations: ${DEFAULT_CONFIG.coreDeclarations},
111
- coreDescription: ${JSON.stringify(coreDescriptionValue)},
112
- coreEntryFile: "${DEFAULT_CONFIG.coreEntryFile}",
113
- coreEntrySrcDir: "${DEFAULT_CONFIG.coreEntrySrcDir}",
114
- coreBuildOutDir: "${DEFAULT_CONFIG.coreBuildOutDir}",
115
- ${coreIsCLI}
116
- // JSR-only config
117
- distJsrAllowDirty: ${DEFAULT_CONFIG.distJsrAllowDirty},
118
- distJsrBuilder: "${DEFAULT_CONFIG.distJsrBuilder}",
119
- distJsrDirName: "${DEFAULT_CONFIG.distJsrDirName}",
120
- distJsrDryRun: ${DEFAULT_CONFIG.distJsrDryRun},
121
- distJsrFailOnWarn: ${DEFAULT_CONFIG.distJsrFailOnWarn},
122
- distJsrGenTsconfig: ${DEFAULT_CONFIG.distJsrGenTsconfig},
123
- distJsrOutFilesExt: "${DEFAULT_CONFIG.distJsrOutFilesExt}",
124
- distJsrSlowTypes: ${DEFAULT_CONFIG.distJsrSlowTypes},
125
- // NPM-only config
126
- distNpmBuilder: "${DEFAULT_CONFIG.distNpmBuilder}",
127
- distNpmDirName: "${DEFAULT_CONFIG.distNpmDirName}",
128
- distNpmOutFilesExt: "${DEFAULT_CONFIG.distNpmOutFilesExt}",
129
- // Libraries Dler Plugin
130
- // Publish specific dirs as separate packages
131
- // This feature is experimental at the moment
132
- // Please commit your changes before using it
133
- libsActMode: "${libsActModeValue}",
134
- libsDirDist: "${DEFAULT_CONFIG.libsDirDist}",
135
- libsDirSrc: "${DEFAULT_CONFIG.libsDirSrc}",
136
- libsList: ${libsObject},
137
- // @reliverse/relinka logger setup
138
- logsFileName: "${DEFAULT_CONFIG.logsFileName}",
139
- logsFreshFile: ${DEFAULT_CONFIG.logsFreshFile},
140
- // Dependency filtering
141
- // Global is always applied
142
- filterDepsPatterns: {
143
- global: [
144
- "@types",
145
- "biome",
146
- "eslint",
147
- "knip",
148
- "prettier",
149
- "typescript",
150
- "@reliverse/rse",
151
- "@reliverse/dler",
152
- "!@reliverse/rse-sdk",
153
- "!@reliverse/dler-sdk",
154
- ],
155
- "dist-npm": [],
156
- "dist-jsr": [],
157
- "dist-libs": {
158
- "@reliverse/dler-sdk": {
159
- npm: [],
160
- jsr: [],
161
- },
162
- },
163
- },
164
- // Build setup
165
- transpileFailOnWarn: ${DEFAULT_CONFIG.transpileFailOnWarn},
166
- transpileEsbuild: "${DEFAULT_CONFIG.transpileEsbuild}",
167
- transpileFormat: "${DEFAULT_CONFIG.transpileFormat}",
168
- transpileMinify: ${DEFAULT_CONFIG.transpileMinify},
169
- transpilePublicPath: "${DEFAULT_CONFIG.transpilePublicPath}",
170
- transpileSourcemap: "${DEFAULT_CONFIG.transpileSourcemap}",
171
- transpileSplitting: ${DEFAULT_CONFIG.transpileSplitting},
172
- transpileStub: ${DEFAULT_CONFIG.transpileStub},
173
- transpileTarget: "${DEFAULT_CONFIG.transpileTarget}",
174
- transpileWatch: ${DEFAULT_CONFIG.transpileWatch},
175
- transpileAlias: {},
176
- transpileEntries: [],
177
- transpileExternals: [],
178
- transpileClean: true,
179
- transpileParallel: false,
180
- transpileReplace: {},
181
- transpileRollup: {
182
- alias: {},
183
- commonjs: {},
184
- dts: {},
185
- esbuild: {},
186
- json: {},
187
- replace: {},
188
- resolve: {},
189
- },
190
- transpileShowOutLog: false,
191
- transpileStubOptions: {
192
- jiti: {},
193
- },
194
- transpileWatchOptions: undefined,
195
- });
196
- `;
161
+ const configTemplate = [
162
+ importDefineConfigStatement,
163
+ "",
164
+ "/**",
165
+ " * Reliverse Bundler Configuration",
166
+ " * Hover over a field to see more details",
167
+ " * @see https://github.com/reliverse/dler",
168
+ " */",
169
+ "export default defineConfig({",
170
+ " // Bump configuration",
171
+ " bumpDisable: " + DEFAULT_CONFIG.bumpDisable + ",",
172
+ " bumpFilter: " + getBumpFilter(isDev) + ",",
173
+ ' bumpMode: "' + DEFAULT_CONFIG.bumpMode + '",',
174
+ "",
175
+ " // Common configuration",
176
+ " commonPubPause: " + pausePublishValue + ",",
177
+ ' commonPubRegistry: "' + registryValue + '",',
178
+ " commonVerbose: " + verboseValue + ",",
179
+ "",
180
+ " // Core configuration",
181
+ ' coreBuildOutDir: "' + DEFAULT_CONFIG.coreBuildOutDir + '",',
182
+ " coreDeclarations: " + DEFAULT_CONFIG.coreDeclarations + ",",
183
+ " coreDescription: " + JSON.stringify(coreDescriptionValue) + ",",
184
+ ' coreEntryFile: "' + DEFAULT_CONFIG.coreEntryFile + '",',
185
+ ' coreEntrySrcDir: "' + DEFAULT_CONFIG.coreEntrySrcDir + '",',
186
+ " " + coreIsCLI,
187
+ "",
188
+ " // JSR-only config",
189
+ " distJsrAllowDirty: " + DEFAULT_CONFIG.distJsrAllowDirty + ",",
190
+ ' distJsrBuilder: "' + DEFAULT_CONFIG.distJsrBuilder + '",',
191
+ ' distJsrDirName: "' + DEFAULT_CONFIG.distJsrDirName + '",',
192
+ " distJsrDryRun: " + DEFAULT_CONFIG.distJsrDryRun + ",",
193
+ " distJsrFailOnWarn: " + DEFAULT_CONFIG.distJsrFailOnWarn + ",",
194
+ " distJsrGenTsconfig: " + DEFAULT_CONFIG.distJsrGenTsconfig + ",",
195
+ ' distJsrOutFilesExt: "' + DEFAULT_CONFIG.distJsrOutFilesExt + '",',
196
+ " distJsrSlowTypes: " + DEFAULT_CONFIG.distJsrSlowTypes + ",",
197
+ "",
198
+ " // NPM-only config",
199
+ ' distNpmBuilder: "' + DEFAULT_CONFIG.distNpmBuilder + '",',
200
+ ' distNpmDirName: "' + DEFAULT_CONFIG.distNpmDirName + '",',
201
+ ' distNpmOutFilesExt: "' + DEFAULT_CONFIG.distNpmOutFilesExt + '",',
202
+ "",
203
+ " // Libraries Dler Plugin",
204
+ " // Publish specific dirs as separate packages",
205
+ " // This feature is experimental at the moment",
206
+ " // Please commit your changes before using it",
207
+ ' libsActMode: "' + libsActModeValue + '",',
208
+ ' libsDirDist: "' + DEFAULT_CONFIG.libsDirDist + '",',
209
+ ' libsDirSrc: "' + DEFAULT_CONFIG.libsDirSrc + '",',
210
+ " libsList: " + libsObject + ",",
211
+ "",
212
+ " // @reliverse/relinka logger setup",
213
+ ' logsFileName: "' + DEFAULT_CONFIG.logsFileName + '",',
214
+ " logsFreshFile: " + DEFAULT_CONFIG.logsFreshFile + ",",
215
+ "",
216
+ " // Specifies what resources to send to npm and jsr registries.",
217
+ ' // coreBuildOutDir (e.g. "bin") dir is automatically included.',
218
+ " // The following is also included if publishArtifacts is {}:",
219
+ ' // - global: ["package.json", "README.md", "LICENSE"]',
220
+ ' // - dist-jsr,dist-libs/jsr: ["jsr.json"]',
221
+ " publishArtifacts: " + getPublishArtifacts(isDev) + ",",
222
+ "",
223
+ " // Dependency filtering",
224
+ " // Global is always applied",
225
+ " filterDepsPatterns: " + getFilterDepsPatterns(isDev) + ",",
226
+ "",
227
+ " // Build setup",
228
+ " // transpileAlias: {},",
229
+ " // transpileClean: true,",
230
+ " // transpileEntries: [],",
231
+ ' transpileEsbuild: "' + DEFAULT_CONFIG.transpileEsbuild + '",',
232
+ " // transpileExternals: [],",
233
+ " transpileFailOnWarn: " + DEFAULT_CONFIG.transpileFailOnWarn + ",",
234
+ ' transpileFormat: "' + DEFAULT_CONFIG.transpileFormat + '",',
235
+ " transpileMinify: " + DEFAULT_CONFIG.transpileMinify + ",",
236
+ " // transpileParallel: false,",
237
+ ' transpilePublicPath: "' + DEFAULT_CONFIG.transpilePublicPath + '",',
238
+ " // transpileReplace: {},",
239
+ " // transpileRollup: {",
240
+ " // alias: {},",
241
+ " // commonjs: {},",
242
+ " // dts: {},",
243
+ " // esbuild: {},",
244
+ " // json: {},",
245
+ " // replace: {},",
246
+ " // resolve: {},",
247
+ " // },",
248
+ " // transpileShowOutLog: false,",
249
+ ' transpileSourcemap: "' + DEFAULT_CONFIG.transpileSourcemap + '",',
250
+ " transpileSplitting: " + DEFAULT_CONFIG.transpileSplitting + ",",
251
+ " transpileStub: " + DEFAULT_CONFIG.transpileStub + ",",
252
+ " // transpileStubOptions: { jiti: {} },",
253
+ ' transpileTarget: "' + DEFAULT_CONFIG.transpileTarget + '",',
254
+ " transpileWatch: " + DEFAULT_CONFIG.transpileWatch + ",",
255
+ " // transpileWatchOptions: undefined,",
256
+ "});"
257
+ ].join("\n");
197
258
  return configTemplate;
198
259
  }
199
- function getValue(isDev, devValue, prodValue) {
200
- return isDev ? devValue : prodValue;
201
- }
package/package.json CHANGED
@@ -34,12 +34,12 @@
34
34
  "ts-morph": "^26.0.0",
35
35
  "untyped": "^2.0.0"
36
36
  },
37
- "description": "@reliverse/dler is a flexible, unified, and fully automated bundler for typescript and javascript projects, as well as an npm and jsr publishing tool. dler is not only a bundler, it also tries to serve as the most powerful codemod toolkit for js/ts.",
37
+ "description": "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.",
38
38
  "homepage": "https://docs.reliverse.org",
39
39
  "license": "MIT",
40
40
  "name": "@reliverse/dler",
41
41
  "type": "module",
42
- "version": "1.7.5",
42
+ "version": "1.7.7",
43
43
  "keywords": [
44
44
  "reliverse",
45
45
  "cli",