Skip to content

Commit 0e47cd0

Browse files
committed
fix scaffolding using default flow and config
1 parent 29e44b1 commit 0e47cd0

File tree

144 files changed

+1458
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+1458
-711
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dist-npm/
44
.DS_Store
55
merged.txt
66
.eslintcache
7-
.cursorrules
87
node_modules/
98
addons/premium/
109
addons/**/premium/

.reliverse

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"ignoreDependencies": [],
6262

6363
// Config revalidation (1h | 1d | 2d | 7d)
64-
"configLastRevalidate": "2024-12-25T13:06:12.128Z",
64+
"configLastRevalidate": "2024-12-29T20:57:03.697Z",
6565
"configRevalidateFrequency": "2d",
6666

6767
// Custom rules for Reliverse AI

build.optim.ts

+28-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ const npmFilesToDelete: string[] = [
2727
"types/internal.d.ts",
2828
"**/*.temp.js",
2929
"**/*.temp.d.ts",
30-
"**/*.txt",
3130
];
3231

33-
const jsrFilesToDelete: string[] = ["**/*.test.ts", "**/*.temp.ts", "**/*.txt"];
32+
const jsrFilesToDelete: string[] = ["**/*.test.ts", "**/*.temp.ts"];
3433

3534
/**
3635
* Deletes files matching the provided patterns within the base directory.
@@ -241,6 +240,31 @@ async function copySrcToOutput(): Promise<void> {
241240
}
242241
}
243242

243+
/**
244+
* Renames all .tsx files to -tsx.txt in the specified directory and its subdirectories.
245+
* @param dir - The directory to process.
246+
*/
247+
async function renameTsxFiles(dir: string): Promise<void> {
248+
try {
249+
const files = await globby("**/*.tsx", {
250+
cwd: dir,
251+
absolute: true,
252+
});
253+
254+
for (const filePath of files) {
255+
const newPath = filePath.replace(/\.tsx$/, "-tsx.txt");
256+
await fs.rename(filePath, newPath);
257+
relinka("info-verbose", `Renamed: ${filePath} -> ${newPath}`);
258+
}
259+
} catch (error) {
260+
relinka(
261+
"error",
262+
"Error renaming .tsx files:",
263+
error instanceof Error ? error.message : String(error),
264+
);
265+
}
266+
}
267+
244268
/**
245269
* Optimizes the build for production by processing files and deleting unnecessary ones.
246270
* @param dir - The directory to optimize.
@@ -256,6 +280,8 @@ async function optimizeBuildForProduction(dir: string): Promise<void> {
256280
await copySrcToOutput();
257281
relinka("info", "Processing copied files to replace import paths...");
258282
await processFiles(outputDir); // Process files after copying
283+
relinka("info", "Renaming .tsx files to -tsx.txt for JSR compatibility...");
284+
await renameTsxFiles(outputDir);
259285
} else {
260286
relinka("info", "Creating an optimized production build...");
261287
await processFiles(dir);

bun.lockb

22 KB
Binary file not shown.

cspell.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"version": "0.2",
33
"language": "en",
4-
"import": [
5-
"@cspell/dict-npm/cspell-ext.json"
6-
],
74
"ignorePaths": [
85
"**/*.lock",
96
"**/*.txt",
@@ -46,6 +43,7 @@
4643
"continuar",
4744
"cristal",
4845
"cronvel",
46+
"crossplatform",
4947
"datepart",
5048
"dateparts",
5149
"deafult",
@@ -99,6 +97,7 @@
9997
"mkdist",
10098
"Mkey",
10199
"montag",
100+
"moonrepo",
102101
"Nazar",
103102
"Nazarii",
104103
"nenc",
@@ -149,6 +148,7 @@
149148
"termkit",
150149
"tseslint",
151150
"Tully",
151+
"turborepo",
152152
"turso",
153153
"typebox",
154154
"typecheck",
@@ -164,6 +164,7 @@
164164
"valign",
165165
"venv",
166166
"versator",
167+
"VITE",
167168
"Vous",
168169
"vsprintf",
169170
"Whoo",

jsr.jsonc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reliverse/cli",
3-
"version": "1.4.3",
3+
"version": "1.4.8",
44
"author": "blefnk",
55
"license": "MIT",
66
"exports": "./dist-jsr/main.ts",
@@ -34,4 +34,4 @@
3434
"tests-runtime/**"
3535
]
3636
}
37-
}
37+
}

package.json

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reliverse/cli",
3-
"version": "1.4.3",
3+
"version": "1.4.8",
44
"author": "blefnk",
55
"type": "module",
66
"description": "This superapp CLI tool can help you easily create new web projects, manage existing projects, and automatically make advanced codebase modifications, with more features coming soon.",
@@ -44,9 +44,17 @@
4444
"url": "https://github.com/reliverse/cli/issues",
4545
"email": "[email protected]"
4646
},
47-
"files": ["package.json", "README.md", "LICENSE.md", "dist-npm"],
47+
"files": [
48+
"package.json",
49+
"README.md",
50+
"LICENSE.md",
51+
"dist-npm"
52+
],
4853
"homepage": "https://github.com/reliverse/cli",
49-
"keywords": ["cli", "reliverse"],
54+
"keywords": [
55+
"cli",
56+
"reliverse"
57+
],
5058
"license": "MIT",
5159
"dependencies": {
5260
"@clack/core": "^0.4.0",
@@ -71,8 +79,8 @@
7179
"drizzle-orm": "^0.38.3",
7280
"execa": "^9.5.2",
7381
"fs-extra": "^11.2.0",
82+
"geist": "^1.3.1",
7483
"globby": "^14.0.2",
75-
"gradient-string": "^3.0.0",
7684
"magic-regexp": "^0.8.0",
7785
"nanoid": "^5.0.9",
7886
"node-emoji": "^2.2.0",
@@ -104,6 +112,7 @@
104112
"@planetscale/database": "^1.19.0",
105113
"@prisma/adapter-planetscale": "^6.1.0",
106114
"@prisma/client": "^6.1.0",
115+
"@react-router/dev": "^7.1.1",
107116
"@stylistic/eslint-plugin": "^2.12.1",
108117
"@swc/core": "^1.10.3",
109118
"@t3-oss/env-nextjs": "^0.11.1",
@@ -118,7 +127,6 @@
118127
"@types/cross-spawn": "^6.0.6",
119128
"@types/eslint__js": "^8.42.3",
120129
"@types/fs-extra": "^11.0.4",
121-
"@types/gradient-string": "^1.1.6",
122130
"@types/node": "^22.10.2",
123131
"@types/react": "^19.0.2",
124132
"@types/react-dom": "^19.0.2",
@@ -152,4 +160,4 @@
152160
"vitest": "^2.1.8",
153161
"zod": "^3.24.1"
154162
}
155-
}
163+
}

src/app/db/constants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import path from "pathe";
2+
import { fileURLToPath } from "url";
23

34
export const isVerboseEnabled = false;
45

6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
58
export const PKG_ROOT = path.resolve(__dirname, "../../../..");
69

710
// File conflict settings, useful for prompting user to resolve conflicts during project setup

src/app/menu/askGithubName.ts

+43-29
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,56 @@
11
import { inputPrompt } from "@reliverse/prompts";
2-
import pc from "picocolors";
32

43
import {
54
readReliverseMemory,
65
updateReliverseMemory,
76
} from "~/args/memory/impl.js";
7+
import { relinka } from "~/utils/console.js";
88

9-
export async function askGithubName(): Promise<string> {
10-
const memory = await readReliverseMemory();
9+
export async function askGithubName(): Promise<string | null> {
10+
try {
11+
const memory = await readReliverseMemory();
12+
if (!memory) {
13+
relinka("error", "Failed to read reliverse memory");
14+
return null;
15+
}
1116

12-
let placeholder = "";
13-
let content = "";
17+
if (memory.githubUsername && memory.githubUsername !== "") {
18+
return memory.githubUsername;
19+
}
1420

15-
if (memory.githubUsername) {
16-
placeholder = memory.githubUsername;
17-
content = `Last used GitHub username: ${pc.cyanBright(placeholder)}`;
18-
}
21+
const ghUsername = await inputPrompt({
22+
title: "What's your GitHub username?",
23+
content:
24+
"💡 If you don't have a GitHub account, you can create one for free at https://github.com/signup",
25+
validate: (value: string | undefined) => {
26+
if (!value?.trim()) {
27+
return "GitHub username is required for deployment";
28+
}
29+
if (!/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i.test(value)) {
30+
return "Invalid GitHub username format";
31+
}
32+
return true;
33+
},
34+
});
1935

20-
const githubUsername = await inputPrompt({
21-
title: "What's your GitHub username?",
22-
placeholder,
23-
content,
24-
validate: (value: string | undefined) => {
25-
if (!value?.trim()) {
26-
return "GitHub username is required for deployment";
27-
}
28-
if (!/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i.test(value)) {
29-
return "Invalid GitHub username format";
30-
}
31-
return true;
32-
},
33-
});
36+
if (ghUsername !== "" && ghUsername !== memory.githubUsername) {
37+
await updateReliverseMemory({
38+
githubUsername: ghUsername,
39+
});
40+
} else {
41+
relinka(
42+
"error",
43+
"Something went wrong while saving your GitHub username...",
44+
);
45+
}
3446

35-
if (githubUsername && githubUsername !== placeholder) {
36-
await updateReliverseMemory({
37-
githubUsername,
38-
});
47+
return ghUsername;
48+
} catch (error) {
49+
relinka(
50+
"error",
51+
"Failed to get GitHub username:",
52+
error instanceof Error ? error.message : String(error),
53+
);
54+
return null;
3955
}
40-
41-
return githubUsername;
4256
}

src/app/menu/askVercelName.ts

+17-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { inputPrompt } from "@reliverse/prompts";
2-
import pc from "picocolors";
32

43
import {
54
readReliverseMemory,
@@ -10,33 +9,31 @@ export async function askVercelName(): Promise<string> {
109
const memory = await readReliverseMemory();
1110

1211
let placeholder = "";
13-
let content = "";
1412

1513
if (memory.vercelUsername) {
1614
placeholder = memory.vercelUsername;
17-
content = `Last used Vercel username: ${pc.cyanBright(placeholder)}`;
1815
}
1916

20-
const vercelUsername = await inputPrompt({
21-
title: "What's your Vercel team name?",
22-
placeholder,
23-
content,
24-
validate: (value: string): string | boolean => {
25-
if (!value?.trim()) {
26-
return "Vercel username is required for deployment";
27-
}
28-
if (!/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i.test(value)) {
29-
return "Invalid Vercel username format";
30-
}
31-
return true;
32-
},
33-
});
17+
if (placeholder === "") {
18+
placeholder = await inputPrompt({
19+
title: "What's your Vercel team name?",
20+
validate: (value: string): string | boolean => {
21+
if (!value?.trim()) {
22+
return "Vercel username is required for deployment";
23+
}
24+
if (!/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i.test(value)) {
25+
return "Invalid Vercel username format";
26+
}
27+
return true;
28+
},
29+
});
30+
}
3431

35-
if (vercelUsername && vercelUsername !== placeholder) {
32+
if (placeholder !== "" && placeholder !== memory.vercelUsername) {
3633
await updateReliverseMemory({
37-
vercelUsername,
34+
vercelUsername: placeholder,
3835
});
3936
}
4037

41-
return vercelUsername;
38+
return placeholder;
4239
}

src/app/menu/buildBrandNewThing.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ export async function buildBrandNewThing(
273273
title: "Should I continue with advanced or simple mode?",
274274
options: [
275275
{
276-
label: "Advanced",
276+
label: pc.bold(pc.greenBright("Advanced")),
277277
value: "recommended",
278-
hint: pc.greenBright("✨ recommended"),
278+
hint: pc.greenBright(pc.reset("✨ STABLE & RECOMMENDED")),
279279
},
280280
{
281-
label: "Simple",
281+
label: pc.dim(pc.red("Simple")),
282282
value: "offline",
283-
hint: pc.redBright("🚨 experimental, offline"),
283+
hint: pc.red("🚨 experimental, offline"),
284284
},
285285
],
286286
});

src/app/menu/compose-env-file/mod.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { selectPrompt, inputPrompt, confirmPrompt } from "@reliverse/prompts";
22
import { execa } from "execa";
33
import fs from "fs-extra";
44
import open from "open";
5-
import pc from "picocolors";
65

76
import { relinka } from "~/utils/console.js";
87

@@ -81,8 +80,8 @@ export async function composeEnvFile(
8180
"Please provide the path to your existing .env file or directory:",
8281
placeholder:
8382
process.platform === "win32"
84-
? `Enter the path (e.g. ${pc.cyanBright("C:\\Users\\name\\project\\.env")} or ${pc.cyanBright("C:\\Users\\name\\project")})`
85-
: `Enter the path (e.g. ${pc.cyanBright("/home/user/project/.env")} or ${pc.cyanBright("/home/user/project")})`,
83+
? `Enter the path (e.g. "C:\\Users\\name\\project\\.env" or "C:\\Users\\name\\project"`
84+
: `Enter the path (e.g. "/home/user/project/.env" or "/home/user/project"`,
8685
content:
8786
"You can provide either the .env file path or the directory containing it.",
8887
contentColor: "yellowBright",

0 commit comments

Comments
 (0)