create-rakta-app 0.1.3 → 0.1.5
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/assets/favicon.ico +0 -0
- package/dist/index.js +339 -8
- package/dist/index.js.map +6 -6
- package/package.json +2 -1
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -1654,7 +1654,7 @@ function ensureDirectory(dirPath) {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
function writeFile(absolutePath, fileContent) {
|
|
1656
1656
|
ensureDirectory(dirname(absolutePath));
|
|
1657
|
-
writeFileSync(absolutePath, fileContent
|
|
1657
|
+
writeFileSync(absolutePath, fileContent);
|
|
1658
1658
|
}
|
|
1659
1659
|
function writeProjectFiles(projectRoot, generatedFiles) {
|
|
1660
1660
|
for (const projectFile of generatedFiles) {
|
|
@@ -1663,6 +1663,9 @@ function writeProjectFiles(projectRoot, generatedFiles) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
|
|
1666
|
+
// src/generator.ts
|
|
1667
|
+
import { readFileSync } from "fs";
|
|
1668
|
+
|
|
1666
1669
|
// src/types.ts
|
|
1667
1670
|
var CSS_DISPLAY = {
|
|
1668
1671
|
tailwind: "Tailwind CSS",
|
|
@@ -1702,6 +1705,8 @@ var PROJECT_MODE_DISPLAY = {
|
|
|
1702
1705
|
};
|
|
1703
1706
|
|
|
1704
1707
|
// src/generator.ts
|
|
1708
|
+
var DEFAULT_METADATA_TITLE = "Rakta.js | Small in size. Fierce in speed. Alive in every route";
|
|
1709
|
+
var FAVICON_BYTES = readFileSync(new URL("../assets/favicon.ico", import.meta.url));
|
|
1705
1710
|
function getRootFiles(projectConfig) {
|
|
1706
1711
|
const { projectName, projectMode } = projectConfig;
|
|
1707
1712
|
const workspaces = projectMode === "fullstack" ? ["frontend", "backend", "shared"] : [];
|
|
@@ -1814,7 +1819,7 @@ function getFrontendOnlyFiles(projectConfig) {
|
|
|
1814
1819
|
typecheck: "tsc --noEmit"
|
|
1815
1820
|
},
|
|
1816
1821
|
dependencies: {
|
|
1817
|
-
raktajs: "^0.1.
|
|
1822
|
+
raktajs: "^0.1.5",
|
|
1818
1823
|
react: "^19.2.7",
|
|
1819
1824
|
"react-dom": "^19.2.7",
|
|
1820
1825
|
...getCssDependencies(cssFramework)
|
|
@@ -1856,6 +1861,10 @@ function getFrontendOnlyFiles(projectConfig) {
|
|
|
1856
1861
|
|
|
1857
1862
|
export default defineRaktaConfig({
|
|
1858
1863
|
appName: "${projectName}",
|
|
1864
|
+
seo: {
|
|
1865
|
+
defaultTitle: "${DEFAULT_METADATA_TITLE}",
|
|
1866
|
+
defaultDescription: "Built with Rakta.js \u2014 Small in size. Fierce in speed. Alive in every route.",
|
|
1867
|
+
},
|
|
1859
1868
|
render: {
|
|
1860
1869
|
defaultMode: "csr",
|
|
1861
1870
|
routes: {},
|
|
@@ -1898,6 +1907,10 @@ export default defineRaktaConfig({
|
|
|
1898
1907
|
{
|
|
1899
1908
|
path: "public/.gitkeep",
|
|
1900
1909
|
content: ""
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
path: "public/favicon.ico",
|
|
1913
|
+
content: FAVICON_BYTES
|
|
1901
1914
|
}
|
|
1902
1915
|
];
|
|
1903
1916
|
}
|
|
@@ -1921,7 +1934,7 @@ function getFullstackFrontendFiles(projectConfig) {
|
|
|
1921
1934
|
typecheck: "tsc --noEmit"
|
|
1922
1935
|
},
|
|
1923
1936
|
dependencies: {
|
|
1924
|
-
|
|
1937
|
+
raktajs: "^0.1.5",
|
|
1925
1938
|
react: "^19.2.7",
|
|
1926
1939
|
"react-dom": "^19.2.7",
|
|
1927
1940
|
...getCssDependencies(cssFramework)
|
|
@@ -1959,6 +1972,10 @@ function getFullstackFrontendFiles(projectConfig) {
|
|
|
1959
1972
|
|
|
1960
1973
|
export default defineRaktaConfig({
|
|
1961
1974
|
appName: "${projectName}",
|
|
1975
|
+
seo: {
|
|
1976
|
+
defaultTitle: "${DEFAULT_METADATA_TITLE}",
|
|
1977
|
+
defaultDescription: "Built with Rakta.js \u2014 Small in size. Fierce in speed. Alive in every route.",
|
|
1978
|
+
},
|
|
1962
1979
|
render: {
|
|
1963
1980
|
defaultMode: "csr",
|
|
1964
1981
|
routes: {
|
|
@@ -2219,6 +2236,10 @@ export type UserSchema = typeof userSchema;
|
|
|
2219
2236
|
path: "frontend/public/.gitkeep",
|
|
2220
2237
|
content: ""
|
|
2221
2238
|
},
|
|
2239
|
+
{
|
|
2240
|
+
path: "frontend/public/favicon.ico",
|
|
2241
|
+
content: FAVICON_BYTES
|
|
2242
|
+
},
|
|
2222
2243
|
{
|
|
2223
2244
|
path: "frontend/components/ui/.gitkeep",
|
|
2224
2245
|
content: ""
|
|
@@ -2701,6 +2722,306 @@ body {
|
|
|
2701
2722
|
transform: translateY(2px);
|
|
2702
2723
|
}
|
|
2703
2724
|
}
|
|
2725
|
+
|
|
2726
|
+
#rakta-root {
|
|
2727
|
+
min-height: 100vh;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
main {
|
|
2731
|
+
width: min(1120px, calc(100% - 32px));
|
|
2732
|
+
min-height: 100vh;
|
|
2733
|
+
margin: 0 auto;
|
|
2734
|
+
padding: 56px 0;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
section {
|
|
2738
|
+
margin: 0 0 24px;
|
|
2739
|
+
border: 1px solid rgba(248, 113, 113, 0.18);
|
|
2740
|
+
border-radius: 18px;
|
|
2741
|
+
background:
|
|
2742
|
+
linear-gradient(135deg, rgba(220, 38, 38, 0.16), transparent 34%),
|
|
2743
|
+
#0e111a;
|
|
2744
|
+
box-shadow: 0 24px 80px rgba(127, 29, 29, 0.2);
|
|
2745
|
+
padding: clamp(24px, 4vw, 44px);
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
p {
|
|
2749
|
+
margin: 0 0 12px;
|
|
2750
|
+
color: #cbd5e1;
|
|
2751
|
+
line-height: 1.7;
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
h1,
|
|
2755
|
+
h2 {
|
|
2756
|
+
margin: 0 0 12px;
|
|
2757
|
+
color: #ffffff;
|
|
2758
|
+
line-height: 1;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
h1 {
|
|
2762
|
+
max-width: 760px;
|
|
2763
|
+
font-size: clamp(42px, 8vw, 84px);
|
|
2764
|
+
letter-spacing: 0;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
h2 {
|
|
2768
|
+
font-size: clamp(28px, 4vw, 44px);
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
click {
|
|
2772
|
+
display: inline-flex;
|
|
2773
|
+
align-items: center;
|
|
2774
|
+
justify-content: center;
|
|
2775
|
+
min-height: 42px;
|
|
2776
|
+
margin: 16px 12px 0 0;
|
|
2777
|
+
border: 1px solid rgba(248, 113, 113, 0.42);
|
|
2778
|
+
border-radius: 12px;
|
|
2779
|
+
padding: 0 16px;
|
|
2780
|
+
color: #fecaca;
|
|
2781
|
+
font-weight: 700;
|
|
2782
|
+
text-decoration: none;
|
|
2783
|
+
cursor: pointer;
|
|
2784
|
+
transition:
|
|
2785
|
+
transform 160ms ease,
|
|
2786
|
+
border-color 160ms ease,
|
|
2787
|
+
background 160ms ease;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
click:hover {
|
|
2791
|
+
border-color: #f87171;
|
|
2792
|
+
background: rgba(220, 38, 38, 0.12);
|
|
2793
|
+
transform: translateY(-1px);
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
button {
|
|
2797
|
+
font: inherit;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2800
|
+
.relative {
|
|
2801
|
+
position: relative;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
.absolute {
|
|
2805
|
+
position: absolute;
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
.inset-0 {
|
|
2809
|
+
inset: 0;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
.bottom-0 {
|
|
2813
|
+
bottom: 0;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
.left-0 {
|
|
2817
|
+
left: 0;
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
.top-2 {
|
|
2821
|
+
top: 8px;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
.right-3 {
|
|
2825
|
+
right: 12px;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
.block {
|
|
2829
|
+
display: block;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
.flex {
|
|
2833
|
+
display: flex;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
.flex-col {
|
|
2837
|
+
flex-direction: column;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
.flex-wrap {
|
|
2841
|
+
flex-wrap: wrap;
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
.items-center {
|
|
2845
|
+
align-items: center;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
.items-start {
|
|
2849
|
+
align-items: flex-start;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
.justify-center {
|
|
2853
|
+
justify-content: center;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
.gap-2 {
|
|
2857
|
+
gap: 8px;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
.gap-4 {
|
|
2861
|
+
gap: 16px;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
.gap-8 {
|
|
2865
|
+
gap: 32px;
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
.w-full {
|
|
2869
|
+
width: 100%;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
.max-w-full {
|
|
2873
|
+
max-width: 100%;
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
.overflow-hidden {
|
|
2877
|
+
overflow: hidden;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
.select-none {
|
|
2881
|
+
user-select: none;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
.cursor-pointer {
|
|
2885
|
+
cursor: pointer;
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
.text-left {
|
|
2889
|
+
text-align: left;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
.text-sm {
|
|
2893
|
+
font-size: 14px;
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
.text-lg {
|
|
2897
|
+
font-size: 18px;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
.text-xl {
|
|
2901
|
+
font-size: 20px;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
.font-bold {
|
|
2905
|
+
font-weight: 800;
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
.font-semibold {
|
|
2909
|
+
font-weight: 700;
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
.font-mono {
|
|
2913
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
.text-white {
|
|
2917
|
+
color: #fff;
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
.text-slate-400 {
|
|
2921
|
+
color: #94a3b8;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
.text-red-600 {
|
|
2925
|
+
color: #dc2626;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
.bg-red-600 {
|
|
2929
|
+
background: #dc2626;
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
.bg-black\\/75 {
|
|
2933
|
+
background: rgba(0, 0, 0, 0.75);
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
.pointer-events-none {
|
|
2937
|
+
pointer-events: none;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
.rounded-sm {
|
|
2941
|
+
border-radius: 2px;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
.rounded-lg {
|
|
2945
|
+
border-radius: 8px;
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
.min-h-5 {
|
|
2949
|
+
min-height: 20px;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
.tabular-nums {
|
|
2953
|
+
font-variant-numeric: tabular-nums;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
button[aria-label^="ShrimpRun"] {
|
|
2957
|
+
border: 2px solid rgba(248, 113, 113, 0.28);
|
|
2958
|
+
border-radius: 16px;
|
|
2959
|
+
background:
|
|
2960
|
+
linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(7, 10, 18, 0.98)),
|
|
2961
|
+
radial-gradient(circle at 18% 22%, rgba(248, 113, 113, 0.16), transparent 30%);
|
|
2962
|
+
box-shadow:
|
|
2963
|
+
inset 0 0 0 1px rgba(255, 255, 255, 0.04),
|
|
2964
|
+
0 20px 60px rgba(0, 0, 0, 0.28);
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
button[aria-label^="ShrimpRun"] > .bottom-0.left-0 {
|
|
2968
|
+
background: linear-gradient(90deg, #7f1d1d, #dc2626, #fecaca);
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
button:not([aria-label]) {
|
|
2972
|
+
border: 0;
|
|
2973
|
+
border-radius: 10px;
|
|
2974
|
+
background: #dc2626;
|
|
2975
|
+
color: #fff;
|
|
2976
|
+
cursor: pointer;
|
|
2977
|
+
font-weight: 800;
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
.shrimp-sprite {
|
|
2981
|
+
filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.32));
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.shrimp-run-obstacle {
|
|
2985
|
+
border-radius: 8px 8px 2px 2px;
|
|
2986
|
+
background:
|
|
2987
|
+
radial-gradient(circle at 50% 8px, #fecaca 0 4px, transparent 5px),
|
|
2988
|
+
linear-gradient(135deg, #fb7185 0%, #dc2626 46%, #7f1d1d 100%);
|
|
2989
|
+
box-shadow:
|
|
2990
|
+
inset -6px -8px 0 rgba(69, 10, 10, 0.32),
|
|
2991
|
+
0 0 0 2px rgba(254, 202, 202, 0.18);
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
.shrimp-run-obstacle::before,
|
|
2995
|
+
.shrimp-run-obstacle::after {
|
|
2996
|
+
position: absolute;
|
|
2997
|
+
bottom: 8px;
|
|
2998
|
+
width: 10px;
|
|
2999
|
+
height: 22px;
|
|
3000
|
+
border-radius: 999px 999px 4px 4px;
|
|
3001
|
+
background: #ef4444;
|
|
3002
|
+
content: "";
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
.shrimp-run-obstacle::before {
|
|
3006
|
+
left: -7px;
|
|
3007
|
+
transform: rotate(-18deg);
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
.shrimp-run-obstacle::after {
|
|
3011
|
+
right: -7px;
|
|
3012
|
+
transform: rotate(18deg);
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
@media (max-width: 720px) {
|
|
3016
|
+
main {
|
|
3017
|
+
width: min(100% - 20px, 1120px);
|
|
3018
|
+
padding: 24px 0;
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
section {
|
|
3022
|
+
padding: 20px;
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
2704
3025
|
`;
|
|
2705
3026
|
}
|
|
2706
3027
|
function getCssGlobals(cssFramework) {
|
|
@@ -2845,7 +3166,9 @@ export default function RootLayout({ children }: RootLayoutProps) {
|
|
|
2845
3166
|
`;
|
|
2846
3167
|
}
|
|
2847
3168
|
function generateFrontendOnlyPage(projectName) {
|
|
2848
|
-
return `
|
|
3169
|
+
return `import ShrimpRunGame from "./components/shrimpRunGame";
|
|
3170
|
+
|
|
3171
|
+
export default function HomePage() {
|
|
2849
3172
|
return (
|
|
2850
3173
|
<main className="mx-auto flex min-h-screen w-full max-w-4xl flex-col gap-6 px-4 py-16 sm:px-6 lg:px-8">
|
|
2851
3174
|
<section className="rounded-3xl border border-white/10 bg-[#0e111a] p-8 shadow-2xl shadow-red-950/20">
|
|
@@ -3138,7 +3461,9 @@ export default function RaktaShrimpMascot({
|
|
|
3138
3461
|
`;
|
|
3139
3462
|
}
|
|
3140
3463
|
function generateShrimpRunGameComponent() {
|
|
3141
|
-
return
|
|
3464
|
+
return `import { useCallback, useEffect, useRef, useState } from "react";
|
|
3465
|
+
import RaktaShrimpMascot from "./raktaShrimpMascot";
|
|
3466
|
+
// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
3142
3467
|
|
|
3143
3468
|
type GameStatus = "idle" | "running" | "dead";
|
|
3144
3469
|
|
|
@@ -3443,12 +3768,18 @@ export default function ShrimpRunGame() {
|
|
|
3443
3768
|
/>
|
|
3444
3769
|
|
|
3445
3770
|
<span
|
|
3446
|
-
className="absolute"
|
|
3771
|
+
className="absolute shrimp-sprite"
|
|
3447
3772
|
style={{
|
|
3448
3773
|
left: SHRIMP_START_X,
|
|
3449
3774
|
bottom: shrimpBottomOffset,
|
|
3450
3775
|
width: SHRIMP_WIDTH,
|
|
3451
3776
|
height: SHRIMP_HEIGHT,
|
|
3777
|
+
transform: isDead
|
|
3778
|
+
? "rotate(18deg) translateY(8px)"
|
|
3779
|
+
: shrimp.isJumping
|
|
3780
|
+
? "rotate(-8deg) translateY(-4px)"
|
|
3781
|
+
: "rotate(0deg)",
|
|
3782
|
+
transition: "transform 120ms ease",
|
|
3452
3783
|
}}
|
|
3453
3784
|
>
|
|
3454
3785
|
<RaktaShrimpMascot isJumping={shrimp.isJumping} isDead={isDead} />
|
|
@@ -3457,7 +3788,7 @@ export default function ShrimpRunGame() {
|
|
|
3457
3788
|
{obstacles.map((obstacle) => (
|
|
3458
3789
|
<span
|
|
3459
3790
|
key={obstacle.id}
|
|
3460
|
-
className="absolute
|
|
3791
|
+
className="absolute shrimp-run-obstacle"
|
|
3461
3792
|
style={{
|
|
3462
3793
|
left: obstacle.xPosition,
|
|
3463
3794
|
bottom: GROUND_STRIP_HEIGHT,
|
|
@@ -4090,4 +4421,4 @@ Error: ${errorMessage}
|
|
|
4090
4421
|
process.exit(1);
|
|
4091
4422
|
});
|
|
4092
4423
|
|
|
4093
|
-
//# debugId=
|
|
4424
|
+
//# debugId=7E0E06BF6F6CB6FA64756E2164756E21
|