@reliableapp/frontend-cli 1.0.2 → 1.0.3
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 +27 -4
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,14 +14,21 @@ That's it on a supported platform — release SHA auto-detects, project IDs come
|
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Pick whichever fits your workflow:
|
|
18
18
|
|
|
19
|
+
**As a devDependency (recommended for build scripts):**
|
|
19
20
|
```bash
|
|
20
|
-
|
|
21
|
+
npm install --save-dev @reliableapp/frontend-cli
|
|
21
22
|
```
|
|
23
|
+
The `reliableapp-frontend` binary then resolves automatically inside any npm script — fastest option for repeat builds.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
**Via `npx` (zero install):**
|
|
26
|
+
```bash
|
|
27
|
+
npx --yes @reliableapp/frontend-cli sourcemaps upload [options]
|
|
28
|
+
```
|
|
29
|
+
Slower on first run (downloads the package) but zero setup. Good for one-off CI YAML steps.
|
|
24
30
|
|
|
31
|
+
**Globally:**
|
|
25
32
|
```bash
|
|
26
33
|
npm i -g @reliableapp/frontend-cli
|
|
27
34
|
reliableapp-frontend sourcemaps upload [options]
|
|
@@ -29,6 +36,8 @@ reliableapp-frontend sourcemaps upload [options]
|
|
|
29
36
|
|
|
30
37
|
Requires Node 18+.
|
|
31
38
|
|
|
39
|
+
> **Heads up:** if you write `reliableapp-frontend ...` directly in a shell or build script *without* installing the package locally or globally, you'll get `command not found`. The binary lives in `node_modules/.bin/` (after install) — npm scripts find it there automatically; raw shell does not.
|
|
40
|
+
|
|
32
41
|
## Setup (one-time)
|
|
33
42
|
|
|
34
43
|
In the Reliable dashboard, generate an API token for your frontend project:
|
|
@@ -59,7 +68,11 @@ That's the only thing you need — the token already names the frontend project
|
|
|
59
68
|
|
|
60
69
|
### `package.json` script (Vercel, Netlify, Railway, Render, Coolify, Dokploy, anything Nixpacks-based)
|
|
61
70
|
|
|
62
|
-
PaaS platforms that auto-build don't have CI step injection — chain the CLI into your build script
|
|
71
|
+
PaaS platforms that auto-build don't have CI step injection — chain the CLI into your build script. Install it as a devDependency once so the binary resolves on every build:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install --save-dev @reliableapp/frontend-cli
|
|
75
|
+
```
|
|
63
76
|
|
|
64
77
|
```json
|
|
65
78
|
{
|
|
@@ -69,6 +82,16 @@ PaaS platforms that auto-build don't have CI step injection — chain the CLI in
|
|
|
69
82
|
}
|
|
70
83
|
```
|
|
71
84
|
|
|
85
|
+
**Or skip the install and use `npx --yes`** (slower on repeat builds — downloaded each time):
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "vite build && npx --yes @reliableapp/frontend-cli sourcemaps upload --dist=./dist --url-prefix=https://app.example.com/"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
72
95
|
Set `RELIABLE_TOKEN` in the platform's environment variables UI. The CLI auto-detects the commit SHA from the platform's own env vars (no `--release` needed).
|
|
73
96
|
|
|
74
97
|
## Required SDK config
|
package/dist/index.js
CHANGED
|
@@ -129,6 +129,13 @@ async function sourcemapsUpload(opts) {
|
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
if (ci) console.log(gray(`CI detected via $${ci}`));
|
|
132
|
+
const token = (opts.token?.trim() || process.env.RELIABLE_TOKEN?.trim()) ?? "";
|
|
133
|
+
if (!token) {
|
|
134
|
+
console.error(red("\u2717 No API token provided."));
|
|
135
|
+
console.error(gray(" Pass --token=rl_fpt_... or set the RELIABLE_TOKEN environment variable."));
|
|
136
|
+
console.error(gray(" Generate a token in: Frontend Project \u2192 Settings \u2192 API Tokens."));
|
|
137
|
+
process.exit(2);
|
|
138
|
+
}
|
|
132
139
|
const explicit = opts.release?.trim();
|
|
133
140
|
const auto = explicit ? null : autodetectRelease();
|
|
134
141
|
const release = explicit ?? auto?.release ?? "";
|
|
@@ -184,7 +191,7 @@ async function sourcemapsUpload(opts) {
|
|
|
184
191
|
try {
|
|
185
192
|
await uploadSourcemap({
|
|
186
193
|
api: opts.api,
|
|
187
|
-
token
|
|
194
|
+
token,
|
|
188
195
|
release,
|
|
189
196
|
environment: opts.environment,
|
|
190
197
|
assetUrl,
|
|
@@ -219,10 +226,9 @@ function computeAssetUrl(urlPrefix, relativePath) {
|
|
|
219
226
|
var program = new Command();
|
|
220
227
|
program.name("reliableapp-frontend").description("Reliable frontend CLI \u2014 sourcemaps, releases, and other build-time uploads").version("1.0.0");
|
|
221
228
|
var sourcemaps = program.command("sourcemaps").description("Sourcemap operations");
|
|
222
|
-
sourcemaps.command("upload").description("Upload sourcemaps for a release to the Reliable backend").
|
|
229
|
+
sourcemaps.command("upload").description("Upload sourcemaps for a release to the Reliable backend").option(
|
|
223
230
|
"--token <token>",
|
|
224
|
-
"API token (rl_fpt_...). Falls back to $RELIABLE_TOKEN. The token already names which frontend project to upload to \u2014 no other IDs needed."
|
|
225
|
-
process.env.RELIABLE_TOKEN
|
|
231
|
+
"API token (rl_fpt_...). Falls back to $RELIABLE_TOKEN. The token already names which frontend project to upload to \u2014 no other IDs needed."
|
|
226
232
|
).option(
|
|
227
233
|
"--release <id>",
|
|
228
234
|
"Release identifier. Auto-detected from common platform env vars if omitted (GITHUB_SHA, VERCEL_GIT_COMMIT_SHA, RAILWAY_GIT_COMMIT_SHA, RENDER_GIT_COMMIT, etc.)."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reliableapp/frontend-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Reliable frontend CLI — upload sourcemaps and manage frontend releases from CI. Built by Ziloris · https://ziloris.com",
|
|
5
5
|
"homepage": "https://reliable.ziloris.com/docs",
|
|
6
6
|
"bugs": {
|