Skip to content

Commit 0579498

Browse files
committed
Bring the README and CI up to org standard
1 parent 77c7a5a commit 0579498

3 files changed

Lines changed: 38 additions & 25 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
branches: [main]
78

89
jobs:
910
test:
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4
1314
- uses: actions/setup-node@v4
14-
with: { node-version: 22 }
15-
- run: npm install
15+
with:
16+
node-version: 22
17+
cache: npm
18+
- run: npm ci
1619
- run: npm run typecheck
20+
- run: npm run lint
1721
# The golden vectors are the contract between every Ripstop SDK. Red here
1822
# means this SDK disagrees with the protocol, not the other way round.
1923
- run: npm test
20-
- run: npm run build

README.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
# @ripstop/web
1+
<p align="center">
2+
<a href="https://ripstop.dev"><img src="https://ripstop.dev/mark.png" width="56" alt="Ripstop"></a>
3+
</p>
24

3-
**Remote config, update walls and maintenance mode for web apps.**
4-
Signed at the edge, verified in the browser, 6.5 KB gzipped.
5+
<h1 align="center">Ripstop Web SDK</h1>
56

6-
[![npm](https://img.shields.io/npm/v/@ripstop/web.svg)](https://www.npmjs.com/package/@ripstop/web)
7-
[![CI](https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yaml/badge.svg)](https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yaml)
8-
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7+
<p align="center">
8+
<a href="https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yml"><img src="https://github.com/ripstop-dev/ripstop-web/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
9+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
10+
</p>
911

10-
## Install
12+
<p align="center"><b>Remote config, update walls and maintenance mode for web apps — signed at the edge, verified in the browser, 6.5 KB gzipped.</b></p>
13+
14+
## Installation
15+
16+
`@ripstop/web` is not on npm yet. Until it is, install straight from GitHub —
17+
the package builds itself on install:
1118

1219
```bash
13-
npm install @ripstop/web
20+
npm install github:ripstop-dev/ripstop-web
1421
```
1522

16-
## Quickstart
23+
Once it is published this becomes the `npm install @ripstop/web` you expected.
24+
25+
## Quick start
1726

1827
```ts
1928
import { Ripstop } from '@ripstop/web';
@@ -67,6 +76,19 @@ const limit = ripstop.value('upload_limit', 10);
6776
Always pass a fallback. On a first load with no network there is no payload yet
6877
— that is the fail-open path working as intended.
6978

79+
## API
80+
81+
| | Default | |
82+
| --- | --- | --- |
83+
| `apiKey` || Your app's public SDK key. Safe to ship |
84+
| `appVersion` || The build you are running; rules evaluate against it |
85+
| `locale` | `en` | Which wall copy to resolve; falls back to `en` per key |
86+
| `minFetchInterval` | 6 hours | How long a payload is fresh enough to skip the network |
87+
| `timeoutMs` | 5000 | Fetch budget. After that, cache |
88+
| `storage` | localStorage | Swap for `MemoryStorage`, sessionStorage, your own |
89+
| `signingKeys` | pinned | Override for self-hosted deployments and tests |
90+
| `fetchImpl` | global | Inject your own for tests or a proxy |
91+
7092
## What it does when things break
7193

7294
| Situation | What your app does |
@@ -82,19 +104,6 @@ The cache is re-verified every time it is read. This matters more on the web
82104
than anywhere else: `localStorage` is two keystrokes away in devtools, so a
83105
cache that were trusted would make every wall a polite request.
84106

85-
## Options
86-
87-
| | Default | |
88-
| --- | --- | --- |
89-
| `apiKey` || Your app's public SDK key. Safe to ship |
90-
| `appVersion` || The build you are running; rules evaluate against it |
91-
| `locale` | `en` | Which wall copy to resolve; falls back to `en` per key |
92-
| `minFetchInterval` | 6 hours | How long a payload is fresh enough to skip the network |
93-
| `timeoutMs` | 5000 | Fetch budget. After that, cache |
94-
| `storage` | localStorage | Swap for `MemoryStorage`, sessionStorage, your own |
95-
| `signingKeys` | pinned | Override for self-hosted deployments and tests |
96-
| `fetchImpl` | global | Inject your own for tests or a proxy |
97-
98107
## SSR
99108

100109
`Ripstop.init` runs anywhere `fetch` exists. Without `localStorage` it falls

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
],
2828
"scripts": {
2929
"build": "tsup src/index.ts --format esm,cjs --dts --clean --minify",
30+
"prepare": "npm run build",
3031
"typecheck": "tsc --noEmit",
3132
"test": "vitest run",
3233
"lint": "eslint ."

0 commit comments

Comments
 (0)