@focusbc/bbs-lib 0.0.4 → 0.0.6

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 DELETED
@@ -1,155 +0,0 @@
1
- # `@focusbc/bbs-lib`
2
-
3
- TypeScript library wrapping `deck.gl` and [`@focusbc/map-rendering`](https://www.npmjs.com/package/@focusbc/map-rendering) for BBS map rendering.
4
-
5
- The library exposes a high-level `MapOverlay` API that receives the BBS map context returned by the integration API and renders the corresponding static and dynamic map layers.
6
-
7
- ---
8
-
9
- ## Installation
10
-
11
- The package is published to npm under the `@focusbc` scope.
12
-
13
- ```bash
14
- # Using yarn
15
- yarn add @focusbc/bbs-lib
16
-
17
- # Using npm
18
- npm install @focusbc/bbs-lib
19
- ```
20
-
21
- Because this package depends on `@focusbc/map-rendering` and deck.gl, consumers should use compatible deck.gl versions with the ones declared by the package.
22
-
23
- ---
24
-
25
- ## Usage
26
-
27
- ```html
28
- <div id="map-overlay" style="position: relative; width: 100%; height: 100%;"></div>
29
- ```
30
-
31
- ```ts
32
- import { MapOverlay, type MapContext } from '@focusbc/bbs-lib'
33
-
34
- const context: MapContext = {
35
- // Context returned by the BBS/integration API
36
- }
37
-
38
- const overlay = MapOverlay.initialize(document.getElementById('map-overlay')!, context)
39
-
40
- // Later, when the event/site changes:
41
- overlay.setContext(newContext)
42
- ```
43
-
44
- ---
45
-
46
- ## Development
47
-
48
- Install dependencies and build the library from the `bbs-lib/` directory:
49
-
50
- ```bash
51
- yarn install
52
- yarn build
53
- ```
54
-
55
- From the repository root you can also run:
56
-
57
- ```bash
58
- yarn bbs-lib build
59
- ```
60
-
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
-
63
- ---
64
-
65
- ## Sandbox (local manual testing)
66
-
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
-
69
- 1. Copy `sandbox/config.example.ts` to `sandbox/config.ts` and set:
70
- - `INTEGRATION_API_BASE` — for example, `http://localhost:5016`
71
- - `BBS_API_KEY` — must match `Settings.BbsApiKey` in your local integration-api config
72
-
73
- 2. Start `integration-api` locally.
74
-
75
- 3. Build and serve the sandbox:
76
-
77
- ```bash
78
- cd bbs-lib
79
- yarn install
80
- yarn sandbox:build
81
- npx --yes serve sandbox -p 5173
82
- ```
83
-
84
- For continuous rebuild on save:
85
-
86
- ```bash
87
- yarn sandbox:watch
88
- ```
89
-
90
- Open `http://localhost:5173`, select an event, then a site. The overlay calls `MapOverlay.initialize` on first site selection and `setContext` on subsequent changes.
91
-
92
- ---
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
-
112
- ## Releasing the library
113
-
114
- The release process is handled by `bbs-lib/scripts/release-lib.sh` and can be started from inside `bbs-lib/`:
115
-
116
- ```bash
117
- yarn release:lib
118
- ```
119
-
120
- By default, this performs a patch release, for example `1.0.0` → `1.0.1`.
121
-
122
- You can also choose the version bump explicitly:
123
-
124
- ```bash
125
- yarn release:lib patch
126
- yarn release:lib minor
127
- yarn release:lib major
128
- ```
129
-
130
- From the repository root, the equivalent command is:
131
-
132
- ```bash
133
- yarn release:bbs-lib
134
- ```
135
-
136
- ### Release prerequisites
137
-
138
- 1. You must have access to publish `@focusbc/bbs-lib` under the `@focusbc` npm scope.
139
- 2. You must have the Google Cloud CLI installed and authenticated.
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`.
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.
142
-
143
- ### What happens during release
144
-
145
- When you run `yarn release:lib`, the script:
146
-
147
- 1. Decrypts `bbs-lib/.npmrc.enc` into a temporary local `bbs-lib/.npmrc`.
148
- 2. Bumps `package.json` using `npm version <patch|minor|major> --no-git-tag-version`.
149
- 3. Builds the package with `npm run build`.
150
- 4. Publishes the package to `https://registry.npmjs.org/` with `npm publish --access public`.
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.
154
-
155
- If the release fails after the version bump, review `package.json` before retrying because the version may already have been changed locally.