@reliverse/dler 1.7.131 → 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.
@@ -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.131";
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.131";
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,8 +3,6 @@ export declare const DEFAULT_SEPARATOR_RAW = "\\n\\n";
3
3
  export declare const normalizeGlobPattern: (pattern: string) => string;
4
4
  export declare const parseCSV: (s: string) => any[];
5
5
  export declare const unescape: (s: string) => string;
6
- export declare const maybePrompt: <T>(interactive: boolean, value: T | undefined, promptFn: () => Promise<T>) => Promise<T | undefined>;
7
- export declare const collectFiles: (include: string[], extraIgnore: string[], recursive: boolean, sortBy: "name" | "path" | "mtime" | "none", depth: number) => Promise<string[]>;
8
6
  export declare const writeResult: (sections: string[], _separator: string, toFile: string | undefined, toStdout: boolean, dryRun: boolean, backup: boolean, generateSourceMap?: boolean) => Promise<void>;
9
7
  export declare const writeFilesPreserveStructure: (files: string[], outDir: string, preserveStructure: boolean, increment: boolean, concurrency: number, dryRun: boolean, backup: boolean) => Promise<void>;
10
8
  export declare const processSection: (raw: string, rel: string, prefix: string, pathAbove: boolean, injectPath: boolean) => string;
@@ -1,18 +1,13 @@
1
1
  import path from "@reliverse/pathkit";
2
- import { glob } from "@reliverse/reglob";
3
2
  import fs from "@reliverse/relifso";
4
- import { relinka } from "@reliverse/relinka";
5
3
  import { withEnhancedSpinner } from "@reliverse/rempts";
6
4
  import MagicString, { Bundle } from "magic-string";
7
5
  import pMap from "p-map";
8
- import { isBinaryExt } from "../utils/binary.js";
9
6
  import {
10
- checkFileSize,
11
7
  checkPermissions,
12
8
  handleCtxError,
13
9
  sanitizeInput,
14
10
  validateContent,
15
- validateFileExists,
16
11
  validateFileType,
17
12
  validateMergeOperation,
18
13
  validatePath
@@ -28,66 +23,6 @@ export const normalizeGlobPattern = (pattern) => {
28
23
  };
29
24
  export const parseCSV = (s) => s.split(",").map((t) => sanitizeInput(t.trim())).filter(Boolean);
30
25
  export const unescape = (s) => s.replace(/\\n/g, "\n").replace(/\\t/g, " ");
31
- export const maybePrompt = async (interactive, value, promptFn) => {
32
- if (!interactive || value !== void 0) return value;
33
- return promptFn();
34
- };
35
- export const collectFiles = async (include, extraIgnore, recursive, sortBy, depth) => {
36
- try {
37
- const normalizedInclude = include.map(normalizeGlobPattern);
38
- const files = await glob(normalizedInclude, {
39
- ignore: [...DEFAULT_IGNORES, ...extraIgnore.map(sanitizeInput)],
40
- absolute: true,
41
- onlyFiles: true,
42
- deep: recursive ? void 0 : 1
43
- });
44
- const validFiles = [];
45
- let binaryFilesDetected = false;
46
- for (const file of files) {
47
- await validateFileExists(file, "merge");
48
- await checkFileSize(file);
49
- await checkPermissions(file, "read");
50
- if (await isBinaryExt(file)) {
51
- binaryFilesDetected = true;
52
- continue;
53
- }
54
- validFiles.push(file);
55
- }
56
- if (binaryFilesDetected) {
57
- relinka("info", "Binary files were detected and skipped");
58
- }
59
- let filtered = [...new Set(validFiles)];
60
- if (depth > 0) {
61
- const fileGroups = /* @__PURE__ */ new Map();
62
- for (const file of filtered) {
63
- const relPath = path.relative(process.cwd(), file);
64
- const parts = relPath.split(path.sep);
65
- const groupKey = parts.slice(0, depth).join(path.sep);
66
- if (!fileGroups.has(groupKey)) {
67
- fileGroups.set(groupKey, []);
68
- }
69
- const group = fileGroups.get(groupKey);
70
- if (group) {
71
- group.push(file);
72
- }
73
- }
74
- filtered = Array.from(fileGroups.values()).flat();
75
- }
76
- if (sortBy === "name") {
77
- filtered.sort((a, b) => path.basename(a).localeCompare(path.basename(b)));
78
- } else if (sortBy === "path") {
79
- filtered.sort();
80
- } else if (sortBy === "mtime") {
81
- filtered = await pMap(filtered, async (f) => ({ f, mtime: (await fs.stat(f)).mtimeMs }), {
82
- concurrency: 8
83
- }).then((arr) => arr.sort((a, b) => a.mtime - b.mtime).map((x) => x.f));
84
- }
85
- return filtered;
86
- } catch (error) {
87
- handleCtxError(error, "collectFiles");
88
- return [];
89
- }
90
- };
91
26
  export const writeResult = async (sections, _separator, toFile, toStdout, dryRun, backup, generateSourceMap = false) => {
92
27
  try {
93
28
  const bundle = new Bundle();
@@ -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,23 +10,23 @@ export type Database = z.infer<typeof DatabaseSchema>;
10
10
  export declare const ORMSchema: z.ZodEnum<{
11
11
  none: "none";
12
12
  drizzle: "drizzle";
13
- prisma: "prisma";
14
13
  mongoose: "mongoose";
14
+ prisma: "prisma";
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";
21
22
  express: "express";
22
23
  fastify: "fastify";
23
24
  elysia: "elysia";
24
- convex: "convex";
25
25
  }>;
26
26
  export type Backend = z.infer<typeof BackendSchema>;
27
27
  export declare const RuntimeSchema: z.ZodEnum<{
28
- bun: "bun";
29
28
  none: "none";
29
+ bun: "bun";
30
30
  node: "node";
31
31
  workers: "workers";
32
32
  }>;
@@ -45,18 +45,18 @@ export declare const FrontendSchema: z.ZodEnum<{
45
45
  }>;
46
46
  export type Frontend = z.infer<typeof FrontendSchema>;
47
47
  export declare const AddonsSchema: z.ZodEnum<{
48
- biome: "biome";
49
48
  none: "none";
49
+ biome: "biome";
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<{
58
- ai: "ai";
59
58
  none: "none";
59
+ ai: "ai";
60
60
  todo: "todo";
61
61
  }>;
62
62
  export type Examples = z.infer<typeof ExamplesSchema>;
@@ -18,35 +18,11 @@ import type { GlobOptions } from "tinyglobby";
18
18
  import type { Schema } from "untyped";
19
19
  import type { ReliverseMemory } from "../utils/schemaMemory.js";
20
20
  import type { ReliverseConfig } from "../schema/mod";
21
- export type { TemplateUpdateInfo } from "../add/add-local/core/templates.js";
22
- export type { ShowMenuResult } from "../add/add-local/core/types.js";
23
- export type { RuleRepo, UnghRepoResponse, } from "../add/add-rule/add-rule-types.js";
24
- export type { AIAgentOptions, AiSdkAgent, CircularTrigger, } from "../ai/ai-impl/ai-types.js";
25
- export type { LintSuggestion } from "../ai/ai-impl/relinter/relinter.js";
26
- export type { KeyType, KnownService, } from "../init/use-template/cp-modules/compose-env-file/cef-keys.js";
27
- export type { ConfigurationOptions } from "../init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-config.js";
28
- export type { VercelTeam } from "../init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-team.js";
29
- export type { DeploymentLog, DeploymentLogType, DeploymentOptions, EnvVar, VercelDeploymentConfig, VercelFramework, } from "../init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-types.js";
30
- export type { GenCfg, GenCfgJsonc } from "../mrse/mrse-impl.js";
31
- export type { UploadFile } from "../upload/providers/providers-mod.js";
32
- export type { UploadedUCFile } from "../upload/providers/uploadcare.js";
33
- export type { UploadedFile } from "../upload/providers/uploadthing.js";
34
- export type { DetectionSource, DetectOptions, PackageManager, PkgManagerInfo, } from "../utils/dependencies/getUserPkgManager.js";
35
- export type { DownloadResult } from "../utils/downloading/downloadRepo.js";
36
- export type { ScriptStatus } from "../utils/handlers/promptPackageJsonScripts.js";
37
- export type { InstanceGithub } from "../utils/instanceGithub.js";
38
- export type { InstanceVercel } from "../utils/instanceVercel.js";
39
- export type { CategoryFromSchema, CloneOrTemplateRepo, RepoFromSchema, RepoOption, } from "../utils/projectRepository.js";
40
- export type { ReplaceConfig } from "../utils/replacements/reps-impl.js";
41
- export type { Hardcoded, UrlPatterns } from "../utils/replacements/reps-keys.js";
42
- export { handleReplacements } from "../utils/replacements/reps-mod.js";
43
- export type { EncryptedDataMemory, ReliverseMemory, UserDataMemory, } from "../utils/schemaMemory.js";
44
- export type { RepoInfo, ReposConfig } from "../utils/schemaTemplate.js";
45
21
  export type ArgTypeShared = string | number | boolean | string[] | undefined;
46
- export interface CommonArgs {
22
+ export interface CommonCliArgs {
47
23
  isCI: boolean;
48
24
  isDev: boolean;
49
- strCwd: string;
25
+ cwdStr: string;
50
26
  }
51
27
  export type IterableError = Iterable<{
52
28
  schema: unknown;
@@ -655,3 +631,4 @@ export type MkdistOptions = {
655
631
  compilerOptions?: TSConfig["compilerOptions"];
656
632
  };
657
633
  } & LoaderOptions;
634
+ export {};
@@ -1 +0,0 @@
1
- export { handleReplacements } from "../utils/replacements/reps-mod.js";
@@ -1,5 +1,5 @@
1
- import type { CommonArgs } from "../types/mod";
2
- export declare function commonStartActions({ strCwd, isCI, isDev, showRuntimeInfo, clearConsole, withStartPrompt, }: CommonArgs & {
1
+ import type { CommonCliArgs } from "../types/mod";
2
+ export declare function commonStartActions({ cwdStr, isCI, isDev, showRuntimeInfo, clearConsole, withStartPrompt, }: CommonCliArgs & {
3
3
  showRuntimeInfo: boolean;
4
4
  clearConsole: boolean;
5
5
  withStartPrompt: boolean;
@@ -2,7 +2,7 @@ import { relinka } from "@reliverse/relinka";
2
2
  import { prepareReliverseEnvironment } from "../config/prepare.js";
3
3
  import { showEndPrompt, showStartPrompt } from "./startEndPrompts.js";
4
4
  export async function commonStartActions({
5
- strCwd,
5
+ cwdStr,
6
6
  isCI,
7
7
  isDev,
8
8
  showRuntimeInfo,
@@ -27,7 +27,7 @@ export async function commonStartActions({
27
27
  );
28
28
  process.exit(0);
29
29
  }
30
- await prepareReliverseEnvironment(strCwd, isDev, "ts");
30
+ await prepareReliverseEnvironment(cwdStr, isDev, "ts");
31
31
  }
32
32
  export async function commonEndActions({ withEndPrompt }) {
33
33
  if (withEndPrompt) {
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";
@@ -299,15 +298,16 @@ export { ALLOWED_FILE_EXTENSIONS, ALLOWED_IMPORT_EXTENSIONS, STRICT_FILE_EXTENSI
299
298
  export { displayCheckResults } from "./impl/rules/rules-mod";
300
299
  export { getAllFiles, getLineNumber, shouldIgnoreFile } from "./impl/rules/rules-utils";
301
300
  export { generateReltypesContent } from "./impl/schema/gen";
302
- export type { BumpMode, BundlerName, Esbuild, LibConfig, LogLevel, LogLevelConfig, LogLevelsConfig, NpmOutExt, ProjectArchitecture, ProjectCategory, ProjectFramework, ProjectSubcategory, RelinkaDirsConfig, RelinterConfirm, ReliverseConfig, Sourcemap, TranspileFormat, TranspileTarget, } from "./impl/schema/mod";
301
+ export type { BumpMode, BundlerName, Esbuild, LibConfig, LogLevel, LogLevelConfig, LogLevelsConfig, NpmOutExt, PreferredAnalytics, PreferredAPI, PreferredAuth, PreferredCache, PreferredCDN, PreferredCharts, PreferredCMS, PreferredDates, PreferredDBLib, PreferredDBProvider, PreferredDocs, PreferredForm, PreferredFormat, PreferredForms, PreferredI18n, PreferredIcons, PreferredLint, PreferredLogging, PreferredMail, PreferredMarkdown, PreferredMonitoring, PreferredMotion, PreferredNotifications, PreferredPayment, PreferredRouting, PreferredSEO, PreferredSearch, PreferredSecurity, PreferredStateManagement, PreferredStorage, PreferredStyling, PreferredTesting, PreferredUI, PreferredUploads, PreferredValidation, ProjectArchitecture, ProjectCategory, ProjectDeployService, ProjectFramework, ProjectGitService, ProjectPackageManager, ProjectRuntime, ProjectState, ProjectSubcategory, ProjectTemplate, RelinkaDirsConfig, RelinterConfirm, ReliverseConfig, RepoPrivacy, Sourcemap, ThemeMode, TranspileFormat, TranspileTarget, UnknownLiteral, } from "./impl/schema/mod";
303
302
  export { DEFAULT_CONFIG_RELIVERSE, defineConfig } from "./impl/schema/mod";
304
- export { checkIfRegenerationNeeded, ensureReltypesFile } from "./impl/schema/utils";
303
+ export type { JsonSchemaDocument, SchemaFactory } from "./impl/schema/utils";
304
+ export { checkIfRegenerationNeeded, ensureReltypesFile, generateSchemaFile, } from "./impl/schema/utils";
305
305
  export { getAllSourceFiles, splitLargeFileByLines, splitLargeFunctions } from "./impl/split/impl";
306
306
  export { downloadRepoOption, rmTestsRuntime, } from "./impl/toolbox/toolbox-impl";
307
307
  export { openVercelTools } from "./impl/toolbox/toolbox-vercel";
308
308
  export type { BundleSource, IndentOptions, MagicStringOptions, OverwriteOptions, StringTransformer, TransformResult, UpdateOptions, } from "./impl/transform/transform-impl-mod";
309
309
  export { append, compose, createBundle, createTransformer, createTransformerFromMagicString, indent, insertAt, overwrite, pipe, prepend, readAndTransform, remove, replace, replaceAll, slice, template, transformAndWrite, transformMultiple, trim, update, wrapWith, } from "./impl/transform/transform-impl-mod";
310
- export type { AppParams, BaseBuildEntry, BaseConfig, Behavior, BiomeConfig, BiomeConfigResult, BuildContext, BuildEntry, BuildHooks, BuildOptions, BuildPreset, CamelCase, CheckIssue, CheckResult, ColumnType, CopyBuildEntry, CopyHooks, CreateLoaderOptions, DatabasePostgresProvider, DatabaseProvider, DeploymentService, DetectedProject, DirectoryType, DistDirs, DistDirsAll, EsbuildOptions, GitModParams, HyphenatedStringToCamelCase, IconName, InputFile, IntegrationCategory, IntegrationConfig, IntegrationOption, IntegrationOptions, IterableError, Loader, LoaderContext, LoaderResult, LoadFile, MkdistBuildEntry, MkdistHooks, MkdistOptions, ModernReplacement, MonorepoType, NavItem, NavItemWithChildren, NavigationEntry, OutputFile, ParamsOmitReli, ParamsOmitSkipPN, PerfTimer, PrismaField, PrismaModel, ProjectConfigReturn, ProjectSelectionResult, RemovalConfig, RollupBuildEntry, RollupBuildOptions, RollupHooks, RollupOptions, RulesCheckOptions, ShadcnConfig, SubOption, TableSchema, Theme, UnifiedBuildConfig, UntypedBuildEntry, UntypedHooks, UntypedOutput, UntypedOutputs, VSCodeSettings, } from "./impl/types/mod";
310
+ export type { AppParams, ArgTypeShared, BaseBuildEntry, BaseConfig, Behavior, BiomeConfig, BiomeConfigResult, BuildContext, BuildEntry, BuildHooks, BuildOptions, BuildPreset, CamelCase, CheckIssue, CheckResult, ColumnType, CommonCliArgs, CopyBuildEntry, CopyHooks, CreateLoaderOptions, DatabasePostgresProvider, DatabaseProvider, DeploymentService, DetectedProject, DirectoryType, DistDirs, DistDirsAll, EsbuildOptions, GitModParams, HyphenatedStringToCamelCase, IconName, InputFile, IntegrationCategory, IntegrationConfig, IntegrationOption, IntegrationOptions, IterableError, Loader, LoaderContext, LoaderResult, LoadFile, MkdistBuildEntry, MkdistHooks, MkdistOptions, ModernReplacement, MonorepoType, NavItem, NavItemWithChildren, NavigationEntry, OutputFile, ParamsOmitReli, ParamsOmitSkipPN, PerfTimer, PrismaField, PrismaModel, ProjectConfigReturn, ProjectSelectionResult, RemovalConfig, RollupBuildEntry, RollupBuildOptions, RollupHooks, RollupOptions, RulesCheckOptions, ShadcnConfig, SubOption, TableSchema, Theme, UnifiedBuildConfig, UntypedBuildEntry, UntypedHooks, UntypedOutput, UntypedOutputs, VSCodeSettings, } from "./impl/types/mod";
311
311
  export { checkPackageUpdates, displayUpdateSummary, getEffectiveLinker, handleCatalogOnlyUpdate, handleInstallation, handleInteractiveSelection, handleRecursiveUpdates, handleToolUpgrades, handleWorkspaceUpdates, prepareUpdateCandidates, updateRootPackageJson, validatePackageJson, validateUpdateArgs, } from "./impl/update/impl";
312
312
  export type { DependencyInfo, PackageCheckOptions, UpdateResult, UpgradeResult, } from "./impl/update/utils";
313
313
  export { applyVersionUpdate, CACHE_TTL, checkPackageUpdate, collectTargetDependencies, displayUpdateResults, fetchVersionFromRegistry, findAllPackageJsons, findWorkspacePackageJsons, getGlobalPackages, getLatestVersion, getPmOptions, handleGlobalUpdates, isCatalogReference, isMonorepo, isNonSemverSpecifier, isNpmAlias, isSemverCompatible, isWorkspaceDependency, prepareDependenciesForUpdate, runInstallCommand, runInstallCommandWithFilter, updateGlobalPackage, updatePackageJsonFile, updateWorkspacePackages, upgradeBun, upgradeDlerGlobal, upgradeDlerLocal, upgradeGit, upgradeNode, upgradeNpm, upgradePnpm, upgradeYarn, versionCache, } from "./impl/update/utils";
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,
@@ -712,7 +711,11 @@ export { displayCheckResults } from "./impl/rules/rules-mod.js";
712
711
  export { getAllFiles, getLineNumber, shouldIgnoreFile } from "./impl/rules/rules-utils.js";
713
712
  export { generateReltypesContent } from "./impl/schema/gen.js";
714
713
  export { DEFAULT_CONFIG_RELIVERSE, defineConfig } from "./impl/schema/mod.js";
715
- export { checkIfRegenerationNeeded, ensureReltypesFile } from "./impl/schema/utils.js";
714
+ export {
715
+ checkIfRegenerationNeeded,
716
+ ensureReltypesFile,
717
+ generateSchemaFile
718
+ } from "./impl/schema/utils.js";
716
719
  export { getAllSourceFiles, splitLargeFileByLines, splitLargeFunctions } from "./impl/split/impl.js";
717
720
  export {
718
721
  downloadRepoOption,
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.131",
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
- }