@devopsplaybook.io/common-web 0.7.0 → 0.8.0
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/CHANGELOG.md +33 -0
- package/CONTRIBUTING.md +12 -0
- package/README.md +34 -2
- package/package.json +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,39 @@ All notable changes to this project are documented here.
|
|
|
5
5
|
This project follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
6
6
|
and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.8.0] - 2026-10-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Package metadata: `repository`, `homepage`, `bugs` and a conservative
|
|
13
|
+
`sideEffects` whitelist (CSS and `.vue` files are never tree-shaken;
|
|
14
|
+
the `.ts` modules are side-effect-free at import time). No `types` entry is
|
|
15
|
+
added because the package intentionally ships raw sources with no build step;
|
|
16
|
+
this is now documented in the README.
|
|
17
|
+
- axe-core accessibility gate: `tests/accessibility.spec.ts` mounts every
|
|
18
|
+
shipped component in a real DOM tree and fails on axe violations
|
|
19
|
+
(`color-contrast` is covered by the packed-tokens contrast test instead,
|
|
20
|
+
because jsdom cannot compute rendered contrast).
|
|
21
|
+
- Coverage thresholds in `vitest.config.ts` (statements 95%, branches 88%,
|
|
22
|
+
functions 99%, lines 97%) so coverage regressions fail `npm test`.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `scripts/build-package.mjs` now derives `requiredFiles` from the public
|
|
27
|
+
source directories plus the fixed root assets, so every public file is
|
|
28
|
+
required and packaging regressions fail `npm run build` instead of shipping
|
|
29
|
+
silently.
|
|
30
|
+
- Removed the dead `base-package` and `bootstrap-checks` jobs from `PR Check`;
|
|
31
|
+
`main` has had a package manifest since 0.4.0, so the bootstrap path could
|
|
32
|
+
never run. `version-check` now always runs.
|
|
33
|
+
- README: removed the stale bootstrap-workflow note and added "SSR and
|
|
34
|
+
client-only usage" plus "Packaging, types and side effects" documenting the
|
|
35
|
+
delivered behavior. CONTRIBUTING: documented the coverage and accessibility
|
|
36
|
+
gates.
|
|
37
|
+
- `.gitignore` now excludes environment files (`.env`, `.env.*` with an
|
|
38
|
+
`!.env.example` exception) and key material (`*.pem`, `*.key`). No secret is
|
|
39
|
+
committed today; this is cheap hardening. No consumer-facing API change.
|
|
40
|
+
|
|
8
41
|
## [0.7.0] - 2026-10-24
|
|
9
42
|
|
|
10
43
|
### Added
|
package/CONTRIBUTING.md
CHANGED
|
@@ -15,6 +15,18 @@ npm audit --omit=dev --audit-level=high
|
|
|
15
15
|
The tests consume the generated npm tarball, not only the working tree.
|
|
16
16
|
`npm run build` checks the publish file list and builds the Nuxt playground.
|
|
17
17
|
|
|
18
|
+
Two quality gates run with `npm test`:
|
|
19
|
+
|
|
20
|
+
- **Coverage thresholds** are enforced in `vitest.config.ts` (statements 95%,
|
|
21
|
+
branches 88%, functions 99%, lines 97%) over the composables, services and
|
|
22
|
+
stores shipped in the tarball. Raise the bar when coverage improves; lower it
|
|
23
|
+
only with an explanation in the PR.
|
|
24
|
+
- **Accessibility**: `tests/accessibility.spec.ts` runs axe-core against every
|
|
25
|
+
shipped component mounted in a real DOM tree and fails on violations. The
|
|
26
|
+
`color-contrast` rule is disabled there because jsdom cannot compute rendered
|
|
27
|
+
contrast; WCAG AA color pairs are already gated by `tests/contrast.spec.ts`
|
|
28
|
+
against the packed tokens.
|
|
29
|
+
|
|
18
30
|
## Scope and compatibility
|
|
19
31
|
|
|
20
32
|
Keep the layer limited to UI and browser behavior that is shared by multiple
|
package/README.md
CHANGED
|
@@ -174,6 +174,28 @@ missing or malformed; `set()` normalises valid non-negative integer strings
|
|
|
174
174
|
(for example `"05000"` becomes `"5000"`) and throws `TypeError` otherwise.
|
|
175
175
|
`"0"` is valid and keeps polling disabled.
|
|
176
176
|
|
|
177
|
+
## SSR and client-only usage
|
|
178
|
+
|
|
179
|
+
The layer is SSR-compatible: the components render on the server, and the
|
|
180
|
+
composables guard their browser-only access.
|
|
181
|
+
|
|
182
|
+
- `useTheme()` guards `document` and `localStorage` (`applyTheme()` returns
|
|
183
|
+
early when `document` is missing; storage writes are skipped), and reads the
|
|
184
|
+
stored preference and media query in `onMounted`, which never runs during SSR.
|
|
185
|
+
- `useOfflineStatus()` defaults `isOnline` to `true` when `navigator` is
|
|
186
|
+
missing, and registers its listeners in `onMounted`.
|
|
187
|
+
- `useAppHeight()` touches `window` only inside `onMounted`.
|
|
188
|
+
- `AuthService` guards every `localStorage` access: during SSR `getToken()`
|
|
189
|
+
resolves `null` and `saveToken()` / `removeToken()` are no-ops.
|
|
190
|
+
|
|
191
|
+
Token storage, session renewal, `AUTH_UPDATED` propagation, cross-tab
|
|
192
|
+
synchronisation and the opt-in Axios integration are browser-only: register the
|
|
193
|
+
Axios helper from a `.client.ts` plugin as shown above, and expect the
|
|
194
|
+
authentication state to become meaningful only after hydration.
|
|
195
|
+
`PreferencesService` and `RefreshIntervalService` access `localStorage`
|
|
196
|
+
unguarded and must only be called in the browser (a client plugin or a
|
|
197
|
+
composable hook, never during SSR).
|
|
198
|
+
|
|
177
199
|
## Tokens and app-shell styles
|
|
178
200
|
|
|
179
201
|
The layer loads `assets/css/tokens.css` and `assets/css/app-shell.css`.
|
|
@@ -231,8 +253,18 @@ workflows so the audit gate can cover production dependencies only;
|
|
|
231
253
|
development-toolchain advisories are reported but do not fail the build. See
|
|
232
254
|
[CONTRIBUTING.md](CONTRIBUTING.md#dependency-audit-policy) for the policy and
|
|
233
255
|
the accepted development-only advisories. The local jobs are a stop-gap until
|
|
234
|
-
the shared `common-utils` npm workflows adopt the same gate
|
|
235
|
-
|
|
256
|
+
the shared `common-utils` npm workflows adopt the same gate.
|
|
257
|
+
|
|
258
|
+
### Packaging, types and side effects
|
|
259
|
+
|
|
260
|
+
The package ships raw Vue and TypeScript sources with no build step, so there is
|
|
261
|
+
deliberately no `types` or `exports.types` entry: type information comes from
|
|
262
|
+
the `.ts`/`.vue` sources themselves and deep imports resolve through the
|
|
263
|
+
`exports` map under Nuxt module resolution. `sideEffects` whitelists CSS and
|
|
264
|
+
`.vue` files so component styles and the token stylesheets are never
|
|
265
|
+
tree-shaken, while the side-effect-free `.ts` modules can be. `npm run build`
|
|
266
|
+
fails when any public file is missing from the packed tarball, and the packed
|
|
267
|
+
archive is what `npm test` runs against.
|
|
236
268
|
|
|
237
269
|
## Development
|
|
238
270
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devopsplaybook.io/common-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared Nuxt layer for DevOpsPlaybook web applications",
|
|
5
5
|
"license": "ISC",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/devopsplaybook-io/common-web.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/devopsplaybook-io/common-web#readme",
|
|
11
|
+
"bugs": "https://github.com/devopsplaybook-io/common-web/issues",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"**/*.vue"
|
|
15
|
+
],
|
|
6
16
|
"engines": {
|
|
7
17
|
"node": ">=22"
|
|
8
18
|
},
|
|
@@ -46,6 +56,7 @@
|
|
|
46
56
|
"@vitejs/plugin-vue": "^6.0.9",
|
|
47
57
|
"@vitest/coverage-v8": "^5.0.5",
|
|
48
58
|
"@vue/test-utils": "^2.5.1",
|
|
59
|
+
"axe-core": "^4.14.0",
|
|
49
60
|
"jsdom": "^30.1.1",
|
|
50
61
|
"nuxt": "^4.6.2",
|
|
51
62
|
"oxlint": "^1.85.0",
|