@reliverse/dler 1.7.132 → 1.7.134

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
  export declare const PROJECT_ROOT: string;
2
- export declare const cliVersion = "1.7.132";
2
+ export declare const cliVersion = "1.7.134";
3
3
  export declare const cliName = "@reliverse/rse";
4
4
  export declare const rseName = "@reliverse/rse";
5
5
  export declare const dlerName = "@reliverse/dler";
@@ -1,7 +1,7 @@
1
1
  import os from "node:os";
2
2
  import path from "@reliverse/pathkit";
3
3
  export const PROJECT_ROOT = path.resolve(process.cwd());
4
- const version = "1.7.132";
4
+ const version = "1.7.134";
5
5
  export const cliVersion = version;
6
6
  export const cliName = "@reliverse/rse";
7
7
  export const rseName = "@reliverse/rse";
@@ -1,8 +1,14 @@
1
- interface ConfigModOptions {
2
- tool: string;
3
- mode: string;
4
- forceUpdate?: boolean;
5
- isDev?: boolean;
6
- }
7
- export declare function ensureConfigMod(options: ConfigModOptions): Promise<void>;
8
- export {};
1
+ import type { ReliverseConfig } from "../schema/mod.js";
2
+ /**
3
+ * Retrieves or creates the main rseg (and any 'mrse' configs).
4
+ * Allows an optional custom path to the TS config file.
5
+ */
6
+ export declare function getOrCreateReliverseConfig({ projectPath, isDev, overrides, customTsconfigPath, }: {
7
+ projectPath: string;
8
+ isDev: boolean;
9
+ overrides: Partial<ReliverseConfig>;
10
+ customTsconfigPath?: string;
11
+ }): Promise<{
12
+ config: ReliverseConfig;
13
+ mrse: ReliverseConfig[];
14
+ }>;
@@ -1,231 +1,79 @@
1
1
  import path from "@reliverse/pathkit";
2
2
  import fs from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
- import { createJiti } from "jiti";
5
- import ky from "ky";
6
- import MagicString from "magic-string";
7
- import { readPackageJSON } from "pkg-types";
8
- export async function ensureConfigMod(options) {
9
- console.log("ensureConfigMod", options);
10
- const { tool, mode, forceUpdate = false, isDev = false } = options;
11
- const configModPath = path.resolve(process.cwd(), "mod.ts");
12
- const pkg = await readPackageJSON().catch(() => ({ version: "1.0.0" }));
13
- let dotConfig = {};
14
- if (await fs.pathExists(configModPath) && !forceUpdate) {
15
- try {
16
- const jiti = createJiti(import.meta.url);
17
- const existingConfig2 = await jiti.import(configModPath);
18
- if (existingConfig2?.dotConfig && typeof existingConfig2.dotConfig === "object") {
19
- dotConfig = existingConfig2.dotConfig;
20
- }
21
- } catch (error) {
22
- relinka(
23
- "warn",
24
- `Could not import existing mod.ts: ${error instanceof Error ? error.message : String(error)}`
25
- );
26
- try {
27
- const content = await fs.readFile(configModPath, "utf8");
28
- dotConfig = parseConfigManually(content);
29
- } catch (parseError) {
30
- relinka("warn", `Manual parsing also failed, starting with empty config`);
31
- }
32
- }
33
- }
34
- const pkgVersion = pkg.version ?? "1.0.0";
35
- const toolConfig = {
36
- version: pkgVersion,
37
- mode,
38
- main: "defineConfig",
39
- input: getInputSource(tool, mode, isDev),
40
- output: `types/${tool}.schema.ts`
41
- };
42
- const existingConfig = dotConfig[tool];
43
- const shouldDownloadSchema = await shouldUpdateSchema(existingConfig, toolConfig);
44
- dotConfig[tool] = toolConfig;
45
- const modContent = generateConfigModContent(dotConfig);
46
- await fs.outputFile(configModPath, modContent, { encoding: "utf8" });
47
- if (shouldDownloadSchema) {
48
- await processSchema(toolConfig.input, toolConfig.output, mode);
49
- const action = mode === "copy-internal" ? "Copied" : "Downloaded";
50
- relinka("info", `${action} fresh types for ${tool} v${pkgVersion}`);
51
- } else {
52
- relinka("info", `Types for ${tool} v${pkgVersion} are up to date, skipping download`);
53
- }
54
- await updateToolConfigImports(tool, toolConfig.main);
55
- relinka("success", `Updated mod.ts with ${tool} configuration`);
56
- }
57
- async function shouldUpdateSchema(existingConfig, newConfig) {
58
- if (!existingConfig) {
59
- return true;
60
- }
61
- if (existingConfig.version !== newConfig.version) {
62
- relinka("info", `Version changed from ${existingConfig.version} to ${newConfig.version}`);
63
- return true;
64
- }
65
- if (existingConfig.input !== newConfig.input) {
66
- relinka("info", `Schema input URL changed`);
67
- return true;
68
- }
69
- const outputPath = path.resolve(process.cwd(), newConfig.output);
70
- if (!await fs.pathExists(outputPath)) {
71
- relinka("info", `Schema file ${newConfig.output} does not exist`);
72
- return true;
73
- }
74
- if (existingConfig.mode !== newConfig.mode || existingConfig.main !== newConfig.main) {
75
- relinka("info", `Configuration mode or main export changed`);
76
- return true;
77
- }
78
- return false;
79
- }
80
- function getInputSource(tool, mode, isDev) {
81
- if (mode === "copy-internal") {
82
- const sourceDir = isDev ? "src" : "bin";
83
- return `${sourceDir}/libs/cfg/cfg-dler.ts`;
84
- } else {
85
- return getSchemaUrl(tool);
86
- }
87
- }
88
- async function processSchema(input, outputPath, mode) {
89
- if (mode === "copy-internal") {
90
- await copyInternalSchema(input, outputPath);
91
- } else {
92
- await downloadSchema(input, outputPath);
93
- }
94
- }
95
- async function copyInternalSchema(inputPath, outputPath) {
96
- try {
97
- const fullInputPath = path.resolve(process.cwd(), inputPath);
98
- const fullOutputPath = path.resolve(process.cwd(), outputPath);
99
- if (!await fs.pathExists(fullInputPath)) {
100
- throw new Error(`Internal schema file not found: ${inputPath}`);
101
- }
102
- const content = await fs.readFile(fullInputPath, "utf8");
103
- await fs.outputFile(fullOutputPath, content, { encoding: "utf8" });
104
- relinka("success", `Copied internal schema from ${inputPath} to ${outputPath}`);
105
- } catch (error) {
106
- relinka(
107
- "error",
108
- `Failed to copy internal schema: ${error instanceof Error ? error.message : String(error)}`
109
- );
110
- throw error;
111
- }
112
- }
113
- function parseConfigManually(content) {
114
- try {
115
- const exportMatch = content.match(/export const dotConfig[^=]*=\s*({[\s\S]*?});/);
116
- if (!exportMatch?.[1]) {
117
- return {};
118
- }
119
- const objStr = exportMatch[1].replace(/(\w+):/g, '"$1":').replace(/'/g, '"').replace(/,(\s*[}\]])/g, "$1");
120
- return JSON.parse(objStr);
121
- } catch (error) {
122
- relinka(
123
- "warn",
124
- `Failed to manually parse config: ${error instanceof Error ? error.message : String(error)}`
4
+ import {
5
+ cliConfigJsonc,
6
+ cliConfigTs,
7
+ RSE_SCHEMA_DEV,
8
+ UNKNOWN_VALUE
9
+ } from "./constants.js";
10
+ import { createReliverseConfig } from "./create.js";
11
+ import { getReliverseConfigPath } from "./path.js";
12
+ import { readReliverseConfig } from "./read.js";
13
+ import { parseAndFixReliverseConfig } from "./repair.js";
14
+ import { DEFAULT_CONFIG_RELIVERSE } from "../schema/mod.js";
15
+ export async function getOrCreateReliverseConfig({
16
+ projectPath,
17
+ isDev,
18
+ overrides,
19
+ customTsconfigPath
20
+ }) {
21
+ const githubUsername = UNKNOWN_VALUE;
22
+ const mrseFolderPath = path.join(projectPath, "mrse");
23
+ const results = [];
24
+ if (await fs.pathExists(mrseFolderPath)) {
25
+ const dirItems = await fs.readdir(mrseFolderPath);
26
+ const rseFiles = dirItems.filter((item) => item === cliConfigJsonc || item === cliConfigTs);
27
+ const configs = await Promise.all(
28
+ rseFiles.map(async (file) => {
29
+ const filePath = path.join(mrseFolderPath, file);
30
+ let foundConfig = await readReliverseConfig(filePath, isDev);
31
+ if (!foundConfig) {
32
+ foundConfig = await parseAndFixReliverseConfig(filePath, isDev);
33
+ }
34
+ if (!foundConfig) {
35
+ relinka("warn", `Skipping invalid config file: ${filePath}`);
36
+ }
37
+ return foundConfig;
38
+ })
125
39
  );
126
- return {};
127
- }
128
- }
129
- function getSchemaUrl(tool) {
130
- const schemaUrls = {
131
- dler: "https://raw.githubusercontent.com/blefnk/temp/refs/heads/main/dler-types.ts",
132
- rse: "https://raw.githubusercontent.com/blefnk/temp/refs/heads/main/rse-types.ts"
133
- };
134
- return schemaUrls[tool] || schemaUrls.dler;
135
- }
136
- async function downloadSchema(inputUrl, outputPath) {
137
- try {
138
- const response = await ky.get(inputUrl);
139
- const content = await response.text();
140
- const fullOutputPath = path.resolve(process.cwd(), outputPath);
141
- await fs.outputFile(fullOutputPath, content, { encoding: "utf8" });
142
- relinka("success", `Downloaded schema to ${outputPath}`);
143
- } catch (error) {
144
- relinka(
145
- "error",
146
- `Failed to download schema: ${error instanceof Error ? error.message : String(error)}`
40
+ results.push(
41
+ ...configs.filter((cfg) => cfg !== null)
147
42
  );
148
- throw error;
149
43
  }
150
- }
151
- async function updateToolConfigImports(tool, mainExport) {
152
- const configPath = path.resolve(process.cwd(), `${tool}.ts`);
44
+ const { configPath } = await getReliverseConfigPath(
45
+ projectPath,
46
+ isDev,
47
+ false,
48
+ customTsconfigPath
49
+ );
153
50
  if (!await fs.pathExists(configPath)) {
154
- relinka("warn", `Config file ${tool}.ts not found, skipping import update`);
155
- return;
156
- }
157
- try {
158
- const content = await fs.readFile(configPath, "utf8");
159
- const s = new MagicString(content);
160
- const schemaImportPath = `./types/${tool}.schema`;
161
- const newImportStatement = `import { ${mainExport} } from "${schemaImportPath}";`;
162
- if (content.includes(schemaImportPath)) {
163
- relinka("info", `Import already exists in ${tool}.ts`);
164
- return;
165
- }
166
- const existingImportRegex = /import\s*{\s*defineConfig\s*}\s*from\s*[^;]+;/;
167
- const existingImportMatch = content.match(existingImportRegex);
168
- if (existingImportMatch) {
169
- const start = content.indexOf(existingImportMatch[0]);
170
- const end = start + existingImportMatch[0].length;
171
- s.overwrite(start, end, newImportStatement);
51
+ await createReliverseConfig(projectPath, githubUsername, isDev, overrides);
52
+ } else {
53
+ const content = (await fs.readFile(configPath, "utf-8")).trim();
54
+ if (!content || content === "{}") {
55
+ await createReliverseConfig(projectPath, githubUsername, isDev, overrides);
172
56
  } else {
173
- const lines = content.split("\n");
174
- let insertIndex = 0;
175
- let insertLine = 0;
176
- for (let i = 0; i < lines.length; i++) {
177
- const line = lines[i]?.trim();
178
- if (line && line.startsWith("import ")) {
179
- insertLine = i + 1;
180
- insertIndex = content.indexOf(lines[i]) + lines[i].length + 1;
181
- } else if (line === "") {
182
- } else if (line) {
183
- break;
57
+ const validConfig = await readReliverseConfig(configPath, isDev);
58
+ if (!validConfig) {
59
+ const fixed = await parseAndFixReliverseConfig(configPath, isDev);
60
+ if (!fixed) {
61
+ relinka("warn", "Could not fix existing config. Using fallback defaults.");
184
62
  }
185
63
  }
186
- if (insertLine === 0) {
187
- s.prepend(newImportStatement + "\n\n");
188
- } else {
189
- s.appendLeft(insertIndex, newImportStatement + "\n");
190
- }
191
64
  }
192
- const updatedContent = s.toString();
193
- await fs.writeFile(configPath, updatedContent, "utf8");
194
- relinka("success", `Updated imports in ${tool}.ts`);
195
- } catch (error) {
196
- relinka(
197
- "error",
198
- `Failed to update imports: ${error instanceof Error ? error.message : String(error)}`
199
- );
200
65
  }
201
- }
202
- function generateConfigModContent(dotConfig) {
203
- const s = new MagicString("");
204
- s.append("// autogenerated by `dler config`\n");
205
- s.append("// don't edit this file manually\n\n");
206
- const interfaceDefinition = generateDotConfigInterface(dotConfig);
207
- s.append(interfaceDefinition);
208
- s.append("\n\n");
209
- s.append("export const dotConfig: DotConfig = ");
210
- s.append(JSON.stringify(dotConfig, null, 2));
211
- s.append(";\n");
212
- return s.toString();
213
- }
214
- function generateDotConfigInterface(dotConfig) {
215
- const s = new MagicString("");
216
- const toolNames = Object.keys(dotConfig);
217
- s.append("export interface ConfigModEntry {\n");
218
- s.append(" version: string;\n");
219
- s.append(" mode: string;\n");
220
- s.append(" main: string;\n");
221
- s.append(" input: string;\n");
222
- s.append(" output: string;\n");
223
- s.append("}\n\n");
224
- s.append("export interface DotConfig {\n");
225
- toolNames.forEach((tool) => {
226
- s.append(` ${tool}?: ConfigModEntry;
227
- `);
228
- });
229
- s.append("}");
230
- return s.toString();
66
+ const mainConfig = await readReliverseConfig(configPath, isDev);
67
+ if (!mainConfig) {
68
+ relinka("warn", "Using fallback default config due to validation failure.");
69
+ const fallbackConfig = { ...DEFAULT_CONFIG_RELIVERSE };
70
+ if (isDev) {
71
+ fallbackConfig.$schema = RSE_SCHEMA_DEV;
72
+ }
73
+ return { config: fallbackConfig, mrse: results };
74
+ }
75
+ if (isDev) {
76
+ mainConfig.$schema = RSE_SCHEMA_DEV;
77
+ }
78
+ return { config: mainConfig, mrse: results };
231
79
  }
@@ -13,14 +13,20 @@ export async function ensureReliverseConfig(isDev, configKind = DEFAULT_CONFIG_K
13
13
  if (configExists) return;
14
14
  try {
15
15
  let pkgDescription;
16
+ let hasDlerDep = false;
16
17
  try {
17
18
  const pkg = await readPackageJSON();
18
19
  if (pkg && typeof pkg.description === "string" && pkg.description.trim()) {
19
20
  pkgDescription = pkg.description.trim();
20
21
  }
22
+ const deps = pkg.dependencies;
23
+ const devDeps = pkg.devDependencies;
24
+ hasDlerDep = Boolean(
25
+ deps && "@reliverse/dler" in deps || devDeps && "@reliverse/dler" in devDeps
26
+ );
21
27
  } catch {
22
28
  }
23
- const configContent = generateConfig(isDev, pkgDescription, configKind);
29
+ const configContent = generateConfig(isDev, pkgDescription, configKind, hasDlerDep);
24
30
  await fs.outputFile(configPath, configContent, { encoding: "utf8" });
25
31
  relinka(
26
32
  "success",
@@ -78,29 +84,8 @@ async function ensureGitignoreEntries(cwd) {
78
84
  relinka("success", `Updated .gitignore with required entries`);
79
85
  }
80
86
  }
81
- function getLibsObject(isDev) {
82
- return isDev ? {
83
- "@reliverse/reliverse-sdk": {
84
- libDeclarations: true,
85
- libDescription: "@reliverse/reliverse without cli",
86
- libDirName: "sdk",
87
- libMainFile: "sdk/sdk-mod.ts",
88
- libPkgKeepDeps: true,
89
- libTranspileMinify: true,
90
- libPubPause: false,
91
- libPubRegistry: "npm-jsr"
92
- },
93
- "~/app/types/mod": {
94
- libDeclarations: true,
95
- libDescription: "config for @reliverse/reliverse",
96
- libDirName: "cfg",
97
- libMainFile: "cfg/cfg-mod.ts",
98
- libPkgKeepDeps: true,
99
- libTranspileMinify: true,
100
- libPubPause: false,
101
- libPubRegistry: "npm-jsr"
102
- }
103
- } : {};
87
+ function getCoreEntrySrcDir(isDev) {
88
+ return isDev ? "src-ts" : "src";
104
89
  }
105
90
  function generateJsoncConfig(isDev, pkgDescription) {
106
91
  const schemaUrl = `${rseOrg}/schema.json`;
@@ -254,7 +239,7 @@ function generateJsoncConfig(isDev, pkgDescription) {
254
239
  "coreDeclarations": ${DEFAULT_CONFIG_RELIVERSE.coreDeclarations},
255
240
  "coreDescription": ${JSON.stringify(coreDescriptionValue)},
256
241
  "coreEntryFile": "${DEFAULT_CONFIG_RELIVERSE.coreEntryFile}",
257
- "coreEntrySrcDir": "${DEFAULT_CONFIG_RELIVERSE.coreEntrySrcDir}",
242
+ "coreEntrySrcDir": "${getCoreEntrySrcDir(isDev)}",
258
243
  "coreIsCLI": {
259
244
  "enabled": false,
260
245
  "scripts": {}
@@ -291,7 +276,7 @@ function generateJsoncConfig(isDev, pkgDescription) {
291
276
  "libsActMode": "${libsActModeValue}",
292
277
  "libsDirDist": "${DEFAULT_CONFIG_RELIVERSE.libsDirDist}",
293
278
  "libsDirSrc": "${DEFAULT_CONFIG_RELIVERSE.libsDirSrc}",
294
- "libsList": ${JSON.stringify(getLibsObject(isDev), null, 2)},
279
+ "libsList": {},
295
280
  // Logger setup
296
281
  "logsFileName": "${DEFAULT_CONFIG_RELIVERSE.logsFileName}",
297
282
  "logsFreshFile": ${DEFAULT_CONFIG_RELIVERSE.logsFreshFile},
@@ -416,8 +401,8 @@ function generateJsoncConfig(isDev, pkgDescription) {
416
401
  }
417
402
  }`;
418
403
  }
419
- function generateConfig(isDev, pkgDescription, configKind = "ts") {
420
- const importdefineConfigStatement = `import { defineConfig } from "./reltypes";`;
404
+ function generateConfig(isDev, pkgDescription, configKind = "ts", usePackageImport = false) {
405
+ const importdefineConfigStatement = usePackageImport ? `import { defineConfig } from "@reliverse/dler";` : `import { defineConfig } from "./reltypes";`;
421
406
  const verboseValue = getValue(isDev, true, DEFAULT_CONFIG_RELIVERSE.commonVerbose);
422
407
  const coreIsCLI = getCoreIsCLI(isDev);
423
408
  const registryValue = getValue(isDev, "npm-jsr", DEFAULT_CONFIG_RELIVERSE.commonPubRegistry);
@@ -427,7 +412,6 @@ function generateConfig(isDev, pkgDescription, configKind = "ts") {
427
412
  "reliverse (prev. dler) is a flexible, unified, and fully automated bundler for TypeScript and JavaScript projects, as well as an NPM and JSR publishing tool.",
428
413
  pkgDescription || DEFAULT_CONFIG_RELIVERSE.coreDescription
429
414
  );
430
- const libsActModeValue = getValue(isDev, "main-and-libs", DEFAULT_CONFIG_RELIVERSE.libsActMode);
431
415
  if (configKind === "jsonc") {
432
416
  return generateJsoncConfig(isDev, pkgDescription);
433
417
  }
@@ -616,10 +600,10 @@ function generateConfig(isDev, pkgDescription, configKind = "ts") {
616
600
  " // Publish specific dirs as separate packages",
617
601
  " // This feature is experimental at the moment",
618
602
  " // Please commit your changes before using it",
619
- ' libsActMode: "' + libsActModeValue + '",',
603
+ ' libsActMode: "main-project-only",',
620
604
  ' libsDirDist: "' + DEFAULT_CONFIG_RELIVERSE.libsDirDist + '",',
621
605
  ' libsDirSrc: "' + DEFAULT_CONFIG_RELIVERSE.libsDirSrc + '",',
622
- " libsList: " + JSON.stringify(getLibsObject(isDev), null, 2) + ",",
606
+ " libsList: {},",
623
607
  "",
624
608
  " // @reliverse/relinka logger setup",
625
609
  ' logsFileName: "' + DEFAULT_CONFIG_RELIVERSE.logsFileName + '",',
@@ -792,10 +776,7 @@ function generateConfig(isDev, pkgDescription, configKind = "ts") {
792
776
  return configTemplate;
793
777
  }
794
778
  function getCoreIsCLI(isDev) {
795
- return isDev ? `coreIsCLI: { enabled: true, scripts: { reliverse: "reliverse.ts" } },` : `// coreIsCLI: {
796
- // enabled: false,
797
- // scripts: { mycli: "mycli.ts" },
798
- // },`;
779
+ return isDev ? `coreIsCLI: { enabled: true, scripts: { rse: "rse.ts" } },` : `coreIsCLI: { enabled: false, scripts: {} },`;
799
780
  }
800
781
  function getValue(isDev, devValue, prodValue) {
801
782
  return isDev ? devValue : prodValue;
@@ -804,7 +785,7 @@ function getBumpFilter(isDev) {
804
785
  return isDev ? `[
805
786
  "package.json",
806
787
  "reliverse.ts",
807
- "src-ts/impl/config/info.ts",
788
+ "src-ts/rse.ts",
808
789
  ]` : `["package.json", "reliverse.ts"]`;
809
790
  }
810
791
  function getPublishArtifacts(isDev) {
@@ -812,12 +793,7 @@ function getPublishArtifacts(isDev) {
812
793
  global: ["package.json", "README.md", "LICENSE", "LICENSES"],
813
794
  "dist-jsr": [],
814
795
  "dist-npm": [],
815
- "dist-libs": {
816
- "@reliverse/reliverse-sdk": {
817
- jsr: [],
818
- npm: [],
819
- },
820
- },
796
+ "dist-libs": {},
821
797
  }` : `{
822
798
  global: ["package.json", "README.md", "LICENSE"],
823
799
  "dist-jsr": [],
@@ -1,7 +1,7 @@
1
1
  import { relinka } from "@reliverse/relinka";
2
2
  import { confirmPrompt } from "@reliverse/rempts";
3
3
  import { FALLBACK_ENV_EXAMPLE_URL } from "../config/constants.js";
4
- import { getOrCreateReliverseConfig } from "../config/core-cfg.js";
4
+ import { getOrCreateReliverseConfig } from "../config/core.js";
5
5
  import { composeEnvFile } from "../init/use-template/cp-modules/compose-env-file/cef-mod.js";
6
6
  import { getCurrentWorkingDirectory } from "../utils/terminalHelpers.js";
7
7
  export async function envArgImpl(isDev, pathToProject) {
@@ -22,7 +22,7 @@ import { getOrCreateReliverseMemory } from "../../utils/reliverseMemory.js";
22
22
  import { findTsconfigUp } from "../../utils/tsconfigHelpers.js";
23
23
  import { createTSConfig } from "../../utils/utils-tsconfig.js";
24
24
  import { getProjectContent } from "../../config/content.js";
25
- import { getOrCreateReliverseConfig } from "../../config/core-cfg.js";
25
+ import { getOrCreateReliverseConfig } from "../../config/core.js";
26
26
  import { detectProjectsWithReliverseConfig } from "../../config/detect.js";
27
27
  const NEW_PROJECT_OPTION = "new-project";
28
28
  const EXIT_OPTION = "exit";
@@ -1,7 +1,7 @@
1
1
  import { relinka } from "@reliverse/relinka";
2
2
  import { confirmPrompt, defineCommand, inputPrompt, selectPrompt } from "@reliverse/rempts";
3
3
  import { execaCommand } from "execa";
4
- import { getOrCreateReliverseConfig } from "../config/core-cfg.js";
4
+ import { getOrCreateReliverseConfig } from "../config/core.js";
5
5
  import { getCurrentWorkingDirectory } from "../utils/terminalHelpers.js";
6
6
  const DANGEROUS_COMMANDS = ["login", "logout", "memory", "schema", "studio", "update", "upload"];
7
7
  const SAFE_COMMANDS = [
@@ -3,7 +3,7 @@ import fs, { ensuredir } from "@reliverse/relifso";
3
3
  import { relinka } from "@reliverse/relinka";
4
4
  import { confirmPrompt } from "@reliverse/rempts";
5
5
  import { homeDir } from "../config/constants.js";
6
- import { getOrCreateReliverseConfig } from "../config/core-cfg.js";
6
+ import { getOrCreateReliverseConfig } from "../config/core.js";
7
7
  import { initGithubSDK } from "../utils/instanceGithub.js";
8
8
  import { askUsernameFrontend } from "../utils/prompts/askUsernameFrontend.js";
9
9
  import { getOrCreateReliverseMemory } from "../utils/reliverseMemory.js";
@@ -10,18 +10,18 @@ export type Database = z.infer<typeof DatabaseSchema>;
10
10
  export declare const ORMSchema: z.ZodEnum<{
11
11
  none: "none";
12
12
  drizzle: "drizzle";
13
- mongoose: "mongoose";
14
13
  prisma: "prisma";
14
+ mongoose: "mongoose";
15
15
  }>;
16
16
  export type ORM = z.infer<typeof ORMSchema>;
17
17
  export declare const BackendSchema: z.ZodEnum<{
18
18
  none: "none";
19
19
  hono: "hono";
20
20
  next: "next";
21
- convex: "convex";
22
- elysia: "elysia";
23
21
  express: "express";
24
22
  fastify: "fastify";
23
+ convex: "convex";
24
+ elysia: "elysia";
25
25
  }>;
26
26
  export type Backend = z.infer<typeof BackendSchema>;
27
27
  export declare const RuntimeSchema: z.ZodEnum<{
@@ -33,7 +33,7 @@ export async function ensureReltypesFile(cwd) {
33
33
  const raw = await fs.readFile(pkgJsonPath, "utf8");
34
34
  const pkg = JSON.parse(raw);
35
35
  const hasDler = Boolean(
36
- pkg.dependencies && pkg.dependencies["@reliverse/dler"] || pkg.devDependencies && pkg.devDependencies["@reliverse/dler"]
36
+ pkg.name === "@reliverse/dler" || pkg.dependencies && pkg.dependencies["@reliverse/dler"] || pkg.devDependencies && pkg.devDependencies["@reliverse/dler"]
37
37
  );
38
38
  if (hasDler) {
39
39
  return;
package/bin/mod.d.ts CHANGED
@@ -119,8 +119,7 @@ export { injectSectionComments } from "./impl/config/comments";
119
119
  export { CONCURRENCY_DEFAULT, CONFIG_CATEGORIES, cliConfigJsonc, cliConfigJsoncBak, cliConfigJsoncTmp, cliConfigTs, cliConfigTsBak, cliConfigTsTmp, cliDomainDocs, cliDomainEnv, cliDomainRoot, cliHomeDir, cliHomeRepos, cliHomeTmp, cliJsrPath, cliName, cliVersion, DEFAULT_CLI_USERNAME, DEFAULT_DOMAIN, dlerName, endTitle, FALLBACK_ENV_EXAMPLE_URL, homeDir, IGNORE_PATTERNS, memoryPath, PROJECT_ROOT, RSE_SCHEMA_DEV, RSE_SCHEMA_URL, rseName, rseOrg, rseOrgBase, SHOW_VERBOSE, tsconfigJson, UNKNOWN_STRING, UNKNOWN_VALUE, useLocalhost, validExtensions, } from "./impl/config/constants";
120
120
  export type { RequiredProjectContent } from "./impl/config/content";
121
121
  export { getProjectContent } from "./impl/config/content";
122
- export { ensureConfigMod } from "./impl/config/core";
123
- export { getOrCreateReliverseConfig } from "./impl/config/core-cfg";
122
+ export { getOrCreateReliverseConfig } from "./impl/config/core";
124
123
  export { createReliverseConfig, generateReliverseConfig, writeReliverseConfig, } from "./impl/config/create";
125
124
  export { generateDefaultRulesForProject, getDefaultReliverseConfig, } from "./impl/config/def-utils";
126
125
  export { detectFeatures, detectProject, detectProjectFramework, detectProjectsWithReliverseConfig, getPackageJson, getPackageJsonSafe, PROJECT_FRAMEWORK_FILES, } from "./impl/config/detect";
package/bin/mod.js CHANGED
@@ -247,8 +247,7 @@ export {
247
247
  validExtensions
248
248
  } from "./impl/config/constants.js";
249
249
  export { getProjectContent } from "./impl/config/content.js";
250
- export { ensureConfigMod } from "./impl/config/core.js";
251
- export { getOrCreateReliverseConfig } from "./impl/config/core-cfg.js";
250
+ export { getOrCreateReliverseConfig } from "./impl/config/core.js";
252
251
  export {
253
252
  createReliverseConfig,
254
253
  generateReliverseConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@ai-sdk/openai": "^2.0.22",
3
+ "@ai-sdk/openai": "^2.0.23",
4
4
  "@babel/preset-react": "^7.27.1",
5
5
  "@babel/preset-typescript": "^7.27.1",
6
6
  "@hookform/resolvers": "^5.2.1",
@@ -32,7 +32,7 @@
32
32
  "@volar/typescript": "^2.4.23",
33
33
  "@vue/language-core": "^3.0.6",
34
34
  "@vue/language-core2.0": "npm:@vue/language-core@2.0.29",
35
- "ai": "^5.0.27",
35
+ "ai": "^5.0.28",
36
36
  "async-listen": "^3.1.0",
37
37
  "autoprefixer": "^10.4.21",
38
38
  "better-auth": "^1.3.7",
@@ -64,7 +64,7 @@
64
64
  "jsonrepair": "^3.13.0",
65
65
  "ky": "^1.9.1",
66
66
  "lookpath": "^1.2.3",
67
- "lucide-react": "^0.541.0",
67
+ "lucide-react": "^0.542.0",
68
68
  "magic-string": "^0.30.18",
69
69
  "magicast": "^0.3.5",
70
70
  "mlly": "^1.8.0",
@@ -116,14 +116,14 @@
116
116
  "vue-tsc": "^3.0.6",
117
117
  "vue-tsc1": "npm:vue-tsc@1.8.27",
118
118
  "vue-tsc2.0": "npm:vue-tsc@2.0.29",
119
- "zod": "^4.1.4"
119
+ "zod": "^4.1.5"
120
120
  },
121
121
  "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.",
122
122
  "homepage": "https://docs.reliverse.org/cli",
123
123
  "license": "MIT",
124
124
  "name": "@reliverse/dler",
125
125
  "type": "module",
126
- "version": "1.7.132",
126
+ "version": "1.7.134",
127
127
  "author": "reliverse",
128
128
  "bugs": {
129
129
  "email": "blefnk@gmail.com",
@@ -1,14 +0,0 @@
1
- import type { ReliverseConfig } from "../schema/mod.js";
2
- /**
3
- * Retrieves or creates the main rseg (and any 'mrse' configs).
4
- * Allows an optional custom path to the TS config file.
5
- */
6
- export declare function getOrCreateReliverseConfig({ projectPath, isDev, overrides, customTsconfigPath, }: {
7
- projectPath: string;
8
- isDev: boolean;
9
- overrides: Partial<ReliverseConfig>;
10
- customTsconfigPath?: string;
11
- }): Promise<{
12
- config: ReliverseConfig;
13
- mrse: ReliverseConfig[];
14
- }>;
@@ -1,79 +0,0 @@
1
- import path from "@reliverse/pathkit";
2
- import fs from "@reliverse/relifso";
3
- import { relinka } from "@reliverse/relinka";
4
- import {
5
- cliConfigJsonc,
6
- cliConfigTs,
7
- RSE_SCHEMA_DEV,
8
- UNKNOWN_VALUE
9
- } from "./constants.js";
10
- import { createReliverseConfig } from "./create.js";
11
- import { getReliverseConfigPath } from "./path.js";
12
- import { readReliverseConfig } from "./read.js";
13
- import { parseAndFixReliverseConfig } from "./repair.js";
14
- import { DEFAULT_CONFIG_RELIVERSE } from "../schema/mod.js";
15
- export async function getOrCreateReliverseConfig({
16
- projectPath,
17
- isDev,
18
- overrides,
19
- customTsconfigPath
20
- }) {
21
- const githubUsername = UNKNOWN_VALUE;
22
- const mrseFolderPath = path.join(projectPath, "mrse");
23
- const results = [];
24
- if (await fs.pathExists(mrseFolderPath)) {
25
- const dirItems = await fs.readdir(mrseFolderPath);
26
- const rseFiles = dirItems.filter((item) => item === cliConfigJsonc || item === cliConfigTs);
27
- const configs = await Promise.all(
28
- rseFiles.map(async (file) => {
29
- const filePath = path.join(mrseFolderPath, file);
30
- let foundConfig = await readReliverseConfig(filePath, isDev);
31
- if (!foundConfig) {
32
- foundConfig = await parseAndFixReliverseConfig(filePath, isDev);
33
- }
34
- if (!foundConfig) {
35
- relinka("warn", `Skipping invalid config file: ${filePath}`);
36
- }
37
- return foundConfig;
38
- })
39
- );
40
- results.push(
41
- ...configs.filter((cfg) => cfg !== null)
42
- );
43
- }
44
- const { configPath } = await getReliverseConfigPath(
45
- projectPath,
46
- isDev,
47
- false,
48
- customTsconfigPath
49
- );
50
- if (!await fs.pathExists(configPath)) {
51
- await createReliverseConfig(projectPath, githubUsername, isDev, overrides);
52
- } else {
53
- const content = (await fs.readFile(configPath, "utf-8")).trim();
54
- if (!content || content === "{}") {
55
- await createReliverseConfig(projectPath, githubUsername, isDev, overrides);
56
- } else {
57
- const validConfig = await readReliverseConfig(configPath, isDev);
58
- if (!validConfig) {
59
- const fixed = await parseAndFixReliverseConfig(configPath, isDev);
60
- if (!fixed) {
61
- relinka("warn", "Could not fix existing config. Using fallback defaults.");
62
- }
63
- }
64
- }
65
- }
66
- const mainConfig = await readReliverseConfig(configPath, isDev);
67
- if (!mainConfig) {
68
- relinka("warn", "Using fallback default config due to validation failure.");
69
- const fallbackConfig = { ...DEFAULT_CONFIG_RELIVERSE };
70
- if (isDev) {
71
- fallbackConfig.$schema = RSE_SCHEMA_DEV;
72
- }
73
- return { config: fallbackConfig, mrse: results };
74
- }
75
- if (isDev) {
76
- mainConfig.$schema = RSE_SCHEMA_DEV;
77
- }
78
- return { config: mainConfig, mrse: results };
79
- }