ubriot 0.2.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/README.md +35 -0
- package/bin/ubriot +2 -0
- package/dist/api.js +27 -0
- package/dist/config.js +42 -0
- package/dist/index.js +1650 -0
- package/dist/readline.js +78 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ubriot
|
|
2
|
+
|
|
3
|
+
CI/CD CLI for Expo and React Native. Ship iOS and Android native builds, submit to TestFlight and Google Play, and push OTA updates — all from one command.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g ubriot
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ubriot login
|
|
15
|
+
ubriot ship ios # build + submit to TestFlight
|
|
16
|
+
ubriot ship android # build + submit to Google Play
|
|
17
|
+
ubriot update # publish an OTA update
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
| Command | What it does |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `ubriot login` | Log in to your Ubriot account |
|
|
25
|
+
| `ubriot ship ios` | Build iOS app and submit to TestFlight |
|
|
26
|
+
| `ubriot ship android` | Build Android AAB and submit to Google Play |
|
|
27
|
+
| `ubriot ship ios --no-submit` | Build only, skip TestFlight |
|
|
28
|
+
| `ubriot update` | Export and publish an OTA update |
|
|
29
|
+
| `ubriot push setup --app <name>` | Set up native push notifications |
|
|
30
|
+
| `ubriot apps list` | List your release apps |
|
|
31
|
+
| `ubriot builds list --app <name>` | List recent builds |
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Full setup guide and credential instructions at [ubriot.dev](https://ubriot.dev).
|
package/bin/ubriot
ADDED
package/dist/api.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.makeClient = makeClient;
|
|
7
|
+
exports.handleError = handleError;
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const config_1 = require("./config");
|
|
10
|
+
function makeClient() {
|
|
11
|
+
const cfg = (0, config_1.readConfig)();
|
|
12
|
+
return axios_1.default.create({
|
|
13
|
+
baseURL: cfg.apiBase,
|
|
14
|
+
headers: cfg.token ? { Authorization: `Bearer ${cfg.token}` } : {},
|
|
15
|
+
timeout: 30000,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function handleError(err) {
|
|
19
|
+
if (axios_1.default.isAxiosError(err)) {
|
|
20
|
+
const msg = err.response?.data?.message ?? err.message;
|
|
21
|
+
console.error(`Error: ${msg}`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.error("Error:", err);
|
|
25
|
+
}
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readConfig = readConfig;
|
|
4
|
+
exports.writeConfig = writeConfig;
|
|
5
|
+
exports.requireAuth = requireAuth;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const os_1 = require("os");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const CONFIG_DIR = (0, path_1.join)((0, os_1.homedir)(), ".ubriot");
|
|
10
|
+
const CONFIG_FILE = (0, path_1.join)(CONFIG_DIR, "config.json");
|
|
11
|
+
const defaults = {
|
|
12
|
+
apiBase: "https://api.ubriot.dev/api/v1",
|
|
13
|
+
token: null,
|
|
14
|
+
email: null,
|
|
15
|
+
};
|
|
16
|
+
function readConfig() {
|
|
17
|
+
const applyEnv = (cfg) => ({
|
|
18
|
+
...cfg,
|
|
19
|
+
apiBase: process.env.UBRIOT_API_BASE?.trim() || cfg.apiBase,
|
|
20
|
+
});
|
|
21
|
+
if (!(0, fs_1.existsSync)(CONFIG_FILE))
|
|
22
|
+
return applyEnv({ ...defaults });
|
|
23
|
+
try {
|
|
24
|
+
return applyEnv({ ...defaults, ...JSON.parse((0, fs_1.readFileSync)(CONFIG_FILE, "utf8")) });
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return applyEnv({ ...defaults });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function writeConfig(updates) {
|
|
31
|
+
(0, fs_1.mkdirSync)(CONFIG_DIR, { recursive: true });
|
|
32
|
+
const current = readConfig();
|
|
33
|
+
(0, fs_1.writeFileSync)(CONFIG_FILE, JSON.stringify({ ...current, ...updates }, null, 2), "utf8");
|
|
34
|
+
}
|
|
35
|
+
function requireAuth() {
|
|
36
|
+
const cfg = readConfig();
|
|
37
|
+
if (!cfg.token) {
|
|
38
|
+
console.error(`Not logged in. Run: ubriot login --api-base ${cfg.apiBase}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
return cfg;
|
|
42
|
+
}
|