@reliverse/dler 1.7.132 → 1.7.133

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.
@@ -146,8 +146,8 @@ export declare const optionsSchema: z.ZodObject<{
146
146
  cwd: z.ZodString;
147
147
  config: z.ZodOptional<z.ZodString>;
148
148
  database: z.ZodOptional<z.ZodEnum<{
149
- mysql: "mysql";
150
149
  sqlite: "sqlite";
150
+ mysql: "mysql";
151
151
  mongodb: "mongodb";
152
152
  postgres: "postgres";
153
153
  mssql: "mssql";
@@ -165,7 +165,7 @@ export declare const optionsSchema: z.ZodObject<{
165
165
  }, z.core.$strip>;
166
166
  export declare const outroText = "\uD83E\uDD73 All Done, Happy Hacking!";
167
167
  export declare function getLatestNpmVersion(packageName: string): Promise<string>;
168
- export declare function getPackageManager(): Promise<"bun" | "npm" | "yarn" | "pnpm">;
168
+ export declare function getPackageManager(): Promise<"bun" | "npm" | "pnpm" | "yarn">;
169
169
  export declare function getEnvFiles(cwd: string): Promise<string[]>;
170
170
  export declare function updateEnvs({ envs, files, isCommented, }: {
171
171
  /**
@@ -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.133";
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.133";
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",
@@ -416,8 +422,8 @@ function generateJsoncConfig(isDev, pkgDescription) {
416
422
  }
417
423
  }`;
418
424
  }
419
- function generateConfig(isDev, pkgDescription, configKind = "ts") {
420
- const importdefineConfigStatement = `import { defineConfig } from "./reltypes";`;
425
+ function generateConfig(isDev, pkgDescription, configKind = "ts", usePackageImport = false) {
426
+ const importdefineConfigStatement = usePackageImport ? `import { defineConfig } from "@reliverse/dler";` : `import { defineConfig } from "./reltypes";`;
421
427
  const verboseValue = getValue(isDev, true, DEFAULT_CONFIG_RELIVERSE.commonVerbose);
422
428
  const coreIsCLI = getCoreIsCLI(isDev);
423
429
  const registryValue = getValue(isDev, "npm-jsr", DEFAULT_CONFIG_RELIVERSE.commonPubRegistry);
@@ -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";
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  export declare const DatabaseSchema: z.ZodEnum<{
3
+ sqlite: "sqlite";
3
4
  none: "none";
4
5
  mysql: "mysql";
5
- sqlite: "sqlite";
6
6
  mongodb: "mongodb";
7
7
  postgres: "postgres";
8
8
  }>;
@@ -19,9 +19,9 @@ export declare const BackendSchema: z.ZodEnum<{
19
19
  hono: "hono";
20
20
  next: "next";
21
21
  convex: "convex";
22
- elysia: "elysia";
23
22
  express: "express";
24
23
  fastify: "fastify";
24
+ elysia: "elysia";
25
25
  }>;
26
26
  export type Backend = z.infer<typeof BackendSchema>;
27
27
  export declare const RuntimeSchema: z.ZodEnum<{
@@ -50,8 +50,8 @@ export declare const AddonsSchema: z.ZodEnum<{
50
50
  tauri: "tauri";
51
51
  starlight: "starlight";
52
52
  turborepo: "turborepo";
53
- pwa: "pwa";
54
53
  husky: "husky";
54
+ pwa: "pwa";
55
55
  }>;
56
56
  export type Addons = z.infer<typeof AddonsSchema>;
57
57
  export declare const ExamplesSchema: z.ZodEnum<{
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.133",
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
- }