@sleekcms/sync 1.2.0 → 1.2.2

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/cli.js +9 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -95,14 +95,14 @@ function setupKeyboardInput(handlers) {
95
95
  }
96
96
  });
97
97
  }
98
+ const EDITOR_CANDIDATES = [
99
+ { name: "VS Code", cmd: "code", args: (dir) => ["-n", dir] },
100
+ { name: "Cursor", cmd: "cursor", args: (dir) => ["-n", dir] },
101
+ ];
98
102
  function showEditorMenu(viewsDir, handlers) {
99
- const editors = [];
100
- if (commandExists("code")) {
101
- editors.push({ key: "1", name: "VS Code", cmd: "code" });
102
- }
103
- if (commandExists("cursor")) {
104
- editors.push({ key: "2", name: "Cursor", cmd: "cursor" });
105
- }
103
+ const editors = EDITOR_CANDIDATES
104
+ .filter(e => commandExists(e.cmd))
105
+ .map((e, i) => ({ ...e, key: String(i + 1) }));
106
106
  if (editors.length === 0) {
107
107
  console.log("\nšŸ‘€ Watching for changes...");
108
108
  showWatchHelp();
@@ -135,9 +135,10 @@ function showEditorMenu(viewsDir, handlers) {
135
135
  const selected = editors.find(e => e.key === answer.trim());
136
136
  if (selected) {
137
137
  console.log(`šŸ‘€ Watching for changes... (opened ${selected.name})`);
138
- (0, child_process_1.spawn)(selected.cmd, ["-n", viewsDir], {
138
+ (0, child_process_1.spawn)(selected.cmd, selected.args(viewsDir), {
139
139
  detached: true,
140
140
  stdio: "ignore",
141
+ ...(selected.cwd ? { cwd: selected.cwd(viewsDir) } : {}),
141
142
  }).unref();
142
143
  }
143
144
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleekcms/sync",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Edit SleekCMS sites locally — models, content, templates, images — with live two-way sync and AI agent support.",
5
5
  "keywords": [
6
6
  "sleekcms",