@reliverse/dler 1.7.113 → 1.7.115
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.
- package/bin/app/add/add-local/core/templates.d.ts +3 -3
- package/bin/app/add/add-local/core/templates.js +8 -8
- package/bin/app/add/cmd.js +2 -2
- package/bin/app/ai/ai-impl/ai-chat.d.ts +2 -2
- package/bin/app/ai/ai-impl/ai-types.d.ts +2 -2
- package/bin/app/ai/ai-impl/relinter/relinter.d.ts +2 -2
- package/bin/app/ai/ai-menu.d.ts +2 -2
- package/bin/app/ai/cmd.js +4 -4
- package/bin/app/better/auth/cmd.js +1 -6
- package/bin/app/build/build-library.d.ts +5 -4
- package/bin/app/build/build-regular.d.ts +4 -3
- package/bin/app/build/cmd.d.ts +10 -0
- package/bin/app/build/cmd.js +29 -12
- package/bin/app/build/impl.d.ts +3 -2
- package/bin/app/build/library-flow.d.ts +5 -4
- package/bin/app/build/postbuild.d.ts +2 -2
- package/bin/app/build/postbuild.js +0 -6
- package/bin/app/build/prebuild.d.ts +2 -2
- package/bin/app/build/prebuild.js +0 -6
- package/bin/app/build/regular-flow.d.ts +4 -3
- package/bin/app/check/cmd.js +2 -2
- package/bin/app/config/constants.d.ts +1 -1
- package/bin/app/config/constants.js +1 -1
- package/bin/app/config/content.d.ts +1 -1
- package/bin/app/config/content.js +2 -2
- package/bin/app/config/core-cfg.d.ts +5 -5
- package/bin/app/config/core-cfg.js +27 -16
- package/bin/app/config/create.d.ts +6 -5
- package/bin/app/config/create.js +13 -22
- package/bin/app/config/def-utils.d.ts +3 -3
- package/bin/app/config/def-utils.js +10 -8
- package/bin/app/config/detect.d.ts +4 -2
- package/bin/app/config/detect.js +36 -6
- package/bin/app/config/gen-cfg.js +4 -4
- package/bin/app/config/load.d.ts +2 -2
- package/bin/app/config/load.js +1 -1
- package/bin/app/config/migrate.d.ts +1 -1
- package/bin/app/config/migrate.js +7 -3
- package/bin/app/config/path.d.ts +1 -1
- package/bin/app/config/path.js +3 -3
- package/bin/app/config/prepare.d.ts +1 -1
- package/bin/app/config/prepare.js +83 -81
- package/bin/app/config/prompts.d.ts +1 -1
- package/bin/app/config/prompts.js +1 -1
- package/bin/app/config/read.d.ts +3 -3
- package/bin/app/config/read.js +13 -35
- package/bin/app/config/repair.d.ts +2 -2
- package/bin/app/config/repair.js +12 -12
- package/bin/app/config/unstable.d.ts +3 -3
- package/bin/app/config/unstable.js +2 -14
- package/bin/app/config/update.d.ts +3 -3
- package/bin/app/config/update.js +41 -48
- package/bin/app/env/env-impl.js +2 -2
- package/bin/app/init/cmd-2.js +2 -2
- package/bin/app/init/init-utils/init-utils.js +7 -7
- package/bin/app/init/init-utils/mm-deprecated/editor-menu.d.ts +3 -2
- package/bin/app/init/init-utils/mm-deprecated/editor-menu.js +1 -6
- package/bin/app/init/use-template/cp-impl.d.ts +5 -4
- package/bin/app/init/use-template/cp-mod.d.ts +3 -3
- package/bin/app/init/use-template/cp-mod.js +5 -5
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/compose-env-file/cef-impl.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/compose-env-file/cef-mod.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/deploy.d.ts +4 -3
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/gdp-mod.d.ts +5 -4
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/git.d.ts +6 -5
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/github.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.d.ts +2 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.js +6 -3
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.d.ts +3 -2
- package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.js +4 -4
- package/bin/app/invoke/cmd.js +2 -2
- package/bin/app/mrse/cmd.js +2 -2
- package/bin/app/mrse/mrse-impl.js +2 -2
- package/bin/app/providers/better-t-stack/types.d.ts +9 -9
- package/bin/app/providers/package.json +3 -0
- package/bin/app/providers/reliverse-stack/reliverse-stack-mod.js +2 -2
- package/bin/app/providers/reliverse-stack/rs-impl.d.ts +4 -4
- package/bin/app/pub/cmd.d.ts +10 -0
- package/bin/app/pub/cmd.js +27 -12
- package/bin/app/pub/impl.d.ts +3 -2
- package/bin/app/rempts/cmd.js +2 -2
- package/bin/app/rules/reliverse/dler-config-health/dler-config-health.d.ts +1 -1
- package/bin/app/rules/reliverse/dler-config-health/dler-config-health.js +1 -1
- package/bin/app/schema/cmd.js +3 -3
- package/bin/app/{config/reltypes-content.js → schema/gen.js} +474 -228
- package/bin/app/schema/mod.d.ts +1224 -0
- package/bin/app/schema/mod.js +329 -0
- package/bin/app/{config/reltypes-utils.js → schema/utils.js} +6 -3
- package/bin/app/toolbox/cmd.js +2 -2
- package/bin/app/toolbox/toolbox-impl.d.ts +3 -2
- package/bin/app/types/mod.d.ts +10 -1518
- package/bin/app/types/mod.js +0 -161
- package/bin/app/update/impl.d.ts +1 -0
- package/bin/app/update/impl.js +102 -1
- package/bin/app/utils/common.d.ts +3 -0
- package/bin/app/utils/common.js +28 -0
- package/bin/app/utils/decideHelper.d.ts +2 -2
- package/bin/app/utils/downloading/downloadRepo.d.ts +2 -2
- package/bin/app/utils/downloading/downloadRepo.js +3 -3
- package/bin/app/utils/downloading/handleDownload.d.ts +2 -2
- package/bin/app/utils/finalize.d.ts +2 -1
- package/bin/app/utils/handlers/handleCleanup.js +2 -2
- package/bin/app/utils/handlers/handleCodemods.d.ts +2 -2
- package/bin/app/utils/projectRepository.d.ts +3 -4
- package/bin/app/utils/prompts/askUsernameFrontend.d.ts +2 -2
- package/bin/app/utils/prompts/askUsernameFrontend.js +3 -3
- package/bin/app/utils/resolve-cross-libs.js +2 -2
- package/bin/app/utils/startEndPrompts.d.ts +8 -2
- package/bin/app/utils/startEndPrompts.js +43 -12
- package/bin/app/utils/utils-build.d.ts +2 -2
- package/bin/app/utils/utils-clean.d.ts +1 -1
- package/bin/app/utils/utils-deps.d.ts +2 -2
- package/bin/app/utils/utils-determine.d.ts +1 -1
- package/bin/app/utils/utils-jsr-json.d.ts +2 -2
- package/bin/app/utils/utils-package-json-libraries.d.ts +3 -3
- package/bin/app/utils/utils-package-json-regular.d.ts +2 -2
- package/bin/dler.js +2 -92
- package/bin/mod.d.ts +431 -438
- package/bin/mod.js +36 -27
- package/package.json +12 -10
- package/bin/app/agg/cmd.d.ts +0 -72
- package/bin/app/agg/cmd.js +0 -128
- package/bin/app/cli/cmd.d.ts +0 -12
- package/bin/app/cli/cmd.js +0 -56
- package/bin/app/cli/impl.d.ts +0 -3
- package/bin/app/cli/impl.js +0 -88
- package/bin/app/config/default-cfg.d.ts +0 -3
- package/bin/app/config/default-cfg.js +0 -155
- package/bin/app/config/default.d.ts +0 -6
- package/bin/app/config/default.js +0 -159
- package/bin/app/config/schema.d.ts +0 -130
- package/bin/app/config/schema.js +0 -443
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.d.ts +0 -12
- package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.js +0 -69
- package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.d.ts +0 -2
- package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.js +0 -26
- package/bin/app/schema/schema-impl.d.ts +0 -2
- package/bin/app/schema/schema-impl.js +0 -24
- package/bin/app/update/cmd.d.ts +0 -103
- package/bin/app/update/cmd.js +0 -299
- package/bin/app/utils/native-cli/nc-impl.d.ts +0 -15
- package/bin/app/utils/native-cli/nc-impl.js +0 -154
- package/bin/app/utils/native-cli/nc-mod.d.ts +0 -3
- package/bin/app/utils/native-cli/nc-mod.js +0 -44
- package/bin/app/web/README.md +0 -149
- package/bin/app/web/cmd.d.ts +0 -2
- package/bin/app/web/cmd.js +0 -11
- package/bin/dler-go +0 -4
- package/bin/dler-rust +0 -4
- /package/bin/app/{config/reltypes-content.d.ts → schema/gen.d.ts} +0 -0
- /package/bin/app/{config/reltypes-utils.d.ts → schema/utils.d.ts} +0 -0
- /package/bin/app/utils/{hasOnlyRseConfig.d.ts → hasOnlyReliverseConfig.d.ts} +0 -0
- /package/bin/app/utils/{hasOnlyRseConfig.js → hasOnlyReliverseConfig.js} +0 -0
package/bin/app/config/create.js
CHANGED
|
@@ -2,7 +2,6 @@ import path from "@reliverse/pathkit";
|
|
|
2
2
|
import fs from "@reliverse/relifso";
|
|
3
3
|
import { relinka } from "@reliverse/relinka";
|
|
4
4
|
import { confirmPrompt } from "@reliverse/rempts";
|
|
5
|
-
import { Value } from "@sinclair/typebox/value";
|
|
6
5
|
import { execaCommand } from "execa";
|
|
7
6
|
async function addDevDependency(pkgName, opts) {
|
|
8
7
|
const pkgPath = path.join(opts.cwd, "package.json");
|
|
@@ -35,12 +34,10 @@ import {
|
|
|
35
34
|
rseName,
|
|
36
35
|
UNKNOWN_VALUE
|
|
37
36
|
} from "./constants.js";
|
|
38
|
-
import { generateDefaultRulesForProject,
|
|
39
|
-
import { DEFAULT_CONFIG_RSE } from "./default-cfg.js";
|
|
37
|
+
import { generateDefaultRulesForProject, getDefaultReliverseConfig } from "./def-utils.js";
|
|
40
38
|
import { detectFeatures, getPackageJson } from "./detect.js";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { rseSchema } from "./schema.js";
|
|
39
|
+
import { getReliverseConfigPath } from "./path.js";
|
|
40
|
+
import { readReliverseConfig } from "./read.js";
|
|
44
41
|
import {
|
|
45
42
|
atomicWriteFile,
|
|
46
43
|
cleanGitHubUrl,
|
|
@@ -48,7 +45,8 @@ import {
|
|
|
48
45
|
objectToCodeString,
|
|
49
46
|
updateTsConfigInclude
|
|
50
47
|
} from "./utils.js";
|
|
51
|
-
|
|
48
|
+
import { DEFAULT_CONFIG_RELIVERSE } from "../schema/mod.js";
|
|
49
|
+
export async function writeReliverseConfig(configPath, config, isDev, skipInstallPrompt = false) {
|
|
52
50
|
if (await fs.pathExists(configPath)) {
|
|
53
51
|
relinka("verbose", `Config file already exists at ${configPath}, skipping creation`);
|
|
54
52
|
return;
|
|
@@ -123,13 +121,6 @@ export default defineConfig(${objectLiteralWithComments});
|
|
|
123
121
|
throw error;
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
|
-
if (!Value.Check(rseSchema, config)) {
|
|
127
|
-
const issues = [...Value.Errors(rseSchema, config)].map(
|
|
128
|
-
(err) => `Path "${err.path}": ${err.message}`
|
|
129
|
-
);
|
|
130
|
-
relinka("error", "Invalid config:", issues.join("; "));
|
|
131
|
-
throw new Error(`Invalid config: ${issues.join("; ")}`);
|
|
132
|
-
}
|
|
133
124
|
let fileContent = JSON.stringify(config, null, 2);
|
|
134
125
|
fileContent = injectSectionComments(fileContent);
|
|
135
126
|
const { backupPath, tempPath } = getBackupAndTempPaths(configPath);
|
|
@@ -139,7 +130,7 @@ export default defineConfig(${objectLiteralWithComments});
|
|
|
139
130
|
await atomicWriteFile(configPath, fileContent, backupPath, tempPath);
|
|
140
131
|
relinka("verbose", "Config written successfully");
|
|
141
132
|
}
|
|
142
|
-
export async function
|
|
133
|
+
export async function createReliverseConfig(projectPath, githubUsername, isDev, overrides) {
|
|
143
134
|
const defaultRules = await generateDefaultRulesForProject(projectPath, isDev);
|
|
144
135
|
const effectiveProjectName = defaultRules?.projectName ?? path.basename(projectPath);
|
|
145
136
|
let effectiveAuthorName = defaultRules?.projectAuthor ?? UNKNOWN_VALUE;
|
|
@@ -147,7 +138,7 @@ export async function createRseConfig(projectPath, githubUsername, isDev, overri
|
|
|
147
138
|
if (effectiveAuthorName === "blefnk" && isDev) {
|
|
148
139
|
effectiveAuthorName = "reliverse";
|
|
149
140
|
}
|
|
150
|
-
await
|
|
141
|
+
await generateReliverseConfig({
|
|
151
142
|
projectName: effectiveProjectName,
|
|
152
143
|
frontendUsername: effectiveAuthorName,
|
|
153
144
|
deployService: "vercel",
|
|
@@ -162,7 +153,7 @@ export async function createRseConfig(projectPath, githubUsername, isDev, overri
|
|
|
162
153
|
defaultRules ? "Created config based on detected project settings." : "Created initial config. Please review and adjust as needed."
|
|
163
154
|
);
|
|
164
155
|
}
|
|
165
|
-
export async function
|
|
156
|
+
export async function generateReliverseConfig({
|
|
166
157
|
projectName,
|
|
167
158
|
frontendUsername,
|
|
168
159
|
deployService,
|
|
@@ -182,7 +173,7 @@ export async function generateRseConfig({
|
|
|
182
173
|
if (frontendUsername === "blefnk" && isDev) {
|
|
183
174
|
frontendUsername = "reliverse";
|
|
184
175
|
}
|
|
185
|
-
const defaultConfig = await
|
|
176
|
+
const defaultConfig = await getDefaultReliverseConfig(
|
|
186
177
|
projectPath,
|
|
187
178
|
isDev,
|
|
188
179
|
projectName,
|
|
@@ -243,18 +234,18 @@ export async function generateRseConfig({
|
|
|
243
234
|
if (customOutputPath && customFilename) {
|
|
244
235
|
effectiveConfigPath = path.join(customOutputPath, customFilename);
|
|
245
236
|
} else {
|
|
246
|
-
const configPathInfo = configInfo ?? await
|
|
237
|
+
const configPathInfo = configInfo ?? await getReliverseConfigPath(projectPath, isDev, skipInstallPrompt);
|
|
247
238
|
effectiveConfigPath = configPathInfo.configPath;
|
|
248
239
|
}
|
|
249
240
|
let existingContent = null;
|
|
250
241
|
if (!overwrite && await fs.pathExists(effectiveConfigPath)) {
|
|
251
242
|
try {
|
|
252
|
-
existingContent = await
|
|
243
|
+
existingContent = await readReliverseConfig(effectiveConfigPath, isDev);
|
|
253
244
|
} catch {
|
|
254
245
|
}
|
|
255
246
|
}
|
|
256
247
|
const effectiveConfig = {
|
|
257
|
-
...
|
|
248
|
+
...DEFAULT_CONFIG_RELIVERSE,
|
|
258
249
|
...existingContent,
|
|
259
250
|
...defaultConfig,
|
|
260
251
|
...overrides
|
|
@@ -262,5 +253,5 @@ export async function generateRseConfig({
|
|
|
262
253
|
if (isDev) {
|
|
263
254
|
effectiveConfig.$schema = RSE_SCHEMA_DEV;
|
|
264
255
|
}
|
|
265
|
-
await
|
|
256
|
+
await writeReliverseConfig(effectiveConfigPath, effectiveConfig, isDev, skipInstallPrompt);
|
|
266
257
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReliverseConfig } from "../schema/mod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Generating a Default Config and Merging with Detected Data
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function generateDefaultRulesForProject(projectPath: string, isDev: boolean): Promise<
|
|
5
|
+
export declare function getDefaultReliverseConfig(projectPath: string, isDev: boolean, projectName?: string, projectAuthor?: string): Promise<ReliverseConfig>;
|
|
6
|
+
export declare function generateDefaultRulesForProject(projectPath: string, isDev: boolean): Promise<ReliverseConfig | null>;
|
|
@@ -5,9 +5,9 @@ import { safeDestr } from "destr";
|
|
|
5
5
|
import { readPackageJSON } from "pkg-types";
|
|
6
6
|
import { getBiomeConfig } from "./biome.js";
|
|
7
7
|
import { cliDomainDocs, DEFAULT_DOMAIN, rseName, UNKNOWN_VALUE } from "./constants.js";
|
|
8
|
-
import { DEFAULT_CONFIG_RSE } from "./default-cfg.js";
|
|
9
8
|
import { detectFeatures, detectProjectFramework, getPackageJsonSafe } from "./detect.js";
|
|
10
|
-
|
|
9
|
+
import { DEFAULT_CONFIG_RELIVERSE } from "../schema/mod.js";
|
|
10
|
+
export async function getDefaultReliverseConfig(projectPath, isDev, projectName, projectAuthor) {
|
|
11
11
|
const packageJson = await getPackageJsonSafe(projectPath);
|
|
12
12
|
const effectiveProjectName = packageJson?.name ?? projectName ?? UNKNOWN_VALUE;
|
|
13
13
|
let effectiveAuthorName = typeof packageJson?.author === "object" ? packageJson.author?.name ?? projectAuthor : packageJson?.author ?? projectAuthor ?? UNKNOWN_VALUE;
|
|
@@ -29,7 +29,7 @@ export async function getDefaultRseConfig(projectPath, isDev, projectName, proje
|
|
|
29
29
|
}
|
|
30
30
|
const detectedProjectFramework = await detectProjectFramework(projectPath);
|
|
31
31
|
return {
|
|
32
|
-
...
|
|
32
|
+
...DEFAULT_CONFIG_RELIVERSE,
|
|
33
33
|
projectName: effectiveProjectName,
|
|
34
34
|
projectAuthor: effectiveAuthorName,
|
|
35
35
|
projectDescription: packageData.description ?? UNKNOWN_VALUE,
|
|
@@ -45,7 +45,7 @@ export async function getDefaultRseConfig(projectPath, isDev, projectName, proje
|
|
|
45
45
|
projectPackageManager: detectedPkgManager.packageManager,
|
|
46
46
|
projectRuntime: ["node", "deno", "bun"].includes(runtimeInfo?.name ?? "") ? runtimeInfo?.name : "node",
|
|
47
47
|
codeStyle: {
|
|
48
|
-
...
|
|
48
|
+
...DEFAULT_CONFIG_RELIVERSE.codeStyle,
|
|
49
49
|
lineWidth: biomeConfig?.lineWidth ?? 80,
|
|
50
50
|
indentSize: biomeConfig?.indentWidth ?? 2,
|
|
51
51
|
tabWidth: biomeConfig?.indentWidth ?? 2
|
|
@@ -62,15 +62,15 @@ export async function generateDefaultRulesForProject(projectPath, isDev) {
|
|
|
62
62
|
} catch {
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const rules = await
|
|
65
|
+
const rules = await getDefaultReliverseConfig(projectPath, isDev);
|
|
66
66
|
if (!projectCategory) {
|
|
67
67
|
rules.features = {
|
|
68
|
-
...
|
|
68
|
+
...DEFAULT_CONFIG_RELIVERSE.features,
|
|
69
69
|
language: ["typescript"],
|
|
70
70
|
themes: ["default"]
|
|
71
71
|
};
|
|
72
72
|
rules.preferredLibraries = {
|
|
73
|
-
...
|
|
73
|
+
...DEFAULT_CONFIG_RELIVERSE.preferredLibraries,
|
|
74
74
|
databaseLibrary: "drizzle",
|
|
75
75
|
authentication: "better-auth"
|
|
76
76
|
};
|
|
@@ -126,7 +126,9 @@ export async function generateDefaultRulesForProject(projectPath, isDev) {
|
|
|
126
126
|
const hasValibot = "valibot" in deps;
|
|
127
127
|
rules.features = await detectFeatures(projectPath, packageJson);
|
|
128
128
|
if (!rules.preferredLibraries) {
|
|
129
|
-
rules.preferredLibraries = {
|
|
129
|
+
rules.preferredLibraries = {
|
|
130
|
+
...DEFAULT_CONFIG_RELIVERSE.preferredLibraries
|
|
131
|
+
};
|
|
130
132
|
}
|
|
131
133
|
if (hasDrizzle) {
|
|
132
134
|
rules.preferredLibraries.databaseLibrary = "drizzle";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type PackageJson } from "pkg-types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProjectFramework } from "../schema/mod.js";
|
|
3
|
+
import type { DetectedProject } from "../types/mod.js";
|
|
4
|
+
export declare const PROJECT_FRAMEWORK_FILES: Record<ProjectFramework, string[]>;
|
|
3
5
|
export declare function detectProjectFramework(projectPath: string): Promise<ProjectFramework | null>;
|
|
4
6
|
export declare function getPackageJson(projectPath: string): Promise<PackageJson | null>;
|
|
5
7
|
export declare function getPackageJsonSafe(projectPath: string): Promise<PackageJson | null>;
|
|
6
8
|
export declare function detectProject(projectPath: string, isDev: boolean): Promise<DetectedProject | null>;
|
|
7
|
-
export declare function
|
|
9
|
+
export declare function detectProjectsWithReliverseConfig(projectPath: string, isDev: boolean): Promise<DetectedProject[]>;
|
|
8
10
|
export declare function detectFeatures(projectPath: string, packageJson: PackageJson | null): Promise<{
|
|
9
11
|
i18n: boolean;
|
|
10
12
|
analytics: boolean;
|
package/bin/app/config/detect.js
CHANGED
|
@@ -3,9 +3,39 @@ import fs from "@reliverse/relifso";
|
|
|
3
3
|
import { relinka } from "@reliverse/relinka";
|
|
4
4
|
import { readPackageJSON } from "pkg-types";
|
|
5
5
|
import { getProjectContent } from "./content.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { getReliverseConfigPath } from "./path.js";
|
|
7
|
+
import { readReliverseConfig } from "./read.js";
|
|
8
|
+
export const PROJECT_FRAMEWORK_FILES = {
|
|
9
|
+
unknown: [],
|
|
10
|
+
nextjs: ["next.config.js", "next.config.ts", "next.config.mjs"],
|
|
11
|
+
vite: ["vite.config.js", "vite.config.ts", "react.config.js"],
|
|
12
|
+
svelte: ["svelte.config.js", "svelte.config.ts"],
|
|
13
|
+
remix: ["remix.config.js", "remix.config.ts"],
|
|
14
|
+
astro: ["astro.config.js", "astro.config.ts", "astro.config.mjs"],
|
|
15
|
+
nuxt: ["nuxt.config.js", "nuxt.config.ts"],
|
|
16
|
+
solid: ["solid.config.js", "solid.config.ts"],
|
|
17
|
+
qwik: ["qwik.config.js", "qwik.config.ts"],
|
|
18
|
+
"react-native": ["App.js", "App.tsx", "App.ts"],
|
|
19
|
+
expo: ["app.json", "app.config.js"],
|
|
20
|
+
capacitor: ["capacitor.config.ts", "capacitor.config.json"],
|
|
21
|
+
ionic: ["ionic.config.json"],
|
|
22
|
+
electron: ["electron.config.js", "electron.config.ts"],
|
|
23
|
+
tauri: ["tauri.conf.json"],
|
|
24
|
+
neutralino: ["neutralino.config.json"],
|
|
25
|
+
rempts: ["package.json:@reliverse/rempts"],
|
|
26
|
+
citty: ["package.json:citty"],
|
|
27
|
+
commander: ["package.json:commander"],
|
|
28
|
+
cac: ["package.json:cac"],
|
|
29
|
+
meow: ["package.json:meow"],
|
|
30
|
+
yargs: ["package.json:yargs"],
|
|
31
|
+
vscode: ["vscode.config.js", "vscode.config.ts"],
|
|
32
|
+
webextension: ["manifest.json"],
|
|
33
|
+
"browser-extension": ["manifest.json"],
|
|
34
|
+
"npm-jsr": ["jsr.json", "jsr.jsonc"],
|
|
35
|
+
lynx: ["App.tsx", "App.css"],
|
|
36
|
+
vue: ["vue.config.js", "vite.config.ts"],
|
|
37
|
+
wxt: ["wxt.config.js", "wxt.config.ts"]
|
|
38
|
+
};
|
|
9
39
|
export async function detectProjectFramework(projectPath) {
|
|
10
40
|
const packageJson = await getPackageJson(projectPath);
|
|
11
41
|
if (!packageJson) {
|
|
@@ -74,9 +104,9 @@ export async function detectProject(projectPath, isDev) {
|
|
|
74
104
|
try {
|
|
75
105
|
const { requiredContent, optionalContent } = await getProjectContent(projectPath);
|
|
76
106
|
if (!requiredContent.filePackageJson) return null;
|
|
77
|
-
const { configPath } = await
|
|
107
|
+
const { configPath } = await getReliverseConfigPath(projectPath, isDev, false);
|
|
78
108
|
if (!await fs.pathExists(configPath)) return null;
|
|
79
|
-
const config = await
|
|
109
|
+
const config = await readReliverseConfig(configPath, isDev);
|
|
80
110
|
if (!config) return null;
|
|
81
111
|
return {
|
|
82
112
|
name: path.basename(projectPath),
|
|
@@ -93,7 +123,7 @@ export async function detectProject(projectPath, isDev) {
|
|
|
93
123
|
return null;
|
|
94
124
|
}
|
|
95
125
|
}
|
|
96
|
-
export async function
|
|
126
|
+
export async function detectProjectsWithReliverseConfig(projectPath, isDev) {
|
|
97
127
|
const detected = [];
|
|
98
128
|
const rootProject = await detectProject(projectPath, isDev);
|
|
99
129
|
if (rootProject) detected.push(rootProject);
|
|
@@ -4,8 +4,8 @@ import { relinka } from "@reliverse/relinka";
|
|
|
4
4
|
import { destr } from "destr";
|
|
5
5
|
import { execaCommand } from "execa";
|
|
6
6
|
import { CONFIG_CATEGORIES, UNKNOWN_VALUE } from "./constants.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { generateReliverseConfig } from "./create.js";
|
|
8
|
+
import { getReliverseConfigPath } from "./path.js";
|
|
9
9
|
async function generateBiomeConfig(projectPath) {
|
|
10
10
|
const biomePath = path.join(projectPath, "biome.json");
|
|
11
11
|
const biomeExists = await fs.pathExists(biomePath);
|
|
@@ -87,11 +87,11 @@ export async function generateConfigFiles(projectPath, overwrite, projectName, d
|
|
|
87
87
|
};
|
|
88
88
|
const cleanDomain = primaryDomain.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
89
89
|
const finalFrontendUsername = isDev && frontendUsername === "blefnk" ? "reliverse" : frontendUsername;
|
|
90
|
-
const configInfo = await
|
|
90
|
+
const configInfo = await getReliverseConfigPath(projectPath, isDev, false);
|
|
91
91
|
const mainConfigFileName = path.basename(configInfo.configPath);
|
|
92
92
|
const configGenerators = {
|
|
93
93
|
[mainConfigFileName]: async () => {
|
|
94
|
-
await
|
|
94
|
+
await generateReliverseConfig({
|
|
95
95
|
projectName,
|
|
96
96
|
frontendUsername: !finalFrontendUsername || finalFrontendUsername.trim() === "" ? UNKNOWN_VALUE : finalFrontendUsername,
|
|
97
97
|
deployService,
|
package/bin/app/config/load.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReliverseConfig } from "../schema/mod.js";
|
|
2
2
|
/**
|
|
3
3
|
* Searches for and loads the configuration file `reliverse.ts`.
|
|
4
4
|
* Falls back to default configuration if the file is not found.
|
|
5
5
|
* Uses jiti for seamless TypeScript and ESM support.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getConfigDler(): Promise<
|
|
7
|
+
export declare function getConfigDler(): Promise<ReliverseConfig>;
|
|
8
8
|
/**
|
|
9
9
|
* Searches for and loads bunfig.toml configuration files.
|
|
10
10
|
* Checks both local (project root) and global locations.
|
package/bin/app/config/load.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from "@reliverse/pathkit";
|
|
|
2
2
|
import fs from "@reliverse/relifso";
|
|
3
3
|
import { relinka } from "@reliverse/relinka";
|
|
4
4
|
import { createJiti } from "jiti";
|
|
5
|
-
import { defineConfig } from "
|
|
5
|
+
import { defineConfig } from "../schema/mod.js";
|
|
6
6
|
const CONFIG_FILENAME = "reliverse.ts";
|
|
7
7
|
export async function getConfigDler() {
|
|
8
8
|
const cwd = process.cwd();
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Migrates an external rseg file into the current project config.
|
|
3
3
|
* Only migrates fields that exist in the current schema.
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function migrateReliverseConfig(externalrseth: string, projectPath: string, isDev: boolean): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "@reliverse/relifso";
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
3
|
import { parseJSONC } from "confbox";
|
|
4
|
-
import {
|
|
5
|
-
export async function
|
|
4
|
+
import { updateReliverseConfig } from "./update.js";
|
|
5
|
+
export async function migrateReliverseConfig(externalrseth, projectPath, isDev) {
|
|
6
6
|
try {
|
|
7
7
|
const content = await fs.readFile(externalrseth, "utf-8");
|
|
8
8
|
const parsed = parseJSONC(content);
|
|
@@ -44,7 +44,11 @@ export async function migrateRseConfig(externalrseth, projectPath, isDev) {
|
|
|
44
44
|
migratedFields.push(String(key));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const success = await
|
|
47
|
+
const success = await updateReliverseConfig(
|
|
48
|
+
projectPath,
|
|
49
|
+
validConfig,
|
|
50
|
+
isDev
|
|
51
|
+
);
|
|
48
52
|
if (success) {
|
|
49
53
|
relinka("success", "Successfully migrated config");
|
|
50
54
|
relinka("verbose", "Migrated fields:", migratedFields.join(", "));
|
package/bin/app/config/path.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - Honors a custom tsconfig.json path if provided.
|
|
6
6
|
* - Caches results by projectPath.
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function getReliverseConfigPath(projectPath: string, isDev: boolean, skipPrompt: boolean, customTsconfigPath?: string): Promise<{
|
|
9
9
|
configPath: string;
|
|
10
10
|
isTS: boolean;
|
|
11
11
|
}>;
|
package/bin/app/config/path.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from "@reliverse/pathkit";
|
|
2
2
|
import fs from "@reliverse/relifso";
|
|
3
3
|
import { tsconfigJson } from "./constants.js";
|
|
4
|
-
import {
|
|
4
|
+
import { askReliverseConfigType } from "./prompts.js";
|
|
5
5
|
const configPathCache = /* @__PURE__ */ new Map();
|
|
6
|
-
export async function
|
|
6
|
+
export async function getReliverseConfigPath(projectPath, isDev, skipPrompt, customTsconfigPath) {
|
|
7
7
|
const cached = configPathCache.get(projectPath);
|
|
8
8
|
if (cached) {
|
|
9
9
|
return cached;
|
|
@@ -23,7 +23,7 @@ export async function getRseConfigPath(projectPath, isDev, skipPrompt, customTsc
|
|
|
23
23
|
} else if (tsExists) {
|
|
24
24
|
result = { configPath: rseTs, isTS: true };
|
|
25
25
|
} else if (tsconfigExists && !jsoncExists && !skipPrompt) {
|
|
26
|
-
const choice = await
|
|
26
|
+
const choice = await askReliverseConfigType();
|
|
27
27
|
result = choice === "ts" ? { configPath: rseTs, isTS: true } : { configPath: rseJsonc, isTS: false };
|
|
28
28
|
} else {
|
|
29
29
|
result = { configPath: rseJsonc, isTS: false };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type ConfigKind = "ts" | "jsonc";
|
|
2
2
|
export declare function ensureReliverseConfig(isDev: boolean, configKind?: ConfigKind): Promise<void>;
|
|
3
|
-
export declare function prepareReliverseEnvironment(isDev: boolean, configKind?: ConfigKind): Promise<void>;
|
|
3
|
+
export declare function prepareReliverseEnvironment(cwd: string, isDev: boolean, configKind?: ConfigKind): Promise<void>;
|