@embeddables/cli 0.6.10 → 0.6.11

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.
@@ -38,10 +38,10 @@ export async function runBranch(opts) {
38
38
  console.log('');
39
39
  // Pull the selected branch
40
40
  if (selectedBranch === null) {
41
- // User selected "main" - pull without branch
41
+ // User selected "main" - pull main and clear saved branch
42
42
  console.log(pc.cyan('Switching to main (latest published version)...'));
43
43
  console.log('');
44
- await runPull({ id: embeddableId });
44
+ await runPull({ id: embeddableId, useMain: true });
45
45
  }
46
46
  else {
47
47
  console.log(pc.cyan(`Switching to branch: ${selectedBranch.name}...`));
@@ -3,6 +3,8 @@ export type RunPullOptions = {
3
3
  out?: string;
4
4
  branch?: string;
5
5
  branchName?: string;
6
+ /** When true, pull main and clear saved branch (e.g. when user explicitly selects "main" in branch switcher). */
7
+ useMain?: boolean;
6
8
  fix?: boolean;
7
9
  preserve?: boolean;
8
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAgHA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,iBAiQjD"}
1
+ {"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAgHA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iHAAiH;IACjH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,iBAkQjD"}
@@ -153,10 +153,10 @@ export async function runPull(opts) {
153
153
  embeddableId = selected;
154
154
  console.log('');
155
155
  }
156
- // Stay on current branch when no --branch: use config's _branch_id if set
157
- const currentFromConfig = opts.branch == null ? getCurrentBranchFromConfig(embeddableId) : null;
158
- const effectiveBranch = opts.branch ?? currentFromConfig?.branchId;
159
- const effectiveBranchName = opts.branchName ?? currentFromConfig?.branchName;
156
+ // When useMain, pull main and ignore/clear saved branch. Otherwise stay on current branch when no --branch.
157
+ const currentFromConfig = opts.useMain || opts.branch != null ? null : getCurrentBranchFromConfig(embeddableId);
158
+ const effectiveBranch = opts.useMain ? undefined : (opts.branch ?? currentFromConfig?.branchId);
159
+ const effectiveBranchName = opts.useMain ? undefined : (opts.branchName ?? currentFromConfig?.branchName);
160
160
  let url = `https://engine.embeddables.com/${embeddableId}?version=latest`;
161
161
  if (effectiveBranch) {
162
162
  url += `&embeddable_branch=${effectiveBranch}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddables/cli",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "embeddables": "./bin/embeddables.mjs"