@focusbc/bbs-lib 0.0.2 → 0.0.4
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 → README.md} +23 -22
- package/dist/browser/bbs-lib.js +79032 -0
- package/dist/browser/bbs-lib.js.map +7 -0
- package/dist/overlay/map-overlay.d.ts +7 -0
- package/dist/overlay/map-overlay.d.ts.map +1 -1
- package/dist/overlay/map-overlay.js +11 -0
- package/dist/overlay/map-overlay.js.map +1 -1
- package/package.json +7 -4
package/{readme.md → README.md}
RENAMED
|
@@ -58,13 +58,13 @@ From the repository root you can also run:
|
|
|
58
58
|
yarn bbs-lib build
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
The build output is generated under `dist/`. Only `dist/**/*` and this README are included in the published npm package.
|
|
61
|
+
The build output is generated under `dist/`. Only `dist/**/*` and this README are included in the published npm package. The `demo/` and `sandbox/` folders are **not** published (see `package.json` `"files"` and `.npmignore`).
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
65
|
## Sandbox (local manual testing)
|
|
66
66
|
|
|
67
|
-
A small static page under `sandbox/` can be used to test `MapOverlay` against the integration API BBS endpoints.
|
|
67
|
+
A small static page under `sandbox/` can be used to test `MapOverlay` against the integration API BBS endpoints. Unlike `demo/`, the sandbox bundles the **local library source** from this repo.
|
|
68
68
|
|
|
69
69
|
1. Copy `sandbox/config.example.ts` to `sandbox/config.ts` and set:
|
|
70
70
|
- `INTEGRATION_API_BASE` — for example, `http://localhost:5016`
|
|
@@ -91,6 +91,24 @@ Open `http://localhost:5173`, select an event, then a site. The overlay calls `M
|
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
94
|
+
## Client demo
|
|
95
|
+
|
|
96
|
+
The client-facing reference implementation lives in [`demo/`](demo/). It installs `@focusbc/bbs-lib` from **npm** (not the local `src/` or `dist/` in this repo) and bundles with esbuild. See [`demo/README.md`](demo/README.md).
|
|
97
|
+
|
|
98
|
+
From this directory:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
yarn demo:serve
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Or from the repository root:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
yarn bbs-demo:serve
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
94
112
|
## Releasing the library
|
|
95
113
|
|
|
96
114
|
The release process is handled by `bbs-lib/scripts/release-lib.sh` and can be started from inside `bbs-lib/`:
|
|
@@ -122,24 +140,6 @@ yarn release:bbs-lib
|
|
|
122
140
|
3. Your Google Cloud user must be able to decrypt/encrypt with the existing KMS key used by `auxiliary/scripts/decrypt_file.sh` and `auxiliary/scripts/encrypt_file.sh`.
|
|
123
141
|
4. `bbs-lib/.npmrc.enc` must exist. This is the encrypted version of the npm credentials file and is the only credential file that should be committed.
|
|
124
142
|
|
|
125
|
-
### Creating `bbs-lib/.npmrc.enc` for the first time
|
|
126
|
-
|
|
127
|
-
Create a temporary plaintext `bbs-lib/.npmrc` file:
|
|
128
|
-
|
|
129
|
-
```ini
|
|
130
|
-
//registry.npmjs.org/:_authToken=<NPM_TOKEN>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Then encrypt it using the repository KMS helper and remove the plaintext file:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
cd bbs-lib
|
|
137
|
-
bash ../auxiliary/scripts/encrypt_file.sh .npmrc .npmrc.enc
|
|
138
|
-
rm .npmrc
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Commit `bbs-lib/.npmrc.enc`. Do **not** commit `bbs-lib/.npmrc`.
|
|
142
|
-
|
|
143
143
|
### What happens during release
|
|
144
144
|
|
|
145
145
|
When you run `yarn release:lib`, the script:
|
|
@@ -148,7 +148,8 @@ When you run `yarn release:lib`, the script:
|
|
|
148
148
|
2. Bumps `package.json` using `npm version <patch|minor|major> --no-git-tag-version`.
|
|
149
149
|
3. Builds the package with `npm run build`.
|
|
150
150
|
4. Publishes the package to `https://registry.npmjs.org/` with `npm publish --access public`.
|
|
151
|
-
5.
|
|
152
|
-
6.
|
|
151
|
+
5. Uploads `dist/browser/bbs-lib.js` to Cloud Storage at `gs://bbs-lib-bucket/bbs-lib` (override with `BBS_LIB_BUCKET_URI` or `BBS_LIB_BUCKET`).
|
|
152
|
+
6. Re-encrypts the temporary `.npmrc` back into `.npmrc.enc`.
|
|
153
|
+
7. Removes the plaintext `.npmrc` from disk.
|
|
153
154
|
|
|
154
155
|
If the release fails after the version bump, review `package.json` before retrying because the version may already have been changed locally.
|