@vexblocks/cli 1.0.9 → 1.1.1

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 CHANGED
@@ -168,11 +168,10 @@ If you already have a Convex project with a `schema.ts`:
168
168
 
169
169
  1. Run `npx @vexblocks/cli add backend`
170
170
  2. The CLI will:
171
- - Create a backup of your schema
172
171
  - Add `schema.cms.ts` with CMS tables
173
- - Add instructions for merging
172
+ - Automatically merge CMS tables into your schema
174
173
 
175
- 3. Update your `schema.ts`:
174
+ 3. Your `schema.ts` will be updated to include:
176
175
 
177
176
  ```typescript
178
177
  import { defineSchema } from "convex/server"
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var PACKAGE_NAMES = {
30
30
  };
31
31
  var MANAGED_PACKAGES = ["cms", "shared", "types"];
32
32
  var PROTECTED_FILES = [
33
- "packages/backend/vexblocks.config.ts",
33
+ "packages/backend/convex/cms/vexblocks.config.ts",
34
34
  "packages/backend/.env",
35
35
  "packages/backend/.env.local",
36
36
  "packages/cms-shared/src/types/generated.ts"
@@ -88,14 +88,6 @@ async function getPackageManager(cwd) {
88
88
  }
89
89
  return "npm";
90
90
  }
91
- async function createBackup(filePath) {
92
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
93
- const backupPath = `${filePath}.backup-${timestamp}`;
94
- if (await fs.pathExists(filePath)) {
95
- await fs.copy(filePath, backupPath);
96
- }
97
- return backupPath;
98
- }
99
91
 
100
92
  // src/utils/github.ts
101
93
  import path2 from "path";
@@ -482,17 +474,7 @@ async function installBackendPackage(targetPath, sourcePath, spinner) {
482
474
  const hasSchema = await fs4.pathExists(existingSchemaPath);
483
475
  if (hasSchema) {
484
476
  spinner.text = "Detected existing Convex schema, merging CMS tables...";
485
- const backupPath = `${existingSchemaPath}.backup-${Date.now()}`;
486
- await fs4.copy(existingSchemaPath, backupPath);
487
- logger.info(`Backed up existing schema to ${path4.basename(backupPath)}`);
488
- const cmsFiles = [
489
- "convex/cms",
490
- "convex/auth.ts",
491
- "convex/auth.config.ts",
492
- "convex/http.ts",
493
- "better-auth",
494
- "emails"
495
- ];
477
+ const cmsFiles = ["convex/cms", "convex/auth.ts", "convex/auth.config.ts", "convex/http.ts", "better-auth", "emails"];
496
478
  for (const file of cmsFiles) {
497
479
  const fullSourcePath = `${sourcePath}/${file}`;
498
480
  const fullTargetPath = path4.join(targetPath, file);
@@ -578,7 +560,7 @@ async function mergeSchemaFile(schemaPath, spinner) {
578
560
  }
579
561
  spinner.text = "Merging CMS schema into existing schema.ts...";
580
562
  let newContent = content;
581
- const importStatement = 'import { cmsSchemaExports } from "./schema.cms"';
563
+ const importStatement = 'import { cmsSchemaExports } from "./cms/schema.cms"';
582
564
  const hasImport = content.includes(importStatement);
583
565
  if (!hasImport) {
584
566
  const importRegex = /^import\s+.*from\s+['"].*['"];?\s*$/gm;
@@ -1151,8 +1133,6 @@ async function upgradePackage(cwd, pkg, version, manifest, options) {
1151
1133
  }
1152
1134
  const isManaged = MANAGED_PACKAGES.includes(pkg);
1153
1135
  if (isManaged || options.force) {
1154
- const backupPath = await createBackup(targetPath);
1155
- spinner.text = `Created backup at ${path7.basename(backupPath)}`;
1156
1136
  await fs7.remove(targetPath);
1157
1137
  const sourcePath = getSourcePath2(pkg);
1158
1138
  await downloadAndExtractPackage(sourcePath, targetPath, (file) => {
@@ -1164,9 +1144,6 @@ async function upgradePackage(cwd, pkg, version, manifest, options) {
1164
1144
  for (const file of cmsFiles) {
1165
1145
  const targetFilePath = path7.join(targetPath, file);
1166
1146
  const sourceFilePath = `packages/backend/${file}`;
1167
- if (await fs7.pathExists(targetFilePath)) {
1168
- await createBackup(targetFilePath);
1169
- }
1170
1147
  try {
1171
1148
  await fs7.remove(targetFilePath);
1172
1149
  await downloadAndExtractPackage(sourceFilePath, targetFilePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vexblocks/cli",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "CLI for adding VexBlocks Headless CMS to your Turborepo project",
5
5
  "keywords": [
6
6
  "cms",