@capawesome/cli 3.8.0 → 3.10.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [3.10.0](https://github.com/capawesome-team/cli/compare/v3.9.0...v3.10.0) (2025-12-20)
6
+
7
+
8
+ ### Features
9
+
10
+ * add `apps:liveupdates:generatesigningkey` command ([#104](https://github.com/capawesome-team/cli/issues/104)) ([d0bceef](https://github.com/capawesome-team/cli/commit/d0bceefb0db3977484cde600ea084b52986ccf3d))
11
+
12
+ ## [3.9.0](https://github.com/capawesome-team/cli/compare/v3.8.0...v3.9.0) (2025-12-20)
13
+
14
+
15
+ ### Features
16
+
17
+ * **apps:builds:create:** add `--stack` option ([#106](https://github.com/capawesome-team/cli/issues/106)) ([1b2fa91](https://github.com/capawesome-team/cli/commit/1b2fa9154305b4f73ca3253a84f131ff8fc74263))
18
+
5
19
  ## [3.8.0](https://github.com/capawesome-team/cli/compare/v3.7.0...v3.8.0) (2025-12-04)
6
20
 
7
21
 
@@ -51,13 +51,19 @@ export default defineCommand({
51
51
  })
52
52
  .optional()
53
53
  .describe('The platform for the build. Supported values are `ios` and `android`.'),
54
+ stack: z
55
+ .enum(['macos-sequoia', 'macos-tahoe'], {
56
+ message: 'Build stack must be either `macos-sequoia` or `macos-tahoe`.',
57
+ })
58
+ .optional()
59
+ .describe('The build stack to use for the build process.'),
54
60
  type: z
55
61
  .string()
56
62
  .optional()
57
63
  .describe('The type of build. For iOS, supported values are `simulator`, `development`, `ad-hoc`, `app-store`, and `enterprise`. For Android, supported values are `debug` and `release`.'),
58
64
  })),
59
65
  action: async (options) => {
60
- let { appId, platform, type, gitRef, environment, certificate, json } = options;
66
+ let { appId, platform, type, gitRef, environment, certificate, json, stack } = options;
61
67
  // Check if the user is logged in
62
68
  if (!authorizationService.hasAuthorizationToken()) {
63
69
  consola.error('You must be logged in to run this command. Please run the `login` command first.');
@@ -201,6 +207,7 @@ export default defineCommand({
201
207
  appCertificateName: certificate,
202
208
  appEnvironmentName: environment,
203
209
  appId,
210
+ stack,
204
211
  gitRef,
205
212
  platform,
206
213
  type,
@@ -0,0 +1,76 @@
1
+ import { defineCommand, defineOptions } from '@robingenz/zli';
2
+ import consola from 'consola';
3
+ import { promises as fs } from 'fs';
4
+ import pathModule from 'path';
5
+ import { z } from 'zod';
6
+ export default defineCommand({
7
+ description: 'Generate a new code signing key pair for Live Updates.',
8
+ options: defineOptions(z.object({
9
+ publicKeyPath: z
10
+ .string()
11
+ .optional()
12
+ .describe('Path where the public key should be saved. Defaults to "public.pem".'),
13
+ privateKeyPath: z
14
+ .string()
15
+ .optional()
16
+ .describe('Path where the private key should be saved. Defaults to "private.pem".'),
17
+ keySize: z.coerce
18
+ .number()
19
+ .optional()
20
+ .default(2048)
21
+ .refine((val) => [2048, 3072, 4096].includes(val), {
22
+ message: 'Key size must be 2048, 3072, or 4096 bits.',
23
+ })
24
+ .describe('The RSA key size in bits. Must be 2048, 3072, or 4096. Defaults to 2048.'),
25
+ })),
26
+ action: async (options, _args) => {
27
+ const { publicKeyPath = 'public.pem', privateKeyPath = 'private.pem', keySize = 2048 } = options;
28
+ try {
29
+ consola.start(`Generating ${keySize}-bit RSA key pair...`);
30
+ // Generate RSA key pair using Node.js crypto module
31
+ const crypto = await import('crypto');
32
+ const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', {
33
+ modulusLength: keySize,
34
+ publicKeyEncoding: {
35
+ type: 'spki',
36
+ format: 'pem',
37
+ },
38
+ privateKeyEncoding: {
39
+ type: 'pkcs8',
40
+ format: 'pem',
41
+ },
42
+ });
43
+ // Resolve absolute paths
44
+ const absolutePublicKeyPath = pathModule.resolve(process.cwd(), publicKeyPath);
45
+ const absolutePrivateKeyPath = pathModule.resolve(process.cwd(), privateKeyPath);
46
+ // Write the keys to files
47
+ await fs.writeFile(absolutePublicKeyPath, publicKey, 'utf8');
48
+ await fs.writeFile(absolutePrivateKeyPath, privateKey, 'utf8');
49
+ consola.log('');
50
+ consola.log('Public key saved to: ' + absolutePublicKeyPath);
51
+ consola.log('Private key saved to: ' + absolutePrivateKeyPath);
52
+ consola.log('');
53
+ consola.warn('IMPORTANT: Keep your private key safe and never commit it to version control!');
54
+ consola.log('');
55
+ consola.log('To configure code signing in the Capacitor Live Update plugin, add the following to your Capacitor Configuration file:');
56
+ consola.log('');
57
+ // Format the public key for JSON output (remove line breaks)
58
+ const publicKeyForJson = publicKey.replace(/\n/g, '');
59
+ // Print the JSON configuration
60
+ const config = {
61
+ plugins: {
62
+ LiveUpdate: {
63
+ publicKey: publicKeyForJson,
64
+ },
65
+ },
66
+ };
67
+ consola.log(JSON.stringify(config, null, 2));
68
+ console.log('');
69
+ consola.success('Code signing key pair generated successfully!');
70
+ }
71
+ catch (error) {
72
+ consola.error('Failed to generate signing key pair.');
73
+ throw error;
74
+ }
75
+ },
76
+ });
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ const config = defineConfig({
39
39
  'apps:deployments:cancel': await import('./commands/apps/deployments/cancel.js').then((mod) => mod.default),
40
40
  'apps:deployments:logs': await import('./commands/apps/deployments/logs.js').then((mod) => mod.default),
41
41
  'apps:devices:delete': await import('./commands/apps/devices/delete.js').then((mod) => mod.default),
42
+ 'apps:liveupdates:generatesigningkey': await import('./commands/apps/liveupdates/generate-signing-key.js').then((mod) => mod.default),
42
43
  'manifests:generate': await import('./commands/manifests/generate.js').then((mod) => mod.default),
43
44
  'organizations:create': await import('./commands/organizations/create.js').then((mod) => mod.default),
44
45
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "3.8.0",
3
+ "version": "3.10.0",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {