@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
package/dist/bin/commands/dev.js
CHANGED
|
@@ -6897,7 +6897,7 @@ var init_PathResolver = __esm({
|
|
|
6897
6897
|
}
|
|
6898
6898
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6899
6899
|
let writeContent;
|
|
6900
|
-
if (
|
|
6900
|
+
if (Buffer.isBuffer(content)) {
|
|
6901
6901
|
writeContent = content;
|
|
6902
6902
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6903
6903
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6906,7 +6906,7 @@ var init_PathResolver = __esm({
|
|
|
6906
6906
|
}
|
|
6907
6907
|
try {
|
|
6908
6908
|
return await safeExecuteAsync(async () => {
|
|
6909
|
-
if (
|
|
6909
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6910
6910
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6911
6911
|
} else {
|
|
6912
6912
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -6958,7 +6958,7 @@ var init_PathResolver = __esm({
|
|
|
6958
6958
|
}
|
|
6959
6959
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6960
6960
|
let writeContent;
|
|
6961
|
-
if (
|
|
6961
|
+
if (Buffer.isBuffer(content)) {
|
|
6962
6962
|
writeContent = content;
|
|
6963
6963
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6964
6964
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6966,7 +6966,7 @@ var init_PathResolver = __esm({
|
|
|
6966
6966
|
writeContent = String(content);
|
|
6967
6967
|
}
|
|
6968
6968
|
try {
|
|
6969
|
-
if (
|
|
6969
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6970
6970
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6971
6971
|
} else {
|
|
6972
6972
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7716,7 +7716,7 @@ var init_typed_file_operations = __esm({
|
|
|
7716
7716
|
});
|
|
7717
7717
|
|
|
7718
7718
|
// packages/tooling/src/bundler/utils.ts
|
|
7719
|
-
import { Buffer
|
|
7719
|
+
import { Buffer } from "node:buffer";
|
|
7720
7720
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7721
7721
|
import { createRequire as createRequire3 } from "node:module";
|
|
7722
7722
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7733,7 +7733,7 @@ var init_utils = __esm({
|
|
|
7733
7733
|
globalThis.require = require2;
|
|
7734
7734
|
globalThis.__filename = __filename;
|
|
7735
7735
|
globalThis.__dirname = __dirname;
|
|
7736
|
-
globalThis.Buffer =
|
|
7736
|
+
globalThis.Buffer = Buffer;
|
|
7737
7737
|
globalThis.process = process;
|
|
7738
7738
|
if (typeof global === "undefined") {
|
|
7739
7739
|
globalThis.global = globalThis;
|
|
@@ -6630,7 +6630,7 @@ var init_PathResolver = __esm({
|
|
|
6630
6630
|
}
|
|
6631
6631
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6632
6632
|
let writeContent;
|
|
6633
|
-
if (
|
|
6633
|
+
if (Buffer.isBuffer(content)) {
|
|
6634
6634
|
writeContent = content;
|
|
6635
6635
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6636
6636
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6639,7 +6639,7 @@ var init_PathResolver = __esm({
|
|
|
6639
6639
|
}
|
|
6640
6640
|
try {
|
|
6641
6641
|
return await safeExecuteAsync(async () => {
|
|
6642
|
-
if (
|
|
6642
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6643
6643
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6644
6644
|
} else {
|
|
6645
6645
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -6691,7 +6691,7 @@ var init_PathResolver = __esm({
|
|
|
6691
6691
|
}
|
|
6692
6692
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6693
6693
|
let writeContent;
|
|
6694
|
-
if (
|
|
6694
|
+
if (Buffer.isBuffer(content)) {
|
|
6695
6695
|
writeContent = content;
|
|
6696
6696
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6697
6697
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6699,7 +6699,7 @@ var init_PathResolver = __esm({
|
|
|
6699
6699
|
writeContent = String(content);
|
|
6700
6700
|
}
|
|
6701
6701
|
try {
|
|
6702
|
-
if (
|
|
6702
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6703
6703
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6704
6704
|
} else {
|
|
6705
6705
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7448,7 +7448,7 @@ var init_typed_file_operations = __esm({
|
|
|
7448
7448
|
});
|
|
7449
7449
|
|
|
7450
7450
|
// packages/tooling/src/bundler/utils.ts
|
|
7451
|
-
import { Buffer
|
|
7451
|
+
import { Buffer } from "node:buffer";
|
|
7452
7452
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7453
7453
|
import { createRequire as createRequire3 } from "node:module";
|
|
7454
7454
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7465,7 +7465,7 @@ var init_utils = __esm({
|
|
|
7465
7465
|
globalThis.require = require2;
|
|
7466
7466
|
globalThis.__filename = __filename;
|
|
7467
7467
|
globalThis.__dirname = __dirname;
|
|
7468
|
-
globalThis.Buffer =
|
|
7468
|
+
globalThis.Buffer = Buffer;
|
|
7469
7469
|
globalThis.process = process;
|
|
7470
7470
|
if (typeof global === "undefined") {
|
|
7471
7471
|
globalThis.global = globalThis;
|
|
@@ -7572,6 +7572,121 @@ var init_app_detection = __esm({
|
|
|
7572
7572
|
}
|
|
7573
7573
|
});
|
|
7574
7574
|
|
|
7575
|
+
// packages/tooling/src/utils/secrets-resolver.ts
|
|
7576
|
+
function parseEnvFile(filePath) {
|
|
7577
|
+
if (!pathExists(filePath)) return {};
|
|
7578
|
+
const content = readSync(filePath, { format: "text" });
|
|
7579
|
+
if (typeof content !== "string" || !content) return {};
|
|
7580
|
+
const result = {};
|
|
7581
|
+
for (const line of content.split(/\r?\n/)) {
|
|
7582
|
+
const trimmed = line.trim();
|
|
7583
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
7584
|
+
const eqIdx = trimmed.indexOf("=");
|
|
7585
|
+
if (eqIdx === -1) continue;
|
|
7586
|
+
const key = trimmed.slice(0, eqIdx).trim();
|
|
7587
|
+
let value = trimmed.slice(eqIdx + 1).trim();
|
|
7588
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
7589
|
+
value = value.slice(1, -1);
|
|
7590
|
+
}
|
|
7591
|
+
if (key && value) {
|
|
7592
|
+
result[key] = value;
|
|
7593
|
+
}
|
|
7594
|
+
}
|
|
7595
|
+
return result;
|
|
7596
|
+
}
|
|
7597
|
+
function readEnvVar(filePath, varName) {
|
|
7598
|
+
if (!pathExists(filePath)) return null;
|
|
7599
|
+
const content = readSync(filePath, { format: "text" });
|
|
7600
|
+
if (typeof content !== "string") return null;
|
|
7601
|
+
for (const line of content.split(/\r?\n/)) {
|
|
7602
|
+
const trimmed = line.trim();
|
|
7603
|
+
if (!trimmed || trimmed.startsWith("#")) continue;
|
|
7604
|
+
if (trimmed.startsWith(`${varName}=`)) {
|
|
7605
|
+
let val = trimmed.substring(`${varName}=`.length).trim();
|
|
7606
|
+
if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) {
|
|
7607
|
+
val = val.slice(1, -1);
|
|
7608
|
+
}
|
|
7609
|
+
return val || null;
|
|
7610
|
+
}
|
|
7611
|
+
}
|
|
7612
|
+
return null;
|
|
7613
|
+
}
|
|
7614
|
+
function loadDndevSecrets(projectRoot) {
|
|
7615
|
+
const secretsPath = joinPath(projectRoot, ".dndev.secrets");
|
|
7616
|
+
if (cachedSecretsPath === secretsPath && cachedSecrets) {
|
|
7617
|
+
return cachedSecrets;
|
|
7618
|
+
}
|
|
7619
|
+
cachedSecrets = parseEnvFile(secretsPath);
|
|
7620
|
+
cachedSecretsPath = secretsPath;
|
|
7621
|
+
return cachedSecrets;
|
|
7622
|
+
}
|
|
7623
|
+
function resolveSecret(name, projectRoot, opts) {
|
|
7624
|
+
const appDir = opts?.appDir ?? projectRoot;
|
|
7625
|
+
const envValue = process.env[name];
|
|
7626
|
+
if (envValue) {
|
|
7627
|
+
return { value: envValue, source: "process.env" };
|
|
7628
|
+
}
|
|
7629
|
+
const secrets = loadDndevSecrets(projectRoot);
|
|
7630
|
+
if (secrets[name]) {
|
|
7631
|
+
return { value: secrets[name], source: ".dndev.secrets" };
|
|
7632
|
+
}
|
|
7633
|
+
if (name === "SUPABASE_SECRET_KEY" && secrets["SUPABASE_SERVICE_ROLE_KEY"]) {
|
|
7634
|
+
return {
|
|
7635
|
+
value: secrets["SUPABASE_SERVICE_ROLE_KEY"],
|
|
7636
|
+
source: ".dndev.secrets"
|
|
7637
|
+
};
|
|
7638
|
+
}
|
|
7639
|
+
const legacyPaths = LEGACY_PATHS[name];
|
|
7640
|
+
if (legacyPaths) {
|
|
7641
|
+
for (const relPath of legacyPaths) {
|
|
7642
|
+
const fullPath = joinPath(appDir, relPath);
|
|
7643
|
+
const value = readEnvVar(fullPath, name);
|
|
7644
|
+
if (value) {
|
|
7645
|
+
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
7646
|
+
warnedLegacy.add(name);
|
|
7647
|
+
log.warn(
|
|
7648
|
+
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
7649
|
+
);
|
|
7650
|
+
}
|
|
7651
|
+
return { value, source: "legacy", legacyPath: relPath };
|
|
7652
|
+
}
|
|
7653
|
+
if (name === "SUPABASE_SECRET_KEY") {
|
|
7654
|
+
const aliasValue = readEnvVar(fullPath, "SUPABASE_SERVICE_ROLE_KEY");
|
|
7655
|
+
if (aliasValue) {
|
|
7656
|
+
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
7657
|
+
warnedLegacy.add(name);
|
|
7658
|
+
log.warn(
|
|
7659
|
+
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
7660
|
+
);
|
|
7661
|
+
}
|
|
7662
|
+
return { value: aliasValue, source: "legacy", legacyPath: relPath };
|
|
7663
|
+
}
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7666
|
+
}
|
|
7667
|
+
return null;
|
|
7668
|
+
}
|
|
7669
|
+
var LEGACY_PATHS, warnedLegacy, cachedSecretsPath, cachedSecrets;
|
|
7670
|
+
var init_secrets_resolver = __esm({
|
|
7671
|
+
"packages/tooling/src/utils/secrets-resolver.ts"() {
|
|
7672
|
+
"use strict";
|
|
7673
|
+
init_utils();
|
|
7674
|
+
init_pathResolver();
|
|
7675
|
+
init_cli_output();
|
|
7676
|
+
LEGACY_PATHS = {
|
|
7677
|
+
VERCEL_TOKEN: [".env.local"],
|
|
7678
|
+
SUPABASE_SECRET_KEY: ["supabase/functions/.env", "functions/.env"],
|
|
7679
|
+
SUPABASE_DB_URL: ["supabase/functions/.env", "functions/.env"],
|
|
7680
|
+
SUPABASE_ACCESS_TOKEN: ["supabase/functions/.env", "functions/.env"],
|
|
7681
|
+
STRIPE_SECRET_KEY: ["supabase/functions/.env", "functions/.env"],
|
|
7682
|
+
STRIPE_WEBHOOK_SECRET: ["supabase/functions/.env", "functions/.env"]
|
|
7683
|
+
};
|
|
7684
|
+
warnedLegacy = /* @__PURE__ */ new Set();
|
|
7685
|
+
cachedSecretsPath = null;
|
|
7686
|
+
cachedSecrets = null;
|
|
7687
|
+
}
|
|
7688
|
+
});
|
|
7689
|
+
|
|
7575
7690
|
// packages/tooling/src/utils/cross-app-detection.ts
|
|
7576
7691
|
function detectBackendFromProviders(appDir) {
|
|
7577
7692
|
for (const candidate of PROVIDERS_CANDIDATES) {
|
|
@@ -7637,9 +7752,9 @@ var init_cross_app_detection = __esm({
|
|
|
7637
7752
|
var check_env_exports = {};
|
|
7638
7753
|
__export(check_env_exports, {
|
|
7639
7754
|
envCheck: () => envCheck,
|
|
7640
|
-
parseEnvFile: () =>
|
|
7755
|
+
parseEnvFile: () => parseEnvFile2
|
|
7641
7756
|
});
|
|
7642
|
-
function
|
|
7757
|
+
function parseEnvFile2(filePath) {
|
|
7643
7758
|
const map = /* @__PURE__ */ new Map();
|
|
7644
7759
|
if (!pathExists(filePath)) return map;
|
|
7645
7760
|
const content = readSync(filePath, { format: "text" });
|
|
@@ -7681,8 +7796,8 @@ var init_check_env = __esm({
|
|
|
7681
7796
|
}
|
|
7682
7797
|
results.push({ name: ".env file", status: "pass", message: "Found" });
|
|
7683
7798
|
if (pathExists(examplePath)) {
|
|
7684
|
-
const example =
|
|
7685
|
-
const actual =
|
|
7799
|
+
const example = parseEnvFile2(examplePath);
|
|
7800
|
+
const actual = parseEnvFile2(envPath);
|
|
7686
7801
|
const missing = [];
|
|
7687
7802
|
const empty = [];
|
|
7688
7803
|
for (const [key] of example) {
|
|
@@ -7918,6 +8033,7 @@ var init_check_supabase = __esm({
|
|
|
7918
8033
|
init_pathResolver();
|
|
7919
8034
|
init_cross_app_detection();
|
|
7920
8035
|
init_supabase();
|
|
8036
|
+
init_secrets_resolver();
|
|
7921
8037
|
supabaseCheck = {
|
|
7922
8038
|
id: "supabase",
|
|
7923
8039
|
name: "Supabase",
|
|
@@ -7992,33 +8108,24 @@ var init_check_supabase = __esm({
|
|
|
7992
8108
|
message: ".env file not found"
|
|
7993
8109
|
});
|
|
7994
8110
|
}
|
|
7995
|
-
const
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
if (typeof content !== "string") continue;
|
|
8005
|
-
if (content.match(/SUPABASE_(?:SECRET|SERVICE_ROLE)_KEY=.+/)) {
|
|
8006
|
-
secretFound = true;
|
|
8007
|
-
}
|
|
8008
|
-
if (content.match(/SUPABASE_DB_URL=.+/)) {
|
|
8009
|
-
dbUrlFound = true;
|
|
8010
|
-
}
|
|
8011
|
-
if (secretFound || dbUrlFound) break;
|
|
8012
|
-
}
|
|
8111
|
+
const projectRoot = ctx.projectRoot ?? process.cwd();
|
|
8112
|
+
const secretKey = resolveSecret("SUPABASE_SECRET_KEY", projectRoot, {
|
|
8113
|
+
appDir: ctx.appDir,
|
|
8114
|
+
silent: true
|
|
8115
|
+
});
|
|
8116
|
+
const accessToken = resolveSecret("SUPABASE_ACCESS_TOKEN", projectRoot, {
|
|
8117
|
+
appDir: ctx.appDir,
|
|
8118
|
+
silent: true
|
|
8119
|
+
});
|
|
8013
8120
|
results.push({
|
|
8014
8121
|
name: "Secret key",
|
|
8015
|
-
status:
|
|
8016
|
-
message:
|
|
8122
|
+
status: secretKey ? "pass" : "fail",
|
|
8123
|
+
message: secretKey ? `Found (${secretKey.source})` : "Missing SUPABASE_SECRET_KEY"
|
|
8017
8124
|
});
|
|
8018
8125
|
results.push({
|
|
8019
|
-
name: "
|
|
8020
|
-
status:
|
|
8021
|
-
message:
|
|
8126
|
+
name: "Access token",
|
|
8127
|
+
status: accessToken ? "pass" : "fail",
|
|
8128
|
+
message: accessToken ? `Found (${accessToken.source})` : "Missing SUPABASE_ACCESS_TOKEN (needed for DB migrations)"
|
|
8022
8129
|
});
|
|
8023
8130
|
return results;
|
|
8024
8131
|
}
|
package/dist/bin/commands/emu.js
CHANGED
|
@@ -6980,7 +6980,7 @@ var init_PathResolver = __esm({
|
|
|
6980
6980
|
}
|
|
6981
6981
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6982
6982
|
let writeContent;
|
|
6983
|
-
if (
|
|
6983
|
+
if (Buffer.isBuffer(content)) {
|
|
6984
6984
|
writeContent = content;
|
|
6985
6985
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6986
6986
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6989,7 +6989,7 @@ var init_PathResolver = __esm({
|
|
|
6989
6989
|
}
|
|
6990
6990
|
try {
|
|
6991
6991
|
return await safeExecuteAsync(async () => {
|
|
6992
|
-
if (
|
|
6992
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6993
6993
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6994
6994
|
} else {
|
|
6995
6995
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -7041,7 +7041,7 @@ var init_PathResolver = __esm({
|
|
|
7041
7041
|
}
|
|
7042
7042
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7043
7043
|
let writeContent;
|
|
7044
|
-
if (
|
|
7044
|
+
if (Buffer.isBuffer(content)) {
|
|
7045
7045
|
writeContent = content;
|
|
7046
7046
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7047
7047
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7049,7 +7049,7 @@ var init_PathResolver = __esm({
|
|
|
7049
7049
|
writeContent = String(content);
|
|
7050
7050
|
}
|
|
7051
7051
|
try {
|
|
7052
|
-
if (
|
|
7052
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7053
7053
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7054
7054
|
} else {
|
|
7055
7055
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7818,7 +7818,7 @@ var init_typed_file_operations = __esm({
|
|
|
7818
7818
|
});
|
|
7819
7819
|
|
|
7820
7820
|
// packages/tooling/src/bundler/utils.ts
|
|
7821
|
-
import { Buffer
|
|
7821
|
+
import { Buffer } from "node:buffer";
|
|
7822
7822
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7823
7823
|
import { createRequire as createRequire3 } from "node:module";
|
|
7824
7824
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7835,7 +7835,7 @@ var init_utils = __esm({
|
|
|
7835
7835
|
globalThis.require = require2;
|
|
7836
7836
|
globalThis.__filename = __filename;
|
|
7837
7837
|
globalThis.__dirname = __dirname;
|
|
7838
|
-
globalThis.Buffer =
|
|
7838
|
+
globalThis.Buffer = Buffer;
|
|
7839
7839
|
globalThis.process = process;
|
|
7840
7840
|
if (typeof global === "undefined") {
|
|
7841
7841
|
globalThis.global = globalThis;
|
|
@@ -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");
|
|
@@ -7398,7 +7398,7 @@ var init_pathResolver = __esm({
|
|
|
7398
7398
|
});
|
|
7399
7399
|
|
|
7400
7400
|
// packages/tooling/src/bundler/utils.ts
|
|
7401
|
-
import { Buffer
|
|
7401
|
+
import { Buffer } from "node:buffer";
|
|
7402
7402
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7403
7403
|
import { createRequire as createRequire3 } from "node:module";
|
|
7404
7404
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7415,7 +7415,7 @@ var init_utils = __esm({
|
|
|
7415
7415
|
globalThis.require = require2;
|
|
7416
7416
|
globalThis.__filename = __filename;
|
|
7417
7417
|
globalThis.__dirname = __dirname;
|
|
7418
|
-
globalThis.Buffer =
|
|
7418
|
+
globalThis.Buffer = Buffer;
|
|
7419
7419
|
globalThis.process = process;
|
|
7420
7420
|
if (typeof global === "undefined") {
|
|
7421
7421
|
globalThis.global = globalThis;
|
|
@@ -6984,7 +6984,7 @@ var init_PathResolver = __esm({
|
|
|
6984
6984
|
}
|
|
6985
6985
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6986
6986
|
let writeContent;
|
|
6987
|
-
if (
|
|
6987
|
+
if (Buffer.isBuffer(content)) {
|
|
6988
6988
|
writeContent = content;
|
|
6989
6989
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6990
6990
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -6993,7 +6993,7 @@ var init_PathResolver = __esm({
|
|
|
6993
6993
|
}
|
|
6994
6994
|
try {
|
|
6995
6995
|
return await safeExecuteAsync(async () => {
|
|
6996
|
-
if (
|
|
6996
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
6997
6997
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6998
6998
|
} else {
|
|
6999
6999
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -7045,7 +7045,7 @@ var init_PathResolver = __esm({
|
|
|
7045
7045
|
}
|
|
7046
7046
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7047
7047
|
let writeContent;
|
|
7048
|
-
if (
|
|
7048
|
+
if (Buffer.isBuffer(content)) {
|
|
7049
7049
|
writeContent = content;
|
|
7050
7050
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7051
7051
|
writeContent = JSON.stringify(content, null, 2);
|
|
@@ -7053,7 +7053,7 @@ var init_PathResolver = __esm({
|
|
|
7053
7053
|
writeContent = String(content);
|
|
7054
7054
|
}
|
|
7055
7055
|
try {
|
|
7056
|
-
if (
|
|
7056
|
+
if (Buffer.isBuffer(writeContent)) {
|
|
7057
7057
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7058
7058
|
} else {
|
|
7059
7059
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
@@ -7749,7 +7749,7 @@ var init_pathResolver = __esm({
|
|
|
7749
7749
|
});
|
|
7750
7750
|
|
|
7751
7751
|
// packages/tooling/src/bundler/utils.ts
|
|
7752
|
-
import { Buffer
|
|
7752
|
+
import { Buffer } from "node:buffer";
|
|
7753
7753
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7754
7754
|
import { createRequire as createRequire3 } from "node:module";
|
|
7755
7755
|
import { dirname as dirname3, resolve as resolve3 } from "node:path";
|
|
@@ -7766,7 +7766,7 @@ var init_utils = __esm({
|
|
|
7766
7766
|
globalThis.require = require2;
|
|
7767
7767
|
globalThis.__filename = __filename;
|
|
7768
7768
|
globalThis.__dirname = __dirname;
|
|
7769
|
-
globalThis.Buffer =
|
|
7769
|
+
globalThis.Buffer = Buffer;
|
|
7770
7770
|
globalThis.process = process;
|
|
7771
7771
|
if (typeof global === "undefined") {
|
|
7772
7772
|
globalThis.global = globalThis;
|
|
@@ -8088,6 +8088,11 @@ function generateScripts(templateName, options) {
|
|
|
8088
8088
|
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8089
8089
|
scripts.preview = "vite preview";
|
|
8090
8090
|
scripts["type-check"] = "tsc --noEmit";
|
|
8091
|
+
} else if (templateName === "dndev") {
|
|
8092
|
+
scripts.dev = "vite";
|
|
8093
|
+
scripts.build = "tsc --noEmit && vite build --mode production";
|
|
8094
|
+
scripts.preview = "vite preview";
|
|
8095
|
+
scripts["type-check"] = "tsc --noEmit";
|
|
8091
8096
|
} else if (templateName === "entities") {
|
|
8092
8097
|
}
|
|
8093
8098
|
return scripts;
|