Repository navigation
chore: align openapi-viewer with the shared service conventions - #62
Merged
Merged
Conversation
Same header and sponsors block as the other data-fair services; Dawizz is no longer listed as a sponsor.
- @data-fair/lib-express 2 and lib-node 3: the breaking change is the pino logger, which this service does not use (only session, errorHandler, site and SPA middlewares) - @data-fair/lib-types-builder stays pinned at 1.10.1: later versions crash on the OpenAPI 3.1 meta-schema (makeLocalDefs reads its $ref property as a reference) - @data-fair/frame 0.19, @apidevtools/json-schema-ref-parser 16 - js-yaml 5: no default export any more, imported as a namespace - lockfile refresh (minor and patch updates, npm audit fix: no high vulnerability left) - dev environment tooling for the next commit: @data-fair/lib-dev, nodemon, dotenv - engines.node >=24.22.1, like .nvmrc and the Docker image
Used as the readiness URL of the api pane in the dev environment, and usable as a container healthcheck. The service has no dependency to check, so it answers ok.
- dev/dev.json: ports in .env (no more hard-coded 5600 / 8081 / 3000, nor the HMR port 7200 shared with metrics), readiness URLs (api /api/ping, ui), dev page URL - .zellij.kdl: panes run their command directly (no nvm/npm wrappers), status pane with df-status --start-deps, api with nodemon after df-dev wait-deps, vite under df-mem-cap - api/nodemon.json replaces node --watch - docker-compose: canonical nginx 1.29.4, simple-directory (healthcheck, shared dev secrets) and mongo 8.0.17 (healthcheck, 0.25 GB cache) blocks; no fake "dev" profile - dev nginx template with the shared head instead of a full nginx.conf - api config files in .mjs; the development one reads .env, the example docs URL follows the dev env's host and port; the unused test config and its branch in config.ts are removed - vite: ports from .env with strictPort, no server block for vite preview - scripts: dev-zellij through df-dev, stop-dev-deps on every profile, dev-* scripts removed - playwright reads .env for its baseURL; the /dev page links follow the page's origin (and the recursive example link had a typo) - .gitignore on the shared template (.env, dev/logs, agent working files) - CONTRIBUTING: install with npx --no df-dev setup, standalone vs integrated mode Moving from mongo 4.2 to 8 needs the dev volume reset (docker compose down -v).
- CI reads the node version from .nvmrc instead of any 24.x - CI no longer prints the logs of a "data-fair" compose service that does not exist here (the quality job never starts the compose) - playwright: trace and screenshot kept on failure, 30 s test timeout; the html reporter stays locally, the snapshot review reads it - vite: typed router declarations in dts/typed-router.d.ts like the other UIs
A dependency discovered while browsing reloaded the page (three times on a first visit), which breaks cold e2e runs. Only the commonjs dependencies are pre-bundled now: vjsf's, debug, prismjs and its components, statuses. Validated on an empty ui/node_modules/.vite: the e2e suite passes and vite logs no reload.
vite-plugin-node-polyfills prepends its globals shim to every pre-bundled dependency without a
trailing semicolon. prism-bash.min.js and prism-yaml.min.js start with an IIFE, which then
became an argument of the process polyfill call, so these languages never registered in dev
("Prism component for language bash was not found"). The production build was not affected.
The plugin was added for json-schema-ref-parser, whose version 16 only needs the Buffer
global (process is guarded, path is no longer imported): the plugin is replaced by the
buffer package assigned to globalThis.Buffer next to the dereference call. This also drops
the node-stdlib-browser / crypto-browserify / elliptic chain from the UI dependencies.
data-fair documents its collapse and sampling parameters with enum: [null, ...]. vjsf renders that enum as a select whose null item crashes (Cannot read properties of null (reading 'header')), and every re-render of the form then fails. null means "no value", which an empty optional field already expresses: it is removed from the field schema (and from items.enum), without mutating the documentation.
Measured on a 1000 lines /lines response (307 kB of JSON, 1.4 MB of highlighted HTML): Prism 64 ms, DOMPurify 378 ms, DOM insertion 536 ms; about 4 s for 5000 lines. - Prism output is inserted as is: Prism escapes the code it highlights, so sanitizing it again was pure cost - past 100 kB the code is shown as plain text, without the DOM of every token - an unknown language shows the code as text instead of inserting it as HTML (a "<div>" in a response body disappeared) - the copy button shows whenever there is code, not only when highlighting produced a tag - v-safe-html no longer sanitizes and rewrites the element on every update of its parent when its value did not change
BatLeDev
force-pushed
the
chore-align-service
branch
from
November 9, 2026 09:58
00607ce to
3bba6ca
Compare
lib-utils 1.14.2 keeps a property named $ref in makeLocalDefs (data-fair/lib#67), so lib-types-builder no longer crashes on the OpenAPI 3.1 meta-schema: ^1.14.6 with lib-utils ^1.14.2 instead of the exact 1.10.1 pin. build-types and check-types pass with the published versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align openapi-viewer with the other data-fair services, and fix the UI issues found while validating it.
@data-fair/lib-dev: ports in.env(the HMR port 7200 collided with metrics), zellij panes without nvm/npm wrappers, nodemon, canonical compose blocks (nginx 1.29.4 with the shared template, simple-directory, mongo 8.0.17 with healthchecks),.mjsconfig files,/api/pingfor readiness, no dependency discovery in vite.nvmrc, Playwright keeps traces on failure,.gitignoretemplate, typed router declarations, README header and sponsors like the other servicesvite-plugin-node-polyfillsprepended its shim without a semicolon to Prism's minified components; the plugin is replaced by an explicitBufferglobal, which also drops thecrypto-browserify/ellipticchainnullin a parameter enum (data-fair'scollapseandsampling) crashed the operation formWhy: keep the service on the shared conventions so that it runs and is operated like the others, standalone or embedded in the data-fair stack.
Heads-up:
docker compose down -v)node:*modules, externalized in the browser; only internal refs are resolved, the production build was checked