modern-cms 1.1.1 → 1.1.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 +3 -3
- package/bin/modern-cms.js +16 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,9 +38,9 @@ npx modern-cms
|
|
|
38
38
|
| 1 | Project directory | Must be empty or not yet exist |
|
|
39
39
|
| 2 | Database engine | PostgreSQL or MySQL |
|
|
40
40
|
| 3 | Database host / port / name / username / password | Builds `DATABASE_URL` and rewrites the Prisma schema's datasource for you |
|
|
41
|
-
| 4 |
|
|
42
|
-
| 5 |
|
|
43
|
-
| 6 |
|
|
41
|
+
| 4 | Web app port / API port | Defaults `3000` / `4000` |
|
|
42
|
+
| 5 | Storage provider | AWS S3 (or S3-compatible) / Azure Blob Storage / Cloudinary |
|
|
43
|
+
| 6 | Provider credentials | Endpoint/keys/bucket for S3, connection string/container for Azure, cloud name/API key/secret for Cloudinary |
|
|
44
44
|
| 7 | Public site URL / API URL | Defaults follow whatever ports you picked |
|
|
45
45
|
| 8 | Admin email / password | Leave the password blank to auto-generate one (printed once, at the end) |
|
|
46
46
|
|
package/bin/modern-cms.js
CHANGED
|
@@ -85,12 +85,21 @@ async function main() {
|
|
|
85
85
|
if (fs.existsSync(migrationsDir)) fs.rmSync(migrationsDir, { recursive: true, force: true });
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// --- Ports ---
|
|
89
|
+
const ports = await prompts(
|
|
90
|
+
[
|
|
91
|
+
{ type: "text", name: "webPort", message: "Web app port", initial: "3000" },
|
|
92
|
+
{ type: "text", name: "apiPort", message: "API port", initial: "4000" },
|
|
93
|
+
],
|
|
94
|
+
{ onCancel }
|
|
95
|
+
);
|
|
96
|
+
|
|
88
97
|
// --- Storage ---
|
|
89
98
|
const { provider } = await prompts(
|
|
90
99
|
{
|
|
91
100
|
type: "select",
|
|
92
101
|
name: "provider",
|
|
93
|
-
message: "File storage",
|
|
102
|
+
message: "File storage (AWS S3, Azure Blob Storage, or Cloudinary)",
|
|
94
103
|
choices: [
|
|
95
104
|
{ title: "AWS S3 (or any S3-compatible: MinIO, R2, Spaces...)", value: "s3" },
|
|
96
105
|
{ title: "Azure Blob Storage", value: "azure" },
|
|
@@ -143,13 +152,12 @@ async function main() {
|
|
|
143
152
|
}
|
|
144
153
|
const storageEnvLines = buildStorageEnvLines(provider, storageValues);
|
|
145
154
|
|
|
146
|
-
// ---
|
|
155
|
+
// --- Site / admin (necessary extras beyond what was asked for: the app needs to
|
|
156
|
+
// know its own public URLs, and the CMS needs an initial admin login) ---
|
|
147
157
|
const site = await prompts(
|
|
148
158
|
[
|
|
149
|
-
{ type: "text", name: "
|
|
150
|
-
{ type: "text", name: "
|
|
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}` },
|
|
159
|
+
{ type: "text", name: "siteUrl", message: "Public site URL", initial: `http://localhost:${ports.webPort}` },
|
|
160
|
+
{ type: "text", name: "apiUrl", message: "API URL", initial: `http://localhost:${ports.apiPort}` },
|
|
153
161
|
{ type: "text", name: "adminEmail", message: "Admin login email", initial: "admin@example.com" },
|
|
154
162
|
{ type: "password", name: "adminPassword", message: "Admin login password (leave blank to generate one)" },
|
|
155
163
|
],
|
|
@@ -165,10 +173,10 @@ async function main() {
|
|
|
165
173
|
storageProvider: provider,
|
|
166
174
|
storageEnvLines,
|
|
167
175
|
siteUrl: site.siteUrl,
|
|
168
|
-
apiPort:
|
|
176
|
+
apiPort: ports.apiPort,
|
|
169
177
|
revalidateSecret: randomSecret(),
|
|
170
178
|
});
|
|
171
|
-
const webEnv = buildWebEnv({ apiUrl: site.apiUrl, siteUrl: site.siteUrl, webPort:
|
|
179
|
+
const webEnv = buildWebEnv({ apiUrl: site.apiUrl, siteUrl: site.siteUrl, webPort: ports.webPort });
|
|
172
180
|
const rootEnv = buildRootEnv({ db, databaseUrl, storageProvider: provider, storageEnvLines });
|
|
173
181
|
|
|
174
182
|
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.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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": {
|