@vexblocks/cli 1.1.9 → 2.0.0

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 (2) hide show
  1. package/dist/index.js +36 -16
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -520,27 +520,31 @@ async function installBackendPackage(targetPath, sourcePath, spinner) {
520
520
  const hasSchema = await fs4.pathExists(existingSchemaPath);
521
521
  if (hasSchema) {
522
522
  spinner.text = "Detected existing Convex schema, merging CMS tables...";
523
- const cmsFiles = [
524
- "convex/cms",
523
+ const cmsDirs = ["convex/cms", "better-auth", "emails"];
524
+ const cmsIndividualFiles = [
525
525
  "convex/auth.ts",
526
526
  "convex/auth.config.ts",
527
527
  "convex/http.ts",
528
- "better-auth",
529
- "emails"
528
+ "convex/convex.config.ts"
530
529
  ];
531
- for (const file of cmsFiles) {
530
+ for (const dir of cmsDirs) {
531
+ const fullSourcePath = `${sourcePath}/${dir}`;
532
+ const fullTargetPath = path4.join(targetPath, dir);
533
+ spinner.text = `Downloading ${dir}...`;
534
+ try {
535
+ await downloadAndExtractPackage(fullSourcePath, fullTargetPath);
536
+ } catch {
537
+ }
538
+ }
539
+ for (const file of cmsIndividualFiles) {
532
540
  const fullSourcePath = `${sourcePath}/${file}`;
533
541
  const fullTargetPath = path4.join(targetPath, file);
534
542
  spinner.text = `Downloading ${file}...`;
535
543
  try {
536
- await downloadAndExtractPackage(fullSourcePath, fullTargetPath);
544
+ const content = await fetchFile(fullSourcePath);
545
+ await fs4.ensureDir(path4.dirname(fullTargetPath));
546
+ await fs4.writeFile(fullTargetPath, content);
537
547
  } catch {
538
- try {
539
- const content = await fetchFile(fullSourcePath);
540
- await fs4.ensureDir(path4.dirname(fullTargetPath));
541
- await fs4.writeFile(fullTargetPath, content);
542
- } catch {
543
- }
544
548
  }
545
549
  }
546
550
  await mergeSchemaFile(existingSchemaPath, spinner);
@@ -1204,16 +1208,32 @@ async function upgradePackage(cwd, pkg, version, manifest, options) {
1204
1208
  });
1205
1209
  } else {
1206
1210
  spinner.text = `Upgrading CMS files in ${PACKAGE_NAMES[pkg]}...`;
1207
- const cmsFiles = ["convex/cms"];
1208
- for (const file of cmsFiles) {
1209
- const targetFilePath = path7.join(targetPath, file);
1210
- const sourceFilePath = `packages/backend/${file}`;
1211
+ const cmsDirs = ["convex/cms", "better-auth", "emails"];
1212
+ for (const dir of cmsDirs) {
1213
+ const targetFilePath = path7.join(targetPath, dir);
1214
+ const sourceFilePath = `packages/backend/${dir}`;
1211
1215
  try {
1212
1216
  await fs7.remove(targetFilePath);
1213
1217
  await downloadAndExtractPackage(sourceFilePath, targetFilePath);
1214
1218
  } catch {
1215
1219
  }
1216
1220
  }
1221
+ const cmsIndividualFiles = [
1222
+ "convex/auth.ts",
1223
+ "convex/auth.config.ts",
1224
+ "convex/http.ts",
1225
+ "convex/convex.config.ts"
1226
+ ];
1227
+ for (const file of cmsIndividualFiles) {
1228
+ const targetFilePath = path7.join(targetPath, file);
1229
+ const sourceFilePath = `packages/backend/${file}`;
1230
+ try {
1231
+ const content = await fetchFile(sourceFilePath);
1232
+ await fs7.ensureDir(path7.dirname(targetFilePath));
1233
+ await fs7.writeFile(targetFilePath, content);
1234
+ } catch {
1235
+ }
1236
+ }
1217
1237
  }
1218
1238
  const newConfig = {
1219
1239
  ...config,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vexblocks/cli",
3
- "version": "1.1.9",
3
+ "version": "2.0.0",
4
4
  "description": "CLI for adding VexBlocks Headless CMS to your Turborepo project",
5
5
  "keywords": [
6
6
  "cms",
@@ -43,18 +43,18 @@
43
43
  "prepublishOnly": "pnpm run build"
44
44
  },
45
45
  "dependencies": {
46
- "@inquirer/prompts": "^8.2.0",
47
- "commander": "^14.0.2",
46
+ "@inquirer/prompts": "^8.2.1",
47
+ "commander": "^14.0.3",
48
48
  "diff": "^8.0.3",
49
49
  "fs-extra": "^11.3.3",
50
- "ora": "^9.0.0",
50
+ "ora": "^9.3.0",
51
51
  "picocolors": "^1.1.1",
52
- "tar": "^7.5.3"
52
+ "tar": "^7.5.9"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/diff": "^8.0.0",
56
56
  "@types/fs-extra": "^11.0.4",
57
- "@types/node": "^25.0.9",
57
+ "@types/node": "^25.2.3",
58
58
  "tsup": "^8.5.1",
59
59
  "typescript": "^5.9.3"
60
60
  },