create-rari-app 0.3.6 → 0.3.8

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.mjs CHANGED
@@ -5,8 +5,39 @@ import { dirname, join } from "node:path";
5
5
  import process from "node:process";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { cancel, confirm, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
8
- import pc from "picocolors";
9
8
 
9
+ //#region src/utils/colors.ts
10
+ const isColorSupported = !(process.env.NO_COLOR || process.argv.includes("--no-color")) && (process.env.FORCE_COLOR || process.argv.includes("--color") || process.platform === "win32" || process.stdout?.isTTY && process.env.TERM !== "dumb" || process.env.CI);
11
+ function formatter(open, close, replace = open) {
12
+ return (input) => {
13
+ const string = String(input);
14
+ const index = string.indexOf(close, open.length);
15
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
16
+ };
17
+ }
18
+ function replaceClose(string, close, replace, index) {
19
+ let result = "";
20
+ let cursor = 0;
21
+ do {
22
+ result += string.substring(cursor, index) + replace;
23
+ cursor = index + close.length;
24
+ index = string.indexOf(close, cursor);
25
+ } while (~index);
26
+ return result + string.substring(cursor);
27
+ }
28
+ const f = isColorSupported ? formatter : () => String;
29
+ const colors = {
30
+ isColorSupported,
31
+ black: f("\x1B[30m", "\x1B[39m"),
32
+ red: f("\x1B[31m", "\x1B[39m"),
33
+ green: f("\x1B[32m", "\x1B[39m"),
34
+ cyan: f("\x1B[36m", "\x1B[39m"),
35
+ gray: f("\x1B[90m", "\x1B[39m"),
36
+ bgCyan: f("\x1B[46m", "\x1B[49m")
37
+ };
38
+ var colors_default = colors;
39
+
40
+ //#endregion
10
41
  //#region src/index.ts
11
42
  const templates = { default: {
12
43
  name: "Default",
@@ -19,19 +50,32 @@ const packageManagers = {
19
50
  bun: "bun"
20
51
  };
21
52
  async function main() {
22
- intro(pc.bgCyan(pc.black(" create-rari-app ")));
23
- const projectName = await text({
24
- message: "What is your project named?",
25
- placeholder: "my-rari-app",
26
- validate: (value) => {
27
- if (!value) return "Please enter a project name.";
28
- if (value.includes(" ")) return "Project name cannot contain spaces.";
29
- if (!/^[\w-]+$/.test(value)) return "Project name can only contain letters, numbers, hyphens, and underscores.";
53
+ intro(colors_default.bgCyan(colors_default.black(" create-rari-app ")));
54
+ let projectName = process.argv.slice(2)[0];
55
+ if (projectName) {
56
+ if (projectName.includes(" ")) {
57
+ console.error(colors_default.red("Error: Project name cannot contain spaces."));
58
+ process.exit(1);
30
59
  }
31
- });
32
- if (isCancel(projectName)) {
33
- cancel("Operation cancelled.");
34
- process.exit(0);
60
+ if (!/^[@\w/-]+$/.test(projectName)) {
61
+ console.error(colors_default.red("Error: Project name can only contain letters, numbers, hyphens, underscores, slashes, and @ symbol."));
62
+ process.exit(1);
63
+ }
64
+ } else {
65
+ const promptedName = await text({
66
+ message: "What is your project named?",
67
+ placeholder: "my-rari-app",
68
+ validate: (value) => {
69
+ if (!value) return "Please enter a project name.";
70
+ if (value.includes(" ")) return "Project name cannot contain spaces.";
71
+ if (!/^[@\w/-]+$/.test(value)) return "Project name can only contain letters, numbers, hyphens, underscores, slashes, and @ symbol.";
72
+ }
73
+ });
74
+ if (isCancel(promptedName)) {
75
+ cancel("Operation cancelled.");
76
+ process.exit(0);
77
+ }
78
+ projectName = promptedName;
35
79
  }
36
80
  const template = await select({
37
81
  message: "Which template would you like to use?",
@@ -71,12 +115,12 @@ async function main() {
71
115
  installDeps
72
116
  };
73
117
  await createProject(options);
74
- outro(pc.green("🎉 Project created successfully!"));
118
+ outro(colors_default.green("🎉 Project created successfully!"));
75
119
  console.warn();
76
- console.warn(pc.cyan("Next steps:"));
77
- console.warn(pc.gray(` cd ${options.name}`));
78
- if (!options.installDeps) console.warn(pc.gray(` ${options.packageManager} install`));
79
- console.warn(pc.gray(` ${options.packageManager} run dev`));
120
+ console.warn(colors_default.cyan("Next steps:"));
121
+ console.warn(colors_default.gray(` cd ${options.name}`));
122
+ if (!options.installDeps) console.warn(colors_default.gray(` ${options.packageManager} install`));
123
+ console.warn(colors_default.gray(` ${options.packageManager} run dev`));
80
124
  console.warn();
81
125
  }
82
126
  async function createProject(options) {
@@ -105,14 +149,13 @@ async function copyTemplate(templatePath, projectPath, options) {
105
149
  "tsconfig.json",
106
150
  "index.html",
107
151
  "README.md",
108
- "railway.toml",
109
- "render.yaml",
110
152
  "src/app/globals.css",
111
153
  "src/app/layout.tsx",
112
154
  "src/app/page.tsx",
113
155
  "src/app/about/page.tsx",
114
156
  "src/components/Welcome.tsx",
115
157
  "src/components/ServerTime.tsx",
158
+ "src/components/Rari.tsx",
116
159
  "gitignore"
117
160
  ];
118
161
  await mkdir(join(projectPath, "src", "app", "about"), { recursive: true });
@@ -144,7 +187,7 @@ async function installDependencies(projectPath, packageManager) {
144
187
  });
145
188
  }
146
189
  main().catch((error) => {
147
- console.error(pc.red("Error:"), error.message);
190
+ console.error(colors_default.red("Error:"), error.message);
148
191
  process.exit(1);
149
192
  });
150
193
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-rari-app",
3
3
  "type": "module",
4
- "version": "0.3.6",
4
+ "version": "0.3.8",
5
5
  "description": "Create Runtime Accelerated Rendering Infrastructure (rari) applications with no build configuration",
6
6
  "author": "Ryan Skinner",
7
7
  "license": "MIT",
@@ -46,12 +46,11 @@
46
46
  "lint:fix": "oxlint --fix"
47
47
  },
48
48
  "dependencies": {
49
- "@clack/prompts": "^0.11.0",
50
- "picocolors": "^1.1.1"
49
+ "@clack/prompts": "^0.11.0"
51
50
  },
52
51
  "devDependencies": {
53
- "@types/node": "^25.0.9",
54
- "@typescript/native-preview": "^7.0.0-dev.20260120.1",
52
+ "@types/node": "^25.0.10",
53
+ "@typescript/native-preview": "^7.0.0-dev.20260123.3",
55
54
  "oxlint": "^1.41.0",
56
55
  "tsdown": "^0.18.4"
57
56
  }
@@ -8,10 +8,9 @@
8
8
  "node": ">=20.0.0"
9
9
  },
10
10
  "scripts": {
11
- "build": "{{PACKAGE_MANAGER}} run clean && {{PACKAGE_MANAGER}} run typecheck && vite build",
12
- "dev": "vite",
13
- "predev": "{{PACKAGE_MANAGER}} run build",
14
- "start": "NODE_ENV=production rari start",
11
+ "build": "rari build",
12
+ "dev": "rari dev",
13
+ "start": "rari start",
15
14
  "deploy:railway": "rari deploy railway",
16
15
  "deploy:render": "rari deploy render",
17
16
  "clean": "rm -rf dist",
@@ -24,10 +23,10 @@
24
23
  },
25
24
  "devDependencies": {
26
25
  "@tailwindcss/vite": "^4.1.18",
27
- "@types/node": "^25.0.9",
26
+ "@types/node": "^25.0.10",
28
27
  "@types/react": "^19.2.9",
29
28
  "@types/react-dom": "^19.2.3",
30
- "@typescript/native-preview": "^7.0.0-dev.20260120.1",
29
+ "@typescript/native-preview": "^7.0.0-dev.20260123.3",
31
30
  "rolldown-vite": "^7.3.1",
32
31
  "tailwindcss": "^4.1.18"
33
32
  }
@@ -0,0 +1,23 @@
1
+ import type { SVGProps } from 'react'
2
+
3
+ export default function Rari(props: SVGProps<SVGSVGElement>) {
4
+ return (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="437"
8
+ height="145"
9
+ fill="none"
10
+ viewBox="0 0 437 145"
11
+ {...props}
12
+ >
13
+ <g>
14
+ <g fill="currentColor">
15
+ <path d="m436.808 0-5.6 24.6h-46.2l5.6-24.6zm-8.2 35.2-24.4 106h-46.2l24.6-106z"></path>
16
+ <path d="m370.705 33-9.6 41.6q-7.8-2.2-15.6-2.2-12.801 0-19.2 6.4-2.601 2.6-4.8 8.2-3 8.4-13 54.2h-46.2l24.4-106h46l-3.8 16.6q4.8-5.6 7.6-8 12.399-11.4 27-11.4 3.6 0 7.2.6"></path>
17
+ <path d="M253.303 64.8q0 7.4-2.6 18.6l-9.2 40q-1 3.6-1 7.6 0 1.4 2.2 10.2h-49.4q-.6-5.6.2-11.8-10.8 5.8-12.2 6.6-17.8 8.4-39.8 8.4-8.6 0-15.4-1.6a45 45 0 0 1-6.8-2.2q-3.4-1.4-8.8-4.6-5.2-3.4-8.6-9.2-3.2-6-3.2-13.8 0-5 1.6-9.8 4.6-13 16.8-19.2 2.4-1.2 5.4-2.2 3-1.2 6.6-1.8 3.8-.8 6.8-1.4 3.2-.6 7.8-1 4.6-.6 7.2-.8 2.8-.4 7.8-.6t6.8-.2q2-.2 6.8-.4 5-.2 5.8-.2 4.4-.2 13.4-.4 9-.4 13.4-.6.8-5.8-1.4-9.2-4-6.6-20.2-6.6-14.8 0-20.2 3.8-1.6 1.2-4.2 5.4h-45.6q4.6-12.4 8.2-16.8 5.2-6.4 13.6-10.6t19-5.8 18.2-2q7.6-.6 17.8-.6 37.6 0 51.2 8.6 12 7.6 12 24.2m-53 29.4q-16.8-1-32.2 1.4-11 1.6-15.2 4-5.2 2.6-5.2 7.6 0 2.2 1.8 4.8 3.8 4.6 13 4.6 23.8 0 34-14.4 2-2.6 3.8-8"></path>
18
+ <path d="m108.4 33-9.6 41.6q-7.8-2.2-15.6-2.2-12.8 0-19.2 6.4-2.6 2.6-4.8 8.2-3 8.4-13 54.2H0l24.4-106h46l-3.8 16.6q4.8-5.6 7.6-8 12.4-11.4 27-11.4 3.6 0 7.2.6"></path>
19
+ </g>
20
+ </g>
21
+ </svg>
22
+ )
23
+ }
@@ -1,6 +1,11 @@
1
+ import Rari from './Rari'
2
+
1
3
  export default function Welcome() {
2
4
  return (
3
5
  <div className="bg-white rounded-xl p-8 shadow-sm">
6
+ <div className="flex items-center gap-4 mb-6">
7
+ <Rari className="w-32 h-auto text-gray-900" />
8
+ </div>
4
9
  <h2 className="text-2xl font-semibold mb-4 text-gray-900">
5
10
  🎉 Welcome to rari!
6
11
  </h2>
@@ -1,9 +0,0 @@
1
- [build]
2
- builder = "RAILPACK"
3
-
4
- [deploy]
5
- startCommand = "pnpm start"
6
- healthcheckPath = "/"
7
- healthcheckTimeout = 300
8
- restartPolicyType = "ON_FAILURE"
9
- restartPolicyMaxRetries = 3
@@ -1,14 +0,0 @@
1
- services:
2
- - type: web
3
- name: '{{PROJECT_NAME}}'
4
- runtime: node
5
- env: node
6
- plan: free
7
- buildCommand: '{{INSTALL_COMMAND}}'
8
- startCommand: '{{PACKAGE_MANAGER}} run start'
9
- healthCheckPath: /
10
- envVars:
11
- - key: NODE_ENV
12
- value: production
13
- - key: RUST_LOG
14
- value: info