@donotdev/cli 0.0.28 → 0.0.29
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/dependencies-matrix.json +16 -9
- package/dist/bin/commands/bump.js +129 -8
- package/dist/bin/commands/db.js +5 -2
- package/dist/bin/commands/deploy.js +7 -4
- package/dist/bin/commands/make-admin.js +225 -122
- package/dist/bin/commands/seed.js +5 -2
- package/dist/bin/commands/setup.js +3 -5
- package/dist/bin/commands/staging.js +7 -4
- package/dist/bin/dndev.js +1 -1
- package/dist/bin/donotdev.js +1 -1
- package/dist/index.js +11 -8
- package/package.json +1 -1
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +1 -2
- package/templates/overlay-supabase/src/config/providers.ts.example +1 -2
- 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/dependencies-matrix.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@donotdev/auth": {
|
|
18
18
|
"description": "Authentication package",
|
|
19
19
|
"packages": {
|
|
20
|
-
"@donotdev/auth": "^0.0.
|
|
20
|
+
"@donotdev/auth": "^0.0.19"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"@donotdev/billing": {
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
"@donotdev/core": {
|
|
36
36
|
"description": "Core framework package",
|
|
37
37
|
"packages": {
|
|
38
|
-
"@donotdev/core": "^0.0.
|
|
38
|
+
"@donotdev/core": "^0.0.37"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"@donotdev/crud": {
|
|
42
42
|
"description": "CRUD operations package",
|
|
43
43
|
"packages": {
|
|
44
|
-
"@donotdev/crud": "^0.0.
|
|
44
|
+
"@donotdev/crud": "^0.0.25"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"@donotdev/firebase": {
|
|
48
48
|
"description": "Firebase provider package",
|
|
49
49
|
"packages": {
|
|
50
|
-
"@donotdev/firebase": "^0.0.
|
|
50
|
+
"@donotdev/firebase": "^0.0.21"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"@donotdev/functions": {
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"@donotdev/expo": {
|
|
78
78
|
"description": "Expo/React Native components package",
|
|
79
79
|
"packages": {
|
|
80
|
-
"@donotdev/expo": "^0.0.
|
|
80
|
+
"@donotdev/expo": "^0.0.10"
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"@donotdev/supabase": {
|
|
84
84
|
"description": "Supabase provider package",
|
|
85
85
|
"packages": {
|
|
86
|
-
"@donotdev/supabase": "^0.0.
|
|
86
|
+
"@donotdev/supabase": "^0.0.10"
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"supabase-js": {
|
|
@@ -256,6 +256,12 @@
|
|
|
256
256
|
"browser-image-compression": "^2.0.2"
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
|
+
"dompurify": {
|
|
260
|
+
"description": "HTML sanitization — XSS-safe alternative to regex-based sanitizers",
|
|
261
|
+
"packages": {
|
|
262
|
+
"dompurify": "^3.3.2"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
259
265
|
"tiptap": {
|
|
260
266
|
"description": "Rich text editor - optional peer dependency. Required: @tiptap/react, @tiptap/pm, @tiptap/starter-kit. Optional: @tiptap/extension-placeholder for placeholder text.",
|
|
261
267
|
"packages": {
|
|
@@ -418,7 +424,7 @@
|
|
|
418
424
|
"@donotdev/cli": {
|
|
419
425
|
"description": "Cli package",
|
|
420
426
|
"packages": {
|
|
421
|
-
"@donotdev/cli": "^0.0.
|
|
427
|
+
"@donotdev/cli": "^0.0.29"
|
|
422
428
|
}
|
|
423
429
|
},
|
|
424
430
|
"@donotdev/mcp-server": {
|
|
@@ -450,7 +456,7 @@
|
|
|
450
456
|
"@donotdev/security": {
|
|
451
457
|
"description": "Security package",
|
|
452
458
|
"packages": {
|
|
453
|
-
"@donotdev/security": "^0.0.
|
|
459
|
+
"@donotdev/security": "^0.0.10"
|
|
454
460
|
}
|
|
455
461
|
},
|
|
456
462
|
"xterm": {
|
|
@@ -601,7 +607,8 @@
|
|
|
601
607
|
"@donotdev/core",
|
|
602
608
|
"react-easy-crop",
|
|
603
609
|
"@dnd-kit",
|
|
604
|
-
"forms-resolvers"
|
|
610
|
+
"forms-resolvers",
|
|
611
|
+
"dompurify"
|
|
605
612
|
],
|
|
606
613
|
"devDependencies": [
|
|
607
614
|
"tiptap"
|
|
@@ -7875,13 +7875,14 @@ function globSync(pattern, options = {}) {
|
|
|
7875
7875
|
});
|
|
7876
7876
|
return results.map((p2) => pathResolverInstance.normalizePath(p2));
|
|
7877
7877
|
}
|
|
7878
|
-
var pathResolverInstance, getAppRoot, resolveFrameworkPackage, normalizePath, pathExists, read, readSync, write, writeSync, ensureDir, getRelativePathBetween, getDirname, joinPath;
|
|
7878
|
+
var pathResolverInstance, getRepoRoot, getAppRoot, resolveFrameworkPackage, normalizePath, pathExists, read, readSync, write, writeSync, ensureDir, getRelativePathBetween, getDirname, joinPath;
|
|
7879
7879
|
var init_pathResolver = __esm({
|
|
7880
7880
|
"packages/tooling/src/utils/pathResolver.ts"() {
|
|
7881
7881
|
"use strict";
|
|
7882
7882
|
init_utils();
|
|
7883
7883
|
init_PathResolver();
|
|
7884
7884
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7885
|
+
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
7885
7886
|
getAppRoot = () => pathResolverInstance.getAppRoot();
|
|
7886
7887
|
resolveFrameworkPackage = (name, from) => pathResolverInstance.resolveFrameworkPackage(name, from || null);
|
|
7887
7888
|
normalizePath = (...pathSegments) => {
|
|
@@ -8042,6 +8043,9 @@ function loadMatrix(mode) {
|
|
|
8042
8043
|
};
|
|
8043
8044
|
return cachedMatrix;
|
|
8044
8045
|
}
|
|
8046
|
+
function clearMatrixCache() {
|
|
8047
|
+
cachedMatrix = null;
|
|
8048
|
+
}
|
|
8045
8049
|
function flattenGroups(groups, options) {
|
|
8046
8050
|
const flat = {};
|
|
8047
8051
|
for (const group of Object.values(groups)) {
|
|
@@ -8101,6 +8105,22 @@ function writePackageJson(filePath, pkg) {
|
|
|
8101
8105
|
overwrite: true
|
|
8102
8106
|
});
|
|
8103
8107
|
}
|
|
8108
|
+
function buildDonotdevVersions(repoRoot) {
|
|
8109
|
+
const versions = {};
|
|
8110
|
+
const root = repoRoot || getRepoRoot();
|
|
8111
|
+
const files = globSync("packages/**/package.json", {
|
|
8112
|
+
cwd: root,
|
|
8113
|
+
absolute: true,
|
|
8114
|
+
ignore: ["**/node_modules/**", "**/dist/**"]
|
|
8115
|
+
});
|
|
8116
|
+
for (const filePath of files) {
|
|
8117
|
+
const pkg = parsePackageJson(filePath);
|
|
8118
|
+
if (pkg?.name?.startsWith("@donotdev/") && pkg.version) {
|
|
8119
|
+
versions[pkg.name] = pkg.version;
|
|
8120
|
+
}
|
|
8121
|
+
}
|
|
8122
|
+
return versions;
|
|
8123
|
+
}
|
|
8104
8124
|
function normalizeVersion(version) {
|
|
8105
8125
|
return version.replace(/^[\^~>=<]+/, "").trim();
|
|
8106
8126
|
}
|
|
@@ -8132,6 +8152,72 @@ function compareVersions(current, expected) {
|
|
|
8132
8152
|
return { behind: false, ahead: false, equal: true, isMajor: false };
|
|
8133
8153
|
}
|
|
8134
8154
|
|
|
8155
|
+
// packages/tooling/src/bundler/sync-dependencies.ts
|
|
8156
|
+
init_utils();
|
|
8157
|
+
import { execSync } from "node:child_process";
|
|
8158
|
+
import { createRequire as createRequire5 } from "node:module";
|
|
8159
|
+
init_pathResolver();
|
|
8160
|
+
var INTERNAL_BUNDLED_PACKAGES = /* @__PURE__ */ new Set([
|
|
8161
|
+
"@donotdev/types",
|
|
8162
|
+
"@donotdev/utils",
|
|
8163
|
+
"@donotdev/stores",
|
|
8164
|
+
"@donotdev/schemas",
|
|
8165
|
+
"@donotdev/hooks",
|
|
8166
|
+
"@donotdev/i18n",
|
|
8167
|
+
"@donotdev/config",
|
|
8168
|
+
"@donotdev/tooling"
|
|
8169
|
+
]);
|
|
8170
|
+
function syncDonotdevToMatrix(matrix, donotdevVersions, dryRun) {
|
|
8171
|
+
const changes = [];
|
|
8172
|
+
for (const [pkgName, actualVersion] of Object.entries(donotdevVersions)) {
|
|
8173
|
+
if (!pkgName.startsWith("@donotdev/")) continue;
|
|
8174
|
+
if (INTERNAL_BUNDLED_PACKAGES.has(pkgName)) continue;
|
|
8175
|
+
const group = matrix.groups[pkgName];
|
|
8176
|
+
if (!group) {
|
|
8177
|
+
matrix.groups[pkgName] = {
|
|
8178
|
+
description: `${pkgName.replace("@donotdev/", "").charAt(0).toUpperCase() + pkgName.replace("@donotdev/", "").slice(1)} package`,
|
|
8179
|
+
packages: { [pkgName]: `^${actualVersion}` }
|
|
8180
|
+
};
|
|
8181
|
+
changes.push({ pkg: pkgName, from: "N/A", to: `^${actualVersion}` });
|
|
8182
|
+
continue;
|
|
8183
|
+
}
|
|
8184
|
+
const matrixVersion = group.packages[pkgName];
|
|
8185
|
+
if (!matrixVersion) {
|
|
8186
|
+
group.packages[pkgName] = `^${actualVersion}`;
|
|
8187
|
+
changes.push({ pkg: pkgName, from: "N/A", to: `^${actualVersion}` });
|
|
8188
|
+
continue;
|
|
8189
|
+
}
|
|
8190
|
+
const normalizedMatrix = matrixVersion.replace(/^\^/, "");
|
|
8191
|
+
if (normalizedMatrix !== actualVersion) {
|
|
8192
|
+
changes.push({
|
|
8193
|
+
pkg: pkgName,
|
|
8194
|
+
from: matrixVersion,
|
|
8195
|
+
to: `^${actualVersion}`
|
|
8196
|
+
});
|
|
8197
|
+
group.packages[pkgName] = `^${actualVersion}`;
|
|
8198
|
+
}
|
|
8199
|
+
}
|
|
8200
|
+
if (changes.length > 0 && !dryRun) {
|
|
8201
|
+
matrix.lastUpdated = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
8202
|
+
try {
|
|
8203
|
+
const require3 = createRequire5(import.meta.url);
|
|
8204
|
+
const matrixPath = require3.resolve("@donotdev/cli/dependencies-matrix.json");
|
|
8205
|
+
writeSync(matrixPath, JSON.stringify(matrix, null, 2) + "\n", {
|
|
8206
|
+
overwrite: true
|
|
8207
|
+
});
|
|
8208
|
+
} catch {
|
|
8209
|
+
const matrixPath = "packages/cli/dependencies-matrix.json";
|
|
8210
|
+
if (pathExists(matrixPath)) {
|
|
8211
|
+
writeSync(matrixPath, JSON.stringify(matrix, null, 2) + "\n", {
|
|
8212
|
+
overwrite: true
|
|
8213
|
+
});
|
|
8214
|
+
}
|
|
8215
|
+
}
|
|
8216
|
+
clearMatrixCache();
|
|
8217
|
+
}
|
|
8218
|
+
return { updated: changes.length > 0, changes };
|
|
8219
|
+
}
|
|
8220
|
+
|
|
8135
8221
|
// packages/tooling/src/utils/dependency-resolver.ts
|
|
8136
8222
|
init_utils();
|
|
8137
8223
|
function applyConditionals(template, options) {
|
|
@@ -8939,19 +9025,37 @@ ${updates.length} update(s) available:`);
|
|
|
8939
9025
|
log.info(` ${relativeFile} (${u2.field})`);
|
|
8940
9026
|
}
|
|
8941
9027
|
}
|
|
8942
|
-
if (majorUpdates.length > 0) {
|
|
8943
|
-
log.info(
|
|
8944
|
-
|
|
8945
|
-
${majorUpdates.length} major update(s) available (manual review required):`
|
|
8946
|
-
);
|
|
9028
|
+
if (majorUpdates.length > 0 && !dryRun) {
|
|
9029
|
+
log.info(`
|
|
9030
|
+
${majorUpdates.length} major update(s) available:`);
|
|
8947
9031
|
for (const u2 of majorUpdates) {
|
|
8948
9032
|
const relativeFile = appRoot ? getRelativePathBetween(appRoot, u2.file) : u2.file;
|
|
8949
9033
|
const normalizedLatest = normalizeVersion(u2.latest);
|
|
8950
9034
|
const displayLatest = ensureCaretPrefix(normalizedLatest);
|
|
8951
|
-
log.info(` \
|
|
9035
|
+
log.info(` \u26A0 ${u2.pkg}: ${u2.current} \u2192 ${displayLatest}`);
|
|
8952
9036
|
log.info(` ${relativeFile} (${u2.field})`);
|
|
8953
|
-
if (u2.migrationPath) log.info(`
|
|
9037
|
+
if (u2.migrationPath) log.info(` migration guide: ${u2.migrationPath}`);
|
|
9038
|
+
if (u2.breakingChanges?.length) {
|
|
9039
|
+
for (const bc of u2.breakingChanges) log.info(` breaking: ${bc}`);
|
|
9040
|
+
}
|
|
9041
|
+
const apply = await askForConfirmation(
|
|
9042
|
+
`Apply major bump for ${u2.pkg}?`,
|
|
9043
|
+
false
|
|
9044
|
+
);
|
|
9045
|
+
if (apply) {
|
|
9046
|
+
updates.push(u2);
|
|
9047
|
+
}
|
|
8954
9048
|
}
|
|
9049
|
+
} else if (majorUpdates.length > 0 && dryRun) {
|
|
9050
|
+
log.info(`
|
|
9051
|
+
${majorUpdates.length} major update(s) available:`);
|
|
9052
|
+
for (const u2 of majorUpdates) {
|
|
9053
|
+
const normalizedLatest = normalizeVersion(u2.latest);
|
|
9054
|
+
const displayLatest = ensureCaretPrefix(normalizedLatest);
|
|
9055
|
+
log.info(` \u26A0 ${u2.pkg}: ${u2.current} \u2192 ${displayLatest}`);
|
|
9056
|
+
if (u2.migrationPath) log.info(` migration guide: ${u2.migrationPath}`);
|
|
9057
|
+
}
|
|
9058
|
+
updates.push(...majorUpdates);
|
|
8955
9059
|
}
|
|
8956
9060
|
if (updates.length > 0) {
|
|
8957
9061
|
let shouldApply = false;
|
|
@@ -9021,6 +9125,23 @@ ${majorUpdates.length} major update(s) available (manual review required):`
|
|
|
9021
9125
|
`
|
|
9022
9126
|
Done. Updated ${updatedFiles.size} file(s). Run "bun install" to apply.`
|
|
9023
9127
|
);
|
|
9128
|
+
if (detectExecutionMode() === "development") {
|
|
9129
|
+
clearMatrixCache();
|
|
9130
|
+
const freshMatrix = loadMatrix();
|
|
9131
|
+
if (freshMatrix) {
|
|
9132
|
+
const freshVersions = buildDonotdevVersions();
|
|
9133
|
+
const sync = syncDonotdevToMatrix(
|
|
9134
|
+
freshMatrix.matrix,
|
|
9135
|
+
freshVersions,
|
|
9136
|
+
false
|
|
9137
|
+
);
|
|
9138
|
+
if (sync.changes.length > 0) {
|
|
9139
|
+
log.success(
|
|
9140
|
+
`Matrix updated (${sync.changes.length} template version(s) synced)`
|
|
9141
|
+
);
|
|
9142
|
+
}
|
|
9143
|
+
}
|
|
9144
|
+
}
|
|
9024
9145
|
}
|
|
9025
9146
|
} else {
|
|
9026
9147
|
log.info("\nUpdates not applied");
|
package/dist/bin/commands/db.js
CHANGED
|
@@ -58878,7 +58878,7 @@ __export(supabase_management_exports, {
|
|
|
58878
58878
|
extractProjectRef: () => extractProjectRef,
|
|
58879
58879
|
tableExists: () => tableExists
|
|
58880
58880
|
});
|
|
58881
|
-
import { execSync } from "node:child_process";
|
|
58881
|
+
import { execSync, spawnSync } from "node:child_process";
|
|
58882
58882
|
function createAdminClient(supabaseUrl, secretKey) {
|
|
58883
58883
|
return createClient(supabaseUrl, secretKey, {
|
|
58884
58884
|
auth: {
|
|
@@ -58988,13 +58988,16 @@ async function deployEdgeFunction(options) {
|
|
|
58988
58988
|
try {
|
|
58989
58989
|
const cmd = getSupabaseCmd();
|
|
58990
58990
|
const projectDir = joinPath(supabaseDir, "..");
|
|
58991
|
-
|
|
58991
|
+
const result = spawnSync(cmd, ["functions", "deploy", functionName], {
|
|
58992
58992
|
cwd: projectDir,
|
|
58993
58993
|
stdio: "pipe",
|
|
58994
58994
|
env: {
|
|
58995
58995
|
...process.env
|
|
58996
58996
|
}
|
|
58997
58997
|
});
|
|
58998
|
+
if (result.status !== 0) {
|
|
58999
|
+
throw new Error(result.stderr?.toString() || "Deploy failed");
|
|
59000
|
+
}
|
|
58998
59001
|
} catch (error2) {
|
|
58999
59002
|
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
59000
59003
|
throw new Error(`Failed to deploy Edge Function: ${message}`);
|
|
@@ -16543,7 +16543,7 @@ var deploy_supabase_functions_exports = {};
|
|
|
16543
16543
|
__export(deploy_supabase_functions_exports, {
|
|
16544
16544
|
deploySupabaseFunctions: () => deploySupabaseFunctions
|
|
16545
16545
|
});
|
|
16546
|
-
import {
|
|
16546
|
+
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
16547
16547
|
async function deploySupabaseFunctions(appDir, config) {
|
|
16548
16548
|
const supabaseDir = joinPath(appDir, "supabase");
|
|
16549
16549
|
const functionsDir = joinPath(supabaseDir, "functions");
|
|
@@ -16578,7 +16578,7 @@ async function deploySupabaseFunctions(appDir, config) {
|
|
|
16578
16578
|
for (const functionName of functionDirs) {
|
|
16579
16579
|
s.start(`Deploying Edge Function: ${functionName}...`);
|
|
16580
16580
|
try {
|
|
16581
|
-
|
|
16581
|
+
const result = spawnSync6("supabase", ["functions", "deploy", functionName], {
|
|
16582
16582
|
cwd: supabaseDir,
|
|
16583
16583
|
stdio: config.verbose ? "inherit" : "pipe",
|
|
16584
16584
|
env: {
|
|
@@ -16586,6 +16586,9 @@ async function deploySupabaseFunctions(appDir, config) {
|
|
|
16586
16586
|
DNDEV_APP_ROOT: appDir
|
|
16587
16587
|
}
|
|
16588
16588
|
});
|
|
16589
|
+
if (result.status !== 0) {
|
|
16590
|
+
throw new Error(result.stderr?.toString() || "Deploy failed");
|
|
16591
|
+
}
|
|
16589
16592
|
s.stop(`Deployed: ${functionName}`);
|
|
16590
16593
|
} catch (error2) {
|
|
16591
16594
|
s.stop(`Failed to deploy: ${functionName}`);
|
|
@@ -16752,7 +16755,7 @@ function safeRemove(path, options = {}) {
|
|
|
16752
16755
|
|
|
16753
16756
|
// packages/tooling/src/apps/deploy.ts
|
|
16754
16757
|
init_utils();
|
|
16755
|
-
import { execSync as
|
|
16758
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
16756
16759
|
|
|
16757
16760
|
// packages/tooling/src/apps/deploy-frontend.ts
|
|
16758
16761
|
init_utils();
|
|
@@ -18055,7 +18058,7 @@ async function main2(options = {}) {
|
|
|
18055
18058
|
isStaging ? "Building (staging mode)..." : "Building application..."
|
|
18056
18059
|
);
|
|
18057
18060
|
try {
|
|
18058
|
-
|
|
18061
|
+
execSync3(buildCmd, {
|
|
18059
18062
|
cwd: appDir,
|
|
18060
18063
|
stdio: "inherit",
|
|
18061
18064
|
env: {
|