dyrected 2.5.49

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.
Files changed (51) hide show
  1. package/LICENSE.md +50 -0
  2. package/README.md +3 -0
  3. package/dist/commands/generate-ai-rules.d.ts +3 -0
  4. package/dist/commands/generate-ai-rules.d.ts.map +1 -0
  5. package/dist/commands/generate-ai-rules.js +16 -0
  6. package/dist/commands/generate-ai-rules.js.map +1 -0
  7. package/dist/commands/generate-types.d.ts +3 -0
  8. package/dist/commands/generate-types.d.ts.map +1 -0
  9. package/dist/commands/generate-types.js +34 -0
  10. package/dist/commands/generate-types.js.map +1 -0
  11. package/dist/commands/init.d.ts +3 -0
  12. package/dist/commands/init.d.ts.map +1 -0
  13. package/dist/commands/init.js +397 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/commands/sync-schema.d.ts +3 -0
  16. package/dist/commands/sync-schema.d.ts.map +1 -0
  17. package/dist/commands/sync-schema.js +89 -0
  18. package/dist/commands/sync-schema.js.map +1 -0
  19. package/dist/commands/upgrade.d.ts +3 -0
  20. package/dist/commands/upgrade.d.ts.map +1 -0
  21. package/dist/commands/upgrade.js +58 -0
  22. package/dist/commands/upgrade.js.map +1 -0
  23. package/dist/index.d.ts +3 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +29 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/utils/ai-rules-template.d.ts +2 -0
  28. package/dist/utils/ai-rules-template.d.ts.map +1 -0
  29. package/dist/utils/ai-rules-template.js +411 -0
  30. package/dist/utils/ai-rules-template.js.map +1 -0
  31. package/dist/utils/config-templates.d.ts +5 -0
  32. package/dist/utils/config-templates.d.ts.map +1 -0
  33. package/dist/utils/config-templates.js +65 -0
  34. package/dist/utils/config-templates.js.map +1 -0
  35. package/dist/utils/detect.d.ts +11 -0
  36. package/dist/utils/detect.d.ts.map +1 -0
  37. package/dist/utils/detect.js +45 -0
  38. package/dist/utils/detect.js.map +1 -0
  39. package/dist/utils/env.d.ts +10 -0
  40. package/dist/utils/env.d.ts.map +1 -0
  41. package/dist/utils/env.js +52 -0
  42. package/dist/utils/env.js.map +1 -0
  43. package/dist/utils/type-generator.d.ts +8 -0
  44. package/dist/utils/type-generator.d.ts.map +1 -0
  45. package/dist/utils/type-generator.js +246 -0
  46. package/dist/utils/type-generator.js.map +1 -0
  47. package/dist/utils/writers.d.ts +6 -0
  48. package/dist/utils/writers.d.ts.map +1 -0
  49. package/dist/utils/writers.js +152 -0
  50. package/dist/utils/writers.js.map +1 -0
  51. package/package.json +43 -0
package/LICENSE.md ADDED
@@ -0,0 +1,50 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Dyrected
6
+ Licensed Work: Dyrected
7
+ Additional Use Grant: Production use and commercial use of the Licensed Work are permitted for your own internal business operations, your own websites and applications, and client websites or applications that you build or deploy on behalf of a client, provided that you do not, without a separate commercial license from the Licensor, (a) provide the Licensed Work as a hosted or managed service to third parties, (b) embed, white-label, sublicense, or otherwise redistribute the Licensed Work as part of a multi-tenant or customer-facing SaaS, platform, or developer service, or (c) enable third parties to create, manage, or operate independent projects, sites, workspaces, or environments using the Licensed Work as a material part of the service you provide.
8
+ Change Date: 2030-05-18
9
+ Change License: Apache License 2.0
10
+
11
+ ---
12
+
13
+ Business Source License 1.1
14
+
15
+ License text copyright © 2024 MariaDB plc, All Rights Reserved.
16
+ “Business Source License” is a trademark of MariaDB plc.
17
+
18
+ ### Terms
19
+
20
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
21
+
22
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
23
+
24
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
25
+
26
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
27
+
28
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
29
+
30
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
31
+
32
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
33
+
34
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
35
+
36
+ MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark “Business Source License”, as long as you comply with the Covenants of Licensor below.
37
+
38
+ ### Covenants of Licensor
39
+
40
+ In consideration of the right to use this License’s text and the “Business Source License” name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
41
+
42
+ 1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where “compatible” means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
43
+
44
+ 2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text “None”.
45
+
46
+ 3. Not to modify this License in any other way.
47
+
48
+ ---
49
+
50
+ The Business Source License (this document, or the “License”) is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # dyrected
2
+
3
+ This is the cli package/app for the Dyrected ecosystem.
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerGenerateAiRules(program: Command): void;
3
+ //# sourceMappingURL=generate-ai-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-ai-rules.d.ts","sourceRoot":"","sources":["../../src/commands/generate-ai-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAgBvD"}
@@ -0,0 +1,16 @@
1
+ import chalk from "chalk";
2
+ import fs from "fs-extra";
3
+ import path from "path";
4
+ import { buildAiRules } from "@dyrected/knowledge";
5
+ export function registerGenerateAiRules(program) {
6
+ program
7
+ .command("generate:ai-rules")
8
+ .description("Generate the canonical Dyrected instructions for AI coding tools")
9
+ .option("-o, --output <path>", "Output file path", ".dyrected/ai-rules.md")
10
+ .action(async ({ output }) => {
11
+ const target = path.resolve(process.cwd(), output);
12
+ await fs.outputFile(target, buildAiRules());
13
+ console.log(chalk.green(`✔ Dyrected AI rules written to ${path.relative(process.cwd(), target)}`));
14
+ });
15
+ }
16
+ //# sourceMappingURL=generate-ai-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-ai-rules.js","sourceRoot":"","sources":["../../src/commands/generate-ai-rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,mBAAmB,CAAC;SAC5B,WAAW,CACV,kEAAkE,CACnE;SACA,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,uBAAuB,CAAC;SAC1E,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAsB,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QACnD,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,mCAAmC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAC1E,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerGenerateTypes(program: Command): void;
3
+ //# sourceMappingURL=generate-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-types.d.ts","sourceRoot":"","sources":["../../src/commands/generate-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAgCrD"}
@@ -0,0 +1,34 @@
1
+ import chalk from "chalk";
2
+ import { runGenerateTypes } from "../utils/type-generator.js";
3
+ export function registerGenerateTypes(program) {
4
+ program
5
+ .command("generate:types")
6
+ .description("Generate TypeScript interfaces from your Dyrected schema")
7
+ .option("-u, --url <url>", "Base URL of your Dyrected API (Cloud or self-hosted)")
8
+ .option("-c, --config <path>", "Path to your dyrected.config.ts (Self-hosted)", "./dyrected.config.ts")
9
+ .option("-o, --output <path>", "Output file path", "./dyrected-types.ts")
10
+ .addHelpText("after", `
11
+ Examples:
12
+ # Generate from local config (default)
13
+ $ npx dyrected generate:types
14
+
15
+ # Generate from a self-hosted instance
16
+ $ npx dyrected generate:types --url http://localhost:3000
17
+
18
+ # Generate from Dyrected Cloud
19
+ $ npx dyrected generate:types --url https://your-site.dyrected.com
20
+
21
+ # Custom config and output paths
22
+ $ npx dyrected generate:types --config ./cms/dyrected.config.ts --output ./types/cms.ts
23
+ `)
24
+ .action(async (options) => {
25
+ try {
26
+ await runGenerateTypes({ url: options.url, config: options.config, output: options.output });
27
+ }
28
+ catch (error) {
29
+ console.error(chalk.red(`\nError: ${error.message}`));
30
+ process.exit(1);
31
+ }
32
+ });
33
+ }
34
+ //# sourceMappingURL=generate-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-types.js","sourceRoot":"","sources":["../../src/commands/generate-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,0DAA0D,CAAC;SACvE,MAAM,CAAC,iBAAiB,EAAE,sDAAsD,CAAC;SACjF,MAAM,CAAC,qBAAqB,EAAE,+CAA+C,EAAE,sBAAsB,CAAC;SACtG,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;SACxE,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;CAaL,CACI;SACA,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,gBAAgB,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/F,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerInit(program: Command): void;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QA2U5C"}
@@ -0,0 +1,397 @@
1
+ import chalk from "chalk";
2
+ import fs from "fs-extra";
3
+ import path from "path";
4
+ import prompts from "prompts";
5
+ import { execSync } from "child_process";
6
+ import { detectFramework, detectPackageManager } from "../utils/detect.js";
7
+ import { buildAiRules } from "@dyrected/knowledge";
8
+ import { buildDbConfig, buildStorageConfig, buildEnvTemplate, buildViteEnvTemplate, } from "../utils/config-templates.js";
9
+ import { writeNextFiles, writeNuxtFiles, writeReactFiles, writeVueFiles } from "../utils/writers.js";
10
+ export function registerInit(program) {
11
+ program
12
+ .command("init")
13
+ .description("Bootstrap a new Dyrected CMS project")
14
+ .option("-y, --yes", "Skip prompts and use default settings (SQLite + Local Storage)")
15
+ .option("-f, --framework <framework>", "Target framework (next, nuxt, react, vue)")
16
+ .option("-d, --db <adapter>", "Database adapter (sqlite, postgres, mysql, mongodb)")
17
+ .option("-s, --storage <adapter>", "Storage adapter (local, s3, b2, cloudinary)")
18
+ .option("-p, --path <path>", "Admin dashboard route path", "admin")
19
+ .option("-o, --overwrite", "Overwrite existing config/env files without confirmation")
20
+ .addHelpText("after", `
21
+ Examples:
22
+ # Interactive setup (detects your framework automatically)
23
+ $ npx dyrected init
24
+
25
+ # Non-interactive automated setup (Next.js, Postgres, S3, custom path)
26
+ $ npx dyrected init -y -f next -d postgres -s s3 -p custom-admin
27
+
28
+ After running init:
29
+ 1. Fill in the values in .env
30
+ 2. Start your dev server
31
+ 3. Open the admin path you chose (default: /cms)
32
+ `)
33
+ .action(async (options) => {
34
+ console.log(chalk.bold("\n🚀 Welcome to Dyrected CMS\n"));
35
+ const cwd = process.cwd();
36
+ const detection = await detectFramework(cwd);
37
+ const autoAccept = !!options.yes;
38
+ const forceOverwrite = !!options.overwrite || autoAccept;
39
+ if (detection && !detection.supported) {
40
+ console.log(chalk.yellow(` Detected framework: ${detection.name}`));
41
+ console.log(chalk.red(`\n Dyrected doesn't have a native ${detection.name} integration yet.`));
42
+ console.log(chalk.dim(` Supported frameworks: Next.js, Nuxt 3, React, Vue`));
43
+ console.log(chalk.dim(` You can still use the SDK directly: https://docs.dyrected.com/docs/integrations/sdk\n`));
44
+ process.exit(0);
45
+ }
46
+ let framework;
47
+ const validFrameworks = ["next", "nuxt", "react", "vue"];
48
+ if (options.framework && validFrameworks.includes(options.framework)) {
49
+ framework = options.framework;
50
+ }
51
+ else if (detection?.supported) {
52
+ const labels = {
53
+ next: "Next.js",
54
+ nuxt: "Nuxt 3",
55
+ react: "React",
56
+ vue: "Vue",
57
+ };
58
+ console.log(chalk.dim(` Detected framework: ${labels[detection.framework]} — skipping prompt\n`));
59
+ framework = detection.framework;
60
+ }
61
+ else if (autoAccept) {
62
+ console.log(chalk.dim(" No framework detected. Defaulting to Next.js\n"));
63
+ framework = "next";
64
+ }
65
+ else {
66
+ const answer = await prompts({
67
+ type: "select",
68
+ name: "framework",
69
+ message: "Which framework are you using?",
70
+ choices: [
71
+ { title: "Next.js", value: "next" },
72
+ { title: "Nuxt 3", value: "nuxt" },
73
+ { title: "React", value: "react" },
74
+ { title: "Vue", value: "vue" },
75
+ ],
76
+ });
77
+ if (!answer.framework) {
78
+ console.log(chalk.yellow("\nAborted."));
79
+ process.exit(0);
80
+ }
81
+ framework = answer.framework;
82
+ }
83
+ const isSpa = framework === "react" || framework === "vue";
84
+ let adminPath = options.path || "admin";
85
+ if (!options.path && !autoAccept) {
86
+ const answer = await prompts({
87
+ type: "text",
88
+ name: "adminPath",
89
+ message: "What path should the admin dashboard use?",
90
+ initial: "admin",
91
+ format: (val) => val.replace(/^\//, "").replace(/\/$/, ""),
92
+ });
93
+ adminPath = answer.adminPath || "admin";
94
+ }
95
+ let db = "sqlite";
96
+ let storage = "local";
97
+ const validDbs = ["sqlite", "postgres", "mysql", "mongodb"];
98
+ const validStorages = ["local", "s3", "b2", "cloudinary"];
99
+ if (options.db && validDbs.includes(options.db)) {
100
+ db = options.db;
101
+ }
102
+ if (options.storage && validStorages.includes(options.storage)) {
103
+ storage = options.storage;
104
+ }
105
+ if (!isSpa && !options.db && !options.storage && !autoAccept) {
106
+ const { quickSetup } = await prompts({
107
+ type: "confirm",
108
+ name: "quickSetup",
109
+ message: "Use Quick Setup (SQLite + Local Storage)?",
110
+ initial: true,
111
+ });
112
+ if (!quickSetup) {
113
+ const dbResponse = await prompts({
114
+ type: "select",
115
+ name: "value",
116
+ message: "Which database adapter?",
117
+ choices: [
118
+ { title: "PostgreSQL (recommended)", value: "postgres" },
119
+ { title: "MySQL", value: "mysql" },
120
+ { title: "SQLite (local dev)", value: "sqlite" },
121
+ { title: "MongoDB", value: "mongodb" },
122
+ ],
123
+ });
124
+ db = dbResponse.value;
125
+ const storageResponse = await prompts({
126
+ type: "select",
127
+ name: "value",
128
+ message: "Which storage adapter?",
129
+ choices: [
130
+ { title: "Local filesystem", value: "local" },
131
+ { title: "AWS S3", value: "s3" },
132
+ { title: "Backblaze B2", value: "b2" },
133
+ { title: "Cloudinary", value: "cloudinary" },
134
+ ],
135
+ });
136
+ storage = storageResponse.value;
137
+ }
138
+ }
139
+ const packageManager = detectPackageManager(cwd);
140
+ // ── 1. Install dependencies ────────────────────────────────────────────
141
+ let deps;
142
+ if (isSpa) {
143
+ const frameworkPkg = framework === "react" ? "@dyrected/react" : "@dyrected/vue";
144
+ deps = frameworkPkg;
145
+ }
146
+ else {
147
+ const frameworkPkg = framework === "next" ? "@dyrected/next" : "@dyrected/nuxt";
148
+ const dbPkg = `@dyrected/db-${db}`;
149
+ const storagePkg = `@dyrected/storage-${storage}`;
150
+ deps = ["@dyrected/core", frameworkPkg, dbPkg, storagePkg].join(" ");
151
+ }
152
+ console.log(chalk.blue(`\nInstalling ${deps}...`));
153
+ try {
154
+ execSync(`${packageManager} add ${deps}`, { cwd, stdio: "inherit" });
155
+ }
156
+ catch {
157
+ console.log(chalk.yellow("\nCould not auto-install. Run the following manually:"));
158
+ console.log(chalk.cyan(` ${packageManager} add ${deps}\n`));
159
+ }
160
+ // ── 2. Write dyrected.config.ts (full-stack only) ─────────────────────
161
+ if (!isSpa) {
162
+ const dbPkg = `@dyrected/db-${db}`;
163
+ const storagePkg = `@dyrected/storage-${storage}`;
164
+ const dbImport = `import { ${db}Adapter } from '${dbPkg}'`;
165
+ const storageFactory = {
166
+ local: "localStorage",
167
+ s3: "s3Storage",
168
+ b2: "b2Storage",
169
+ cloudinary: "cloudinaryStorage",
170
+ }[storage];
171
+ const storageImport = `import { ${storageFactory} } from '${storagePkg}'`;
172
+ const configContent = buildDyrectedConfig(dbImport, storageImport, buildDbConfig(db), buildStorageConfig(storage));
173
+ const configPath = path.join(cwd, "dyrected.config.ts");
174
+ if (await fs.pathExists(configPath)) {
175
+ let overwrite = forceOverwrite;
176
+ if (!forceOverwrite) {
177
+ const answer = await prompts({
178
+ type: "confirm",
179
+ name: "overwrite",
180
+ message: "dyrected.config.ts already exists. Overwrite?",
181
+ initial: false,
182
+ });
183
+ overwrite = answer.overwrite;
184
+ }
185
+ if (!overwrite) {
186
+ console.log(chalk.yellow("Skipping config file."));
187
+ }
188
+ else {
189
+ await fs.outputFile(configPath, configContent);
190
+ console.log(chalk.green("✔ dyrected.config.ts written"));
191
+ }
192
+ }
193
+ else {
194
+ await fs.outputFile(configPath, configContent);
195
+ console.log(chalk.green("✔ dyrected.config.ts written"));
196
+ }
197
+ }
198
+ // ── 3. Framework-specific files ────────────────────────────────────────
199
+ if (framework === "next") {
200
+ await writeNextFiles(cwd, adminPath);
201
+ }
202
+ else if (framework === "nuxt") {
203
+ await writeNuxtFiles(cwd, adminPath);
204
+ }
205
+ else if (framework === "react") {
206
+ await writeReactFiles(cwd, adminPath);
207
+ }
208
+ else if (framework === "vue") {
209
+ await writeVueFiles(cwd, adminPath);
210
+ }
211
+ // ── 4. .env setup ──────────────────────────────────────────────────────
212
+ const envContent = isSpa ? buildViteEnvTemplate() : buildEnvTemplate(db, storage, framework);
213
+ const envExamplePath = path.join(cwd, ".env.example");
214
+ await fs.outputFile(envExamplePath, envContent);
215
+ console.log(chalk.green("✔ .env.example written"));
216
+ const envPath = path.join(cwd, ".env");
217
+ if (await fs.pathExists(envPath)) {
218
+ const existingEnv = await fs.readFile(envPath, "utf-8");
219
+ const missingVars = envContent
220
+ .split("\n")
221
+ .filter((line) => {
222
+ if (!line || line.startsWith("#"))
223
+ return false;
224
+ const key = line.split("=")[0];
225
+ return !existingEnv.includes(`${key}=`);
226
+ })
227
+ .join("\n");
228
+ if (missingVars) {
229
+ let appendEnv = forceOverwrite;
230
+ if (!forceOverwrite) {
231
+ const answer = await prompts({
232
+ type: "confirm",
233
+ name: "appendEnv",
234
+ message: ".env already exists. Append missing Dyrected variables?",
235
+ initial: true,
236
+ });
237
+ appendEnv = answer.appendEnv;
238
+ }
239
+ if (appendEnv) {
240
+ await fs.appendFile(envPath, `\n# ── Dyrected CMS ──────────────────────────────────────────────────\n${missingVars}`);
241
+ console.log(chalk.green("✔ .env file updated with missing variables"));
242
+ }
243
+ }
244
+ else {
245
+ console.log(chalk.dim("ℹ .env already contains all required variables."));
246
+ }
247
+ }
248
+ else {
249
+ let createEnv = forceOverwrite;
250
+ if (!forceOverwrite) {
251
+ const answer = await prompts({
252
+ type: "confirm",
253
+ name: "createEnv",
254
+ message: ".env file is missing. Create it now?",
255
+ initial: true,
256
+ });
257
+ createEnv = answer.createEnv;
258
+ }
259
+ if (createEnv) {
260
+ await fs.outputFile(envPath, envContent);
261
+ console.log(chalk.green("✔ .env file created"));
262
+ }
263
+ }
264
+ // ── AI rules ──────────────────────────────────────────────────────────
265
+ const aiRulesPath = path.join(cwd, ".dyrected", "ai-rules.md");
266
+ if (!(await fs.pathExists(aiRulesPath))) {
267
+ await fs.outputFile(aiRulesPath, buildAiRules());
268
+ console.log(chalk.green("✔ .dyrected/ai-rules.md created"));
269
+ }
270
+ const agentRulePointers = [
271
+ {
272
+ path: path.join(cwd, "AGENTS.md"),
273
+ content: "# Project agent instructions\n\nRead and follow `.dyrected/ai-rules.md` for every Dyrected CMS task.\n",
274
+ },
275
+ {
276
+ path: path.join(cwd, "CLAUDE.md"),
277
+ content: "# Project instructions\n\n@.dyrected/ai-rules.md\n",
278
+ },
279
+ {
280
+ path: path.join(cwd, ".github", "copilot-instructions.md"),
281
+ content: "# Copilot instructions\n\nRead and follow `.dyrected/ai-rules.md` for every Dyrected CMS task.\n",
282
+ },
283
+ {
284
+ path: path.join(cwd, ".cursor", "rules", "dyrected.mdc"),
285
+ content: "---\ndescription: Dyrected CMS project rules\nalwaysApply: true\n---\n\nRead and follow `.dyrected/ai-rules.md` before changing Dyrected configuration or integration code.\n",
286
+ },
287
+ ];
288
+ for (const pointer of agentRulePointers) {
289
+ if (!(await fs.pathExists(pointer.path)))
290
+ await fs.outputFile(pointer.path, pointer.content);
291
+ }
292
+ // ── Done ───────────────────────────────────────────────────────────────
293
+ console.log(chalk.bold.green("\n✅ Dyrected is ready!\n"));
294
+ if (isSpa) {
295
+ console.log(chalk.cyan(` 1. Set VITE_DYRECTED_URL and VITE_DYRECTED_API_KEY in .env`));
296
+ console.log(chalk.cyan(` 2. Add a route for /${adminPath} in your router config`));
297
+ console.log(chalk.cyan(" 3. Start your dev server and open the admin route\n"));
298
+ }
299
+ else {
300
+ console.log(chalk.cyan(` 1. Configure your environment variables in .env`));
301
+ console.log(chalk.cyan(` 2. Open http://localhost:3000/${adminPath} to start managing content.`));
302
+ console.log(chalk.cyan(" 3. Run: npx dyrected generate:types\n"));
303
+ }
304
+ console.log(chalk.bold.magenta("🤖 Using Claude Code or Cursor?"));
305
+ console.log(chalk.dim(" Install the Dyrected skill to give your AI agent full context:"));
306
+ console.log(chalk.cyan(" npx skills add dyrected/agent-skills@dyrected\n"));
307
+ });
308
+ }
309
+ function buildDyrectedConfig(dbImport, storageImport, dbConfig, storageConfig) {
310
+ return `import { defineCollection, defineGlobal, defineConfig } from '@dyrected/core'
311
+ ${dbImport}
312
+ ${storageImport}
313
+
314
+ // ── Admin Auth ────────────────────────────────────────────────────────────
315
+ // Reserved collection — sole login gateway for the Dyrected dashboard.
316
+ // Email + password are auto-managed; declare only extra fields here.
317
+
318
+ const admins = defineCollection({
319
+ slug: '__admins',
320
+ labels: { singular: 'Admin', plural: 'Admins' },
321
+ auth: true,
322
+ fields: [
323
+ { name: 'name', type: 'text', required: true },
324
+ { name: 'role', type: 'select', options: ['admin', 'editor'], defaultValue: 'admin' },
325
+ ],
326
+ })
327
+
328
+ // ── Collections ──────────────────────────────────────────────────────────
329
+
330
+ const media = defineCollection({
331
+ slug: 'media',
332
+ labels: { singular: 'Media', plural: 'Media' },
333
+ upload: true,
334
+ fields: [
335
+ { name: 'alt', type: 'text' },
336
+ ],
337
+ })
338
+
339
+ const pages = defineCollection({
340
+ slug: 'pages',
341
+ labels: { singular: 'Page', plural: 'Pages' },
342
+ fields: [
343
+ { name: 'title', type: 'text', required: true },
344
+ { name: 'slug', type: 'text', required: true },
345
+ { name: 'content', type: 'richText' },
346
+ { name: 'featuredImage', type: 'relationship', relationTo: 'media' },
347
+ ],
348
+ })
349
+
350
+ const posts = defineCollection({
351
+ slug: 'posts',
352
+ labels: { singular: 'Post', plural: 'Posts' },
353
+ fields: [
354
+ { name: 'title', type: 'text', required: true },
355
+ { name: 'content', type: 'richText' },
356
+ { name: 'featuredImage', type: 'relationship', relationTo: 'media' },
357
+ ],
358
+ })
359
+
360
+ // ── Globals ───────────────────────────────────────────────────────────────
361
+
362
+ const navigation = defineGlobal({
363
+ slug: 'navigation',
364
+ label: 'Navigation',
365
+ fields: [
366
+ {
367
+ name: 'menuItems',
368
+ type: 'array',
369
+ fields: [
370
+ { name: 'label', type: 'text' },
371
+ { name: 'link', type: 'relationship', relationTo: 'pages' },
372
+ ],
373
+ },
374
+ ],
375
+ })
376
+
377
+ const settings = defineGlobal({
378
+ slug: 'settings',
379
+ label: 'Site Settings',
380
+ fields: [
381
+ { name: 'siteName', type: 'text' },
382
+ { name: 'logo', type: 'relationship', relationTo: 'media' },
383
+ { name: 'footerText', type: 'textarea' },
384
+ ],
385
+ })
386
+
387
+ // ── Config ────────────────────────────────────────────────────────────────
388
+
389
+ export default defineConfig({
390
+ collections: [admins, media, pages, posts],
391
+ globals: [navigation, settings],
392
+ db: ${dbConfig},
393
+ storage: ${storageConfig},
394
+ })
395
+ `;
396
+ }
397
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,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,eAAe,EAAE,oBAAoB,EAA2B,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErG,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,WAAW,EAAE,gEAAgE,CAAC;SACrF,MAAM,CAAC,6BAA6B,EAAE,2CAA2C,CAAC;SAClF,MAAM,CAAC,o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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgFP,QAAQ;aACH,aAAa;;CAEzB,CAAC;AACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerSyncSchema(program: Command): void;
3
+ //# sourceMappingURL=sync-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../../src/commands/sync-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QAgGlD"}