@clubedge/create-clubedge-app 0.1.1 → 0.1.3
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/CHANGELOG.md +10 -0
- package/README.md +4 -1
- package/bin/create.mjs +34 -2
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `create-clubedge-app` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.1.3
|
|
6
|
+
|
|
7
|
+
- Keep generated project-name customization aligned with the dashboard's route-local sidebar.
|
|
8
|
+
- Verify a fresh CLI-generated starter through install, typecheck, unit tests, production build, and HTTP smoke checks in CI.
|
|
9
|
+
|
|
10
|
+
## 0.1.2
|
|
11
|
+
|
|
12
|
+
- Customize the landing page, sidebar, dashboard, sign-in page, and metadata with the generated project name.
|
|
13
|
+
- Add automated tests for project naming and generated-file customization.
|
|
14
|
+
|
|
5
15
|
## 0.1.1
|
|
6
16
|
|
|
7
17
|
- Keep CLI spinners out of Git and pnpm subprocess output so terminal progress remains readable.
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ cd my-app
|
|
|
33
33
|
pnpm dev
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
The generated project includes `.env.local`; fill in `DATABASE_URL` to start the app and configure Supabase Auth or other providers as needed. See its `SETUP.md` for database, Redis, storage, and Docker setup.
|
|
36
|
+
The generated project includes `.env.local`; fill in `DATABASE_URL` to start the app and configure Supabase Auth or other providers as needed. The root route is a project-named landing page, and the reference dashboard is available at `/dashboard`. See its `SETUP.md` for database, Redis, storage, and Docker setup.
|
|
37
37
|
|
|
38
38
|
When no destination is provided, the CLI asks where to create the project:
|
|
39
39
|
|
|
@@ -73,8 +73,11 @@ corepack enable
|
|
|
73
73
|
pnpm install
|
|
74
74
|
node ./bin/create.mjs --help
|
|
75
75
|
pnpm check
|
|
76
|
+
pnpm test
|
|
76
77
|
```
|
|
77
78
|
|
|
79
|
+
CI also scaffolds a clean project from the current starter, installs its dependencies, runs linting, typechecking, unit tests, browser checks, and a production build, then starts the generated app and checks the landing page, sign-up page, dashboard, health endpoint, logo, and favicon.
|
|
80
|
+
|
|
78
81
|
## Contributing
|
|
79
82
|
|
|
80
83
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for development and pull request guidance. Report vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
package/bin/create.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { cp, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { basename, dirname, join, resolve } from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
9
|
+
import { pathToFileURL } from "node:url";
|
|
9
10
|
|
|
10
11
|
const starterRepository = "yassine-ahmed/clubedge-starter";
|
|
11
12
|
const defaultRef = "main";
|
|
@@ -160,9 +161,36 @@ async function customizeProject(directory, packageName) {
|
|
|
160
161
|
const layout = await readFile(layoutPath, "utf8");
|
|
161
162
|
const customizedLayout = layout
|
|
162
163
|
.replaceAll('"Clubedge Starter"', JSON.stringify(displayName))
|
|
163
|
-
.replace(
|
|
164
|
+
.replace(`%s \u00b7 Clubedge Starter`, `%s \u00b7 ${displayName}`)
|
|
165
|
+
.replace(
|
|
166
|
+
"A production-minded foundation for Clubedge applications.",
|
|
167
|
+
`${displayName} application foundation.`,
|
|
168
|
+
);
|
|
164
169
|
await writeFile(layoutPath, customizedLayout);
|
|
165
170
|
|
|
171
|
+
const appFiles = [
|
|
172
|
+
join(directory, "apps", "web", "src", "app", "page.tsx"),
|
|
173
|
+
join(directory, "apps", "web", "src", "app", "dashboard", "_components", "app-sidebar.tsx"),
|
|
174
|
+
join(directory, "apps", "web", "src", "app", "dashboard", "page.tsx"),
|
|
175
|
+
join(directory, "apps", "web", "src", "app", "login", "page.tsx"),
|
|
176
|
+
];
|
|
177
|
+
for (const appFile of appFiles) {
|
|
178
|
+
let source;
|
|
179
|
+
try {
|
|
180
|
+
source = await readFile(appFile, "utf8");
|
|
181
|
+
} catch (error) {
|
|
182
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
throw error;
|
|
186
|
+
}
|
|
187
|
+
const customizedSource = source
|
|
188
|
+
.replaceAll("Clubedge Starter", displayName)
|
|
189
|
+
.replaceAll('>Clubedge<', `>${displayName}<`)
|
|
190
|
+
.replaceAll("Starter workspace", "Application workspace");
|
|
191
|
+
await writeFile(appFile, customizedSource);
|
|
192
|
+
}
|
|
193
|
+
|
|
166
194
|
const exampleEnvironment = join(directory, ".env.example");
|
|
167
195
|
const localEnvironment = join(directory, "apps", "web", ".env.local");
|
|
168
196
|
await cp(exampleEnvironment, localEnvironment, { errorOnExist: true });
|
|
@@ -255,4 +283,8 @@ async function main() {
|
|
|
255
283
|
}
|
|
256
284
|
}
|
|
257
285
|
|
|
258
|
-
|
|
286
|
+
export { customizeProject, displayNameFromPackageName, packageNameFromDirectory };
|
|
287
|
+
|
|
288
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
289
|
+
await main();
|
|
290
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clubedge/create-clubedge-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Create a Next.js application from the Clubedge Starter reference implementation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.9.0",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"start": "node ./bin/create.mjs",
|
|
38
|
-
"check": "node --check ./bin/create.mjs"
|
|
38
|
+
"check": "node --check ./bin/create.mjs",
|
|
39
|
+
"test": "node --test"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@clack/prompts": "^1.8.1",
|