@dyrected/cli 2.3.3 → 2.3.5
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/dist/commands/generate-types.d.ts +3 -0
- package/dist/commands/generate-types.d.ts.map +1 -0
- package/dist/commands/generate-types.js +34 -0
- package/dist/commands/generate-types.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +280 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/sync-schema.d.ts +3 -0
- package/dist/commands/sync-schema.d.ts.map +1 -0
- package/dist/commands/sync-schema.js +83 -0
- package/dist/commands/sync-schema.js.map +1 -0
- package/dist/index.js +16 -571
- package/dist/index.js.map +1 -1
- package/dist/utils/config-templates.d.ts +4 -0
- package/dist/utils/config-templates.d.ts.map +1 -0
- package/dist/utils/config-templates.js +54 -0
- package/dist/utils/config-templates.js.map +1 -0
- package/dist/utils/detect.d.ts +3 -0
- package/dist/utils/detect.d.ts.map +1 -0
- package/dist/utils/detect.js +27 -0
- package/dist/utils/detect.js.map +1 -0
- package/dist/utils/type-generator.d.ts +6 -0
- package/dist/utils/type-generator.d.ts.map +1 -0
- package/dist/utils/type-generator.js +151 -0
- package/dist/utils/type-generator.js.map +1 -0
- package/dist/utils/writers.d.ts +4 -0
- package/dist/utils/writers.d.ts.map +1 -0
- package/dist/utils/writers.js +110 -0
- package/dist/utils/writers.js.map +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,578 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import path from "path";
|
|
7
|
-
import prompts from "prompts";
|
|
8
|
-
import { execSync } from "child_process";
|
|
9
|
-
import { createJiti } from "jiti";
|
|
10
|
-
import { generateAIPrompt } from "@dyrected/sdk";
|
|
3
|
+
import { registerInit } from "./commands/init.js";
|
|
4
|
+
import { registerGenerateTypes } from "./commands/generate-types.js";
|
|
5
|
+
import { registerSyncSchema } from "./commands/sync-schema.js";
|
|
11
6
|
const program = new Command();
|
|
12
|
-
program.name("dyrected").description("Dyrected CMS CLI tool").version("0.0.1");
|
|
13
|
-
// ─── init ──────────────────────────────────────────────────────────────────
|
|
14
7
|
program
|
|
15
|
-
.
|
|
16
|
-
.description("
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{ title: "Nuxt 3", value: "nuxt" },
|
|
26
|
-
],
|
|
27
|
-
});
|
|
28
|
-
if (!framework) {
|
|
29
|
-
console.log(chalk.yellow("\nAborted."));
|
|
30
|
-
process.exit(0);
|
|
31
|
-
}
|
|
32
|
-
const { quickSetup } = await prompts({
|
|
33
|
-
type: "confirm",
|
|
34
|
-
name: "quickSetup",
|
|
35
|
-
message: "Use Quick Setup (SQLite + Local Storage)?",
|
|
36
|
-
initial: true,
|
|
37
|
-
});
|
|
38
|
-
const { adminPath } = await prompts({
|
|
39
|
-
type: "text",
|
|
40
|
-
name: "adminPath",
|
|
41
|
-
message: "What path should the admin dashboard use?",
|
|
42
|
-
initial: "cms",
|
|
43
|
-
format: (val) => val.replace(/^\//, "").replace(/\/$/, ""),
|
|
44
|
-
});
|
|
45
|
-
let db = "sqlite";
|
|
46
|
-
let storage = "local";
|
|
47
|
-
if (!quickSetup) {
|
|
48
|
-
const dbResponse = await prompts({
|
|
49
|
-
type: "select",
|
|
50
|
-
name: "value",
|
|
51
|
-
message: "Which database adapter?",
|
|
52
|
-
choices: [
|
|
53
|
-
{ title: "PostgreSQL (recommended)", value: "postgres" },
|
|
54
|
-
{ title: "SQLite (local dev)", value: "sqlite" },
|
|
55
|
-
{ title: "MongoDB", value: "mongodb" },
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
db = dbResponse.value;
|
|
59
|
-
const storageResponse = await prompts({
|
|
60
|
-
type: "select",
|
|
61
|
-
name: "value",
|
|
62
|
-
message: "Which storage adapter?",
|
|
63
|
-
choices: [
|
|
64
|
-
{ title: "Local filesystem", value: "local" },
|
|
65
|
-
{ title: "AWS S3", value: "s3" },
|
|
66
|
-
{ title: "Backblaze B2", value: "b2" },
|
|
67
|
-
{ title: "Cloudinary", value: "cloudinary" },
|
|
68
|
-
],
|
|
69
|
-
});
|
|
70
|
-
storage = storageResponse.value;
|
|
71
|
-
}
|
|
72
|
-
const cwd = process.cwd();
|
|
73
|
-
const packageManager = detectPackageManager(cwd);
|
|
74
|
-
// ── 1. Install dependencies ──────────────────────────────────────────
|
|
75
|
-
const frameworkPkg = framework === "next" ? "@dyrected/next" : "@dyrected/nuxt";
|
|
76
|
-
const dbPkg = `@dyrected/db-${db}`;
|
|
77
|
-
const storagePkg = `@dyrected/storage-${storage}`;
|
|
78
|
-
const deps = [frameworkPkg, dbPkg, storagePkg].join(" ");
|
|
79
|
-
console.log(chalk.blue(`\nInstalling ${deps}...`));
|
|
80
|
-
try {
|
|
81
|
-
execSync(`${packageManager} add ${deps}`, { cwd, stdio: "inherit" });
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
console.log(chalk.yellow("\nCould not auto-install. Run the following manually:"));
|
|
85
|
-
console.log(chalk.cyan(` ${packageManager} add ${deps}\n`));
|
|
86
|
-
}
|
|
87
|
-
// ── 2. Write dyrected.config.ts ──────────────────────────────────────
|
|
88
|
-
const dbImport = `import { ${db}Adapter } from '${dbPkg}'`;
|
|
89
|
-
const storageImport = `import { ${storage}Adapter } from '${storagePkg}'`;
|
|
90
|
-
const dbConfig = buildDbConfig(db);
|
|
91
|
-
const storageConfig = buildStorageConfig(storage);
|
|
92
|
-
const configContent = `import { defineCollection, defineGlobal, defineConfig } from '@dyrected/core'
|
|
93
|
-
${dbImport}
|
|
94
|
-
${storageImport}
|
|
95
|
-
|
|
96
|
-
// ── Collections ──────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
const media = defineCollection({
|
|
99
|
-
slug: 'media',
|
|
100
|
-
labels: { singular: 'Media', plural: 'Media' },
|
|
101
|
-
upload: true,
|
|
102
|
-
fields: [
|
|
103
|
-
{ name: 'alt', type: 'text' },
|
|
104
|
-
],
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
const pages = defineCollection({
|
|
108
|
-
slug: 'pages',
|
|
109
|
-
labels: { singular: 'Page', plural: 'Pages' },
|
|
110
|
-
fields: [
|
|
111
|
-
{ name: 'title', type: 'text', required: true },
|
|
112
|
-
{ name: 'slug', type: 'text', required: true },
|
|
113
|
-
{ name: 'content', type: 'richText' },
|
|
114
|
-
{ name: 'featuredImage', type: 'relationship', relationTo: 'media' },
|
|
115
|
-
],
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const posts = defineCollection({
|
|
119
|
-
slug: 'posts',
|
|
120
|
-
labels: { singular: 'Post', plural: 'Posts' },
|
|
121
|
-
fields: [
|
|
122
|
-
{ name: 'title', type: 'text', required: true },
|
|
123
|
-
{ name: 'content', type: 'richText' },
|
|
124
|
-
{ name: 'featuredImage', type: 'relationship', relationTo: 'media' },
|
|
125
|
-
],
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// ── Globals ───────────────────────────────────────────────────────────────
|
|
129
|
-
|
|
130
|
-
const navigation = defineGlobal({
|
|
131
|
-
slug: 'navigation',
|
|
132
|
-
label: 'Navigation',
|
|
133
|
-
fields: [
|
|
134
|
-
{
|
|
135
|
-
name: 'menuItems',
|
|
136
|
-
type: 'array',
|
|
137
|
-
fields: [
|
|
138
|
-
{ name: 'label', type: 'text' },
|
|
139
|
-
{ name: 'link', type: 'relationship', relationTo: 'pages' },
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
const settings = defineGlobal({
|
|
146
|
-
slug: 'settings',
|
|
147
|
-
label: 'Site Settings',
|
|
148
|
-
fields: [
|
|
149
|
-
{ name: 'siteName', type: 'text' },
|
|
150
|
-
{ name: 'logo', type: 'relationship', relationTo: 'media' },
|
|
151
|
-
{ name: 'footerText', type: 'textarea' },
|
|
152
|
-
],
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
// ── Config ────────────────────────────────────────────────────────────────
|
|
156
|
-
|
|
157
|
-
export default defineConfig({
|
|
158
|
-
collections: [media, pages, posts],
|
|
159
|
-
globals: [navigation, settings],
|
|
160
|
-
db: ${dbConfig},
|
|
161
|
-
storage: ${storageConfig},
|
|
162
|
-
})
|
|
163
|
-
`;
|
|
164
|
-
const configPath = path.join(cwd, "dyrected.config.ts");
|
|
165
|
-
if (await fs.pathExists(configPath)) {
|
|
166
|
-
const { overwrite } = await prompts({
|
|
167
|
-
type: "confirm",
|
|
168
|
-
name: "overwrite",
|
|
169
|
-
message: "dyrected.config.ts already exists. Overwrite?",
|
|
170
|
-
initial: false,
|
|
171
|
-
});
|
|
172
|
-
if (!overwrite) {
|
|
173
|
-
console.log(chalk.yellow("Skipping config file."));
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
await fs.outputFile(configPath, configContent);
|
|
177
|
-
console.log(chalk.green("✔ dyrected.config.ts written"));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
await fs.outputFile(configPath, configContent);
|
|
182
|
-
console.log(chalk.green("✔ dyrected.config.ts written"));
|
|
183
|
-
}
|
|
184
|
-
// ── 3. Framework-specific files ──────────────────────────────────────
|
|
185
|
-
if (framework === "next") {
|
|
186
|
-
await writeNextFiles(cwd, adminPath);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
await writeNuxtFiles(cwd, adminPath);
|
|
190
|
-
}
|
|
191
|
-
// ── 4. .env setup ───────────────────────────────────────────────────
|
|
192
|
-
const envContent = buildEnvTemplate(db, storage, framework);
|
|
193
|
-
const envExamplePath = path.join(cwd, ".env.example");
|
|
194
|
-
await fs.outputFile(envExamplePath, envContent);
|
|
195
|
-
console.log(chalk.green("✔ .env.example written"));
|
|
196
|
-
const envPath = path.join(cwd, ".env");
|
|
197
|
-
if (await fs.pathExists(envPath)) {
|
|
198
|
-
const existingEnv = await fs.readFile(envPath, "utf-8");
|
|
199
|
-
const missingVars = envContent
|
|
200
|
-
.split("\n")
|
|
201
|
-
.filter((line) => {
|
|
202
|
-
if (!line || line.startsWith("#"))
|
|
203
|
-
return false;
|
|
204
|
-
const key = line.split("=")[0];
|
|
205
|
-
return !existingEnv.includes(`${key}=`);
|
|
206
|
-
})
|
|
207
|
-
.join("\n");
|
|
208
|
-
if (missingVars) {
|
|
209
|
-
const { appendEnv } = await prompts({
|
|
210
|
-
type: "confirm",
|
|
211
|
-
name: "appendEnv",
|
|
212
|
-
message: ".env already exists. Append missing Dyrected variables?",
|
|
213
|
-
initial: true,
|
|
214
|
-
});
|
|
215
|
-
if (appendEnv) {
|
|
216
|
-
await fs.appendFile(envPath, `\n# ── Dyrected CMS ──────────────────────────────────────────────────\n${missingVars}`);
|
|
217
|
-
console.log(chalk.green("✔ .env file updated with missing variables"));
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
console.log(chalk.dim("ℹ .env already contains all required variables."));
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
const { createEnv } = await prompts({
|
|
226
|
-
type: "confirm",
|
|
227
|
-
name: "createEnv",
|
|
228
|
-
message: ".env file is missing. Create it now?",
|
|
229
|
-
initial: true,
|
|
230
|
-
});
|
|
231
|
-
if (createEnv) {
|
|
232
|
-
await fs.outputFile(envPath, envContent);
|
|
233
|
-
console.log(chalk.green("✔ .env file created"));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// ── Done ─────────────────────────────────────────────────────────────
|
|
237
|
-
console.log(chalk.bold.green("\n✅ Dyrected is ready!\n"));
|
|
238
|
-
console.log(chalk.cyan(` 1. Configure your environment variables in .env`));
|
|
239
|
-
console.log(chalk.cyan(` 2. Open http://localhost:3000/${adminPath} to start managing content.`));
|
|
240
|
-
console.log(chalk.cyan(" 3. Run: npx @dyrected/cli generate:types\n"));
|
|
241
|
-
const promptText = generateAIPrompt(framework, {
|
|
242
|
-
baseUrl: "http://localhost:3000",
|
|
243
|
-
isSelfHosted: true,
|
|
244
|
-
});
|
|
245
|
-
const promptPath = path.join(cwd, "dyrected-ai-prompt.md");
|
|
246
|
-
await fs.outputFile(promptPath, promptText);
|
|
247
|
-
console.log(chalk.bold.magenta("🤖 AI INTEGRATION PROMPT"));
|
|
248
|
-
console.log(chalk.cyan(` Prompt saved to: ${chalk.bold("dyrected-ai-prompt.md")}`));
|
|
249
|
-
console.log(chalk.dim(" Copy the contents of this file to your AI (Claude, GPT, etc.) to scaffold your CMS logic.\n"));
|
|
250
|
-
});
|
|
251
|
-
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
252
|
-
function detectPackageManager(cwd) {
|
|
253
|
-
if (fs.existsSync(path.join(cwd, "pnpm-lock.yaml")))
|
|
254
|
-
return "pnpm";
|
|
255
|
-
if (fs.existsSync(path.join(cwd, "yarn.lock")))
|
|
256
|
-
return "yarn";
|
|
257
|
-
return "npm";
|
|
258
|
-
}
|
|
259
|
-
function buildDbConfig(db) {
|
|
260
|
-
switch (db) {
|
|
261
|
-
case "postgres":
|
|
262
|
-
return `postgresAdapter({ url: process.env.DATABASE_URL! })`;
|
|
263
|
-
case "sqlite":
|
|
264
|
-
return `sqliteAdapter({ filename: './data.db' })`;
|
|
265
|
-
case "mongodb":
|
|
266
|
-
return `mongodbAdapter({ url: process.env.DATABASE_URL! })`;
|
|
267
|
-
default:
|
|
268
|
-
return `postgresAdapter({ url: process.env.DATABASE_URL! })`;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function buildStorageConfig(storage) {
|
|
272
|
-
switch (storage) {
|
|
273
|
-
case "local":
|
|
274
|
-
return `localAdapter({ directory: './public/uploads', serveFrom: '/uploads' })`;
|
|
275
|
-
case "s3":
|
|
276
|
-
return `s3Adapter({ bucket: process.env.S3_BUCKET!, region: process.env.S3_REGION!, accessKeyId: process.env.S3_ACCESS_KEY_ID!, secretAccessKey: process.env.S3_SECRET_ACCESS_KEY! })`;
|
|
277
|
-
case "b2":
|
|
278
|
-
return `b2Adapter({ bucketId: process.env.B2_BUCKET_ID!, keyId: process.env.B2_KEY_ID!, applicationKey: process.env.B2_APPLICATION_KEY! })`;
|
|
279
|
-
case "cloudinary":
|
|
280
|
-
return `cloudinaryAdapter({ cloudName: process.env.CLOUDINARY_CLOUD_NAME!, apiKey: process.env.CLOUDINARY_API_KEY!, apiSecret: process.env.CLOUDINARY_API_SECRET! })`;
|
|
281
|
-
default:
|
|
282
|
-
return `localAdapter({ directory: './public/uploads', serveFrom: '/uploads' })`;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
async function writeNextFiles(cwd, adminPath) {
|
|
286
|
-
const apiRoutePath = path.join(cwd, "app/dyrected/[...route]/route.ts");
|
|
287
|
-
if (!(await fs.pathExists(apiRoutePath))) {
|
|
288
|
-
await fs.outputFile(apiRoutePath, `export { GET, POST, PUT, PATCH, DELETE } from '@dyrected/next'\n`);
|
|
289
|
-
console.log(chalk.green("✔ app/dyrected/[...route]/route.ts written"));
|
|
290
|
-
}
|
|
291
|
-
const adminPagePath = path.join(cwd, `app/${adminPath}/page.tsx`);
|
|
292
|
-
if (!(await fs.pathExists(adminPagePath))) {
|
|
293
|
-
await fs.outputFile(adminPagePath, `import { DyrectedAdmin } from '@dyrected/next/admin'
|
|
294
|
-
|
|
295
|
-
export default function AdminPage() {
|
|
296
|
-
return <DyrectedAdmin apiPath="/dyrected" />
|
|
297
|
-
}
|
|
298
|
-
`);
|
|
299
|
-
console.log(chalk.green(`✔ app/${adminPath}/page.tsx written`));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
async function writeNuxtFiles(cwd, adminPath) {
|
|
303
|
-
console.log(chalk.yellow("\n⚠ Add the module to your nuxt.config.ts:"));
|
|
304
|
-
console.log(chalk.dim(`
|
|
305
|
-
modules: ['@dyrected/nuxt'],
|
|
306
|
-
`));
|
|
307
|
-
const adminPagePath = path.join(cwd, `pages/${adminPath}/index.vue`);
|
|
308
|
-
if (!(await fs.pathExists(adminPagePath))) {
|
|
309
|
-
await fs.outputFile(adminPagePath, `<template>
|
|
310
|
-
<ClientOnly>
|
|
311
|
-
<DyrectedAdmin basename="/${adminPath}" />
|
|
312
|
-
</ClientOnly>
|
|
313
|
-
</template>
|
|
314
|
-
|
|
315
|
-
<script setup lang="ts">
|
|
316
|
-
definePageMeta({
|
|
317
|
-
layout: false,
|
|
318
|
-
});
|
|
319
|
-
</script>
|
|
8
|
+
.name("dyrected")
|
|
9
|
+
.description("Dyrected CMS CLI tool")
|
|
10
|
+
.version("0.0.1")
|
|
11
|
+
.addHelpText("after", `
|
|
12
|
+
Commands:
|
|
13
|
+
init Bootstrap Dyrected in your project (interactive)
|
|
14
|
+
generate:types Generate TypeScript types from your schema
|
|
15
|
+
sync:schema Push your local schema to Dyrected Cloud
|
|
16
|
+
|
|
17
|
+
Run \`npx @dyrected/cli <command> --help\` for detailed usage and examples.
|
|
320
18
|
`);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
function buildEnvTemplate(db, storage, framework) {
|
|
325
|
-
const lines = [
|
|
326
|
-
`# Dyrected CMS — Environment Variables`,
|
|
327
|
-
`DATABASE_URL=${db === "mongodb" ? "mongodb://localhost:27017/dyrected" : "postgres://user:pass@localhost:5432/dyrected"}`,
|
|
328
|
-
`JWT_SECRET=change-me-32-characters-minimum`,
|
|
329
|
-
`ENCRYPTION_KEY=change-me-aes-256-key`,
|
|
330
|
-
``,
|
|
331
|
-
];
|
|
332
|
-
if (storage === "s3") {
|
|
333
|
-
lines.push(`S3_BUCKET=my-bucket`, `S3_REGION=us-east-1`, `S3_ACCESS_KEY_ID=`, `S3_SECRET_ACCESS_KEY=`);
|
|
334
|
-
}
|
|
335
|
-
else if (storage === "b2") {
|
|
336
|
-
lines.push(`B2_BUCKET_ID=`, `B2_KEY_ID=`, `B2_APPLICATION_KEY=`);
|
|
337
|
-
}
|
|
338
|
-
else if (storage === "cloudinary") {
|
|
339
|
-
lines.push(`CLOUDINARY_CLOUD_NAME=`, `CLOUDINARY_API_KEY=`, `CLOUDINARY_API_SECRET=`);
|
|
340
|
-
}
|
|
341
|
-
const prefix = framework === "next" ? "NEXT_PUBLIC_" : "NUXT_PUBLIC_";
|
|
342
|
-
lines.push(``, `${prefix}DYRECTED_URL=http://localhost:3000`, `${prefix}DYRECTED_API_KEY=local-dev`);
|
|
343
|
-
return lines.join("\n") + "\n";
|
|
344
|
-
}
|
|
345
|
-
// ─── generate:types ─────────────────────────────────────────────────────────
|
|
346
|
-
program
|
|
347
|
-
.command("generate:types")
|
|
348
|
-
.description("Generate TypeScript interfaces from your Dyrected schema")
|
|
349
|
-
.option("-u, --url <url>", "Base URL of your Dyrected API (Cloud or self-hosted)")
|
|
350
|
-
.option("-c, --config <path>", "Path to your dyrected.config.ts (Self-hosted)", "./dyrected.config.ts")
|
|
351
|
-
.option("-o, --output <path>", "Output file path", "./dyrected-types.ts")
|
|
352
|
-
.action(async (options) => {
|
|
353
|
-
try {
|
|
354
|
-
let schema;
|
|
355
|
-
if (options.url) {
|
|
356
|
-
console.log(chalk.blue(`Fetching schemas from ${options.url}/api/schemas...`));
|
|
357
|
-
const response = await fetch(`${options.url}/api/schemas`);
|
|
358
|
-
if (!response.ok) {
|
|
359
|
-
throw new Error(`Failed to fetch schemas: ${response.statusText}`);
|
|
360
|
-
}
|
|
361
|
-
schema = await response.json();
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
const configPath = path.resolve(process.cwd(), options.config);
|
|
365
|
-
if (await fs.pathExists(configPath)) {
|
|
366
|
-
console.log(chalk.blue(`Generating types from local config: ${configPath}...`));
|
|
367
|
-
const jiti = createJiti(configPath);
|
|
368
|
-
const configModule = (await jiti.import(configPath));
|
|
369
|
-
schema = configModule.default || configModule;
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
// Fallback to default localhost if no config found
|
|
373
|
-
const url = "http://localhost:3000";
|
|
374
|
-
console.log(chalk.blue(`No local config found. Fetching schemas from ${url}/api/schemas...`));
|
|
375
|
-
const response = await fetch(`${url}/api/schemas`);
|
|
376
|
-
if (!response.ok) {
|
|
377
|
-
throw new Error(`Failed to fetch schemas: ${response.statusText}`);
|
|
378
|
-
}
|
|
379
|
-
schema = await response.json();
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (!schema || !schema.collections) {
|
|
383
|
-
throw new Error("Invalid schema: collections missing.");
|
|
384
|
-
}
|
|
385
|
-
const code = generateTypes(schema);
|
|
386
|
-
const formattedCode = await prettier.format(code, { parser: "typescript" });
|
|
387
|
-
await fs.outputFile(path.resolve(process.cwd(), options.output), formattedCode);
|
|
388
|
-
console.log(chalk.green(`\nSuccess! Types generated at ${options.output}`));
|
|
389
|
-
}
|
|
390
|
-
catch (error) {
|
|
391
|
-
console.error(chalk.red(`\nError: ${error.message}`));
|
|
392
|
-
process.exit(1);
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
function generateTypes(schema) {
|
|
396
|
-
let code = `/**
|
|
397
|
-
* This file was automatically generated by Dyrected CLI.
|
|
398
|
-
* DO NOT MODIFY IT BY HAND.
|
|
399
|
-
*/
|
|
400
|
-
|
|
401
|
-
export interface Media {
|
|
402
|
-
id: string;
|
|
403
|
-
filename: string;
|
|
404
|
-
filesize: number;
|
|
405
|
-
mimeType: string;
|
|
406
|
-
url: string;
|
|
407
|
-
width?: number;
|
|
408
|
-
height?: number;
|
|
409
|
-
createdAt: string;
|
|
410
|
-
updatedAt: string;
|
|
411
|
-
}
|
|
412
|
-
\n`;
|
|
413
|
-
for (const col of schema.collections) {
|
|
414
|
-
if (!col || !col.slug)
|
|
415
|
-
continue;
|
|
416
|
-
const interfaceName = toPascalCase(col.slug);
|
|
417
|
-
// Skip if it's the base Media interface and we already have it
|
|
418
|
-
if (interfaceName === "Media") {
|
|
419
|
-
// We could merge fields here if we want, but usually base Media is enough
|
|
420
|
-
// For now, let's just add the custom fields to a separate interface or merge
|
|
421
|
-
code = code.replace("export interface Media {", `export interface MediaBase {`);
|
|
422
|
-
code = code.replace("export interface MediaBase {", `export interface Media {`);
|
|
423
|
-
}
|
|
424
|
-
const existingInterface = code.includes(`export interface ${interfaceName} {`);
|
|
425
|
-
if (existingInterface && interfaceName !== "Media")
|
|
426
|
-
continue;
|
|
427
|
-
if (interfaceName === "Media") {
|
|
428
|
-
// If it's Media, we just want to add the extra fields to the existing interface
|
|
429
|
-
const extraFields = col.fields.filter((f) => !["filename", "filesize", "mimeType", "url", "width", "height", "createdAt", "updatedAt"].includes(f.name));
|
|
430
|
-
if (extraFields.length > 0) {
|
|
431
|
-
const insertionPoint = code.indexOf("}", code.indexOf("export interface Media {"));
|
|
432
|
-
const fieldsCode = extraFields
|
|
433
|
-
.map((f) => ` ${f.name}${f.required ? "" : "?"}: ${mapFieldType(f)};`)
|
|
434
|
-
.join("\n");
|
|
435
|
-
code = code.slice(0, insertionPoint) + fieldsCode + "\n" + code.slice(insertionPoint);
|
|
436
|
-
}
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
code += `export interface ${interfaceName} {\n`;
|
|
440
|
-
code += ` id: string;\n`;
|
|
441
|
-
for (const field of col.fields) {
|
|
442
|
-
if (field.name === "createdAt" || field.name === "updatedAt" || field.name === "id")
|
|
443
|
-
continue;
|
|
444
|
-
code += ` ${field.name}${field.required ? "" : "?"}: ${mapFieldType(field)};\n`;
|
|
445
|
-
}
|
|
446
|
-
code += ` createdAt: string;\n`;
|
|
447
|
-
code += ` updatedAt: string;\n`;
|
|
448
|
-
code += `}\n\n`;
|
|
449
|
-
}
|
|
450
|
-
for (const glb of schema.globals) {
|
|
451
|
-
if (!glb || !glb.slug)
|
|
452
|
-
continue;
|
|
453
|
-
const interfaceName = `${toPascalCase(glb.slug)}Global`;
|
|
454
|
-
code += `export interface ${interfaceName} {\n`;
|
|
455
|
-
for (const field of glb.fields) {
|
|
456
|
-
code += ` ${field.name}${field.required ? "" : "?"}: ${mapFieldType(field)};\n`;
|
|
457
|
-
}
|
|
458
|
-
code += `}\n\n`;
|
|
459
|
-
}
|
|
460
|
-
code += `export interface DyrectedSchema {\n`;
|
|
461
|
-
code += ` collections: {\n`;
|
|
462
|
-
for (const col of schema.collections) {
|
|
463
|
-
code += ` ${col.slug}: ${toPascalCase(col.slug)};\n`;
|
|
464
|
-
}
|
|
465
|
-
code += ` };\n`;
|
|
466
|
-
code += ` globals: {\n`;
|
|
467
|
-
for (const glb of schema.globals) {
|
|
468
|
-
code += ` ${glb.slug}: ${toPascalCase(glb.slug)}Global;\n`;
|
|
469
|
-
}
|
|
470
|
-
code += ` };\n`;
|
|
471
|
-
code += `}\n`;
|
|
472
|
-
return code;
|
|
473
|
-
}
|
|
474
|
-
function mapFieldType(field) {
|
|
475
|
-
switch (field.type) {
|
|
476
|
-
case "text":
|
|
477
|
-
case "textarea":
|
|
478
|
-
case "richText":
|
|
479
|
-
case "date":
|
|
480
|
-
case "email":
|
|
481
|
-
case "url":
|
|
482
|
-
return "string";
|
|
483
|
-
case "number":
|
|
484
|
-
return "number";
|
|
485
|
-
case "boolean":
|
|
486
|
-
return "boolean";
|
|
487
|
-
case "select":
|
|
488
|
-
return field.options
|
|
489
|
-
? field.options.map((o) => `'${typeof o === "string" ? o : o.value}'`).join(" | ")
|
|
490
|
-
: "string";
|
|
491
|
-
case "relationship": {
|
|
492
|
-
const relationTo = field.relationTo || field.collection;
|
|
493
|
-
return relationTo === "media" ? "Media | string" : `${toPascalCase(relationTo)} | string`;
|
|
494
|
-
}
|
|
495
|
-
case "array":
|
|
496
|
-
if (field.fields) {
|
|
497
|
-
return `Array<{\n${field.fields.map((f) => ` ${f.name}${f.required ? "" : "?"}: ${mapFieldType(f)};`).join("\n")}\n }>`;
|
|
498
|
-
}
|
|
499
|
-
return "any[]";
|
|
500
|
-
case "blocks":
|
|
501
|
-
if (field.blocks) {
|
|
502
|
-
return `Array<${field.blocks.map((b) => `{\n blockType: '${b.slug}';\n${b.fields.map((f) => ` ${f.name}${f.required ? "" : "?"}: ${mapFieldType(f)};`).join("\n")}\n }`).join(" | ")}>`;
|
|
503
|
-
}
|
|
504
|
-
return "any[]";
|
|
505
|
-
case "object":
|
|
506
|
-
if (field.fields) {
|
|
507
|
-
return `{\n${field.fields.map((f) => ` ${f.name}${f.required ? "" : "?"}: ${mapFieldType(f)};`).join("\n")}\n }`;
|
|
508
|
-
}
|
|
509
|
-
return "any";
|
|
510
|
-
default:
|
|
511
|
-
return "any";
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
function toPascalCase(str) {
|
|
515
|
-
if (!str)
|
|
516
|
-
return "Unknown";
|
|
517
|
-
return str.replace(/(^\w|-\w)/g, (m) => m.replace(/-/, "").toUpperCase());
|
|
518
|
-
}
|
|
519
|
-
// ─── sync:schema ─────────────────────────────────────────────────────────────
|
|
520
|
-
program
|
|
521
|
-
.command("sync:schema")
|
|
522
|
-
.description("Sync your local Dyrected schema with the Cloud dashboard")
|
|
523
|
-
.option("-k, --api-key <key>", "Your Dyrected API Key")
|
|
524
|
-
.option("-s, --site-id <id>", "Your Dyrected Site ID")
|
|
525
|
-
.option("-u, --url <url>", "Cloud API URL", "https://prodeegi-vault.onrender.com")
|
|
526
|
-
.option("-c, --config <path>", "Path to your dyrected.config.ts", "./dyrected.config.ts")
|
|
527
|
-
.option("--skip-on-error", "Do not exit with error if sync fails (useful for local builds)")
|
|
528
|
-
.action(async (options) => {
|
|
529
|
-
try {
|
|
530
|
-
const apiKey = options.apiKey || process.env.DYRECTED_API_KEY;
|
|
531
|
-
const siteId = options.siteId || process.env.DYRECTED_SITE_ID;
|
|
532
|
-
const apiUrl = options.url || process.env.DYRECTED_URL || "https://prodeegi-vault.onrender.com";
|
|
533
|
-
const configPath = path.resolve(process.cwd(), options.config);
|
|
534
|
-
const jiti = createJiti(configPath);
|
|
535
|
-
if (!apiKey || !siteId) {
|
|
536
|
-
console.warn(chalk.yellow("\n⚠ Skipping schema sync: API Key or Site ID missing. (Required for Cloud sync, but optional for self-hosted builds)\n"));
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
if (!(await fs.pathExists(configPath))) {
|
|
540
|
-
throw new Error(`Config file not found at ${configPath}`);
|
|
541
|
-
}
|
|
542
|
-
console.log(chalk.blue(`Loading config from ${configPath}...`));
|
|
543
|
-
const configModule = (await jiti.import(configPath));
|
|
544
|
-
const config = configModule.default || configModule;
|
|
545
|
-
if (!config.collections) {
|
|
546
|
-
throw new Error("Invalid config: No collections found.");
|
|
547
|
-
}
|
|
548
|
-
console.log(chalk.blue(`Syncing schema to ${apiUrl}...`));
|
|
549
|
-
const response = await fetch(`${apiUrl}/cloud/workspaces/sites/${siteId}/schema/sync`, {
|
|
550
|
-
method: "POST",
|
|
551
|
-
headers: {
|
|
552
|
-
"Content-Type": "application/json",
|
|
553
|
-
Authorization: `Bearer ${apiKey}`,
|
|
554
|
-
"X-API-Key": apiKey,
|
|
555
|
-
},
|
|
556
|
-
body: JSON.stringify({
|
|
557
|
-
collections: config.collections,
|
|
558
|
-
globals: config.globals || [],
|
|
559
|
-
admin: config.admin || {},
|
|
560
|
-
}),
|
|
561
|
-
});
|
|
562
|
-
if (!response.ok) {
|
|
563
|
-
const error = await response.json().catch(() => ({ message: response.statusText }));
|
|
564
|
-
throw new Error(`Sync failed: ${error.message || response.statusText}`);
|
|
565
|
-
}
|
|
566
|
-
console.log(chalk.green(`\nSuccess! Schema synced successfully for site ${siteId}`));
|
|
567
|
-
}
|
|
568
|
-
catch (error) {
|
|
569
|
-
if (options.skipOnError) {
|
|
570
|
-
console.warn(chalk.yellow(`\n⚠ Sync failed, but skipping error as requested: ${error.message}`));
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
console.error(chalk.red(`\nError: ${error.message}`));
|
|
574
|
-
process.exit(1);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
19
|
+
registerInit(program);
|
|
20
|
+
registerGenerateTypes(program);
|
|
21
|
+
registerSyncSchema(program);
|
|
577
22
|
program.parse();
|
|
578
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/E,8EAA8E;AAE9E,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAE1D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,CAAC;QAClC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,gCAAgC;QACzC,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE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","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,uBAAuB,CAAC;KACpC,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CACV,OAAO,EACP;;;;;;;CAOH,CACE,CAAC;AAEJ,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAE5B,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function buildDbConfig(db: string): string;
|
|
2
|
+
export declare function buildStorageConfig(storage: string): string;
|
|
3
|
+
export declare function buildEnvTemplate(db: string, storage: string, framework: string): string;
|
|
4
|
+
//# sourceMappingURL=config-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-templates.d.ts","sourceRoot":"","sources":["../../src/utils/config-templates.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAahD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAa1D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA0BvF"}
|