create-nocdn-app 0.0.9 → 0.0.11

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/index.js CHANGED
@@ -18,6 +18,7 @@ const flags = {
18
18
  open: args.includes("--open"),
19
19
  useNpm: args.includes("--use-npm"),
20
20
  usePnpm: args.includes("--use-pnpm"),
21
+ testing: args.includes("--testing"),
21
22
  };
22
23
 
23
24
  const cliProjectName = args.find((arg) => !arg.startsWith("-"));
@@ -38,6 +39,7 @@ Options:
38
39
  --open Open project in default editor after creation
39
40
  --use-npm Use npm instead of bun for installing dependencies
40
41
  --use-pnpm Use pnpm instead of bun for installing dependencies
42
+ --testing Use local template instead of cloning from GitHub (for development)
41
43
 
42
44
  Examples:
43
45
  bunx create-nocdn-app Interactive mode
@@ -97,6 +99,16 @@ async function main() {
97
99
  }
98
100
  }
99
101
 
102
+ const projectDescription = await clack.text({
103
+ message: "Project description (optional, press Enter to skip)",
104
+ placeholder: "A brief description of your project",
105
+ });
106
+
107
+ if (clack.isCancel(projectDescription)) {
108
+ clack.cancel("Operation cancelled");
109
+ process.exit(0);
110
+ }
111
+
100
112
  const s = clack.spinner();
101
113
  const pm = getPackageManager();
102
114
 
@@ -109,22 +121,41 @@ async function main() {
109
121
  process.exit(1);
110
122
  } catch {}
111
123
 
112
- s.start("Cloning template...");
113
- const tempPath = path.join(process.cwd(), `.temp-${Date.now()}`);
114
- await execAsync(
115
- `git clone --depth 1 https://github.com/nocdn/create-nocdn-app.git "${tempPath}"`,
116
- );
117
-
118
- await fs.rename(path.join(tempPath, "template"), projectPath);
119
-
120
- await fs.rm(tempPath, { recursive: true, force: true });
121
- s.stop("Template cloned");
124
+ s.start(flags.testing ? "Copying local template..." : "Cloning template...");
125
+ if (flags.testing) {
126
+ const scriptDir = new URL(".", import.meta.url).pathname;
127
+ const localTemplatePath = path.join(scriptDir, "template");
128
+ await fs.cp(localTemplatePath, projectPath, { recursive: true });
129
+ s.stop("Local template copied");
130
+ } else {
131
+ const tempPath = path.join(process.cwd(), `.temp-${Date.now()}`);
132
+ await execAsync(
133
+ `git clone --depth 1 https://github.com/nocdn/create-nocdn-app.git "${tempPath}"`,
134
+ );
135
+ await fs.rename(path.join(tempPath, "template"), projectPath);
136
+ await fs.rm(tempPath, { recursive: true, force: true });
137
+ s.stop("Template cloned");
138
+ }
122
139
 
123
140
  s.start("Configuring project...");
124
141
  const packageJsonPath = path.join(projectPath, "package.json");
125
142
  const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
126
143
  packageJson.name = projectName;
127
144
  await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
145
+
146
+ const layoutPath = path.join(projectPath, "app", "layout.tsx");
147
+ let layoutContent = await fs.readFile(layoutPath, "utf-8");
148
+ layoutContent = layoutContent.replace(
149
+ /title:\s*["']\{\{project-name\}\}["']/,
150
+ `title: "${projectName}"`,
151
+ );
152
+ if (projectDescription && projectDescription.trim()) {
153
+ layoutContent = layoutContent.replace(
154
+ /description:\s*[\s\S]*?(?=,\n|\n\};)/,
155
+ `description: "${projectDescription.trim()}"`,
156
+ );
157
+ }
158
+ await fs.writeFile(layoutPath, layoutContent);
128
159
  s.stop("Project configured");
129
160
 
130
161
  if (!flags.skipInstall) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nocdn-app",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Scaffold Next.js my preferred way",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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,20 @@ 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
+ { path: "./fonts/IoskeleyMono-Bold.woff2", weight: "700" },
33
+ { path: "./fonts/IoskeleyMono-ExtraBold.woff2", weight: "800" },
34
+ ],
35
+ variable: "--font-ioskeley-mono",
36
+ });
37
+
25
38
  export const metadata: Metadata = {
26
- title: "nocdn app template",
39
+ title: "{{project-name}}",
27
40
  description:
28
41
  "generated by git nocdn template: https://github.com/nocdn/create-nocdn-app/template",
29
42
  };
@@ -36,7 +49,7 @@ export default function RootLayout({
36
49
  return (
37
50
  <html lang="en">
38
51
  <body
39
- className={`${geistSans.variable} ${geistMono.variable} ${inter.variable} ${jetBrainsMono.variable} bg-background`}
52
+ className={`${geistSans.variable} ${geistMono.variable} ${inter.variable} ${jetBrainsMono.variable} ${ioskeleyMono.variable} bg-background`}
40
53
  >
41
54
  {children}
42
55
  </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
  );