create-audora-next 0.1.7 → 2.0.1

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.
Files changed (63) hide show
  1. package/README.md +25 -5
  2. package/assets/audora-blog.png +0 -0
  3. package/assets/audora-next.webp +0 -0
  4. package/index.ts +9 -4
  5. package/package.json +8 -2
  6. package/templates/blog/README.md +164 -0
  7. package/templates/blog/bun.lock +1341 -0
  8. package/templates/blog/env.example.template +5 -0
  9. package/templates/blog/eslint.config.mjs +18 -0
  10. package/templates/blog/gitignore.template +41 -0
  11. package/templates/blog/husky.template/pre-commit +16 -0
  12. package/templates/blog/lint-staged.config.mjs +17 -0
  13. package/templates/blog/next.config.ts +38 -0
  14. package/templates/blog/package.json +59 -0
  15. package/templates/blog/postcss.config.mjs +7 -0
  16. package/templates/blog/public/favicon/apple-touch-icon.png +0 -0
  17. package/templates/blog/public/favicon/favicon-96x96.png +0 -0
  18. package/templates/blog/public/favicon/favicon.ico +0 -0
  19. package/templates/blog/public/favicon/favicon.svg +1 -0
  20. package/templates/blog/public/favicon/site.webmanifest +21 -0
  21. package/templates/blog/public/favicon/web-app-manifest-192x192.png +0 -0
  22. package/templates/blog/public/favicon/web-app-manifest-512x512.png +0 -0
  23. package/templates/blog/public/images/screenshot-desktop-dark.webp +0 -0
  24. package/templates/blog/public/images/screenshot-desktop-light.webp +0 -0
  25. package/templates/blog/public/images/screenshot-mobile-dark.webp +0 -0
  26. package/templates/blog/public/images/screenshot-mobile-light.webp +0 -0
  27. package/templates/blog/src/app/blogs/[slug]/page.tsx +171 -0
  28. package/templates/blog/src/app/blogs/page.tsx +108 -0
  29. package/templates/blog/src/app/layout.tsx +60 -0
  30. package/templates/blog/src/app/llms-full.txt/route.ts +97 -0
  31. package/templates/blog/src/app/llms.txt/route.ts +40 -0
  32. package/templates/blog/src/app/manifest.ts +61 -0
  33. package/templates/blog/src/app/page.tsx +57 -0
  34. package/templates/blog/src/app/robots.ts +16 -0
  35. package/templates/blog/src/app/sitemap.ts +52 -0
  36. package/templates/blog/src/blogs/components/animated-blog-list.tsx +33 -0
  37. package/templates/blog/src/blogs/components/blog-post-card.tsx +46 -0
  38. package/templates/blog/src/blogs/components/blog-section.tsx +34 -0
  39. package/templates/blog/src/blogs/components/blog-table-of-contents.tsx +369 -0
  40. package/templates/blog/src/blogs/components/copy-button.tsx +46 -0
  41. package/templates/blog/src/blogs/components/mdx.tsx +225 -0
  42. package/templates/blog/src/blogs/content/cosketch/cosketch-canvas-engine.mdx +186 -0
  43. package/templates/blog/src/blogs/content/cosketch/cosketch-docker-architecture.mdx +175 -0
  44. package/templates/blog/src/blogs/content/cosketch/cosketch-eraser-and-selection.mdx +207 -0
  45. package/templates/blog/src/blogs/content/hello-world.mdx +66 -0
  46. package/templates/blog/src/blogs/data/mdx.ts +68 -0
  47. package/templates/blog/src/blogs/utils/extract-headings.ts +38 -0
  48. package/templates/blog/src/components/copyable-code.tsx +41 -0
  49. package/templates/blog/src/components/footer.tsx +25 -0
  50. package/templates/blog/src/components/header.tsx +27 -0
  51. package/templates/blog/src/components/icons.tsx +84 -0
  52. package/templates/blog/src/components/section-heading.tsx +11 -0
  53. package/templates/blog/src/components/theme-provider.tsx +11 -0
  54. package/templates/blog/src/components/theme-toggle.tsx +20 -0
  55. package/templates/blog/src/components/view-all-link.tsx +56 -0
  56. package/templates/blog/src/config/site.ts +19 -0
  57. package/templates/blog/src/data/llms.ts +112 -0
  58. package/templates/blog/src/data/site.ts +52 -0
  59. package/templates/blog/src/lib/seo.ts +190 -0
  60. package/templates/blog/src/lib/utils.ts +83 -0
  61. package/templates/blog/src/styles/globals.css +99 -0
  62. package/templates/blog/src/utils/cn.ts +7 -0
  63. package/templates/blog/tsconfig.json +34 -0
package/README.md CHANGED
@@ -2,13 +2,23 @@
2
2
 
3
3
  Create a new Audora Next.js app with one command.
4
4
 
5
+ ## Preview
6
+
7
+ **Base template**
8
+
9
+ ![Audora Next](./assets/audora-next.webp)
10
+
11
+ **Blog template**
12
+
13
+ ![Audora Blog](./assets/audora-blog.png)
14
+
5
15
  ## Quick Start
6
16
 
7
17
  ```bash
8
18
  bunx create-audora-next my-app
9
19
  ```
10
20
 
11
- Then follow the prompts, or use:
21
+ Use `--blog` to create the blog template. Then follow the prompts, or use:
12
22
 
13
23
  ```bash
14
24
  cd my-app
@@ -20,10 +30,10 @@ Open [http://localhost:3000](http://localhost:3000) to see your app.
20
30
 
21
31
  ## Available Templates
22
32
 
23
- | Template | Status |
24
- | -------- | ----------- |
25
- | `base` | Available |
26
- | `blog` | Coming Soon |
33
+ | Template | Status | Usage |
34
+ | -------- | --------- | --------------------------------------- |
35
+ | `base` | Available | `bunx create-audora-next my-app` |
36
+ | `blog` | Available | `bunx create-audora-next my-app --blog` |
27
37
 
28
38
  ## Base Template Features
29
39
 
@@ -45,6 +55,16 @@ Open [http://localhost:3000](http://localhost:3000) to see your app.
45
55
  - Husky & lint-staged
46
56
  - Path alias (`@/*`)
47
57
 
58
+ ## Blog Template
59
+
60
+ The blog template includes everything in the base template, plus:
61
+
62
+ - MDX-based blog posts with frontmatter
63
+ - Blog index at `/blogs` and post pages at `/blogs/[slug]`
64
+ - Content in `src/blogs/content` (MDX files)
65
+ - Blog components (post cards, table of contents, etc.)
66
+ - Ready for adding pagination and search
67
+
48
68
  ## Requirements
49
69
 
50
70
  - [Bun](https://bun.sh) v1.0.0 or higher
Binary file
Binary file
package/index.ts CHANGED
@@ -6,7 +6,9 @@ import { execSync } from "child_process";
6
6
  import pc from "picocolors";
7
7
  import ora from "ora";
8
8
 
9
- const projectName = process.argv[2];
9
+ const args = process.argv.slice(2);
10
+ const useBlogTemplate = args.includes("-blog") || args.includes("--blog");
11
+ const projectName = args.find((arg) => arg !== "-blog" && arg !== "--blog");
10
12
 
11
13
  // Validate project name
12
14
  if (!projectName) {
@@ -14,7 +16,7 @@ if (!projectName) {
14
16
  console.log(
15
17
  `\nUsage: ${pc.cyan("bunx create-audora-next")} ${pc.green(
16
18
  "<project-name>"
17
- )}\n`
19
+ )} ${pc.dim("[--blog]")}\n`
18
20
  );
19
21
  process.exit(1);
20
22
  }
@@ -37,13 +39,16 @@ if (existsSync(targetDir)) {
37
39
  process.exit(1);
38
40
  }
39
41
 
42
+ const templateDir = useBlogTemplate ? "blog" : "base";
40
43
  console.log(
41
- `\nCreating a new ${pc.bold("Audora Next")} app in ${pc.cyan(targetDir)}...\n`
44
+ `\nCreating a new ${pc.bold("Audora Next")} app${
45
+ useBlogTemplate ? ` ${pc.dim("(blog template)")}` : ""
46
+ } in ${pc.cyan(targetDir)}...\n`
42
47
  );
43
48
 
44
49
  // Copy template
45
50
  mkdirSync(targetDir);
46
- cpSync(new URL("./templates/base", import.meta.url), targetDir, {
51
+ cpSync(new URL(`./templates/${templateDir}`, import.meta.url), targetDir, {
47
52
  recursive: true,
48
53
  });
49
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-audora-next",
3
- "version": "0.1.7",
3
+ "version": "2.0.1",
4
4
  "description": "Create a new Audora Next.js app with one command",
5
5
  "keywords": [
6
6
  "create",
@@ -14,12 +14,18 @@
14
14
  "type": "module",
15
15
  "license": "MIT",
16
16
  "private": false,
17
+ "scripts": {
18
+ "test:local": "bash scripts/test-local.sh",
19
+ "clean": "rm -rf node_modules .next .turbo",
20
+ "publish:local": "bun run index.ts --blog"
21
+ },
17
22
  "bin": {
18
23
  "create-audora-next": "./index.ts"
19
24
  },
20
25
  "files": [
21
26
  "index.ts",
22
- "templates"
27
+ "templates",
28
+ "assets"
23
29
  ],
24
30
  "devDependencies": {
25
31
  "@types/bun": "latest"
@@ -0,0 +1,164 @@
1
+ # next-starter
2
+
3
+ This project uses [create-audora-next](https://www.npmjs.com/package/create-audora-next) as its base.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ bunx degit audoralabs/next-starter my-app
9
+ cd my-app
10
+ git init
11
+ bun install
12
+ bun dev
13
+ ```
14
+
15
+ Open [http://localhost:3000](http://localhost:3000) to see your app.
16
+
17
+ ## Planned Features
18
+
19
+ - **MDX loading** - Author posts with MDX and frontmatter support.
20
+ - **Pagination** - First-class paginated lists for posts and tags.
21
+ - **Search** - Fast, client-side search across content.
22
+
23
+ ### Recommended Packages
24
+
25
+ - **MDX** - `@next/mdx` and `contentlayer`
26
+ - **Search** - `flexsearch`
27
+ - **Pagination** - Custom paginator (no external package)
28
+
29
+ ## What's Included
30
+
31
+ ### Core Stack
32
+
33
+ | Technology | Version | Notes |
34
+ | ------------ | ------- | ------------------------------ |
35
+ | Next.js | 16.1.1 | App Router, Turbopack enabled |
36
+ | React | 19.2.3 | React Compiler enabled |
37
+ | TypeScript | 5 | Strict mode |
38
+ | Tailwind CSS | 4 | PostCSS, no config file needed |
39
+ | Bun | Latest | Package manager and runtime |
40
+
41
+ ### SEO
42
+
43
+ This starter ships with everything you need for search engine optimization:
44
+
45
+ - **Open Graph & Twitter Cards** - Complete social sharing metadata
46
+ - **Structured Data (JSON-LD)** - WebSite, Organization, and Breadcrumb schemas
47
+ - **Dynamic robots.txt** - Generated from `robots.ts`
48
+ - **Dynamic sitemap.xml** - Generated from `sitemap.ts`
49
+ - **llms.txt** - AI-friendly documentation for LLM assistants
50
+ - **Title Templates** - Consistent page titles with `%s - Site Name` pattern
51
+ - **Canonical URLs** - Prevent duplicate content issues
52
+ - **PWA Manifest** - Web app manifest with icons and screenshots
53
+
54
+ ### Security
55
+
56
+ Pre-configured security headers in `next.config.ts`:
57
+
58
+ - `X-Content-Type-Options: nosniff`
59
+ - `X-Frame-Options: DENY`
60
+ - `X-XSS-Protection: 1; mode=block`
61
+ - `Referrer-Policy: strict-origin-when-cross-origin`
62
+ - `Permissions-Policy` - Camera, microphone, geolocation disabled
63
+
64
+ ### Developer Experience
65
+
66
+ - **ESLint 9** - Flat config with Next.js rules
67
+ - **Prettier** - With Tailwind CSS plugin for class sorting
68
+ - **Husky** - Git hooks for pre-commit linting
69
+ - **lint-staged** - Run linters on staged files only
70
+ - **Path Alias** - `@/*` mapped to `./src/*`
71
+
72
+ > **Note:** Git hooks (Husky) are installed automatically when a Git repository is present.
73
+ > If you initialize Git after installing dependencies, re-run `bun install` to enable hooks.
74
+
75
+ - **Type Checking** - Dedicated `check-types` script
76
+
77
+ ### UI
78
+
79
+ - **Dark Mode** - System preference detection with next-themes
80
+ - **Geist Font** - Pre-configured sans and mono variants
81
+ - **cn() Utility** - Combines clsx and tailwind-merge
82
+
83
+ ## Project Structure
84
+
85
+ ```
86
+ src/
87
+ ├── app/
88
+ │ ├── layout.tsx # Root layout with metadata and JSON-LD
89
+ │ ├── page.tsx # Home page
90
+ │ ├── manifest.ts # PWA web app manifest
91
+ │ ├── robots.ts # robots.txt generation
92
+ │ ├── sitemap.ts # sitemap.xml generation
93
+ │ ├── llms.txt/ # AI-friendly summary
94
+ │ └── llms-full.txt/ # AI-friendly full documentation
95
+ ├── components/
96
+ │ ├── icons.tsx # Icon components
97
+ │ ├── theme-provider.tsx # Theme context provider
98
+ │ └── theme-toggle.tsx # Dark/light mode toggle
99
+ ├── config/
100
+ │ └── site.ts # Site configuration exports
101
+ ├── data/
102
+ │ ├── site.ts # Site metadata (name, URL, description)
103
+ │ └── llms.ts # llms.txt content configuration
104
+ ├── lib/
105
+ │ └── seo.ts # SEO utilities and JSON-LD generators
106
+ ├── styles/
107
+ │ └── globals.css # Global styles and Tailwind imports
108
+ └── utils/
109
+ └── cn.ts # Class name merge utility
110
+ ```
111
+
112
+ ## Configuration
113
+
114
+ ### Site Metadata
115
+
116
+ Edit `src/data/site.ts` to customize your site:
117
+
118
+ ```typescript
119
+ const SITE_DATA = {
120
+ name: "my-app",
121
+ url: "https://my-app.com",
122
+ ogImage: "https://my-app.com/og.png",
123
+ tagline: "Your tagline here",
124
+ description: "Your full description",
125
+ twitterHandle: "@myapp",
126
+ keywords: ["keyword1", "keyword2"],
127
+ };
128
+ ```
129
+
130
+ ### LLMs.txt Content
131
+
132
+ Edit `src/data/llms.ts` to customize AI-friendly documentation.
133
+
134
+ ## Scripts
135
+
136
+ | Command | Description |
137
+ | ---------------------- | -------------------------------- |
138
+ | `bun dev` | Start dev server with Turbopack |
139
+ | `bun run build` | Build for production |
140
+ | `bun start` | Start production server |
141
+ | `bun lint` | Run ESLint |
142
+ | `bun lint:fix` | Run ESLint with auto-fix |
143
+ | `bun check-types` | Run TypeScript type checking |
144
+ | `bun format` | Format all files with Prettier |
145
+ | `bun format:check` | Check formatting without writing |
146
+ | `bun clean` | Remove .next and node_modules |
147
+ | `bun upgrade:next` | Upgrade Next.js to latest |
148
+ | `bun upgrade:tailwind` | Upgrade Tailwind CSS |
149
+
150
+ ## Why These Choices
151
+
152
+ **Bun** - Faster installs, native TypeScript, smaller lockfile.
153
+
154
+ **App Router** - Server components, streaming, better layouts. Pages Router is legacy.
155
+
156
+ **React Compiler** - Automatic memoization without manual `useMemo`/`useCallback`.
157
+
158
+ **Tailwind CSS 4** - Native CSS layers, `@theme` directive, no config file for basics.
159
+
160
+ **ESLint Flat Config** - Cleaner, more composable than `.eslintrc` files.
161
+
162
+ **No Component Library** - Start clean, add shadcn/ui or Radix when needed.
163
+
164
+ **Turbopack** - Faster dev server and builds.