@reliableapp/frontend-cli 1.0.0 → 1.0.2
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 +6 -10
- package/dist/index.js +5 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,13 +35,13 @@ In the Reliable dashboard, generate an API token for your frontend project:
|
|
|
35
35
|
|
|
36
36
|
> Project → Frontend Project → Settings → API Tokens → **Create token**
|
|
37
37
|
|
|
38
|
-
Copy the `rl_fpt_...` value (shown once)
|
|
38
|
+
Copy the `rl_fpt_...` value (shown once) and set it as a secret in your CI / deploy platform:
|
|
39
39
|
|
|
40
40
|
| Variable | Description |
|
|
41
41
|
|---|---|
|
|
42
42
|
| `RELIABLE_TOKEN` | The `rl_fpt_...` token. **Mark as secret.** |
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
|
|
44
|
+
That's the only thing you need — the token already names the frontend project to upload to.
|
|
45
45
|
|
|
46
46
|
## Usage
|
|
47
47
|
|
|
@@ -50,9 +50,7 @@ Copy the `rl_fpt_...` value (shown once). Set it as a secret in your CI / deploy
|
|
|
50
50
|
```yaml
|
|
51
51
|
- name: Upload sourcemaps
|
|
52
52
|
env:
|
|
53
|
-
RELIABLE_TOKEN:
|
|
54
|
-
RELIABLE_PROJECT_ID: ${{ vars.RELIABLE_PROJECT_ID }}
|
|
55
|
-
RELIABLE_FRONTEND_PROJECT_ID: ${{ vars.RELIABLE_FRONTEND_PROJECT_ID }}
|
|
53
|
+
RELIABLE_TOKEN: ${{ secrets.RELIABLE_TOKEN }}
|
|
56
54
|
run: |
|
|
57
55
|
npx @reliableapp/frontend-cli sourcemaps upload \
|
|
58
56
|
--dist=./dist \
|
|
@@ -71,7 +69,7 @@ PaaS platforms that auto-build don't have CI step injection — chain the CLI in
|
|
|
71
69
|
}
|
|
72
70
|
```
|
|
73
71
|
|
|
74
|
-
Set `RELIABLE_TOKEN
|
|
72
|
+
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).
|
|
75
73
|
|
|
76
74
|
## Required SDK config
|
|
77
75
|
|
|
@@ -92,9 +90,7 @@ Without `release`, events arrive but the resolver has no way to find the right m
|
|
|
92
90
|
|
|
93
91
|
| Flag | Default | Description |
|
|
94
92
|
|---|---|---|
|
|
95
|
-
| `--token <token>` | `$RELIABLE_TOKEN` | API token (`rl_fpt_...`) |
|
|
96
|
-
| `--project <id>` | `$RELIABLE_PROJECT_ID` | Master project UUID |
|
|
97
|
-
| `--frontend-project <id>` | `$RELIABLE_FRONTEND_PROJECT_ID` | Frontend project UUID |
|
|
93
|
+
| `--token <token>` | `$RELIABLE_TOKEN` | API token (`rl_fpt_...`). The token names the frontend project — no other IDs needed. |
|
|
98
94
|
| `--release <id>` | auto | Release identifier. Auto-detected on supported platforms |
|
|
99
95
|
| `--dist <path>` | required | Local path to the build output folder |
|
|
100
96
|
| `--url-prefix <url>` | required | Browser-visible URL prefix that maps to `--dist` root |
|
package/dist/index.js
CHANGED
|
@@ -67,7 +67,7 @@ async function uploadSourcemap(input) {
|
|
|
67
67
|
form.append("environment", input.environment);
|
|
68
68
|
form.append("asset_url", input.assetUrl);
|
|
69
69
|
form.append("sourcemap", blob, path2.basename(input.mapPath));
|
|
70
|
-
const url = `${input.api.replace(/\/+$/, "")}/v1/
|
|
70
|
+
const url = `${input.api.replace(/\/+$/, "")}/v1/sourcemaps`;
|
|
71
71
|
const res = await fetch(url, {
|
|
72
72
|
method: "POST",
|
|
73
73
|
headers: { Authorization: `Bearer ${input.token}` },
|
|
@@ -124,10 +124,9 @@ function autodetectRelease() {
|
|
|
124
124
|
async function sourcemapsUpload(opts) {
|
|
125
125
|
const ci = detectCI();
|
|
126
126
|
if (!ci && !opts.force) {
|
|
127
|
-
console.
|
|
128
|
-
console.
|
|
129
|
-
|
|
130
|
-
process.exit(2);
|
|
127
|
+
console.log(yellow("\u2298 Skipping sourcemap upload \u2014 not running in CI."));
|
|
128
|
+
console.log(gray(" This is normal for local builds. Add --force to override."));
|
|
129
|
+
return;
|
|
131
130
|
}
|
|
132
131
|
if (ci) console.log(gray(`CI detected via $${ci}`));
|
|
133
132
|
const explicit = opts.release?.trim();
|
|
@@ -186,8 +185,6 @@ async function sourcemapsUpload(opts) {
|
|
|
186
185
|
await uploadSourcemap({
|
|
187
186
|
api: opts.api,
|
|
188
187
|
token: opts.token,
|
|
189
|
-
masterProjectId: opts.project,
|
|
190
|
-
frontendProjectUuid: opts.frontendProject,
|
|
191
188
|
release,
|
|
192
189
|
environment: opts.environment,
|
|
193
190
|
assetUrl,
|
|
@@ -224,16 +221,8 @@ program.name("reliableapp-frontend").description("Reliable frontend CLI \u2014 s
|
|
|
224
221
|
var sourcemaps = program.command("sourcemaps").description("Sourcemap operations");
|
|
225
222
|
sourcemaps.command("upload").description("Upload sourcemaps for a release to the Reliable backend").requiredOption(
|
|
226
223
|
"--token <token>",
|
|
227
|
-
"API token (rl_fpt_...). Falls back to $RELIABLE_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.",
|
|
228
225
|
process.env.RELIABLE_TOKEN
|
|
229
|
-
).requiredOption(
|
|
230
|
-
"--project <id>",
|
|
231
|
-
"Master project UUID. Falls back to $RELIABLE_PROJECT_ID.",
|
|
232
|
-
process.env.RELIABLE_PROJECT_ID
|
|
233
|
-
).requiredOption(
|
|
234
|
-
"--frontend-project <id>",
|
|
235
|
-
"Frontend project UUID. Falls back to $RELIABLE_FRONTEND_PROJECT_ID.",
|
|
236
|
-
process.env.RELIABLE_FRONTEND_PROJECT_ID
|
|
237
226
|
).option(
|
|
238
227
|
"--release <id>",
|
|
239
228
|
"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.2",
|
|
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": {
|