create-rakta-app 0.1.9 → 0.2.0

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 CHANGED
@@ -1686,7 +1686,7 @@ var STARTER_AUDIO_CODE = `let audioContext: AudioContext | null = null;
1686
1686
  function getAudioContext(): AudioContext | null {
1687
1687
  if (typeof window === "undefined") return null;
1688
1688
 
1689
- const AudioContextCtor = window.AudioContext ?? window.webkitAudioContext;
1689
+ const AudioContextCtor = window.AudioContext;
1690
1690
  if (!AudioContextCtor) return null;
1691
1691
 
1692
1692
  audioContext ??= new AudioContextCtor();
@@ -1882,9 +1882,10 @@ export default function CoralObstacle({
1882
1882
  }
1883
1883
  `;
1884
1884
  var STARTER_PAGE_CODE = `import { useCallback, useEffect, useRef, useState } from "react";
1885
+ import type { IconType } from "react-icons";
1885
1886
  import {
1886
1887
  LuActivity,
1887
- LuCode2,
1888
+ LuCode,
1888
1889
  LuCpu,
1889
1890
  LuGauge,
1890
1891
  LuRocket,
@@ -1898,6 +1899,8 @@ import { playJumpSound, playScoreSound } from "./utils/audio";
1898
1899
 
1899
1900
  type GameStatus = "IDLE" | "SWIMMING" | "JUMPING" | "DEAD";
1900
1901
  type SimSpeed = "NORMAL" | "FAST" | "TURBO";
1902
+ type StatusCard = { title: string; text: string; Icon: IconType };
1903
+ type FeatureCard = { number: string; title: string; text: string; Icon: IconType };
1901
1904
 
1902
1905
  const GAME_WIDTH = 720;
1903
1906
  const GAME_HEIGHT = 280;
@@ -1912,6 +1915,18 @@ function getSpeedValue(speed: SimSpeed): number {
1912
1915
  return 5.2;
1913
1916
  }
1914
1917
 
1918
+ const statusCards: StatusCard[] = [
1919
+ { title: "Routing", text: "File-based routes with fast client navigation", Icon: LuZap },
1920
+ { title: "Metadata", text: "Default title, favicon, and SEO shell included", Icon: LuShieldCheck },
1921
+ { title: "Runtime", text: "Bun-powered dev server on localhost:3000", Icon: LuCpu },
1922
+ ];
1923
+
1924
+ const featureCards: FeatureCard[] = [
1925
+ { number: "01", title: "HOT RELOAD", text: "Pages, components, styles, layouts, stores, and route updates refresh immediately.", Icon: LuActivity },
1926
+ { number: "02", title: "REACT ICONS", text: "Starter icons use react-icons/lu only. No lucide-react dependency ships.", Icon: LuCode },
1927
+ { number: "03", title: "LOCAL FIRST", text: "The CLI prints and serves localhost:3000 for the frontend starter.", Icon: LuGauge },
1928
+ ];
1929
+
1915
1930
  export default function WelcomePage() {
1916
1931
  const [status, setStatus] = useState<GameStatus>("IDLE");
1917
1932
  const [score, setScore] = useState(0);
@@ -2070,10 +2085,10 @@ export default function WelcomePage() {
2070
2085
  const obstaclePos = "BOTTOM" as const;
2071
2086
 
2072
2087
  return (
2073
- <div className="min-h-screen bg-[#050505] text-white">
2088
+ <div className="rakta-welcome min-h-screen bg-[#050505] text-white">
2074
2089
  <div className="scanline" />
2075
- <main className="mx-auto flex w-full max-w-7xl flex-col gap-10 px-6 py-8 md:px-10">
2076
- <nav className="flex items-center justify-between border-b border-surface-stroke pb-5">
2090
+ <main className="rakta-shell mx-auto flex w-full max-w-7xl flex-col gap-10 px-6 py-8 md:px-10">
2091
+ <nav className="rakta-nav flex items-center justify-between border-b border-surface-stroke pb-5">
2077
2092
  <div className="flex items-center gap-3 font-mono text-sm font-extrabold tracking-tight">
2078
2093
  <span className="grid h-8 w-8 place-items-center border border-brand-pink bg-brand-pink text-black">
2079
2094
  R
@@ -2087,7 +2102,7 @@ export default function WelcomePage() {
2087
2102
  </div>
2088
2103
  </nav>
2089
2104
 
2090
- <section className="grid min-h-[540px] items-center gap-10 border-b border-surface-stroke py-12 md:grid-cols-[1.08fr_0.92fr]">
2105
+ <section className="rakta-hero grid min-h-[540px] items-center gap-10 border-b border-surface-stroke py-12 md:grid-cols-[1.08fr_0.92fr]">
2091
2106
  <div>
2092
2107
  <p className="mb-5 font-mono text-[11px] font-bold uppercase tracking-[0.32em] text-brand-pink">
2093
2108
  THE RED ROUTER FRAMEWORK
@@ -2099,7 +2114,7 @@ export default function WelcomePage() {
2099
2114
  Rakta.js is ready. React, Bun, file routes, hot reload, metadata, favicon,
2100
2115
  and the ShrimpRun starter are already wired for your first route.
2101
2116
  </p>
2102
- <div className="mt-8 flex flex-wrap gap-3">
2117
+ <div className="rakta-actions mt-8 flex flex-wrap gap-3">
2103
2118
  <a
2104
2119
  href="#shrimprun"
2105
2120
  className="inline-flex h-11 items-center gap-2 border border-brand-pink bg-brand-pink px-5 font-mono text-xs font-extrabold uppercase text-white transition hover:bg-white hover:text-black"
@@ -2111,19 +2126,15 @@ export default function WelcomePage() {
2111
2126
  href="#start"
2112
2127
  className="inline-flex h-11 items-center gap-2 border border-surface-stroke px-5 font-mono text-xs font-extrabold uppercase text-white transition hover:border-white"
2113
2128
  >
2114
- <LuCode2 className="h-4 w-4" />
2129
+ <LuCode className="h-4 w-4" />
2115
2130
  Start Building
2116
2131
  </a>
2117
2132
  </div>
2118
2133
  </div>
2119
2134
 
2120
- <div className="grid gap-3 border border-surface-stroke bg-surface-card p-5">
2121
- {[
2122
- ["Routing", "File-based routes with fast client navigation", LuZap],
2123
- ["Metadata", "Default title, favicon, and SEO shell included", LuShieldCheck],
2124
- ["Runtime", "Bun-powered dev server on localhost:3000", LuCpu],
2125
- ].map(([title, text, Icon]) => (
2126
- <div key={String(title)} className="flex gap-4 border border-white/5 bg-black p-4">
2135
+ <div className="rakta-status-grid grid gap-3 border border-surface-stroke bg-surface-card p-5">
2136
+ {statusCards.map(({ title, text, Icon }) => (
2137
+ <div key={title} className="flex gap-4 border border-white/5 bg-black p-4">
2127
2138
  <Icon className="mt-1 h-5 w-5 text-brand-pink" />
2128
2139
  <div>
2129
2140
  <h2 className="font-mono text-xs font-extrabold uppercase">{title}</h2>
@@ -2134,13 +2145,9 @@ export default function WelcomePage() {
2134
2145
  </div>
2135
2146
  </section>
2136
2147
 
2137
- <section id="features" className="grid grid-cols-1 gap-0 border border-surface-stroke md:grid-cols-3">
2138
- {[
2139
- ["01", "HOT RELOAD", "Pages, components, styles, layouts, stores, and route updates refresh immediately.", LuActivity],
2140
- ["02", "REACT ICONS", "Starter icons use react-icons/lu only. No lucide-react dependency ships.", LuCode2],
2141
- ["03", "LOCAL FIRST", "The CLI prints and serves localhost:3000 for the frontend starter.", LuGauge],
2142
- ].map(([number, title, text, Icon]) => (
2143
- <div key={String(title)} className="border-b border-surface-stroke p-7 md:border-b-0 md:border-r last:md:border-r-0">
2148
+ <section id="features" className="rakta-feature-grid grid grid-cols-1 gap-0 border border-surface-stroke md:grid-cols-3">
2149
+ {featureCards.map(({ number, title, text, Icon }) => (
2150
+ <div key={title} className="border-b border-surface-stroke p-7 md:border-b-0 md:border-r last:md:border-r-0">
2144
2151
  <span className="font-mono text-[10px] font-bold text-brand-pink">{number}</span>
2145
2152
  <Icon className="my-8 h-6 w-6 text-white" />
2146
2153
  <h2 className="font-mono text-xl font-extrabold uppercase">{title}</h2>
@@ -2149,7 +2156,7 @@ export default function WelcomePage() {
2149
2156
  ))}
2150
2157
  </section>
2151
2158
 
2152
- <section id="shrimprun" className="grid gap-5">
2159
+ <section id="shrimprun" className="rakta-game-section grid gap-5">
2153
2160
  <div>
2154
2161
  <p className="font-mono text-[10px] font-bold uppercase tracking-[0.28em] text-brand-pink">
2155
2162
  SHRIMPRUN SIMULATION
@@ -2162,7 +2169,7 @@ export default function WelcomePage() {
2162
2169
  <button
2163
2170
  type="button"
2164
2171
  onClick={jump}
2165
- className="relative h-[280px] overflow-hidden border-2 border-surface-stroke bg-black text-left outline-none transition focus-visible:border-brand-pink"
2172
+ className="rakta-game-field relative h-[280px] overflow-hidden border-2 border-surface-stroke bg-black text-left outline-none transition focus-visible:border-brand-pink"
2166
2173
  aria-label="ShrimpRun game area. Press Space or click to jump."
2167
2174
  >
2168
2175
  <div className="bg-grid-glow absolute inset-0 opacity-80" />
@@ -2210,7 +2217,7 @@ export default function WelcomePage() {
2210
2217
  )}
2211
2218
  </button>
2212
2219
 
2213
- <div className="flex flex-col justify-between gap-4 font-mono text-[10px] text-zinc-500 md:flex-row md:items-center">
2220
+ <div className="rakta-game-controls flex flex-col justify-between gap-4 font-mono text-[10px] text-zinc-500 md:flex-row md:items-center">
2214
2221
  <div className="flex flex-wrap items-center gap-3">
2215
2222
  <span className="font-extrabold text-white">SHRIMPRUN {aestheticUnit.replace("-", " ")}</span>
2216
2223
  <span>CORAL:</span>
@@ -2269,7 +2276,7 @@ export default function WelcomePage() {
2269
2276
  )}
2270
2277
  </section>
2271
2278
 
2272
- <section id="start" className="border-t border-surface-stroke py-10">
2279
+ <section id="start" className="rakta-start border-t border-surface-stroke py-10">
2273
2280
  <p className="font-mono text-[10px] font-bold uppercase tracking-[0.28em] text-brand-pink">
2274
2281
  NEXT MOVE
2275
2282
  </p>
@@ -2449,7 +2456,7 @@ function getFrontendOnlyFiles(projectConfig) {
2449
2456
  ...useTypeScript ? { typecheck: "tsc --noEmit" } : {}
2450
2457
  },
2451
2458
  dependencies: {
2452
- raktajs: "^0.1.9",
2459
+ raktajs: "^0.2.0",
2453
2460
  react: "^19.2.7",
2454
2461
  "react-dom": "^19.2.7",
2455
2462
  "react-icons": "^5.7.0",
@@ -2577,7 +2584,7 @@ function getFullstackFrontendFiles(projectConfig) {
2577
2584
  typecheck: "tsc --noEmit"
2578
2585
  },
2579
2586
  dependencies: {
2580
- raktajs: "^0.1.9",
2587
+ raktajs: "^0.2.0",
2581
2588
  react: "^19.2.7",
2582
2589
  "react-dom": "^19.2.7",
2583
2590
  ...getCssDependencies(cssFramework)
@@ -2894,13 +2901,13 @@ export type UserSchema = typeof userSchema;
2894
2901
  ];
2895
2902
  }
2896
2903
  function stripTypeScriptSyntax(code) {
2897
- return code.replace(/^import\s+type\s+.+;\r?\n/gm, "").replace(/^export\s+interface\s+\w+\s*\{[\s\S]*?\r?\n\}\r?\n/gm, "").replace(/^interface\s+\w+\s*\{[\s\S]*?\r?\n\}\r?\n/gm, "").replace(/^export\s+type\s+\w+\s*=[\s\S]*?;\r?\n/gm, "").replace(/^type\s+\w+\s*=[\s\S]*?;\r?\n/gm, "").replace(/<("[^"]+"|'[^']+'|\w+)(\s*\|\s*("[^"]+"|'[^']+'|\w+))*\s*>/g, "").replace(/\s+as\s+const/g, "").replace(/\s+as\s+[A-Za-z0-9_<>,[\]\s|&".']+/g, "").replace(/\breadonly\s+/g, "").replace(/(\(|,|\{)\s*([A-Za-z_$][\w$]*)\s*:\s*[A-Za-z_$][\w$]*(?:\[\])?(?:\s*\|\s*[A-Za-z_$][\w$]*(?:\[\])?)*/g, "$1 $2").replace(/\)\s*:\s*(?:void|string|number|boolean|Promise<[^>]+>|[A-Za-z_$][\w$]*(?:\[\])?)/g, ")").replace(/(const|let)\s+([A-Za-z_$][\w$]*)\s*:\s*[^=;]+=/g, "$1 $2 =");
2904
+ return code.replace(/^import\s+type\s+.+;\r?\n/gm, "").replace(/^export\s+interface\s+\w+\s*\{[\s\S]*?\r?\n\}\r?\n/gm, "").replace(/^interface\s+\w+\s*\{[\s\S]*?\r?\n\}\r?\n/gm, "").replace(/^export\s+type\s+\w+\s*=[\s\S]*?;\r?\n/gm, "").replace(/^type\s+\w+\s*=[\s\S]*?;\r?\n/gm, "").replace(/<("[^"]+"|'[^']+'|\w+)(\s*\|\s*("[^"]+"|'[^']+'|\w+))*\s*>/g, "").replace(/\s+as\s+const/g, "").replace(/\s+as\s+[A-Za-z0-9_<>,[\]\s|&".']+/g, "").replace(/\breadonly\s+/g, "").replace(/(\(|,)\s*([A-Za-z_$][\w$]*)\s*:\s*[A-Za-z_$][\w$]*(?:\[\])?(?:\s*\|\s*[A-Za-z_$][\w$]*(?:\[\])?)*/g, "$1 $2").replace(/\)\s*:\s*(?:void|string|number|boolean|Promise<[^>]+>|[A-Za-z_$][\w$]*(?:\[\])?)/g, ")").replace(/\)\s*:\s*[^({=>]+(?=\s*\{)/g, ")").replace(/\}\s*:\s*[A-Za-z_$][\w$]*(?=\s*\))/g, "}").replace(/(const|let)\s+([A-Za-z_$][\w$]*)\s*:\s*[^=;]+=/g, "$1 $2 =");
2898
2905
  }
2899
2906
  function processFilesForLanguage(files, useTypeScript) {
2900
2907
  if (useTypeScript) {
2901
2908
  return files;
2902
2909
  }
2903
- return files.filter((file) => !file.path.endsWith(".d.ts")).map((file) => {
2910
+ return files.filter((file) => !file.path.endsWith(".d.ts") && !file.path.endsWith("types.ts") && !file.path.endsWith("types.js")).map((file) => {
2904
2911
  if (typeof file.content !== "string") {
2905
2912
  return file;
2906
2913
  }
@@ -3379,6 +3386,146 @@ button, a { font: inherit; }
3379
3386
  a { color: inherit; text-decoration: none; }
3380
3387
  #rakta-root { min-height: 100vh; }
3381
3388
 
3389
+ .rakta-welcome {
3390
+ min-height: 100vh;
3391
+ background: #050505;
3392
+ color: #fafafa;
3393
+ }
3394
+ .rakta-shell {
3395
+ width: min(100% - 32px, 1280px);
3396
+ margin: 0 auto;
3397
+ padding: 32px 0;
3398
+ }
3399
+ .rakta-nav {
3400
+ display: flex;
3401
+ align-items: center;
3402
+ justify-content: space-between;
3403
+ border-bottom: 1px solid #1f1f1f;
3404
+ padding-bottom: 20px;
3405
+ }
3406
+ .rakta-hero {
3407
+ display: grid;
3408
+ min-height: 540px;
3409
+ grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
3410
+ align-items: center;
3411
+ gap: 40px;
3412
+ border-bottom: 1px solid #1f1f1f;
3413
+ padding: 48px 0;
3414
+ }
3415
+ .rakta-hero h1 {
3416
+ max-width: 900px;
3417
+ margin: 0;
3418
+ color: #fff;
3419
+ font-size: clamp(3.5rem, 8vw, 6rem);
3420
+ font-weight: 900;
3421
+ line-height: 0.88;
3422
+ letter-spacing: 0;
3423
+ text-transform: uppercase;
3424
+ }
3425
+ .rakta-hero p,
3426
+ .rakta-start p {
3427
+ color: #b5b5b5;
3428
+ }
3429
+ .rakta-actions {
3430
+ display: flex;
3431
+ flex-wrap: wrap;
3432
+ gap: 12px;
3433
+ margin-top: 32px;
3434
+ }
3435
+ .rakta-actions a {
3436
+ display: inline-flex;
3437
+ height: 44px;
3438
+ align-items: center;
3439
+ gap: 8px;
3440
+ border: 1px solid #e11d48;
3441
+ padding: 0 20px;
3442
+ font-family: var(--font-mono);
3443
+ font-size: 12px;
3444
+ font-weight: 800;
3445
+ text-transform: uppercase;
3446
+ }
3447
+ .rakta-actions a:first-child {
3448
+ background: #e11d48;
3449
+ color: #fff;
3450
+ }
3451
+ .rakta-status-grid,
3452
+ .rakta-feature-grid {
3453
+ display: grid;
3454
+ gap: 12px;
3455
+ border: 1px solid #1f1f1f;
3456
+ background: #0d0d0d;
3457
+ padding: 20px;
3458
+ }
3459
+ .rakta-status-grid > div,
3460
+ .rakta-feature-grid > div {
3461
+ border: 1px solid rgba(255, 255, 255, 0.06);
3462
+ background: #000;
3463
+ padding: 16px;
3464
+ }
3465
+ .rakta-feature-grid {
3466
+ grid-template-columns: repeat(3, minmax(0, 1fr));
3467
+ gap: 0;
3468
+ padding: 0;
3469
+ }
3470
+ .rakta-feature-grid > div {
3471
+ min-height: 220px;
3472
+ border-color: #1f1f1f;
3473
+ padding: 28px;
3474
+ }
3475
+ .rakta-game-section {
3476
+ display: grid;
3477
+ gap: 20px;
3478
+ }
3479
+ .rakta-game-section h2,
3480
+ .rakta-start h2 {
3481
+ margin: 12px 0 0;
3482
+ font-size: clamp(2.25rem, 6vw, 4rem);
3483
+ font-weight: 900;
3484
+ line-height: 0.95;
3485
+ text-transform: uppercase;
3486
+ }
3487
+ .rakta-game-field {
3488
+ position: relative;
3489
+ display: block;
3490
+ width: 100%;
3491
+ height: 280px;
3492
+ overflow: hidden;
3493
+ border: 2px solid #1f1f1f;
3494
+ background: #000;
3495
+ color: inherit;
3496
+ cursor: pointer;
3497
+ }
3498
+ .rakta-game-controls {
3499
+ display: flex;
3500
+ flex-wrap: wrap;
3501
+ align-items: center;
3502
+ justify-content: space-between;
3503
+ gap: 16px;
3504
+ font-family: var(--font-mono);
3505
+ font-size: 10px;
3506
+ color: #71717a;
3507
+ }
3508
+ .rakta-game-controls button {
3509
+ border: 1px solid #1f1f1f;
3510
+ padding: 4px 8px;
3511
+ color: #a1a1aa;
3512
+ cursor: pointer;
3513
+ }
3514
+ .rakta-start {
3515
+ border-top: 1px solid #1f1f1f;
3516
+ padding: 40px 0;
3517
+ }
3518
+
3519
+ @media (max-width: 768px) {
3520
+ .rakta-hero,
3521
+ .rakta-feature-grid {
3522
+ grid-template-columns: 1fr;
3523
+ }
3524
+ .rakta-nav > div:last-child {
3525
+ display: none;
3526
+ }
3527
+ }
3528
+
3382
3529
  ::-webkit-scrollbar { width: 6px; height: 6px; }
3383
3530
  ::-webkit-scrollbar-track { background: #000000; }
3384
3531
  ::-webkit-scrollbar-thumb { background: #e11d48; border-radius: 0; }
@@ -4168,4 +4315,4 @@ Error: ${errorMessage}
4168
4315
  process.exit(1);
4169
4316
  });
4170
4317
 
4171
- //# debugId=AC42DEC47A292C4F64756E2164756E21
4318
+ //# debugId=F17FA4C670BBE80264756E2164756E21