@datalabz_/dashboard-kit 4.0.3 → 4.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.
Files changed (3) hide show
  1. package/README.md +55 -38
  2. package/package.json +1 -1
  3. package/v4.js +1 -1
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # dashboard_kit
2
2
 
3
3
  Source for **DashboardKit**, the hosted JS+CSS bundle every LLM-generated
4
- dashboard loads from `https://html-ui-kit-master.888drafts.com/`.
4
+ dashboard loads. Each `kit-v*` tag releases it to Cloudflare Pages and npm (see
5
+ [Hosting](#hosting)).
5
6
 
6
7
  ## What problem it solves
7
8
 
@@ -36,15 +37,11 @@ ever added to, never altered (see Rules).
36
37
 
37
38
  - **`v4` is the current and only live major** — what the authoring guide
38
39
  links, what `catalog.html` demos, and the only kit that is published.
39
- - **`v1`, `v2` and `v3` are deprecated — treat them as gone.** They live in
40
- `deprecatedVersions/` for reference only and are not published. Don't move
41
- them back, don't publish them, don't cite them in docs or `catalog.html`,
42
- and don't copy from them when cutting a new major — start from `v4`.
43
- Because they are unpublished, nothing added to these files can reach a
44
- browser — a runtime deprecation warning was tried and reverted for exactly
45
- that reason. Whatever is live at their CDN URLs is frozen at its last
46
- published state and will vanish if the publish step prunes what is no
47
- longer published.
40
+ - **`v1`, `v2` and `v3` are deprecated — treat them as gone.** They are not in
41
+ this repo and are not published. Don't bring them back, don't publish them,
42
+ don't cite them in docs or `catalog.html`, and don't copy from them when
43
+ cutting a new major — start from `v4`. Whatever is live at their old
44
+ 888drafts URLs is frozen at its last published state.
48
45
 
49
46
  A `vN.js`/`vN.css` pair is one served bundle; the repo's per-file line budget
50
47
  (AGENTS.md #2) does not apply to it — it cannot be split without changing the
@@ -94,48 +91,68 @@ URLs already pinned by live dashboards.
94
91
  - **The SQL gateway is shared across every live kit major** — a wire-format
95
92
  change can break dashboards still on older `vN`s in production, not just the
96
93
  latest.
97
- - **Open questions about a feature, change, or bug go in `TODO.md`, not a
98
- unilateral decision.** If work surfaces something worth doing but not asked
99
- for, ask the user whether to add it to `TODO.md` rather than deciding or
100
- acting on it yourself.
94
+ - **Open questions about a feature, change, or bug go in
95
+ [docs/todo.md](../docs/todo.md), not a unilateral decision.** If work
96
+ surfaces something worth doing but not asked for, ask the user whether to
97
+ add it there rather than deciding or acting on it yourself.
101
98
 
102
99
  ## Cutting a new version (`v{N+1}`)
103
100
 
104
101
  1. Copy `v{N}.js`/`v{N}.css` → `v{N+1}.js`/`v{N+1}.css`.
105
102
  2. Fix the header comment to `/* DashboardKit v{N+1}.js */`.
106
- 3. Update the hardcoded `vN.css`/`vN.js` lines in `serve.mjs`'s startup
107
- `console.log` (just the printed URLs — routing itself isn't version-aware).
103
+ 3. In [bitbucket-pipelines.yml](../bitbucket-pipelines.yml), add
104
+ `v{N+1}.js v{N+1}.css` to the `cp` line and stamp `__BUILD__` in
105
+ `v{N+1}.js` too — **in addition to** `v{N}`, never instead of it. A
106
+ Cloudflare Pages deploy replaces the whole site, so a major left out of a
107
+ deploy stops loading for every dashboard pinned to it.
108
108
  4. Make the actual change in the new file only.
109
109
  5. Update `catalog.html` and the authoring guide's kit links — only once the
110
110
  user has accepted the new `vN`.
111
- 6. The previous `vN` stays in the root and stays published. A major moves to
112
- `deprecatedVersions/` only when no dashboard loads it any more — every one
113
- regenerated on a newer major or deleted — and only by the user's decision,
114
- never as part of cutting the next one.
111
+ 6. The previous `vN` stays in the root and in every deploy. A major is removed
112
+ only when no dashboard loads it any more — every one regenerated on a newer
113
+ major or deleted — and only by the user's decision, never as part of
114
+ cutting the next one.
115
115
 
116
116
  ## Hosting
117
117
 
118
- Served from `https://html-ui-kit-master.888drafts.com/vN.{css,js}` — CORS
119
- open, `Cache-Control: immutable`. What is published is `v4.js`, `v4.css`,
120
- `wrapper.js`, `wrapper.css` and `catalog.html`, as they are in this directory,
121
- with `v4.js`'s `__BUILD__` marker replaced by the commit hash so System Info
122
- can say which build is live. How that gets to the host is not decided yet:
123
- the old repo's Bitbucket pipeline and its build script did not survive the
124
- move into this monorepo, and a replacement is pending with the server team.
118
+ Pushing a `kit-v*` tag (`kit-v4.0.3`, …) runs
119
+ [bitbucket-pipelines.yml](../bitbucket-pipelines.yml). It publishes `v4.js`,
120
+ `v4.css`, `wrapper.js`, `wrapper.css` and `catalog.html` as they are in this
121
+ directory, with `v4.js`'s `__BUILD__` marker replaced by the commit hash so
122
+ System Info can say which build is live, to two places:
123
+
124
+ - **Cloudflare Pages**, project `dashboard-kit` — for BackOffice dashboards,
125
+ which load `https://dashboard-kit-2n2.pages.dev/vN.{css,js}`. That is a test
126
+ address on a test account until the company account serves
127
+ `https://kit.<domain>/`; dashboards made before then keep the test address,
128
+ so the test project must stay until they are rewritten. Every file is
129
+ served with `max-age=0, must-revalidate` and an ETag, so a release reaches
130
+ every dashboard on its next open. CORS is open.
131
+ - **npm** as
132
+ [`@datalabz_/dashboard-kit`](https://www.npmjs.com/package/@datalabz_/dashboard-kit?activeTab=versions),
133
+ served by jsDelivr at
134
+ `https://cdn.jsdelivr.net/npm/@datalabz_/dashboard-kit@<version>/` — for
135
+ Claude artifacts, which pin an exact version. A published version never
136
+ changes.
137
+
138
+ The release log ends with both addresses.
139
+
140
+ **Every release gets a new tag; never move a released one.** Re-pushing a
141
+ released tag deploys the new code to Cloudflare under the old number, and npm
142
+ refuses to publish over that version, so the two hosts end up serving
143
+ different code for one version.
144
+
145
+ **Rolling back:** Cloudflare → Workers & Pages → `dashboard-kit` →
146
+ Deployments → the previous deployment → *Rollback to this deployment*. It
147
+ reaches every dashboard on its next open. npm needs nothing: artifacts keep the
148
+ version they pinned.
125
149
 
126
150
  ## Dev
127
151
 
128
- No build step — edit `vN.js`/`vN.css` directly.
129
-
130
- ```bash
131
- npm start # serve.mjs — dev server on :3400, CORS open
132
- ```
133
-
134
- | URL | What it serves |
135
- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
136
- | `http://localhost:3400/vN.css` / `vN.js` | Kit stylesheet / runtime for a given major |
137
- | `http://localhost:3400/catalog.html` | Component catalog — demos kit features |
138
- | `http://localhost:3400/wrapper.css` / `wrapper.js` | Local harness: hosts a dashboard in a sandboxed iframe and supplies JWT + date/timezone/hierarchy via `postMessage`, standing in for the BackOffice |
152
+ No build step — edit `vN.js`/`vN.css` directly, and open `catalog.html` in a
153
+ browser to see the kit's components. `wrapper.css`/`wrapper.js` are the local
154
+ harness: they host a dashboard in a sandboxed iframe and supply the JWT and
155
+ date/timezone/hierarchy through `postMessage`, standing in for the BackOffice.
139
156
 
140
157
  To simulate the harness's boot message against a dashboard opened directly:
141
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalabz_/dashboard-kit",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "DashboardKit runtime + styles, served from jsDelivr",
5
5
  "license": "UNLICENSED",
6
6
  "files": [
package/v4.js CHANGED
@@ -20,7 +20,7 @@
20
20
  let _activeTabId = '';
21
21
  let _sections = []; // { id, label, load, loaded, errors }
22
22
  let _title = '';
23
- let _gitVer = '857821c'; // replaced at deploy: sed -i "s/857821c/$(git rev-parse --short HEAD)/g" v4.js
23
+ let _gitVer = 'ded6e67'; // replaced at deploy: sed -i "s/ded6e67/$(git rev-parse --short HEAD)/g" v4.js
24
24
  let _calls = []; // System Info call log
25
25
  let _sectionErrors = {}; // sectionId → error count
26
26
  let _generation = 0;