@lazarv/create-react-server 0.0.0-experimental-d003259-20250211-2495688e
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/LICENSE +21 -0
- package/README.md +31 -0
- package/generator.mjs +195 -0
- package/globals.d.ts +59 -0
- package/index.mjs +87 -0
- package/launch.mjs +136 -0
- package/lib/code-merge.mjs +246 -0
- package/lib/dynamic-checkbox.mjs +259 -0
- package/lib/files.mjs +6 -0
- package/lib/formatter.mjs +16 -0
- package/lib/generate-name.mjs +220 -0
- package/lib/theme.mjs +56 -0
- package/logo.mjs +3 -0
- package/package.json +26 -0
- package/steps/alias.mjs +50 -0
- package/steps/authentication.mjs +62 -0
- package/steps/database.mjs +56 -0
- package/steps/deploy.mjs +151 -0
- package/steps/features.mjs +415 -0
- package/steps/host.mjs +40 -0
- package/steps/index.mjs +33 -0
- package/steps/integrations.mjs +104 -0
- package/steps/name.mjs +69 -0
- package/steps/package.mjs +104 -0
- package/steps/port.mjs +42 -0
- package/steps/preset.mjs +188 -0
- package/steps/state-management.mjs +68 -0
- package/steps/third-party.mjs +19 -0
- package/steps/ui.mjs +87 -0
- package/templates/.dockerignore +5 -0
- package/templates/.gitignore.template +19 -0
- package/templates/.prettierignore +3 -0
- package/templates/.prettierrc +11 -0
- package/templates/Dockerfile.npm +49 -0
- package/templates/Dockerfile.pnpm +71 -0
- package/templates/Dockerfile.yarn +71 -0
- package/templates/README.docker.md +15 -0
- package/templates/README.md +35 -0
- package/templates/blank/package.json +6 -0
- package/templates/blank/src/App.jsx +5 -0
- package/templates/blank-ts/package.json +6 -0
- package/templates/blank-ts/src/App.tsx +5 -0
- package/templates/eslint.config.template.mjs +98 -0
- package/templates/get-started/package.json +6 -0
- package/templates/get-started/src/App.jsx +60 -0
- package/templates/get-started/src/Button.jsx +14 -0
- package/templates/get-started/src/Confetti.jsx +19 -0
- package/templates/get-started/src/global.css +3 -0
- package/templates/get-started-ts/globals.d.ts +3 -0
- package/templates/get-started-ts/package.json +6 -0
- package/templates/get-started-ts/src/App.tsx +66 -0
- package/templates/get-started-ts/src/Button.tsx +18 -0
- package/templates/get-started-ts/src/Confetti.tsx +19 -0
- package/templates/get-started-ts/src/global.css +3 -0
- package/templates/nextjs/globals.d.ts +3 -0
- package/templates/nextjs/react-server.config.json +9 -0
- package/templates/nextjs/src/app/layout.tsx +38 -0
- package/templates/nextjs/src/app/page.tsx +33 -0
- package/templates/nextjs/src/components/Button.tsx +18 -0
- package/templates/nextjs/src/components/Confetti.tsx +19 -0
- package/templates/nextjs/src/global.css +3 -0
- package/templates/package.css.json +5 -0
- package/templates/package.eslint.json +19 -0
- package/templates/package.eslint.ts.json +7 -0
- package/templates/package.json +12 -0
- package/templates/package.lightningcss.json +6 -0
- package/templates/package.prettier.json +8 -0
- package/templates/package.react-compiler.json +7 -0
- package/templates/package.swc.json +5 -0
- package/templates/package.tailwind.json +7 -0
- package/templates/package.ts.json +11 -0
- package/templates/postcss.config.mjs +6 -0
- package/templates/router/globals.d.ts +3 -0
- package/templates/router/react-server.config.json +19 -0
- package/templates/router/src/app/@content/about.tsx +98 -0
- package/templates/router/src/app/@content/index.tsx +33 -0
- package/templates/router/src/app/layout.tsx +44 -0
- package/templates/router/src/app/page.tsx +17 -0
- package/templates/router/src/components/Button.tsx +18 -0
- package/templates/router/src/components/Confetti.tsx +19 -0
- package/templates/router/src/components/Navigation.tsx +31 -0
- package/templates/router/src/global.css +3 -0
- package/templates/shared/public/github.svg +4 -0
- package/templates/shared/public/react-server.svg +51 -0
- package/templates/tailwind.config.mjs +6 -0
- package/templates/tsconfig.css.json +9 -0
- package/templates/tsconfig.template.json +15 -0
- package/templates/vite.config.lightningcss.mjs +15 -0
- package/templates/vite.config.lightningcss.ts +15 -0
- package/templates/vite.config.react-compiler.mjs +19 -0
- package/templates/vite.config.react-compiler.ts +19 -0
- package/templates/vite.config.swc.mjs +6 -0
- package/templates/vite.config.swc.ts +6 -0
- package/templates/vite.config.ts +3 -0
- package/wizard.mjs +122 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Define build argument for port with default value
|
|
2
|
+
ARG PORT=3000
|
|
3
|
+
|
|
4
|
+
# Stage 1: Build
|
|
5
|
+
FROM node:20-alpine AS builder
|
|
6
|
+
|
|
7
|
+
# Set working directory
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
# Copy package files
|
|
11
|
+
COPY package.json yarn.lock ./
|
|
12
|
+
|
|
13
|
+
# Install yarn globally
|
|
14
|
+
RUN --mount=type=cache,target=/root/.npm \
|
|
15
|
+
if grep -q "\"packageManager\":" "package.json"; then \
|
|
16
|
+
corepack enable && corepack prepare; \
|
|
17
|
+
else \
|
|
18
|
+
npm install -g yarn; \
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Install dependencies
|
|
22
|
+
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
23
|
+
yarn install --frozen-lockfile
|
|
24
|
+
|
|
25
|
+
# Copy source files and .react-server directory
|
|
26
|
+
COPY . .
|
|
27
|
+
|
|
28
|
+
# Build the application
|
|
29
|
+
RUN yarn build
|
|
30
|
+
|
|
31
|
+
# Stage 2: Production
|
|
32
|
+
FROM node:20-alpine AS runner
|
|
33
|
+
|
|
34
|
+
# Forward the build argument
|
|
35
|
+
ARG PORT
|
|
36
|
+
ENV PORT=$PORT
|
|
37
|
+
|
|
38
|
+
# Set working directory
|
|
39
|
+
WORKDIR /app
|
|
40
|
+
|
|
41
|
+
# Copy package files
|
|
42
|
+
COPY --from=builder /app/package.json /app/yarn.lock ./
|
|
43
|
+
|
|
44
|
+
# Install yarn globally
|
|
45
|
+
RUN --mount=type=cache,target=/root/.npm \
|
|
46
|
+
if grep -q "\"packageManager\":" "package.json"; then \
|
|
47
|
+
corepack enable && corepack prepare; \
|
|
48
|
+
else \
|
|
49
|
+
npm install -g yarn; \
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Copy built files and .react-server from builder stage
|
|
53
|
+
COPY --from=builder /app/package.json /app/yarn.lock ./
|
|
54
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
55
|
+
COPY --from=builder /app/.react-server ./.react-server
|
|
56
|
+
|
|
57
|
+
# Prune dev dependencies
|
|
58
|
+
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
59
|
+
yarn install --production --frozen-lockfile
|
|
60
|
+
|
|
61
|
+
# Run as non-root user
|
|
62
|
+
RUN addgroup -g 1001 -S nodejs && \
|
|
63
|
+
adduser -S nodejs -u 1001 && \
|
|
64
|
+
chown -R nodejs:nodejs /app
|
|
65
|
+
USER nodejs
|
|
66
|
+
|
|
67
|
+
# Expose the port your app runs on
|
|
68
|
+
EXPOSE ${PORT}
|
|
69
|
+
|
|
70
|
+
# Start the application
|
|
71
|
+
CMD ["yarn", "start", "--host"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Build Docker image
|
|
2
|
+
|
|
3
|
+
To build your application into a Docker image, run:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
docker build -t <%=props.projectName %> .
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Run Docker container
|
|
10
|
+
|
|
11
|
+
After building the Docker image, you can run the container with:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
docker run --rm -ti -p <%=props.port %>:<%=props.port %> <%=props.projectName %>
|
|
15
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
This is a [@lazarv/react-server](https://react-server.dev) project bootstrapped with [`create-react-server`](https://react-server.dev/guide/quick-start).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
<%=props.packageManager.run %> dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use the `--open` flag, the development server command menu or navigate to [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
12
|
+
|
|
13
|
+
You can start editing the page by modifying `<%=props.entrypoint%>`. The page auto-updates as you edit the file.
|
|
14
|
+
|
|
15
|
+
## Build
|
|
16
|
+
|
|
17
|
+
To build the application for production, run:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
<%=props.packageManager.run %> build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The build output will be in the `.react-server` directory.
|
|
24
|
+
|
|
25
|
+
To run the production server, run:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
<%=props.packageManager.start %> start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Learn More
|
|
32
|
+
|
|
33
|
+
To learn more about [@lazarv/react-server](https://react-server.dev), take a look at the documentation or search the documentation using the development server.
|
|
34
|
+
|
|
35
|
+
You can check out framework on [GitHub](https://github.com/lazarv/react-server) - your feedback and contributions are welcome!
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
import babelParser from "@babel/eslint-parser";
|
|
5
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
|
+
import js from "@eslint/js"; /*<%=props.eslint.typescript.import %>*/
|
|
7
|
+
import jsxA11Y from "eslint-plugin-jsx-a11y"; /*<%=props.eslint.prettier.import %>*/
|
|
8
|
+
import react from "eslint-plugin-react"; /*<%=props.eslint.reactCompiler.import %>*/
|
|
9
|
+
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
10
|
+
import globals from "globals";
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default [
|
|
21
|
+
{
|
|
22
|
+
ignores: [
|
|
23
|
+
"**/node_modules/",
|
|
24
|
+
"**/dist/",
|
|
25
|
+
"**/build/",
|
|
26
|
+
"**/.react-server/",
|
|
27
|
+
"**/.react-server*/",
|
|
28
|
+
"**/.vercel/",
|
|
29
|
+
"*.mdx",
|
|
30
|
+
"*.md",
|
|
31
|
+
"*.json",
|
|
32
|
+
"*-lock.*",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
...compat.extends(
|
|
36
|
+
"eslint:recommended",
|
|
37
|
+
"plugin:react/recommended",
|
|
38
|
+
"plugin:react/jsx-runtime",
|
|
39
|
+
"plugin:jsx-a11y/recommended"
|
|
40
|
+
/*<%=props.eslint.prettier.compat %>*/
|
|
41
|
+
),
|
|
42
|
+
{
|
|
43
|
+
plugins: {
|
|
44
|
+
react,
|
|
45
|
+
/*<%=props.eslint.reactCompiler.plugin %>*/
|
|
46
|
+
"simple-import-sort": simpleImportSort,
|
|
47
|
+
/*<%=props.eslint.prettier.plugin %>*/
|
|
48
|
+
"jsx-a11y": jsxA11Y,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
languageOptions: {
|
|
52
|
+
globals: {
|
|
53
|
+
...globals.browser,
|
|
54
|
+
...globals.node,
|
|
55
|
+
Deno: "readonly",
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
parser: babelParser,
|
|
59
|
+
ecmaVersion: "latest",
|
|
60
|
+
sourceType: "module",
|
|
61
|
+
|
|
62
|
+
parserOptions: {
|
|
63
|
+
requireConfigFile: false,
|
|
64
|
+
|
|
65
|
+
babelOptions: {
|
|
66
|
+
presets: ["@babel/preset-react"],
|
|
67
|
+
plugins: ["@babel/plugin-syntax-import-assertions"],
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
ecmaFeatures: {
|
|
71
|
+
jsx: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
settings: {
|
|
77
|
+
react: {
|
|
78
|
+
version: "19.0.0",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
rules: {
|
|
83
|
+
"react/prop-types": "off",
|
|
84
|
+
/*<%=props.eslint.reactCompiler.rules %>*/
|
|
85
|
+
"simple-import-sort/imports": [
|
|
86
|
+
"error",
|
|
87
|
+
{
|
|
88
|
+
groups: [["^\\u0000"], ["^node:"], ["^react"], ["^[^.]"], ["^\\."]],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
|
|
92
|
+
"no-async-promise-executor": "off",
|
|
93
|
+
|
|
94
|
+
/*<%=props.eslint.prettier.rules %>*/
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
/*<%=props.eslint.typescript.config %>*/
|
|
98
|
+
];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "./global.css";
|
|
2
|
+
import Confetti from "./Confetti";
|
|
3
|
+
|
|
4
|
+
export default function App() {
|
|
5
|
+
return (
|
|
6
|
+
<html lang="en" className="h-screen" suppressHydrationWarning>
|
|
7
|
+
<head></head>
|
|
8
|
+
<body
|
|
9
|
+
className="w-full min-h-full flex flex-col justify-center items-center dark:bg-zinc-900 dark:text-gray-400"
|
|
10
|
+
suppressHydrationWarning
|
|
11
|
+
>
|
|
12
|
+
<a href="https://github.com/lazarv/react-server" target="_blank">
|
|
13
|
+
<img
|
|
14
|
+
src="/github.svg"
|
|
15
|
+
alt="GitHub page"
|
|
16
|
+
className="absolute top-2 right-2 w-6 h-6"
|
|
17
|
+
/>
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
<section className="flex flex-col mt-auto">
|
|
21
|
+
<div className="relative">
|
|
22
|
+
<img
|
|
23
|
+
src="/react-server.svg"
|
|
24
|
+
className="absolute h-[85%] top-1/2 -translate-x-full -translate-y-1/2 -ml-1"
|
|
25
|
+
alt="@lazarv/react-server logo"
|
|
26
|
+
/>
|
|
27
|
+
<h2 className="text-xs font-semibold m-0 pt-0 border-none dark:text-yellow-500 mt-4 sm:mt-0">
|
|
28
|
+
@lazarv
|
|
29
|
+
</h2>
|
|
30
|
+
<h1 className="text-5xl font-semibold m-0 -mt-4 whitespace-nowrap sm:text-6xl dark:text-yellow-500">
|
|
31
|
+
react-server
|
|
32
|
+
</h1>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<p className="text-lg">
|
|
36
|
+
Welcome to your <b>@lazarv/react-server</b> app!
|
|
37
|
+
</p>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<Confetti className="mt-4" />
|
|
41
|
+
|
|
42
|
+
<p className="text-sm mt-4">
|
|
43
|
+
Try editing <b>src/App.jsx</b> and save to reload.
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
<p className="text-sm mt-auto mb-2">
|
|
47
|
+
Visit{" "}
|
|
48
|
+
<a
|
|
49
|
+
href="https://react-server.dev"
|
|
50
|
+
target="_blank"
|
|
51
|
+
className="text-indigo-500 dark:text-yellow-500"
|
|
52
|
+
>
|
|
53
|
+
react-server.dev
|
|
54
|
+
</a>{" "}
|
|
55
|
+
to learn more about <b>@lazarv/react-server</b>.
|
|
56
|
+
</p>
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default function Button({ className, children, ...props }) {
|
|
2
|
+
return (
|
|
3
|
+
<button
|
|
4
|
+
className={`${className} rounded-full p-1 inline-flex items-center text-black hover:no-underline from-rose-400 via-fuchsia-500 to-indigo-500 bg-gradient-to-r hover:drop-shadow`}
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
{...props}
|
|
8
|
+
className="block rounded-full p-2 px-4 text-sm sm:text-base bg-white dark:bg-gray-900 dark:text-white hover:bg-transparent dark:hover:bg-transparent hover:text-white dark:hover:text-white"
|
|
9
|
+
>
|
|
10
|
+
{children}
|
|
11
|
+
</div>
|
|
12
|
+
</button>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Button from "./Button";
|
|
4
|
+
|
|
5
|
+
export default function Confetti(props) {
|
|
6
|
+
return (
|
|
7
|
+
<Button
|
|
8
|
+
{...props}
|
|
9
|
+
onClick={async () => {
|
|
10
|
+
const { default: confetti } = await import(
|
|
11
|
+
"https://esm.sh/canvas-confetti"
|
|
12
|
+
);
|
|
13
|
+
confetti();
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
Celebrate!
|
|
17
|
+
</Button>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "~/global.css";
|
|
2
|
+
|
|
3
|
+
import Confetti from "~/Confetti";
|
|
4
|
+
|
|
5
|
+
export default function App() {
|
|
6
|
+
return (
|
|
7
|
+
<html lang="en" className="h-screen" suppressHydrationWarning>
|
|
8
|
+
<head></head>
|
|
9
|
+
<body
|
|
10
|
+
className="w-full min-h-full flex flex-col justify-center items-center dark:bg-zinc-900 dark:text-gray-400"
|
|
11
|
+
suppressHydrationWarning
|
|
12
|
+
>
|
|
13
|
+
<a
|
|
14
|
+
href="https://github.com/lazarv/react-server"
|
|
15
|
+
target="_blank"
|
|
16
|
+
rel="noreferrer"
|
|
17
|
+
>
|
|
18
|
+
<img
|
|
19
|
+
src="/github.svg"
|
|
20
|
+
alt="GitHub page"
|
|
21
|
+
className="absolute top-2 right-2 w-6 h-6"
|
|
22
|
+
/>
|
|
23
|
+
</a>
|
|
24
|
+
|
|
25
|
+
<section className="flex flex-col mt-auto">
|
|
26
|
+
<div className="relative">
|
|
27
|
+
<img
|
|
28
|
+
src="/react-server.svg"
|
|
29
|
+
className="absolute h-[85%] top-1/2 -translate-x-full -translate-y-1/2 -ml-1"
|
|
30
|
+
alt="@lazarv/react-server logo"
|
|
31
|
+
/>
|
|
32
|
+
<h2 className="text-xs font-semibold m-0 pt-0 border-none dark:text-yellow-500 mt-4 sm:mt-0">
|
|
33
|
+
@lazarv
|
|
34
|
+
</h2>
|
|
35
|
+
<h1 className="text-5xl font-semibold m-0 -mt-4 whitespace-nowrap sm:text-6xl dark:text-yellow-500">
|
|
36
|
+
react-server
|
|
37
|
+
</h1>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<p className="text-lg">
|
|
41
|
+
Welcome to your <b>@lazarv/react-server</b> app!
|
|
42
|
+
</p>
|
|
43
|
+
</section>
|
|
44
|
+
|
|
45
|
+
<Confetti className="mt-4" />
|
|
46
|
+
|
|
47
|
+
<p className="text-sm mt-4">
|
|
48
|
+
Try editing <b>src/App.tsx</b> and save to reload.
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<p className="text-sm mt-auto mb-2">
|
|
52
|
+
Visit{" "}
|
|
53
|
+
<a
|
|
54
|
+
href="https://react-server.dev"
|
|
55
|
+
target="_blank"
|
|
56
|
+
className="text-indigo-500 dark:text-yellow-500"
|
|
57
|
+
rel="noreferrer"
|
|
58
|
+
>
|
|
59
|
+
react-server.dev
|
|
60
|
+
</a>{" "}
|
|
61
|
+
to learn more about <b>@lazarv/react-server</b>.
|
|
62
|
+
</p>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ButtonProps = React.PropsWithChildren<
|
|
2
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
|
3
|
+
>;
|
|
4
|
+
|
|
5
|
+
export default function Button({ className, children, ...props }: ButtonProps) {
|
|
6
|
+
return (
|
|
7
|
+
<button
|
|
8
|
+
className={`${className} rounded-full p-1 inline-flex items-center text-black hover:no-underline from-rose-400 via-fuchsia-500 to-indigo-500 bg-gradient-to-r hover:drop-shadow`}
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
{...props}
|
|
12
|
+
className="block rounded-full p-2 px-4 text-sm sm:text-base bg-white dark:bg-gray-900 dark:text-white hover:bg-transparent dark:hover:bg-transparent hover:text-white dark:hover:text-white"
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</div>
|
|
16
|
+
</button>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Button, { type ButtonProps } from "~/Button";
|
|
4
|
+
|
|
5
|
+
export default function Confetti(props: ButtonProps) {
|
|
6
|
+
return (
|
|
7
|
+
<Button
|
|
8
|
+
{...props}
|
|
9
|
+
onClick={async () => {
|
|
10
|
+
const { default: confetti } = await import(
|
|
11
|
+
"https://esm.sh/canvas-confetti"
|
|
12
|
+
);
|
|
13
|
+
confetti();
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
Celebrate!
|
|
17
|
+
</Button>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "~/global.css";
|
|
2
|
+
|
|
3
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
4
|
+
return (
|
|
5
|
+
<html lang="en" className="h-screen" suppressHydrationWarning>
|
|
6
|
+
<head></head>
|
|
7
|
+
<body
|
|
8
|
+
className="w-full min-h-full flex flex-col justify-center items-center dark:bg-zinc-900 dark:text-gray-400"
|
|
9
|
+
suppressHydrationWarning
|
|
10
|
+
>
|
|
11
|
+
<a
|
|
12
|
+
href="https://github.com/lazarv/react-server"
|
|
13
|
+
target="_blank"
|
|
14
|
+
rel="noreferrer"
|
|
15
|
+
>
|
|
16
|
+
<img
|
|
17
|
+
src="/github.svg"
|
|
18
|
+
alt="GitHub page"
|
|
19
|
+
className="absolute top-2 right-2 w-6 h-6"
|
|
20
|
+
/>
|
|
21
|
+
</a>
|
|
22
|
+
{children}
|
|
23
|
+
<p className="text-sm mt-auto mb-2">
|
|
24
|
+
Visit{" "}
|
|
25
|
+
<a
|
|
26
|
+
href="https://react-server.dev"
|
|
27
|
+
target="_blank"
|
|
28
|
+
className="text-indigo-500 dark:text-yellow-500"
|
|
29
|
+
rel="noreferrer"
|
|
30
|
+
>
|
|
31
|
+
react-server.dev
|
|
32
|
+
</a>{" "}
|
|
33
|
+
to learn more about <b>@lazarv/react-server</b>.
|
|
34
|
+
</p>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Confetti from "~/components/Confetti";
|
|
2
|
+
|
|
3
|
+
export default function Page() {
|
|
4
|
+
return (
|
|
5
|
+
<>
|
|
6
|
+
<section className="flex flex-col mt-auto">
|
|
7
|
+
<div className="relative">
|
|
8
|
+
<img
|
|
9
|
+
src="/react-server.svg"
|
|
10
|
+
className="absolute h-[85%] top-1/2 -translate-x-full -translate-y-1/2 -ml-1"
|
|
11
|
+
alt="@lazarv/react-server logo"
|
|
12
|
+
/>
|
|
13
|
+
<h2 className="text-xs font-semibold m-0 pt-0 border-none dark:text-yellow-500 mt-4 sm:mt-0">
|
|
14
|
+
@lazarv
|
|
15
|
+
</h2>
|
|
16
|
+
<h1 className="text-5xl font-semibold m-0 -mt-4 whitespace-nowrap sm:text-6xl dark:text-yellow-500">
|
|
17
|
+
react-server
|
|
18
|
+
</h1>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<p className="text-lg">
|
|
22
|
+
Welcome to your <b>@lazarv/react-server</b> app!
|
|
23
|
+
</p>
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<Confetti className="mt-4" />
|
|
27
|
+
|
|
28
|
+
<p className="text-sm mt-4">
|
|
29
|
+
Try editing <b>src/app/page.tsx</b> and save to reload.
|
|
30
|
+
</p>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ButtonProps = React.PropsWithChildren<
|
|
2
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
|
3
|
+
>;
|
|
4
|
+
|
|
5
|
+
export default function Button({ className, children, ...props }: ButtonProps) {
|
|
6
|
+
return (
|
|
7
|
+
<button
|
|
8
|
+
className={`${className} rounded-full p-1 inline-flex items-center text-black hover:no-underline from-rose-400 via-fuchsia-500 to-indigo-500 bg-gradient-to-r hover:drop-shadow`}
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
{...props}
|
|
12
|
+
className="block rounded-full p-2 px-4 text-sm sm:text-base bg-white dark:bg-gray-900 dark:text-white hover:bg-transparent dark:hover:bg-transparent hover:text-white dark:hover:text-white"
|
|
13
|
+
>
|
|
14
|
+
{children}
|
|
15
|
+
</div>
|
|
16
|
+
</button>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Button, { type ButtonProps } from "~/components/Button";
|
|
4
|
+
|
|
5
|
+
export default function Confetti(props: ButtonProps) {
|
|
6
|
+
return (
|
|
7
|
+
<Button
|
|
8
|
+
{...props}
|
|
9
|
+
onClick={async () => {
|
|
10
|
+
const { default: confetti } = await import(
|
|
11
|
+
"https://esm.sh/canvas-confetti"
|
|
12
|
+
);
|
|
13
|
+
confetti();
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
Celebrate!
|
|
17
|
+
</Button>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"lint": "eslint"
|
|
4
|
+
},
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@babel/eslint-parser": "^7.25.9",
|
|
7
|
+
"@babel/plugin-syntax-import-assertions": "^7.25.9",
|
|
8
|
+
"@babel/preset-react": "^7.25.9",
|
|
9
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
10
|
+
"@eslint/js": "^9.13.0",
|
|
11
|
+
"eslint": "^9.13.0",
|
|
12
|
+
"eslint-config-prettier": "^9.1.0",
|
|
13
|
+
"eslint-plugin-jsx-a11y": "^6.10.1",
|
|
14
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
15
|
+
"eslint-plugin-react": "^7.37.2",
|
|
16
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
17
|
+
"globals": "^15.11.0"
|
|
18
|
+
}
|
|
19
|
+
}
|