@capawesome/cli 0.0.8 → 0.0.9
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 +7 -0
- package/dist/commands/apps/bundles/create.js +30 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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
|
+
## [0.0.9](https://github.com/capawesome-team/cli/compare/v0.0.8...v0.0.9) (2024-07-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **bundles:** add `url` argument ([bf7b213](https://github.com/capawesome-team/cli/commit/bf7b21346813543992128f54e9a6bde283c38446))
|
|
11
|
+
|
|
5
12
|
## [0.0.8](https://github.com/capawesome-team/cli/compare/v0.0.7...v0.0.8) (2024-06-10)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -43,6 +43,14 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
43
43
|
type: 'string',
|
|
44
44
|
description: 'Channel to associate the bundle with.',
|
|
45
45
|
},
|
|
46
|
+
iosMax: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'The maximum iOS bundle version (`CFBundleVersion`) that the bundle supports.',
|
|
49
|
+
},
|
|
50
|
+
iosMin: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The minimum iOS bundle version (`CFBundleVersion`) that the bundle supports.',
|
|
53
|
+
},
|
|
46
54
|
path: {
|
|
47
55
|
type: 'string',
|
|
48
56
|
description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.',
|
|
@@ -51,13 +59,9 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
51
59
|
type: 'string',
|
|
52
60
|
description: 'The percentage of devices to deploy the bundle to. Must be a number between 0 and 1 (e.g. 0.5).',
|
|
53
61
|
},
|
|
54
|
-
|
|
55
|
-
type: 'string',
|
|
56
|
-
description: 'The maximum iOS bundle version (`CFBundleVersion`) that the bundle supports.',
|
|
57
|
-
},
|
|
58
|
-
iosMin: {
|
|
62
|
+
url: {
|
|
59
63
|
type: 'string',
|
|
60
|
-
description: 'The
|
|
64
|
+
description: 'The URL to the self-hosted bundle file.',
|
|
61
65
|
},
|
|
62
66
|
},
|
|
63
67
|
run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -67,9 +71,10 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
67
71
|
}
|
|
68
72
|
const { androidMax, androidMin, rollout, iosMax, iosMin } = ctx.args;
|
|
69
73
|
let appId = ctx.args.appId;
|
|
70
|
-
let path = ctx.args.path;
|
|
71
74
|
let channelName = ctx.args.channel;
|
|
72
|
-
|
|
75
|
+
let path = ctx.args.path;
|
|
76
|
+
let url = ctx.args.url;
|
|
77
|
+
if (!path && !url) {
|
|
73
78
|
path = yield (0, prompt_1.prompt)('Enter the path to the app bundle:', {
|
|
74
79
|
type: 'text',
|
|
75
80
|
});
|
|
@@ -99,13 +104,18 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
99
104
|
}
|
|
100
105
|
// Create form data
|
|
101
106
|
const formData = new form_data_1.default();
|
|
102
|
-
if (
|
|
103
|
-
|
|
107
|
+
if (path) {
|
|
108
|
+
if (zip_1.default.isZipped(path)) {
|
|
109
|
+
formData.append('file', (0, node_fs_1.createReadStream)(path));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
consola_1.default.start('Zipping folder...');
|
|
113
|
+
const zipBuffer = yield zip_1.default.zipFolder(path);
|
|
114
|
+
formData.append('file', zipBuffer, { filename: 'bundle.zip' });
|
|
115
|
+
}
|
|
104
116
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const zipBuffer = yield zip_1.default.zipFolder(path);
|
|
108
|
-
formData.append('file', zipBuffer, { filename: 'bundle.zip' });
|
|
117
|
+
if (url) {
|
|
118
|
+
formData.append('url', url);
|
|
109
119
|
}
|
|
110
120
|
if (channelName) {
|
|
111
121
|
formData.append('channelName', channelName);
|
|
@@ -130,7 +140,12 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
130
140
|
if (iosMin) {
|
|
131
141
|
formData.append('minIosAppVersionCode', iosMin);
|
|
132
142
|
}
|
|
133
|
-
|
|
143
|
+
if (path) {
|
|
144
|
+
consola_1.default.start('Uploading...');
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
consola_1.default.start('Creating...');
|
|
148
|
+
}
|
|
134
149
|
// Upload the bundle
|
|
135
150
|
try {
|
|
136
151
|
const response = yield app_bundles_1.default.create({ appId: appId, formData: formData });
|