create-nocdn-app 0.0.8 → 0.0.10

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 CHANGED
@@ -1,15 +1,9 @@
1
1
  # create-nocdn-app
2
2
 
3
- To install dependencies:
3
+ To use:
4
4
 
5
5
  ```bash
6
- bun install
6
+ bunx create-nocdn-app
7
7
  ```
8
8
 
9
- To run:
10
-
11
- ```bash
12
- bun run index.ts
13
- ```
14
-
15
- This project was created using `bun init` in bun v1.3.5. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
9
+ This will ask you for a project name and create a new Next.js (App Router) project with Tailwind + TypeScript + Prettier + Lucide + some prettier plugins like import sorting and tailwind class sorting.
package/index.js CHANGED
@@ -97,6 +97,16 @@ async function main() {
97
97
  }
98
98
  }
99
99
 
100
+ const projectDescription = await clack.text({
101
+ message: "Project description (optional, press Enter to skip)",
102
+ placeholder: "A brief description of your project",
103
+ });
104
+
105
+ if (clack.isCancel(projectDescription)) {
106
+ clack.cancel("Operation cancelled");
107
+ process.exit(0);
108
+ }
109
+
100
110
  const s = clack.spinner();
101
111
  const pm = getPackageManager();
102
112
 
@@ -125,6 +135,20 @@ async function main() {
125
135
  const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
126
136
  packageJson.name = projectName;
127
137
  await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
138
+
139
+ const layoutPath = path.join(projectPath, "app", "layout.tsx");
140
+ let layoutContent = await fs.readFile(layoutPath, "utf-8");
141
+ layoutContent = layoutContent.replace(
142
+ /title:\s*["']\{\{project-name\}\}["']/,
143
+ `title: "${projectName}"`,
144
+ );
145
+ if (projectDescription && projectDescription.trim()) {
146
+ layoutContent = layoutContent.replace(
147
+ /description:\s*[\s\S]*?(?=,\n|\n\};)/,
148
+ `description: "${projectDescription.trim()}"`,
149
+ );
150
+ }
151
+ await fs.writeFile(layoutPath, layoutContent);
128
152
  s.stop("Project configured");
129
153
 
130
154
  if (!flags.skipInstall) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-nocdn-app",
3
- "version": "0.0.8",
4
- "description": "Scaffold Next.js projects the nocdn way",
3
+ "version": "0.0.10",
4
+ "description": "Scaffold Next.js my preferred way",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -19,9 +19,10 @@
19
19
  "create-nocdn-app",
20
20
  "next.js",
21
21
  "scaffold",
22
- "template"
22
+ "template",
23
+ "nocdn"
23
24
  ],
24
25
  "dependencies": {
25
- "@clack/prompts": "^0.11.0"
26
+ "@clack/prompts": "latest"
26
27
  }
27
28
  }
@@ -1,12 +1,6 @@
1
1
  @import "tailwindcss";
2
2
  @import "tw-animate-css";
3
3
 
4
- @font-face {
5
- font-family: "PP Supply Mono";
6
- src: url("./fonts/PPSupplyMono-Variable.woff2") format("woff2");
7
- font-weight: 100 900;
8
- font-display: swap;
9
- }
10
4
 
11
5
  @custom-variant dark (&:is(.dark *));
12
6
  @plugin "tailwindcss-motion";
@@ -16,9 +10,9 @@
16
10
  --color-foreground: var(--foreground);
17
11
  --font-sans: var(--font-geist-sans);
18
12
  --font-mono: var(--font-geist-mono);
19
- --font-pp-supply-mono: "PP Supply Mono", monospace;
20
13
  --font-jetbrains-mono: var(--font-jetbrains-mono);
21
14
  --font-inter: var(--font-inter);
15
+ --font-ioskeley-mono: var(--font-ioskeley-mono);
22
16
  --color-sidebar-ring: var(--sidebar-ring);
23
17
  --color-sidebar-border: var(--sidebar-border);
24
18
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -172,7 +166,7 @@
172
166
  border-radius: 0.375rem;
173
167
  padding: 2px 0.25rem;
174
168
  font-size: 14px;
175
- font-family: var(--font-pp-supply-mono);
169
+ font-family: var(--font-ioskeley-mono);
176
170
  font-weight: 330;
177
171
  width: fit-content;
178
172
  }
@@ -1,5 +1,6 @@
1
1
  import type { Metadata } from "next";
2
2
  import { Geist, Geist_Mono, Inter, JetBrains_Mono } from "next/font/google";
3
+ import localFont from "next/font/local";
3
4
  import "./globals.css";
4
5
 
5
6
  const geistSans = Geist({
@@ -22,8 +23,18 @@ const jetBrainsMono = JetBrains_Mono({
22
23
  subsets: ["latin"],
23
24
  });
24
25
 
26
+ const ioskeleyMono = localFont({
27
+ src: [
28
+ { path: "./fonts/IoskeleyMono-Light.woff2", weight: "300" },
29
+ { path: "./fonts/IoskeleyMono-Regular.woff2", weight: "400" },
30
+ { path: "./fonts/IoskeleyMono-Medium.woff2", weight: "500" },
31
+ { path: "./fonts/IoskeleyMono-SemiBold.woff2", weight: "600" },
32
+ ],
33
+ variable: "--font-ioskeley-mono",
34
+ });
35
+
25
36
  export const metadata: Metadata = {
26
- title: "nocdn app template",
37
+ title: "{{project-name}}",
27
38
  description:
28
39
  "generated by git nocdn template: https://github.com/nocdn/create-nocdn-app/template",
29
40
  };
@@ -36,7 +47,7 @@ export default function RootLayout({
36
47
  return (
37
48
  <html lang="en">
38
49
  <body
39
- className={`${geistSans.variable} ${geistMono.variable} ${inter.variable} ${jetBrainsMono.variable} bg-background`}
50
+ className={`${geistSans.variable} ${geistMono.variable} ${inter.variable} ${jetBrainsMono.variable} ${ioskeleyMono.variable} bg-background`}
40
51
  >
41
52
  {children}
42
53
  </body>
@@ -18,7 +18,7 @@ export async function CodeBlock({ children, lang }: CodeBlockProps) {
18
18
 
19
19
  return (
20
20
  <div
21
- className="font-pp-supply-mono text-sm [&_pre]:bg-transparent [&_pre]:m-0 [&_pre]:p-0"
21
+ className="font-ioskeley-mono text-sm [&_pre]:bg-transparent [&_pre]:m-0 [&_pre]:p-0"
22
22
  dangerouslySetInnerHTML={{ __html: html }}
23
23
  />
24
24
  );