create-rari-app 0.1.3 → 0.1.4
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/dist/index.js +16 -9
- package/package.json +1 -1
- package/templates/default/gitignore +48 -0
- package/templates/default/railway.toml +14 -0
- package/templates/default/railway.json +0 -20
package/dist/index.js
CHANGED
|
@@ -18,7 +18,6 @@ const packageManagers = {
|
|
|
18
18
|
bun: "bun"
|
|
19
19
|
};
|
|
20
20
|
async function main() {
|
|
21
|
-
console.clear();
|
|
22
21
|
intro(pc.bgCyan(pc.black(" create-rari-app ")));
|
|
23
22
|
const projectName = await text({
|
|
24
23
|
message: "What is your project named?",
|
|
@@ -72,12 +71,12 @@ async function main() {
|
|
|
72
71
|
};
|
|
73
72
|
await createProject(options);
|
|
74
73
|
outro(pc.green("🎉 Project created successfully!"));
|
|
75
|
-
console.
|
|
76
|
-
console.
|
|
77
|
-
console.
|
|
78
|
-
if (!options.installDeps) console.
|
|
79
|
-
console.
|
|
80
|
-
console.
|
|
74
|
+
console.warn();
|
|
75
|
+
console.warn(pc.cyan("Next steps:"));
|
|
76
|
+
console.warn(pc.gray(` cd ${options.name}`));
|
|
77
|
+
if (!options.installDeps) console.warn(pc.gray(` ${options.packageManager} install`));
|
|
78
|
+
console.warn(pc.gray(` ${options.packageManager} run dev`));
|
|
79
|
+
console.warn();
|
|
81
80
|
}
|
|
82
81
|
async function createProject(options) {
|
|
83
82
|
const projectPath = join(process.cwd(), options.name);
|
|
@@ -106,19 +105,27 @@ async function copyTemplate(templatePath, projectPath, options) {
|
|
|
106
105
|
"tsconfig.app.json",
|
|
107
106
|
"tsconfig.node.json",
|
|
108
107
|
"index.html",
|
|
108
|
+
"README.md",
|
|
109
|
+
"railway.toml",
|
|
110
|
+
"render.yaml",
|
|
109
111
|
"src/main.tsx",
|
|
110
112
|
"src/App.tsx",
|
|
111
113
|
"src/vite-env.d.ts",
|
|
112
114
|
"src/styles/index.css",
|
|
113
115
|
"src/components/Welcome.tsx",
|
|
114
116
|
"src/components/ServerTime.tsx",
|
|
115
|
-
".
|
|
117
|
+
"src/pages/index.tsx",
|
|
118
|
+
"src/pages/about.tsx",
|
|
119
|
+
"src/pages/examples.tsx",
|
|
120
|
+
"gitignore"
|
|
116
121
|
];
|
|
117
122
|
await mkdir(join(projectPath, "src", "components"), { recursive: true });
|
|
118
123
|
await mkdir(join(projectPath, "src", "styles"), { recursive: true });
|
|
124
|
+
await mkdir(join(projectPath, "src", "pages"), { recursive: true });
|
|
119
125
|
for (const file of templateFiles) {
|
|
120
126
|
const sourcePath = join(templatePath, file);
|
|
121
|
-
const
|
|
127
|
+
const destFile = file === "gitignore" ? ".gitignore" : file;
|
|
128
|
+
const destPath = join(projectPath, destFile);
|
|
122
129
|
try {
|
|
123
130
|
let content = await readFile(sourcePath, "utf-8");
|
|
124
131
|
content = content.replace(/\{\{PROJECT_NAME\}\}/g, options.name).replace(/\{\{PACKAGE_MANAGER\}\}/g, options.packageManager);
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
.pnpm-store/
|
|
4
|
+
|
|
5
|
+
# Production builds
|
|
6
|
+
bin/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
|
|
10
|
+
# Environment variables
|
|
11
|
+
.env
|
|
12
|
+
.env.local
|
|
13
|
+
.env.development.local
|
|
14
|
+
.env.test.local
|
|
15
|
+
.env.production.local
|
|
16
|
+
|
|
17
|
+
# Logs
|
|
18
|
+
npm-debug.log*
|
|
19
|
+
yarn-debug.log*
|
|
20
|
+
yarn-error.log*
|
|
21
|
+
pnpm-debug.log*
|
|
22
|
+
lerna-debug.log*
|
|
23
|
+
|
|
24
|
+
# Editor directories and files
|
|
25
|
+
.vscode/*
|
|
26
|
+
!.vscode/extensions.json
|
|
27
|
+
.idea
|
|
28
|
+
.DS_Store
|
|
29
|
+
*.suo
|
|
30
|
+
*.ntvs*
|
|
31
|
+
*.njsproj
|
|
32
|
+
*.sln
|
|
33
|
+
*.sw?
|
|
34
|
+
|
|
35
|
+
# TypeScript
|
|
36
|
+
*.tsbuildinfo
|
|
37
|
+
|
|
38
|
+
# OS generated files
|
|
39
|
+
Thumbs.db
|
|
40
|
+
|
|
41
|
+
# Rari generated files
|
|
42
|
+
.rari/
|
|
43
|
+
|
|
44
|
+
# Railway
|
|
45
|
+
.railway/
|
|
46
|
+
|
|
47
|
+
# Render
|
|
48
|
+
.render/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[build]
|
|
2
|
+
builder = "NIXPACKS"
|
|
3
|
+
buildCommand = "pnpm run build"
|
|
4
|
+
nixpacksPlan = { phases = { setup = { nixPkgs = [
|
|
5
|
+
"nodejs_20",
|
|
6
|
+
"pnpm"
|
|
7
|
+
] } } }
|
|
8
|
+
|
|
9
|
+
[deploy]
|
|
10
|
+
startCommand = "pnpm start"
|
|
11
|
+
healthcheckPath = "/"
|
|
12
|
+
healthcheckTimeout = 300
|
|
13
|
+
restartPolicyType = "ON_FAILURE"
|
|
14
|
+
restartPolicyMaxRetries = 3
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://railway.app/railway.schema.json",
|
|
3
|
-
"build": {
|
|
4
|
-
"builder": "NIXPACKS"
|
|
5
|
-
},
|
|
6
|
-
"deploy": {
|
|
7
|
-
"startCommand": "npm start",
|
|
8
|
-
"healthcheckPath": "/",
|
|
9
|
-
"healthcheckTimeout": 300,
|
|
10
|
-
"restartPolicyType": "ALWAYS"
|
|
11
|
-
},
|
|
12
|
-
"environments": {
|
|
13
|
-
"production": {
|
|
14
|
-
"variables": {
|
|
15
|
-
"NODE_ENV": "production",
|
|
16
|
-
"RUST_LOG": "info"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|