@epicabdou/create-linkrjs-app 0.0.2 → 0.0.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/README.md +57 -15
- package/package.json +1 -1
- package/template/index.html +3 -0
- package/template/package.json +1 -24
- package/template/src/index.css +3 -0
- package/template/src/main.tsx +1 -0
- package/template/src/pages/index.tsx +8 -3
- package/template/vite.config.ts +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# create-linkrjs-app
|
|
1
|
+
# @epicabdou/create-linkrjs-app
|
|
2
2
|
|
|
3
|
-
Scaffold a new **linkr.js** app
|
|
3
|
+
Scaffold a new **linkr.js** app with Vite, React, React Router v7, file-based routing (**@epicabdou/linkr**), **Tailwind CSS v4**, and the **linkr-design-system**.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -11,23 +11,65 @@ pnpm install
|
|
|
11
11
|
pnpm dev
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
You can also use the shorthand name if the package is available:
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
```bash
|
|
17
|
+
npx create-linkrjs-app my-app
|
|
18
|
+
```
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
- React Router v7
|
|
20
|
-
- **@epicabdou/linkr** for file-based routes from `src/pages/`
|
|
21
|
-
- `index.tsx` (home) and `404.tsx` (not found)
|
|
20
|
+
Replace `my-app` with your desired project name. The CLI creates a folder with that name in the current directory.
|
|
22
21
|
|
|
23
|
-
Dev server runs at http://localhost:8000.
|
|
22
|
+
**Dev server:** runs at `http://localhost:8000` by default.
|
|
23
|
+
|
|
24
|
+
---
|
|
24
25
|
|
|
25
26
|
## What gets created
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
The template produces a minimal but complete Vite + React + TypeScript app with file-based routing and the design system.
|
|
29
|
+
|
|
30
|
+
### Root files
|
|
31
|
+
|
|
32
|
+
| File | Description |
|
|
33
|
+
|------|-------------|
|
|
34
|
+
| `package.json` | Project name set to your app name; includes `@epicabdou/linkr`, `linkr-design-system`, `react`, `react-router`, `tailwindcss`, `@tailwindcss/vite`, `vite`, etc. |
|
|
35
|
+
| `vite.config.ts` | React plugin + Tailwind v4 plugin (`@tailwindcss/vite`), dev server port **8000**. |
|
|
36
|
+
| `index.html` | Entry HTML with root div. |
|
|
37
|
+
| `tsconfig.json` | TypeScript config for the app. |
|
|
38
|
+
|
|
39
|
+
### Source structure
|
|
40
|
+
|
|
41
|
+
| Path | Description |
|
|
42
|
+
|------|-------------|
|
|
43
|
+
| `src/main.tsx` | Entry: imports CSS, builds routes with `createRoutes` + `import.meta.glob("./pages/**/*.tsx")`, creates React root and `RouterProvider`. |
|
|
44
|
+
| `src/index.css` | Tailwind + design system: `@import "tailwindcss"`, `@import "linkr-design-system/theme"`, `@import "linkr-design-system/base"`. |
|
|
45
|
+
| `src/pages/index.tsx` | Home page at `/` (sample content using design-system classes). |
|
|
46
|
+
| `src/pages/404.tsx` | Not-found page (catch-all route). |
|
|
47
|
+
| `src/config/protect.tsx` | Example `ProtectConfig` for route protection (optional use with `<Protect>`). |
|
|
48
|
+
| `src/vite-env.d.ts` | Vite client types. |
|
|
49
|
+
|
|
50
|
+
### Dependencies (template)
|
|
51
|
+
|
|
52
|
+
- **Runtime:** `@epicabdou/linkr`, `linkr-design-system`, `react`, `react-dom`, `react-router`
|
|
53
|
+
- **Dev:** `@tailwindcss/vite`, `tailwindcss`, `@vitejs/plugin-react`, `vite`, `typescript`, `@types/react`, `@types/react-dom`
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Next steps
|
|
58
|
+
|
|
59
|
+
1. **Add routes** — Create files under `src/pages/`:
|
|
60
|
+
- `about.tsx` → `/about`
|
|
61
|
+
- `blog/index.tsx` → `/blog`
|
|
62
|
+
- `blog/[id].tsx` → `/blog/:id`
|
|
63
|
+
- `docs/[...slug].tsx` → `/docs/*`
|
|
64
|
+
2. **Add layouts** — Either add `_layout.tsx` in a page folder, or use a separate `src/layouts/` folder with `layoutsGlob` and `layoutMap` in `main.tsx` (see [linkr README](../linkr/README.md#layouts-in-a-separate-folder)).
|
|
65
|
+
3. **Protect routes** — Use the `protect` export on a page/layout or wrap content with `<Protect>` and the config from `src/config/protect.tsx`.
|
|
66
|
+
4. **Styling** — Use Tailwind utilities and design-system tokens (e.g. `bg-primary-500`, `text-neutral-600`, `rounded-lg`, `font-sans`). See [design-system README](../design-system/README.md).
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
- **Node.js** 18+
|
|
73
|
+
- **pnpm** (recommended), npm, or yarn for installing dependencies
|
|
32
74
|
|
|
33
|
-
|
|
75
|
+
The generated app uses **Vite 5**, **React 18**, **React Router 7**, and **Tailwind CSS 4**.
|
package/package.json
CHANGED
package/template/index.html
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>linkr.js App</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
7
10
|
</head>
|
|
8
11
|
<body>
|
|
9
12
|
<div id="root"></div>
|
package/template/package.json
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-linkrjs-app",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc -b && vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@epicabdou/linkr": "^0.0.2",
|
|
13
|
-
"react": "^18.2.0",
|
|
14
|
-
"react-dom": "^18.2.0",
|
|
15
|
-
"react-router": "^7.0.0"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/react": "^18.2.0",
|
|
19
|
-
"@types/react-dom": "^18.2.0",
|
|
20
|
-
"@vitejs/plugin-react": "^4.2.0",
|
|
21
|
-
"typescript": "^5.3.0",
|
|
22
|
-
"vite": "^5.0.0"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
{"name":"my-linkrjs-app","private":true,"version":"0.0.1","type":"module","scripts":{"dev":"vite","build":"tsc -b && vite build","preview":"vite preview"},"dependencies":{"@epicabdou/linkr":"^0.0.4","linkr-design-system":"^0.0.1","react":"^18.2.0","react-dom":"^18.2.0","react-router":"^7.0.0"},"devDependencies":{"@tailwindcss/vite":"^4.0.0","@types/react":"^18.2.0","@types/react-dom":"^18.2.0","@vitejs/plugin-react":"^4.2.0","tailwindcss":"^4.0.0","typescript":"^5.3.0","vite":"^5.0.0"}}
|
package/template/src/main.tsx
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export default function Home() {
|
|
2
2
|
return (
|
|
3
|
-
<div>
|
|
4
|
-
<h1>Welcome to linkr.js</h1>
|
|
5
|
-
<p
|
|
3
|
+
<div className="min-h-screen font-sans p-8">
|
|
4
|
+
<h1 className="text-3xl font-bold text-neutral-900">Welcome to linkr.js</h1>
|
|
5
|
+
<p className="mt-2 text-neutral-600">
|
|
6
|
+
Edit <code className="rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-sm">src/pages/index.tsx</code> to get started.
|
|
7
|
+
</p>
|
|
8
|
+
<p className="mt-4 text-sm text-neutral-500">
|
|
9
|
+
Tailwind v4 + linkr design system are included. Use utilities like <code className="text-primary-600">bg-primary-500</code>, <code className="text-primary-600">rounded-lg</code>, <code className="text-primary-600">font-sans</code>.
|
|
10
|
+
</p>
|
|
6
11
|
</div>
|
|
7
12
|
);
|
|
8
13
|
}
|
package/template/vite.config.ts
CHANGED