@xano/cli 0.0.75-beta.2 → 0.0.75-beta.4

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
@@ -517,6 +517,12 @@ xano update
517
517
 
518
518
  # Check for updates without installing
519
519
  xano update --check
520
+
521
+ # Update to the latest beta version
522
+ xano update --beta
523
+
524
+ # Check for beta updates without installing
525
+ xano update --beta --check
520
526
  ```
521
527
 
522
528
  ## Scripts
@@ -3,6 +3,7 @@ export default class Update extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
+ beta: import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
7
  check: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
8
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -3,9 +3,12 @@ import { execSync } from 'node:child_process';
3
3
  import BaseCommand from '../../base-command.js';
4
4
  export default class Update extends BaseCommand {
5
5
  static description = 'Update the Xano CLI to the latest version';
6
- static examples = [`$ xano update`, `$ xano update --check`];
6
+ static examples = [`$ xano update`, `$ xano update --check`, `$ xano update --beta`];
7
7
  static flags = {
8
8
  ...BaseCommand.flags,
9
+ beta: Flags.boolean({
10
+ description: 'Update to the latest beta version',
11
+ }),
9
12
  check: Flags.boolean({
10
13
  description: 'Check for updates without installing',
11
14
  }),
@@ -15,8 +18,9 @@ export default class Update extends BaseCommand {
15
18
  const currentVersion = this.config.version;
16
19
  this.log(`Current version: ${currentVersion}`);
17
20
  this.log('Checking for updates...');
21
+ const tag = flags.beta ? 'beta' : 'latest';
18
22
  try {
19
- const latest = execSync('npm view @xano/cli version', { encoding: 'utf8' }).trim();
23
+ const latest = execSync(`npm view @xano/cli dist-tags.${tag}`, { encoding: 'utf8' }).trim();
20
24
  if (latest === currentVersion) {
21
25
  this.log(`Already up to date (${currentVersion})`);
22
26
  return;
@@ -26,7 +30,7 @@ export default class Update extends BaseCommand {
26
30
  return;
27
31
  }
28
32
  this.log(`Updating @xano/cli ${currentVersion} → ${latest}...`);
29
- execSync('npm install -g @xano/cli@latest --no-fund', { stdio: 'inherit' });
33
+ execSync(`npm install -g @xano/cli@${tag} --no-fund`, { stdio: 'inherit' });
30
34
  this.log(`Updated to ${latest}`);
31
35
  }
32
36
  catch (error) {