@capawesome/cli 4.8.0-dev.efa0850.1775645973 → 4.8.1
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 +9 -0
- package/dist/commands/apps/builds/create.js +10 -25
- package/dist/utils/error.js +4 -1
- package/dist/utils/zip.js +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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
|
+
## [4.8.1](https://github.com/capawesome-team/cli/compare/v4.8.0...v4.8.1) (2026-04-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **apps:** validate file count before zipping in `apps:builds:create` ([#149](https://github.com/capawesome-team/cli/issues/149)) ([75c20f3](https://github.com/capawesome-team/cli/commit/75c20f3716097c23f1698d000f04646fd93201a1))
|
|
11
|
+
* **deps:** update `axios` to version 1.15.0 ([9f3a801](https://github.com/capawesome-team/cli/commit/9f3a8014f4bd468ede3e40add3e98b79bec76634))
|
|
12
|
+
* improve error message handling for Axios v4 errors ([#150](https://github.com/capawesome-team/cli/issues/150)) ([ca7be4b](https://github.com/capawesome-team/cli/commit/ca7be4bcf75c7d6cb78eb39997b0b101e7e3eef7))
|
|
13
|
+
|
|
5
14
|
## [4.8.0](https://github.com/capawesome-team/cli/compare/v4.7.0...v4.8.0) (2026-04-08)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -5,9 +5,7 @@ import appCertificatesService from '../../../services/app-certificates.js';
|
|
|
5
5
|
import appEnvironmentsService from '../../../services/app-environments.js';
|
|
6
6
|
import { parseKeyValuePairs } from '../../../utils/app-environments.js';
|
|
7
7
|
import { withAuth } from '../../../utils/auth.js';
|
|
8
|
-
import { createBufferFromPath } from '../../../utils/buffer.js';
|
|
9
8
|
import { isInteractive } from '../../../utils/environment.js';
|
|
10
|
-
import { fileExistsAtPath, isDirectory } from '../../../utils/file.js';
|
|
11
9
|
import { waitForJobCompletion } from '../../../utils/job.js';
|
|
12
10
|
import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
|
|
13
11
|
import zip from '../../../utils/zip.js';
|
|
@@ -49,7 +47,7 @@ export default defineCommand({
|
|
|
49
47
|
.optional()
|
|
50
48
|
.describe('Download the generated IPA file (iOS only). Optionally provide a file path.'),
|
|
51
49
|
json: z.boolean().optional().describe('Output in JSON format.'),
|
|
52
|
-
path: z.string().optional().describe('Path to local source files to upload.
|
|
50
|
+
path: z.string().optional().describe('Path to local source files to upload.'),
|
|
53
51
|
platform: z
|
|
54
52
|
.enum(['ios', 'android', 'web'], {
|
|
55
53
|
message: 'Platform must be either `ios`, `android`, or `web`.',
|
|
@@ -119,22 +117,15 @@ export default defineCommand({
|
|
|
119
117
|
if (sourcePath) {
|
|
120
118
|
consola.warn('The --path option is experimental and may change in the future.');
|
|
121
119
|
const resolvedPath = path.resolve(sourcePath);
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
124
|
-
consola.error('The --path
|
|
120
|
+
const stat = await fs.stat(resolvedPath).catch(() => null);
|
|
121
|
+
if (!stat || !stat.isDirectory()) {
|
|
122
|
+
consola.error('The --path must point to an existing directory.');
|
|
125
123
|
process.exit(1);
|
|
126
124
|
}
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (!packageJsonExists) {
|
|
132
|
-
consola.error('The directory specified by --path must contain a package.json file.');
|
|
133
|
-
process.exit(1);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else if (!zip.isZipped(resolvedPath)) {
|
|
137
|
-
consola.error('The --path must be a folder or a zip file.');
|
|
125
|
+
const packageJsonPath = path.join(resolvedPath, 'package.json');
|
|
126
|
+
const packageJsonStat = await fs.stat(packageJsonPath).catch(() => null);
|
|
127
|
+
if (!packageJsonStat || !packageJsonStat.isFile()) {
|
|
128
|
+
consola.error('The directory specified by --path must contain a package.json file.');
|
|
138
129
|
process.exit(1);
|
|
139
130
|
}
|
|
140
131
|
}
|
|
@@ -274,14 +265,8 @@ export default defineCommand({
|
|
|
274
265
|
// Upload source files if path is provided
|
|
275
266
|
if (sourcePath) {
|
|
276
267
|
const resolvedPath = path.resolve(sourcePath);
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
buffer = await createBufferFromPath(resolvedPath);
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
consola.start('Zipping source files...');
|
|
283
|
-
buffer = await zip.zipFolderWithGitignore(resolvedPath);
|
|
284
|
-
}
|
|
268
|
+
consola.start('Zipping source files...');
|
|
269
|
+
const buffer = await zip.zipFolderWithGitignore(resolvedPath);
|
|
285
270
|
consola.start('Uploading source files...');
|
|
286
271
|
const appBuildSource = await appBuildSourcesService.createFromFile({
|
|
287
272
|
appId,
|
package/dist/utils/error.js
CHANGED
|
@@ -40,7 +40,10 @@ const getErrorMessageFromAxiosError = (error) => {
|
|
|
40
40
|
else if (error.response?.data?.message) {
|
|
41
41
|
message = error.response?.data?.message;
|
|
42
42
|
}
|
|
43
|
-
else if (error.response?.data?.error?.
|
|
43
|
+
else if (Array.isArray(error.response?.data?.error) && (error.response?.data).error[0]?.message) {
|
|
44
|
+
message = (error.response?.data).error[0].message;
|
|
45
|
+
}
|
|
46
|
+
else if (error.response?.data?.error?.issues?.[0]?.message) {
|
|
44
47
|
message = (error.response?.data).error.issues[0].message;
|
|
45
48
|
}
|
|
46
49
|
else if (error.response?.data && typeof error.response?.data === 'string') {
|
package/dist/utils/zip.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { UserError } from '../utils/error.js';
|
|
1
2
|
import AdmZip from 'adm-zip';
|
|
2
3
|
import { globby } from 'globby';
|
|
3
4
|
import path from 'path';
|
|
5
|
+
const MAX_ZIP_ENTRIES = 65535;
|
|
4
6
|
class ZipImpl {
|
|
5
7
|
async zipFolder(sourceFolder) {
|
|
6
8
|
const zip = new AdmZip();
|
|
@@ -14,6 +16,10 @@ class ZipImpl {
|
|
|
14
16
|
ignore: ['.git/**'],
|
|
15
17
|
dot: true,
|
|
16
18
|
});
|
|
19
|
+
if (files.length > MAX_ZIP_ENTRIES) {
|
|
20
|
+
throw new UserError(`The source folder contains ${files.length} files, which exceeds the ZIP limit of ${MAX_ZIP_ENTRIES} entries. ` +
|
|
21
|
+
`Make sure your .gitignore excludes large directories such as node_modules.`);
|
|
22
|
+
}
|
|
17
23
|
const zip = new AdmZip();
|
|
18
24
|
for (const file of files) {
|
|
19
25
|
const filePath = path.join(sourceFolder, file);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/cli",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@robingenz/zli": "0.2.0",
|
|
57
57
|
"@sentry/node": "8.55.0",
|
|
58
58
|
"adm-zip": "0.5.16",
|
|
59
|
-
"axios": "1.
|
|
59
|
+
"axios": "1.15.0",
|
|
60
60
|
"axios-retry": "4.5.0",
|
|
61
61
|
"c12": "3.3.3",
|
|
62
62
|
"consola": "3.3.0",
|