@vm0/cli 1.11.0 → 1.13.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/index.js +40 -21
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12976,6 +12976,15 @@ var EventRenderer = class {
12976
12976
  );
12977
12977
  this.renderArtifactAndVolumes(event.data);
12978
12978
  }
12979
+ /**
12980
+ * Format version ID for display (show short 8-character prefix)
12981
+ */
12982
+ static formatVersion(version2) {
12983
+ if (version2.length === 64 && /^[a-f0-9]+$/i.test(version2)) {
12984
+ return version2.slice(0, 8);
12985
+ }
12986
+ return version2;
12987
+ }
12979
12988
  /**
12980
12989
  * Render artifact and volumes info
12981
12990
  * Used by both vm0_start and vm0_result events
@@ -12985,14 +12994,14 @@ var EventRenderer = class {
12985
12994
  if (artifact && Object.keys(artifact).length > 0) {
12986
12995
  console.log(` Artifact:`);
12987
12996
  for (const [name, version2] of Object.entries(artifact)) {
12988
- console.log(` ${name}: ${chalk3.gray(version2)}`);
12997
+ console.log(` ${name}: ${chalk3.gray(this.formatVersion(version2))}`);
12989
12998
  }
12990
12999
  }
12991
13000
  const volumes = data.volumes;
12992
13001
  if (volumes && Object.keys(volumes).length > 0) {
12993
13002
  console.log(` Volumes:`);
12994
13003
  for (const [name, version2] of Object.entries(volumes)) {
12995
- console.log(` ${name}: ${chalk3.gray(version2)}`);
13004
+ console.log(` ${name}: ${chalk3.gray(this.formatVersion(version2))}`);
12996
13005
  }
12997
13006
  }
12998
13007
  }
@@ -13477,18 +13486,18 @@ var pushCommand = new Command4().name("push").description("Push local files to c
13477
13486
  console.log(chalk6.cyan(`Pushing volume: ${config2.name}`));
13478
13487
  console.log(chalk6.gray("Collecting files..."));
13479
13488
  const files = await getAllFiles(cwd);
13480
- if (files.length === 0) {
13481
- console.log(chalk6.yellow("No files to upload"));
13482
- return;
13483
- }
13484
13489
  let totalSize = 0;
13485
13490
  for (const file2 of files) {
13486
13491
  const stats = await fs.promises.stat(file2);
13487
13492
  totalSize += stats.size;
13488
13493
  }
13489
- console.log(
13490
- chalk6.gray(`Found ${files.length} files (${formatBytes(totalSize)})`)
13491
- );
13494
+ if (files.length === 0) {
13495
+ console.log(chalk6.gray("No files found (empty volume)"));
13496
+ } else {
13497
+ console.log(
13498
+ chalk6.gray(`Found ${files.length} files (${formatBytes(totalSize)})`)
13499
+ );
13500
+ }
13492
13501
  console.log(chalk6.gray("Compressing files..."));
13493
13502
  const zip = new AdmZip();
13494
13503
  for (const file2 of files) {
@@ -13516,8 +13525,13 @@ var pushCommand = new Command4().name("push").description("Push local files to c
13516
13525
  throw new Error(error43.error || "Upload failed");
13517
13526
  }
13518
13527
  const result = await response.json();
13519
- console.log(chalk6.green("\u2713 Upload complete"));
13520
- console.log(chalk6.gray(` Version: ${result.versionId}`));
13528
+ const shortVersion = result.versionId.slice(0, 8);
13529
+ if (result.deduplicated) {
13530
+ console.log(chalk6.green("\u2713 Content unchanged (deduplicated)"));
13531
+ } else {
13532
+ console.log(chalk6.green("\u2713 Upload complete"));
13533
+ }
13534
+ console.log(chalk6.gray(` Version: ${shortVersion}`));
13521
13535
  console.log(chalk6.gray(` Files: ${result.fileCount.toLocaleString()}`));
13522
13536
  console.log(chalk6.gray(` Size: ${formatBytes(result.size)}`));
13523
13537
  } catch (error43) {
@@ -13807,18 +13821,18 @@ var pushCommand2 = new Command8().name("push").description("Push local files to
13807
13821
  console.log(chalk9.cyan(`Pushing artifact: ${config2.name}`));
13808
13822
  console.log(chalk9.gray("Collecting files..."));
13809
13823
  const files = await getAllFiles2(cwd);
13810
- if (files.length === 0) {
13811
- console.log(chalk9.yellow("No files to upload"));
13812
- return;
13813
- }
13814
13824
  let totalSize = 0;
13815
13825
  for (const file2 of files) {
13816
13826
  const stats = await fs4.promises.stat(file2);
13817
13827
  totalSize += stats.size;
13818
13828
  }
13819
- console.log(
13820
- chalk9.gray(`Found ${files.length} files (${formatBytes3(totalSize)})`)
13821
- );
13829
+ if (files.length === 0) {
13830
+ console.log(chalk9.gray("No files found (empty artifact)"));
13831
+ } else {
13832
+ console.log(
13833
+ chalk9.gray(`Found ${files.length} files (${formatBytes3(totalSize)})`)
13834
+ );
13835
+ }
13822
13836
  console.log(chalk9.gray("Compressing files..."));
13823
13837
  const zip = new AdmZip3();
13824
13838
  for (const file2 of files) {
@@ -13846,8 +13860,13 @@ var pushCommand2 = new Command8().name("push").description("Push local files to
13846
13860
  throw new Error(error43.error || "Upload failed");
13847
13861
  }
13848
13862
  const result = await response.json();
13849
- console.log(chalk9.green("\u2713 Upload complete"));
13850
- console.log(chalk9.gray(` Version: ${result.versionId}`));
13863
+ const shortVersion = result.versionId.slice(0, 8);
13864
+ if (result.deduplicated) {
13865
+ console.log(chalk9.green("\u2713 Content unchanged (deduplicated)"));
13866
+ } else {
13867
+ console.log(chalk9.green("\u2713 Upload complete"));
13868
+ }
13869
+ console.log(chalk9.gray(` Version: ${shortVersion}`));
13851
13870
  console.log(chalk9.gray(` Files: ${result.fileCount.toLocaleString()}`));
13852
13871
  console.log(chalk9.gray(` Size: ${formatBytes3(result.size)}`));
13853
13872
  } catch (error43) {
@@ -13962,7 +13981,7 @@ var artifactCommand = new Command10().name("artifact").description("Manage cloud
13962
13981
 
13963
13982
  // src/index.ts
13964
13983
  var program = new Command11();
13965
- program.name("vm0").description("VM0 CLI - A modern build tool").version("1.11.0");
13984
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("1.13.0");
13966
13985
  program.command("hello").description("Say hello from the App").action(() => {
13967
13986
  console.log(chalk11.blue("Welcome to the VM0 CLI!"));
13968
13987
  console.log(chalk11.green(`Core says: ${FOO}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",