modern-cms 1.0.0 → 1.1.0
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 +1 -0
- package/bin/lib.js +4 -4
- package/bin/modern-cms.js +7 -4
- package/package.json +1 -1
- package/template/apps/web/package.json +3 -2
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ You'll be asked for:
|
|
|
13
13
|
- Where to create the project
|
|
14
14
|
- Database engine (PostgreSQL or MySQL) — host, database name, username, password
|
|
15
15
|
- File storage provider (AWS S3 / any S3-compatible service, Azure Blob Storage, or Cloudinary) and its credentials
|
|
16
|
+
- Which port the web app and API should run on (defaults: 3000 and 4000)
|
|
16
17
|
- Site URLs and an admin login
|
|
17
18
|
|
|
18
19
|
The installer scaffolds the full project into your target directory and writes working `.env` files for the API and web app. It does **not** run `npm install` or touch your database for you — it prints the exact next commands to run, so nothing happens on your machine without you seeing it first.
|
package/bin/lib.js
CHANGED
|
@@ -47,7 +47,7 @@ export function buildStorageEnvLines(provider, values) {
|
|
|
47
47
|
];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function buildApiEnv({ databaseUrl, jwtSecret, adminEmail, adminPassword, storageProvider, storageEnvLines, siteUrl, revalidateSecret }) {
|
|
50
|
+
export function buildApiEnv({ databaseUrl, jwtSecret, adminEmail, adminPassword, storageProvider, storageEnvLines, siteUrl, apiPort, revalidateSecret }) {
|
|
51
51
|
return [
|
|
52
52
|
`DATABASE_URL=${databaseUrl}`,
|
|
53
53
|
"",
|
|
@@ -65,7 +65,7 @@ export function buildApiEnv({ databaseUrl, jwtSecret, adminEmail, adminPassword,
|
|
|
65
65
|
...storageEnvLines,
|
|
66
66
|
"",
|
|
67
67
|
"# --- API ---",
|
|
68
|
-
|
|
68
|
+
`API_PORT=${apiPort}`,
|
|
69
69
|
`WEB_ORIGIN=${siteUrl}`,
|
|
70
70
|
"",
|
|
71
71
|
"# --- Cache revalidation ---",
|
|
@@ -78,8 +78,8 @@ export function buildApiEnv({ databaseUrl, jwtSecret, adminEmail, adminPassword,
|
|
|
78
78
|
].join("\n");
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export function buildWebEnv({ apiUrl, siteUrl }) {
|
|
82
|
-
return [`API_URL=${apiUrl}`, `SITE_URL=${siteUrl}`, ""].join("\n");
|
|
81
|
+
export function buildWebEnv({ apiUrl, siteUrl, webPort }) {
|
|
82
|
+
return [`API_URL=${apiUrl}`, `SITE_URL=${siteUrl}`, `PORT=${webPort}`, ""].join("\n");
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export function buildRootEnv({ db, databaseUrl, storageProvider, storageEnvLines }) {
|
package/bin/modern-cms.js
CHANGED
|
@@ -143,11 +143,13 @@ async function main() {
|
|
|
143
143
|
}
|
|
144
144
|
const storageEnvLines = buildStorageEnvLines(provider, storageValues);
|
|
145
145
|
|
|
146
|
-
// ---
|
|
146
|
+
// --- Ports / site / admin ---
|
|
147
147
|
const site = await prompts(
|
|
148
148
|
[
|
|
149
|
-
{ type: "text", name: "
|
|
150
|
-
{ type: "text", name: "
|
|
149
|
+
{ type: "text", name: "webPort", message: "Web app port", initial: "3000" },
|
|
150
|
+
{ type: "text", name: "apiPort", message: "API port", initial: "4000" },
|
|
151
|
+
{ type: "text", name: "siteUrl", message: "Public site URL", initial: (_, values) => `http://localhost:${values.webPort}` },
|
|
152
|
+
{ type: "text", name: "apiUrl", message: "API URL", initial: (_, values) => `http://localhost:${values.apiPort}` },
|
|
151
153
|
{ type: "text", name: "adminEmail", message: "Admin login email", initial: "admin@example.com" },
|
|
152
154
|
{ type: "password", name: "adminPassword", message: "Admin login password (leave blank to generate one)" },
|
|
153
155
|
],
|
|
@@ -163,9 +165,10 @@ async function main() {
|
|
|
163
165
|
storageProvider: provider,
|
|
164
166
|
storageEnvLines,
|
|
165
167
|
siteUrl: site.siteUrl,
|
|
168
|
+
apiPort: site.apiPort,
|
|
166
169
|
revalidateSecret: randomSecret(),
|
|
167
170
|
});
|
|
168
|
-
const webEnv = buildWebEnv({ apiUrl: site.apiUrl, siteUrl: site.siteUrl });
|
|
171
|
+
const webEnv = buildWebEnv({ apiUrl: site.apiUrl, siteUrl: site.siteUrl, webPort: site.webPort });
|
|
169
172
|
const rootEnv = buildRootEnv({ db, databaseUrl, storageProvider: provider, storageEnvLines });
|
|
170
173
|
|
|
171
174
|
fs.writeFileSync(path.join(dest, "apps/api/.env"), apiEnv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-cms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Self-hosted, drag-and-drop website CMS (Next.js + Express + Prisma). Interactive installer scaffolds a full project with your choice of PostgreSQL/MySQL and AWS S3/Azure Blob/Cloudinary storage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "next dev --webpack
|
|
6
|
+
"dev": "dotenv -e .env.local -- next dev --webpack",
|
|
7
7
|
"build": "next build",
|
|
8
|
-
"start": "next start
|
|
8
|
+
"start": "dotenv -e .env.local -- next start",
|
|
9
9
|
"lint": "eslint ."
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/react-dom": "^19.2.3",
|
|
38
38
|
"@types/three": "^0.185.0",
|
|
39
39
|
"autoprefixer": "^10.4.20",
|
|
40
|
+
"dotenv-cli": "^11.0.0",
|
|
40
41
|
"eslint": "^10.6.0",
|
|
41
42
|
"eslint-config-next": "^16.2.10",
|
|
42
43
|
"postcss": "^8.4.47",
|