@capawesome/cli 2.1.4-dev.6aa4113.1756747591 → 2.1.4-dev.6aa4113.1756747592

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.
@@ -12,24 +12,22 @@ export default defineCommand({
12
12
  process.exit(1);
13
13
  }
14
14
  const firstVersion = versions[0].version;
15
+ // Check only major.minor.patch synchronization
15
16
  const allInSync = versions.every((pv) => {
16
17
  return (pv.version.major === firstVersion.major &&
17
18
  pv.version.minor === firstVersion.minor &&
18
- pv.version.patch === firstVersion.patch &&
19
- pv.version.hotfix === firstVersion.hotfix);
19
+ pv.version.patch === firstVersion.patch);
20
20
  });
21
21
  if (!allInSync) {
22
22
  consola.error('Versions are not synchronized across platforms:');
23
23
  versions.forEach((pv) => {
24
24
  const versionStr = versionToString(pv.version);
25
- const hotfixStr = pv.version.hotfix > 0 ? ` (hotfix: ${pv.version.hotfix})` : '';
26
- consola.log(` ${pv.platform}: ${versionStr}${hotfixStr} (${pv.source})`);
25
+ consola.log(` ${pv.platform}: ${versionStr} (${pv.source})`);
27
26
  });
28
27
  process.exit(1);
29
28
  }
30
29
  const versionStr = versionToString(firstVersion);
31
- const hotfixStr = firstVersion.hotfix > 0 ? ` (hotfix: ${firstVersion.hotfix})` : '';
32
- consola.success(`Version: ${versionStr}${hotfixStr}`);
30
+ consola.success(`Version: ${versionStr}`);
33
31
  versions.forEach((pv) => {
34
32
  consola.log(` ${pv.platform}: ${pv.source}`);
35
33
  });
@@ -8,12 +8,10 @@ export default defineCommand({
8
8
  try {
9
9
  const currentVersion = await versionService.ensureVersionsInSync();
10
10
  const newVersion = incrementHotfix(currentVersion);
11
- const currentVersionStr = versionToString(currentVersion);
12
- const newVersionStr = versionToString(newVersion);
13
- const hotfixInfo = `(hotfix: ${currentVersion.hotfix} -> ${newVersion.hotfix})`;
14
- consola.info(`Incrementing hotfix version from ${currentVersionStr} to ${newVersionStr} ${hotfixInfo}...`);
11
+ const versionStr = versionToString(currentVersion);
12
+ consola.info(`Incrementing hotfix for version ${versionStr}...`);
15
13
  await versionService.setVersion(newVersion);
16
- consola.success(`Hotfix version incremented to ${newVersionStr} (hotfix: ${newVersion.hotfix})`);
14
+ consola.success(`Hotfix incremented for version ${versionStr}`);
17
15
  }
18
16
  catch (error) {
19
17
  consola.error(error instanceof Error ? error.message : String(error));
@@ -5,12 +5,10 @@ import consola from 'consola';
5
5
  import { z } from 'zod';
6
6
  export default defineCommand({
7
7
  description: 'Set the version of the app in all relevant files',
8
- args: z.object({
9
- version: z.string(),
10
- }),
8
+ args: z.tuple([z.string().describe('Version')]),
11
9
  action: async (_options, args) => {
12
10
  try {
13
- const version = parseVersion(args.version);
11
+ const version = parseVersion(args[0]);
14
12
  consola.info(`Setting version to ${versionToString(version)}...`);
15
13
  await versionService.setVersion(version);
16
14
  consola.success(`Version set to ${versionToString(version)}`);
@@ -15,14 +15,12 @@ export default defineCommand({
15
15
  consola.info('Current versions:');
16
16
  versions.forEach((pv) => {
17
17
  const versionStr = versionToString(pv.version);
18
- const hotfixStr = pv.version.hotfix > 0 ? ` (hotfix: ${pv.version.hotfix})` : '';
19
- consola.log(` ${pv.platform}: ${versionStr}${hotfixStr}`);
18
+ consola.log(` ${pv.platform}: ${versionStr}`);
20
19
  });
21
20
  const highestVersionStr = versionToString(highestVersion);
22
- const hotfixStr = highestVersion.hotfix > 0 ? ` (hotfix: ${highestVersion.hotfix})` : '';
23
- consola.info(`Syncing all platforms to highest version: ${highestVersionStr}${hotfixStr}...`);
21
+ consola.info(`Syncing all platforms to highest version: ${highestVersionStr}...`);
24
22
  await versionService.setVersion(highestVersion);
25
- consola.success(`All platforms synced to version ${highestVersionStr}${hotfixStr}`);
23
+ consola.success(`All platforms synced to version ${highestVersionStr}`);
26
24
  }
27
25
  catch (error) {
28
26
  consola.error(error instanceof Error ? error.message : String(error));
@@ -1,7 +1,7 @@
1
+ import { compareVersions, parseBuildNumber, parseVersion, versionToBuildNumber, versionToString, } from '../../utils/version.js';
1
2
  import { MobileProject } from '@trapezedev/project';
2
3
  import { existsSync, readFileSync } from 'fs';
3
4
  import { join } from 'path';
4
- import { compareVersions, parseBuildNumber, parseVersion, versionToBuildNumber, versionToString, versionsEqual, } from '../../utils/version.js';
5
5
  export class VersionService {
6
6
  projectPath;
7
7
  constructor(projectPath = process.cwd()) {
@@ -97,6 +97,7 @@ export class VersionService {
97
97
  if (!packageJson.version) {
98
98
  return null;
99
99
  }
100
+ // Web only has version string, no build number (hotfix will always be 0)
100
101
  const version = parseVersion(packageJson.version);
101
102
  return {
102
103
  platform: 'web',
@@ -148,6 +149,7 @@ export class VersionService {
148
149
  if (existsSync(packageJsonPath)) {
149
150
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
150
151
  packageJson.version = versionString;
152
+ // Web only stores version string, not build number
151
153
  const fs = await import('fs/promises');
152
154
  await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
153
155
  }
@@ -155,16 +157,21 @@ export class VersionService {
155
157
  }
156
158
  async ensureVersionsInSync() {
157
159
  const versions = await this.getAllVersions();
158
- if (versions.length === 0) {
160
+ const firstVersion = versions && versions[0] ? versions[0].version : null;
161
+ if (!firstVersion) {
159
162
  throw new Error('No platform versions found');
160
163
  }
161
- const firstVersion = versions[0].version;
162
- const allInSync = versions.every((pv) => versionsEqual(pv.version, firstVersion));
164
+ // Only check major.minor.patch synchronization, ignore hotfix
165
+ const allInSync = versions.every((pv) => pv.version.major === firstVersion.major &&
166
+ pv.version.minor === firstVersion.minor &&
167
+ pv.version.patch === firstVersion.patch);
163
168
  if (!allInSync) {
164
169
  const versionStrings = versions.map((pv) => `${pv.platform}: ${versionToString(pv.version)} (${pv.source})`);
165
170
  throw new Error(`Versions are not synchronized across platforms:\n${versionStrings.join('\n')}`);
166
171
  }
167
- return firstVersion;
172
+ // Return the first version that has a hotfix (iOS or Android), or the first version
173
+ const versionWithHotfix = versions.find((pv) => pv.version.hotfix > 0);
174
+ return versionWithHotfix ? versionWithHotfix.version : firstVersion;
168
175
  }
169
176
  async getHighestVersion() {
170
177
  const versions = await this.getAllVersions();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "2.1.4-dev.6aa4113.1756747591",
3
+ "version": "2.1.4-dev.6aa4113.1756747592",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {