create-nodepress-app 1.0.1 → 1.0.2
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 +21 -23
- package/package.json +1 -1
- package/src/new.js +15 -5
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# create-nodepress-app
|
|
2
2
|
|
|
3
|
-
Scaffold a self-hosted [NodePress](https://nodepress.buildwithkode.com) headless CMS
|
|
3
|
+
Scaffold a self-hosted [NodePress](https://nodepress.buildwithkode.com) headless CMS in one command.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx create-nodepress-app my-
|
|
6
|
+
npx create-nodepress-app my-project
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## What it does
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
1. Clones the NodePress repository
|
|
12
|
+
2. Removes dev-only files (`.claude`, `cli/`, `scripts/`, etc.)
|
|
13
|
+
3. Generates a fresh git repository
|
|
14
|
+
4. Creates `backend/.env`, `frontend/.env.local`, and `.env` with random secrets
|
|
15
|
+
5. Runs `npm install` in both `backend/` and `frontend/`
|
|
15
16
|
|
|
16
17
|
## Requirements
|
|
17
18
|
|
|
@@ -22,36 +23,33 @@ npx create-nodepress-app my-cms
|
|
|
22
23
|
## Usage
|
|
23
24
|
|
|
24
25
|
```bash
|
|
25
|
-
npx create-nodepress-app <project-name>
|
|
26
|
-
npx create-nodepress-app --version
|
|
27
|
-
npx create-nodepress-app --help
|
|
26
|
+
npx create-nodepress-app <project-name> # scaffold a new project
|
|
27
|
+
npx create-nodepress-app --version # show version
|
|
28
|
+
npx create-nodepress-app --help # show help
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
##
|
|
31
|
+
## After scaffolding
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
|
|
34
|
-
cd my-cms
|
|
34
|
+
cd my-project
|
|
35
35
|
|
|
36
|
-
#
|
|
37
|
-
|
|
36
|
+
# Local development
|
|
37
|
+
cd backend
|
|
38
|
+
npx prisma migrate dev # create database tables
|
|
39
|
+
npm run start:dev # backend on http://localhost:3000
|
|
38
40
|
|
|
39
|
-
#
|
|
40
|
-
cd
|
|
41
|
-
#
|
|
42
|
-
cd frontend && npm run dev
|
|
41
|
+
# In a new terminal
|
|
42
|
+
cd frontend
|
|
43
|
+
npm run dev # admin panel on http://localhost:5173
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
- API: `http://localhost:3000/api`
|
|
47
|
-
- API docs: `http://localhost:3000/api/docs`
|
|
48
|
-
|
|
49
|
-
On first load the admin panel redirects to `/setup` where you create the first admin account.
|
|
46
|
+
Open `http://localhost:5173` and create your admin account on the `/setup` page.
|
|
50
47
|
|
|
51
48
|
## Links
|
|
52
49
|
|
|
53
50
|
- Website: [nodepress.buildwithkode.com](https://nodepress.buildwithkode.com)
|
|
54
51
|
- GitHub: [github.com/buildwithkode/nodepress](https://github.com/buildwithkode/nodepress)
|
|
52
|
+
- Issues: [github.com/buildwithkode/nodepress/issues](https://github.com/buildwithkode/nodepress/issues)
|
|
55
53
|
|
|
56
54
|
## License
|
|
57
55
|
|
package/package.json
CHANGED
package/src/new.js
CHANGED
|
@@ -75,21 +75,31 @@ module.exports = async function createProject(name) {
|
|
|
75
75
|
ok('Repository cloned');
|
|
76
76
|
|
|
77
77
|
// Remove git history (this is a fresh project, not a fork)
|
|
78
|
-
// Use fs.rmSync for cross-platform support (rm -rf fails on Windows)
|
|
79
78
|
fs.rmSync(path.join(projectDir, '.git'), { recursive: true, force: true });
|
|
80
79
|
run(`git init`, projectDir);
|
|
81
80
|
ok('Fresh git repository initialized');
|
|
82
81
|
|
|
82
|
+
// ── Remove dev-only files (not needed in a user project) ───────────────────
|
|
83
|
+
const devOnly = [
|
|
84
|
+
'.claude', // Claude Code AI config
|
|
85
|
+
'CLAUDE.md', // Claude Code instructions
|
|
86
|
+
'cli', // The CLI tool itself
|
|
87
|
+
'scripts', // Internal dev scripts
|
|
88
|
+
'package.json', // Root package.json (not backend or frontend)
|
|
89
|
+
'package-lock.json',
|
|
90
|
+
'node_modules',
|
|
91
|
+
];
|
|
92
|
+
for (const entry of devOnly) {
|
|
93
|
+
fs.rmSync(path.join(projectDir, entry), { recursive: true, force: true });
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
// ── Generate secrets ───────────────────────────────────────────────────────
|
|
84
97
|
const dbPassword = secret(24);
|
|
85
98
|
const jwtSecret = secret(48);
|
|
86
99
|
|
|
87
100
|
// ── Write backend .env ─────────────────────────────────────────────────────
|
|
88
|
-
const dbUrl = `postgresql://postgres:${dbPassword}@localhost:5432/nodepress`;
|
|
89
101
|
const backendEnv = {
|
|
90
|
-
|
|
91
|
-
DATABASE_URL: dbUrl,
|
|
92
|
-
DIRECT_URL: dbUrl,
|
|
102
|
+
DATABASE_URL: `postgresql://postgres:${dbPassword}@localhost:5432/nodepress`,
|
|
93
103
|
PORT: '3000',
|
|
94
104
|
JWT_SECRET: jwtSecret,
|
|
95
105
|
CORS_ORIGIN: 'http://localhost:5173',
|