@donotdev/cli 0.0.20 → 0.0.21
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 +31 -0
- package/dependencies-matrix.json +86 -19
- package/dist/bin/commands/agent-setup.js +2 -2
- package/dist/bin/commands/build.js +6 -6
- package/dist/bin/commands/bump.js +491 -69
- package/dist/bin/commands/cacheout.js +6 -6
- package/dist/bin/commands/coach.js +6 -6
- package/dist/bin/commands/create-app.js +23 -15
- package/dist/bin/commands/create-project.js +101 -16
- package/dist/bin/commands/db.js +142136 -0
- package/dist/bin/commands/deploy.js +336 -126
- package/dist/bin/commands/dev.js +6 -6
- package/dist/bin/commands/doctor.js +140 -33
- package/dist/bin/commands/emu.js +6 -6
- package/dist/bin/commands/format.js +6 -6
- package/dist/bin/commands/get-demo.js +11 -6
- package/dist/bin/commands/make-admin.js +14210 -13770
- package/dist/bin/commands/preview.js +6 -6
- package/dist/bin/commands/seed.js +142426 -0
- package/dist/bin/commands/setup-cicd.js +8904 -0
- package/dist/bin/commands/setup.js +256 -212
- package/dist/bin/commands/staging.js +343 -127
- package/dist/bin/commands/sync-secrets.js +55 -33
- package/dist/bin/commands/type-check.js +6 -6
- package/dist/bin/commands/wai.js +6 -6
- package/dist/bin/dndev.js +76 -11
- package/dist/bin/donotdev.js +21 -12
- package/dist/index.js +437 -142
- package/package.json +1 -1
- package/templates/app-demo/.env.example +1 -0
- package/templates/{root-consumer → app-demo}/entities/ExampleEntity.ts.example +15 -9
- package/templates/app-demo/index.html.example +1 -1
- package/templates/app-dndev/index.html.example +164 -0
- package/templates/app-dndev/public/logo.svg.example +1 -0
- package/templates/app-dndev/public/manifest.json.example +10 -0
- package/templates/app-dndev/src/App.tsx.example +35 -0
- package/templates/app-dndev/src/components/CockpitLayout.css.example +181 -0
- package/templates/app-dndev/src/components/CockpitLayout.tsx.example +209 -0
- package/templates/app-dndev/src/components/Kanban.css.example +385 -0
- package/templates/app-dndev/src/components/ModeToggle.tsx.example +32 -0
- package/templates/app-dndev/src/components/OverlaySlot.tsx.example +68 -0
- package/templates/app-dndev/src/components/TerminalPanel.css.example +228 -0
- package/templates/app-dndev/src/components/TerminalPanel.tsx.example +714 -0
- package/templates/app-dndev/src/components/markdown-prose.css.example +49 -0
- package/templates/app-dndev/src/components/phases/CaptainLog.tsx.example +107 -0
- package/templates/app-dndev/src/components/phases/ContextTabs.tsx.example +352 -0
- package/templates/app-dndev/src/components/phases/PhaseCard.tsx.example +126 -0
- package/templates/app-dndev/src/components/phases/PhaseDetail.tsx.example +147 -0
- package/templates/app-dndev/src/components/phases/ReviewPanel.tsx.example +115 -0
- package/templates/app-dndev/src/components/phases/phaseData.ts.example +366 -0
- package/templates/app-dndev/src/config/app.ts.example +103 -0
- package/templates/app-dndev/src/config/commands.ts.example +171 -0
- package/templates/app-dndev/src/config/legal.ts.example +170 -0
- package/templates/app-dndev/src/config/providers.ts.example +7 -0
- package/templates/app-dndev/src/globals.css.example +10 -0
- package/templates/app-dndev/src/hooks/useDndevFile.ts.example +144 -0
- package/templates/app-dndev/src/main.tsx.example +21 -0
- package/templates/app-dndev/src/pages/BoardPage.tsx.example +640 -0
- package/templates/app-dndev/src/pages/GrillPage.tsx.example +658 -0
- package/templates/app-dndev/src/pages/HomePage.tsx.example +347 -0
- package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +33 -0
- package/templates/app-dndev/src/pages/PhasesPage.tsx.example +137 -0
- package/templates/app-dndev/src/pages/SettingsPage.tsx.example +64 -0
- package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +75 -0
- package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +69 -0
- package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +71 -0
- package/templates/app-dndev/src/stores/dndevStore.ts.example +386 -0
- package/templates/app-dndev/src/themes.css.example +161 -0
- package/templates/app-dndev/terminal-sidecar.cjs.example +341 -0
- package/templates/app-dndev/tsconfig.json.example +9 -0
- package/templates/app-dndev/vite.config.ts.example +24 -0
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/index.html.example +1 -1
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/functions-supabase/supabase/functions/.env.example +0 -2
- package/templates/root-consumer/.claude/commands/grill.md.example +86 -8
- package/templates/root-consumer/.dndev.secrets.example +32 -0
- package/templates/root-consumer/.gitignore.example +3 -0
- package/templates/root-consumer/AI.md.example +4 -0
- package/templates/root-consumer/entities/index.ts.example +2 -5
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +4 -0
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +23 -20
- package/templates/root-consumer/guides/dndev/INDEX.md.example +1 -0
- package/templates/root-consumer/guides/dndev/SETUP_BILLING.md.example +3 -7
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +115 -0
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +41 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +13 -18
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +17 -12
- package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
- package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +185 -251
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +26 -8
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +66 -49
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +6 -5
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +9 -9
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +1 -1
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +7 -6
- package/templates/root-consumer/guides/wai-way/context_map.json.example +51 -20
- package/templates/root-consumer/guides/wai-way/hld_template.md.example +138 -0
- package/templates/root-consumer/guides/wai-way/lld_template.md.example +103 -0
- package/templates/root-consumer/guides/wai-way/prd_template.md.example +140 -0
- /package/templates/{root-consumer → app-demo}/entities/Contact.ts.example +0 -0
- /package/templates/{root-consumer → app-demo}/entities/demo.ts.example +0 -0
|
@@ -6601,7 +6601,7 @@ var init_PathResolver = __esm({
|
|
|
6601
6601
|
}
|
|
6602
6602
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6603
6603
|
let writeContent;
|
|
6604
|
-
if (
|
|
6604
|
+
if (Buffer.isBuffer(content)) {
|
|
6605
6605
|
writeContent = content;
|
|
6606
6606
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6607
6607
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6610,7 +6610,7 @@ var init_PathResolver = __esm({
|
|
|
6610
6610
|
}
|
|
6611
6611
|
try {
|
|
6612
6612
|
return await safeExecuteAsync(async () => {
|
|
6613
|
-
if (
|
|
6613
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6614
6614
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6615
6615
|
} else {
|
|
6616
6616
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -6662,7 +6662,7 @@ var init_PathResolver = __esm({
|
|
|
6662
6662
|
}
|
|
6663
6663
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6664
6664
|
let writeContent;
|
|
6665
|
-
if (
|
|
6665
|
+
if (Buffer.isBuffer(content)) {
|
|
6666
6666
|
writeContent = content;
|
|
6667
6667
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6668
6668
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6670,7 +6670,7 @@ var init_PathResolver = __esm({
|
|
|
6670
6670
|
writeContent = String(content);
|
|
6671
6671
|
}
|
|
6672
6672
|
try {
|
|
6673
|
-
if (
|
|
6673
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6674
6674
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6675
6675
|
} else {
|
|
6676
6676
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7421,7 +7421,7 @@ var init_pathResolver = __esm({
|
|
|
7421
7421
|
});
|
|
7422
7422
|
|
|
7423
7423
|
// packages/tooling/src/bundler/utils.ts
|
|
7424
|
-
import { Buffer
|
|
7424
|
+
import { Buffer } from "node:buffer";
|
|
7425
7425
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7426
7426
|
import { createRequire as createRequire3 } from "node:module";
|
|
7427
7427
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7438,7 +7438,7 @@ var init_utils = __esm({
|
|
|
7438
7438
|
globalThis.require = require2;
|
|
7439
7439
|
globalThis.__filename = __filename;
|
|
7440
7440
|
globalThis.__dirname = __dirname;
|
|
7441
|
-
globalThis.Buffer =
|
|
7441
|
+
globalThis.Buffer = Buffer;
|
|
7442
7442
|
globalThis.process = process;
|
|
7443
7443
|
if (typeof global === "undefined") {
|
|
7444
7444
|
globalThis.global = globalThis;
|
|
@@ -6615,7 +6615,7 @@ var init_PathResolver = __esm({
|
|
|
6615
6615
|
}
|
|
6616
6616
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6617
6617
|
let writeContent;
|
|
6618
|
-
if (
|
|
6618
|
+
if (Buffer.isBuffer(content)) {
|
|
6619
6619
|
writeContent = content;
|
|
6620
6620
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6621
6621
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6624,7 +6624,7 @@ var init_PathResolver = __esm({
|
|
|
6624
6624
|
}
|
|
6625
6625
|
try {
|
|
6626
6626
|
return await safeExecuteAsync(async () => {
|
|
6627
|
-
if (
|
|
6627
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6628
6628
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6629
6629
|
} else {
|
|
6630
6630
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -6676,7 +6676,7 @@ var init_PathResolver = __esm({
|
|
|
6676
6676
|
}
|
|
6677
6677
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6678
6678
|
let writeContent;
|
|
6679
|
-
if (
|
|
6679
|
+
if (Buffer.isBuffer(content)) {
|
|
6680
6680
|
writeContent = content;
|
|
6681
6681
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6682
6682
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6684,7 +6684,7 @@ var init_PathResolver = __esm({
|
|
|
6684
6684
|
writeContent = String(content);
|
|
6685
6685
|
}
|
|
6686
6686
|
try {
|
|
6687
|
-
if (
|
|
6687
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6688
6688
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6689
6689
|
} else {
|
|
6690
6690
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7433,7 +7433,7 @@ var init_typed_file_operations = __esm({
|
|
|
7433
7433
|
});
|
|
7434
7434
|
|
|
7435
7435
|
// packages/tooling/src/bundler/utils.ts
|
|
7436
|
-
import { Buffer
|
|
7436
|
+
import { Buffer } from "node:buffer";
|
|
7437
7437
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7438
7438
|
import { createRequire as createRequire3 } from "node:module";
|
|
7439
7439
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7450,7 +7450,7 @@ var init_utils = __esm({
|
|
|
7450
7450
|
globalThis.require = require2;
|
|
7451
7451
|
globalThis.__filename = __filename;
|
|
7452
7452
|
globalThis.__dirname = __dirname;
|
|
7453
|
-
globalThis.Buffer =
|
|
7453
|
+
globalThis.Buffer = Buffer;
|
|
7454
7454
|
globalThis.process = process;
|
|
7455
7455
|
if (typeof global === "undefined") {
|
|
7456
7456
|
globalThis.global = globalThis;
|
|
@@ -7144,7 +7144,7 @@ var init_PathResolver = __esm({
|
|
|
7144
7144
|
}
|
|
7145
7145
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7146
7146
|
let writeContent;
|
|
7147
|
-
if (
|
|
7147
|
+
if (Buffer.isBuffer(content)) {
|
|
7148
7148
|
writeContent = content;
|
|
7149
7149
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7150
7150
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7153,7 +7153,7 @@ var init_PathResolver = __esm({
|
|
|
7153
7153
|
}
|
|
7154
7154
|
try {
|
|
7155
7155
|
return await safeExecuteAsync(async () => {
|
|
7156
|
-
if (
|
|
7156
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7157
7157
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
7158
7158
|
} else {
|
|
7159
7159
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -7205,7 +7205,7 @@ var init_PathResolver = __esm({
|
|
|
7205
7205
|
}
|
|
7206
7206
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7207
7207
|
let writeContent;
|
|
7208
|
-
if (
|
|
7208
|
+
if (Buffer.isBuffer(content)) {
|
|
7209
7209
|
writeContent = content;
|
|
7210
7210
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7211
7211
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7213,7 +7213,7 @@ var init_PathResolver = __esm({
|
|
|
7213
7213
|
writeContent = String(content);
|
|
7214
7214
|
}
|
|
7215
7215
|
try {
|
|
7216
|
-
if (
|
|
7216
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7217
7217
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7218
7218
|
} else {
|
|
7219
7219
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7965,7 +7965,7 @@ async function isBinaryFile(filePath) {
|
|
|
7965
7965
|
try {
|
|
7966
7966
|
let fileHandle = null;
|
|
7967
7967
|
try {
|
|
7968
|
-
const buffer =
|
|
7968
|
+
const buffer = Buffer.alloc(4096);
|
|
7969
7969
|
const fs2 = await import("node:fs");
|
|
7970
7970
|
fileHandle = await fs2.promises.open(filePath, "r");
|
|
7971
7971
|
const { bytesRead } = await fileHandle.read(buffer, 0, 4096, 0);
|
|
@@ -8150,7 +8150,7 @@ var init_pathResolver = __esm({
|
|
|
8150
8150
|
});
|
|
8151
8151
|
|
|
8152
8152
|
// packages/tooling/src/bundler/utils.ts
|
|
8153
|
-
import { Buffer
|
|
8153
|
+
import { Buffer } from "node:buffer";
|
|
8154
8154
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8155
8155
|
import { createRequire as createRequire3 } from "node:module";
|
|
8156
8156
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -8167,7 +8167,7 @@ var init_utils = __esm({
|
|
|
8167
8167
|
globalThis.require = require2;
|
|
8168
8168
|
globalThis.__filename = __filename;
|
|
8169
8169
|
globalThis.__dirname = __dirname;
|
|
8170
|
-
globalThis.Buffer =
|
|
8170
|
+
globalThis.Buffer = Buffer;
|
|
8171
8171
|
globalThis.process = process;
|
|
8172
8172
|
if (typeof global === "undefined") {
|
|
8173
8173
|
globalThis.global = globalThis;
|
|
@@ -8357,9 +8357,11 @@ function processArrayIterations(content, replacements) {
|
|
|
8357
8357
|
function isValidFileName(name) {
|
|
8358
8358
|
return typeof name === "string" && /^[a-zA-Z0-9_-]+$/.test(name);
|
|
8359
8359
|
}
|
|
8360
|
-
var
|
|
8360
|
+
var RESERVED_APP_NAMES = ["demo", "dndev"];
|
|
8361
8361
|
function isReservedAppName(name) {
|
|
8362
|
-
return
|
|
8362
|
+
return RESERVED_APP_NAMES.includes(
|
|
8363
|
+
name.toLowerCase()
|
|
8364
|
+
);
|
|
8363
8365
|
}
|
|
8364
8366
|
async function updateRootPackageJson(rootDir, appNames) {
|
|
8365
8367
|
const packageJsonPath = joinPath(rootDir, "package.json");
|
|
@@ -8547,7 +8549,7 @@ var PROJECT_QUESTIONNAIRE = [
|
|
|
8547
8549
|
},
|
|
8548
8550
|
{
|
|
8549
8551
|
id: "appNames",
|
|
8550
|
-
question: `App name(s) (comma-separated for multiple, e.g., web, admin) - '${
|
|
8552
|
+
question: `App name(s) (comma-separated for multiple, e.g., web, admin) - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
|
|
8551
8553
|
type: "input",
|
|
8552
8554
|
defaultValue: "web"
|
|
8553
8555
|
}
|
|
@@ -8667,6 +8669,11 @@ function generateScripts(templateName, options) {
|
|
|
8667
8669
|
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8668
8670
|
scripts.preview = "vite preview";
|
|
8669
8671
|
scripts["type-check"] = "tsc --noEmit";
|
|
8672
|
+
} else if (templateName === "dndev") {
|
|
8673
|
+
scripts.dev = "vite";
|
|
8674
|
+
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8675
|
+
scripts.preview = "vite preview";
|
|
8676
|
+
scripts["type-check"] = "tsc --noEmit";
|
|
8670
8677
|
} else if (templateName === "entities") {
|
|
8671
8678
|
}
|
|
8672
8679
|
return scripts;
|
|
@@ -8794,7 +8801,7 @@ function resolveDeployConfig(host, backend) {
|
|
|
8794
8801
|
return "vercel-vercel";
|
|
8795
8802
|
}
|
|
8796
8803
|
function getScaffoldParts(builder, host, functions, backend) {
|
|
8797
|
-
const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : `app-${builder}`;
|
|
8804
|
+
const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
|
|
8798
8805
|
return {
|
|
8799
8806
|
builder,
|
|
8800
8807
|
backend,
|
|
@@ -8822,7 +8829,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
8822
8829
|
Ie("\u{1F680} DoNotDev App Creator");
|
|
8823
8830
|
if (!appName) {
|
|
8824
8831
|
appName = await askForInput(
|
|
8825
|
-
`App name - '${
|
|
8832
|
+
`App name - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
|
|
8826
8833
|
"my-app"
|
|
8827
8834
|
);
|
|
8828
8835
|
if (!isValidFileName(appName)) {
|
|
@@ -9023,12 +9030,13 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9023
9030
|
}
|
|
9024
9031
|
}
|
|
9025
9032
|
const executionMode = detectExecutionMode();
|
|
9026
|
-
const
|
|
9033
|
+
const isReservedTemplate = appTemplate === "demo" || appTemplate === "dndev";
|
|
9034
|
+
const templateName = isReservedTemplate ? appTemplate : executionMode === "development" ? `dev-${appTemplate}` : `consumer-${appTemplate}`;
|
|
9027
9035
|
const packageJson = generatePackageJson(templateName, executionMode, {
|
|
9028
9036
|
appName,
|
|
9029
|
-
template:
|
|
9037
|
+
template: isReservedTemplate ? "vite" : appTemplate,
|
|
9030
9038
|
includeFunctions: Boolean(row.functionsTemplate),
|
|
9031
|
-
platform:
|
|
9039
|
+
platform: isReservedTemplate ? void 0 : backendPlatform
|
|
9032
9040
|
});
|
|
9033
9041
|
const packageJsonPath = joinPath(appDir, "package.json");
|
|
9034
9042
|
await write(packageJsonPath, packageJson, {
|
|
@@ -7144,7 +7144,7 @@ var init_PathResolver = __esm({
|
|
|
7144
7144
|
}
|
|
7145
7145
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7146
7146
|
let writeContent;
|
|
7147
|
-
if (
|
|
7147
|
+
if (Buffer.isBuffer(content)) {
|
|
7148
7148
|
writeContent = content;
|
|
7149
7149
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7150
7150
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7153,7 +7153,7 @@ var init_PathResolver = __esm({
|
|
|
7153
7153
|
}
|
|
7154
7154
|
try {
|
|
7155
7155
|
return await safeExecuteAsync(async () => {
|
|
7156
|
-
if (
|
|
7156
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7157
7157
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
7158
7158
|
} else {
|
|
7159
7159
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -7205,7 +7205,7 @@ var init_PathResolver = __esm({
|
|
|
7205
7205
|
}
|
|
7206
7206
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7207
7207
|
let writeContent;
|
|
7208
|
-
if (
|
|
7208
|
+
if (Buffer.isBuffer(content)) {
|
|
7209
7209
|
writeContent = content;
|
|
7210
7210
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7211
7211
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7213,7 +7213,7 @@ var init_PathResolver = __esm({
|
|
|
7213
7213
|
writeContent = String(content);
|
|
7214
7214
|
}
|
|
7215
7215
|
try {
|
|
7216
|
-
if (
|
|
7216
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7217
7217
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7218
7218
|
} else {
|
|
7219
7219
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -8106,7 +8106,7 @@ async function isBinaryFile(filePath) {
|
|
|
8106
8106
|
try {
|
|
8107
8107
|
let fileHandle = null;
|
|
8108
8108
|
try {
|
|
8109
|
-
const buffer =
|
|
8109
|
+
const buffer = Buffer.alloc(4096);
|
|
8110
8110
|
const fs2 = await import("node:fs");
|
|
8111
8111
|
fileHandle = await fs2.promises.open(filePath, "r");
|
|
8112
8112
|
const { bytesRead } = await fileHandle.read(buffer, 0, 4096, 0);
|
|
@@ -8333,7 +8333,7 @@ var init_typed_file_operations = __esm({
|
|
|
8333
8333
|
});
|
|
8334
8334
|
|
|
8335
8335
|
// packages/tooling/src/bundler/utils.ts
|
|
8336
|
-
import { Buffer
|
|
8336
|
+
import { Buffer } from "node:buffer";
|
|
8337
8337
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8338
8338
|
import { createRequire as createRequire3 } from "node:module";
|
|
8339
8339
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -8350,7 +8350,7 @@ var init_utils = __esm({
|
|
|
8350
8350
|
globalThis.require = require2;
|
|
8351
8351
|
globalThis.__filename = __filename;
|
|
8352
8352
|
globalThis.__dirname = __dirname;
|
|
8353
|
-
globalThis.Buffer =
|
|
8353
|
+
globalThis.Buffer = Buffer;
|
|
8354
8354
|
globalThis.process = process;
|
|
8355
8355
|
if (typeof global === "undefined") {
|
|
8356
8356
|
globalThis.global = globalThis;
|
|
@@ -8565,9 +8565,11 @@ function processArrayIterations(content, replacements) {
|
|
|
8565
8565
|
function isValidFileName(name) {
|
|
8566
8566
|
return typeof name === "string" && /^[a-zA-Z0-9_-]+$/.test(name);
|
|
8567
8567
|
}
|
|
8568
|
-
var
|
|
8568
|
+
var RESERVED_APP_NAMES = ["demo", "dndev"];
|
|
8569
8569
|
function isReservedAppName(name) {
|
|
8570
|
-
return
|
|
8570
|
+
return RESERVED_APP_NAMES.includes(
|
|
8571
|
+
name.toLowerCase()
|
|
8572
|
+
);
|
|
8571
8573
|
}
|
|
8572
8574
|
async function updateRootPackageJson(rootDir, appNames) {
|
|
8573
8575
|
const packageJsonPath = joinPath(rootDir, "package.json");
|
|
@@ -8867,7 +8869,7 @@ var PROJECT_QUESTIONNAIRE = [
|
|
|
8867
8869
|
},
|
|
8868
8870
|
{
|
|
8869
8871
|
id: "appNames",
|
|
8870
|
-
question: `App name(s) (comma-separated for multiple, e.g., web, admin) - '${
|
|
8872
|
+
question: `App name(s) (comma-separated for multiple, e.g., web, admin) - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
|
|
8871
8873
|
type: "input",
|
|
8872
8874
|
defaultValue: "web"
|
|
8873
8875
|
}
|
|
@@ -8987,6 +8989,11 @@ function generateScripts(templateName, options) {
|
|
|
8987
8989
|
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8988
8990
|
scripts.preview = "vite preview";
|
|
8989
8991
|
scripts["type-check"] = "tsc --noEmit";
|
|
8992
|
+
} else if (templateName === "dndev") {
|
|
8993
|
+
scripts.dev = "vite";
|
|
8994
|
+
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8995
|
+
scripts.preview = "vite preview";
|
|
8996
|
+
scripts["type-check"] = "tsc --noEmit";
|
|
8990
8997
|
} else if (templateName === "entities") {
|
|
8991
8998
|
}
|
|
8992
8999
|
return scripts;
|
|
@@ -9114,7 +9121,7 @@ function resolveDeployConfig(host, backend) {
|
|
|
9114
9121
|
return "vercel-vercel";
|
|
9115
9122
|
}
|
|
9116
9123
|
function getScaffoldParts(builder, host, functions, backend) {
|
|
9117
|
-
const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : `app-${builder}`;
|
|
9124
|
+
const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : builder === "dndev" ? "app-dndev" : `app-${builder}`;
|
|
9118
9125
|
return {
|
|
9119
9126
|
builder,
|
|
9120
9127
|
backend,
|
|
@@ -9142,7 +9149,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9142
9149
|
Ie("\u{1F680} DoNotDev App Creator");
|
|
9143
9150
|
if (!appName) {
|
|
9144
9151
|
appName = await askForInput(
|
|
9145
|
-
`App name - '${
|
|
9152
|
+
`App name - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
|
|
9146
9153
|
"my-app"
|
|
9147
9154
|
);
|
|
9148
9155
|
if (!isValidFileName(appName)) {
|
|
@@ -9343,12 +9350,13 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9343
9350
|
}
|
|
9344
9351
|
}
|
|
9345
9352
|
const executionMode = detectExecutionMode();
|
|
9346
|
-
const
|
|
9353
|
+
const isReservedTemplate = appTemplate === "demo" || appTemplate === "dndev";
|
|
9354
|
+
const templateName = isReservedTemplate ? appTemplate : executionMode === "development" ? `dev-${appTemplate}` : `consumer-${appTemplate}`;
|
|
9347
9355
|
const packageJson = generatePackageJson(templateName, executionMode, {
|
|
9348
9356
|
appName,
|
|
9349
|
-
template:
|
|
9357
|
+
template: isReservedTemplate ? "vite" : appTemplate,
|
|
9350
9358
|
includeFunctions: Boolean(row.functionsTemplate),
|
|
9351
|
-
platform:
|
|
9359
|
+
platform: isReservedTemplate ? void 0 : backendPlatform
|
|
9352
9360
|
});
|
|
9353
9361
|
const packageJsonPath = joinPath(appDir, "package.json");
|
|
9354
9362
|
await write(packageJsonPath, packageJson, {
|
|
@@ -9739,6 +9747,10 @@ async function main(options) {
|
|
|
9739
9747
|
"Would you like to install the demo app? (component showcase)",
|
|
9740
9748
|
false
|
|
9741
9749
|
);
|
|
9750
|
+
let installCockpitApp = await askForConfirmation(
|
|
9751
|
+
"Would you like to install the cockpit app? (AI development dashboard)",
|
|
9752
|
+
false
|
|
9753
|
+
);
|
|
9742
9754
|
let allAppNames = [...appNames];
|
|
9743
9755
|
let appsToCreate = [];
|
|
9744
9756
|
let appsToSkip = [];
|
|
@@ -9862,6 +9874,13 @@ async function main(options) {
|
|
|
9862
9874
|
const primaryPlatform = Object.values(appConfigs).find(
|
|
9863
9875
|
(c) => c.backend !== "none"
|
|
9864
9876
|
)?.backend ?? "firebase";
|
|
9877
|
+
const hasVercel = Object.values(appConfigs).some(
|
|
9878
|
+
(c) => c.host === "vercel"
|
|
9879
|
+
);
|
|
9880
|
+
const hasSupabase = Object.values(appConfigs).some(
|
|
9881
|
+
(c) => c.backend === "supabase"
|
|
9882
|
+
);
|
|
9883
|
+
const hasBilling = Object.values(appConfigs).some((c) => c.billing);
|
|
9865
9884
|
const rootPackageJson = generatePackageJson(
|
|
9866
9885
|
"consumer-root",
|
|
9867
9886
|
executionMode,
|
|
@@ -9896,8 +9915,12 @@ async function main(options) {
|
|
|
9896
9915
|
// Determined by agent in WAI-WAY Phase 0
|
|
9897
9916
|
needsOAuth: false,
|
|
9898
9917
|
// Determined by agent in WAI-WAY Phase 0
|
|
9899
|
-
needsBilling: false
|
|
9918
|
+
needsBilling: false,
|
|
9900
9919
|
// Determined by agent in WAI-WAY Phase 0
|
|
9920
|
+
// .dndev.secrets conditional sections
|
|
9921
|
+
vercel: hasVercel,
|
|
9922
|
+
supabase: hasSupabase,
|
|
9923
|
+
stripe: hasBilling
|
|
9901
9924
|
};
|
|
9902
9925
|
const firebaseRootFiles = /* @__PURE__ */ new Set([
|
|
9903
9926
|
"firebase.json.example",
|
|
@@ -9926,6 +9949,13 @@ async function main(options) {
|
|
|
9926
9949
|
await replacePlaceholders(destPath, rootReplacements);
|
|
9927
9950
|
}
|
|
9928
9951
|
}
|
|
9952
|
+
const dndevSecretsPath = joinPath(projectDirNormalized, ".dndev.secrets");
|
|
9953
|
+
if (pathExists(dndevSecretsPath)) {
|
|
9954
|
+
await copy(
|
|
9955
|
+
dndevSecretsPath,
|
|
9956
|
+
joinPath(projectDirNormalized, ".dndev.secrets.example")
|
|
9957
|
+
);
|
|
9958
|
+
}
|
|
9929
9959
|
if (setupGithubActions) {
|
|
9930
9960
|
const ciTemplateDir = joinPath(templatesRoot, "github");
|
|
9931
9961
|
await copyTemplateFiles(
|
|
@@ -10026,6 +10056,61 @@ async function main(options) {
|
|
|
10026
10056
|
sDemo.stop("Demo app copied");
|
|
10027
10057
|
}
|
|
10028
10058
|
}
|
|
10059
|
+
if (installCockpitApp) {
|
|
10060
|
+
const sCockpit = Y2();
|
|
10061
|
+
sCockpit.start("Copying cockpit app...");
|
|
10062
|
+
const cockpitAppDir = joinPath(projectDirNormalized, "apps", "dndev");
|
|
10063
|
+
const cockpitTemplateDir = joinPath(templatesRoot, "app-dndev");
|
|
10064
|
+
if (pathExists(cockpitAppDir)) {
|
|
10065
|
+
if (isMergeMode) {
|
|
10066
|
+
const cockpitAction = await askForSelection(
|
|
10067
|
+
"Cockpit app already exists. What would you like to do?",
|
|
10068
|
+
[
|
|
10069
|
+
{ title: "Replace (delete and recreate)", value: "replace" },
|
|
10070
|
+
{ title: "Skip (keep existing)", value: "skip" }
|
|
10071
|
+
],
|
|
10072
|
+
1
|
|
10073
|
+
);
|
|
10074
|
+
if (cockpitAction === "replace") {
|
|
10075
|
+
await remove(cockpitAppDir);
|
|
10076
|
+
} else {
|
|
10077
|
+
sCockpit.stop("Cockpit app skipped (already exists)");
|
|
10078
|
+
installCockpitApp = false;
|
|
10079
|
+
}
|
|
10080
|
+
} else {
|
|
10081
|
+
await remove(cockpitAppDir);
|
|
10082
|
+
}
|
|
10083
|
+
}
|
|
10084
|
+
if (installCockpitApp) {
|
|
10085
|
+
const cockpitFirebaseProjectId = projectName.toLowerCase().replace(/\s+/g, "-");
|
|
10086
|
+
await copyTemplateFiles(cockpitTemplateDir, cockpitAppDir, {
|
|
10087
|
+
projectName,
|
|
10088
|
+
appName: "dndev",
|
|
10089
|
+
includeFunctions: false,
|
|
10090
|
+
needsCRUD: false,
|
|
10091
|
+
setupGithubActions: false,
|
|
10092
|
+
appNames,
|
|
10093
|
+
firebaseProjectId: cockpitFirebaseProjectId,
|
|
10094
|
+
firebaseRegion: "europe-west1",
|
|
10095
|
+
firebaseSecretName: projectName.toUpperCase().replace(/-/g, "_"),
|
|
10096
|
+
YOUR_FIREBASE_PROJECT_ID: cockpitFirebaseProjectId,
|
|
10097
|
+
YOUR_REGION: "europe-west1",
|
|
10098
|
+
monorepoRelativePath: executionMode === "development" ? calculateRelativePath(projectDirNormalized, monorepoRoot) : "",
|
|
10099
|
+
appTemplate: "dndev"
|
|
10100
|
+
});
|
|
10101
|
+
const packageJson = generatePackageJson("dndev", executionMode, {
|
|
10102
|
+
appName: "dndev",
|
|
10103
|
+
template: "vite",
|
|
10104
|
+
includeFunctions: false
|
|
10105
|
+
});
|
|
10106
|
+
const packageJsonPath = joinPath(cockpitAppDir, "package.json");
|
|
10107
|
+
await write(packageJsonPath, packageJson, {
|
|
10108
|
+
format: "json",
|
|
10109
|
+
overwrite: true
|
|
10110
|
+
});
|
|
10111
|
+
sCockpit.stop("Cockpit app copied");
|
|
10112
|
+
}
|
|
10113
|
+
}
|
|
10029
10114
|
log.info("Creating apps...");
|
|
10030
10115
|
for (const appName of appNames) {
|
|
10031
10116
|
const appConfig = appConfigs[appName];
|