Skip to content

Quiver 3.2.1: audit fixes

Latest

Choose a tag to compare

@go4cas go4cas released this 12 Nov 08:46
· 3 commits to main since this release
0365059

A patch release with the fixes from an external code review and security audit of 3.2.0. It has no API changes, and every 3.2.0 app keeps working.

The main fixes:

  • Cancelled navigations keep their history. In browsers with precommit handlers (Chromium), a guard that cancels a navigation leaves history untouched, including the Forward entries.
  • createApp(app, options) cleans up after itself. A failed startup undoes its own changes, so you can retry, and an interrupted one leaves a newer app alone.
  • Safer build tooling. Section and middleware discovery is stricter, and quiver app --out refuses to overwrite its inputs.
  • Stronger release process. The full checks now run on the release tag before anything is staged on npm.

The component recipe files are also PascalCase now (Link.js, Toasts.js, ThemeSwitcher.js), and the docs, READMEs and /add-* commands were audited against all of it.

npm i @go4cas/quiver@3.2.1 · arrow-use stays 0.1.2 · published with provenance

Fixed

  • @go4cas/quiver (3.2.0 audit S32-01, N211): two section folders that are one section, either differing only in the parameter name (pages/[id]/, pages/[slug]/) or spelled two ways in Unicode, each with a _middleware.js, are now a scan error naming both files. Before, quiver:app held the section key twice and only one guard list ran. A convention folder that exists but can't be read (middleware/, a folder under pages/, app.config.js) is now an error instead of an empty folder; an absent one is still fine. A symbolic link to a .js file in layouts/, middleware/ or views/, or a linked _middleware.js, is an error instead of being skipped. Same in the Vite plugin, the Bun plugin and quiver app
  • @go4cas/quiver CLI (S32-03, N212): quiver app --out rejects app.config.js and a pages/**/_middleware.js (usage error, exit 2, with or without --watch), like the convention folders before. Both quiver app and quiver routes now replace an existing output file only when it is empty or starts with // Generated by Quiver. (every 3.x manifest does); any other file is left alone with a [quiver] error and exit 1. The temporary file is created exclusively under a random name, so concurrent writers each leave a complete manifest
  • @go4cas/quiver (R32-05, N210): the build-time meta reader finds the real top-level export const meta = with a small tokenizer. A commented-out meta, or one in a string, template, regular expression or block, no longer supplies the menu link; comments between the declaration's tokens work; a literal followed by more expression ({ … }.nav ? a : b, { … } || x) is unreadable instead of read as its first object; export let/var meta and export { meta } are unreadable. The "meta is not a plain literal" warning now looks for nav/layout in the initializer only, not in the rest of the file
  • @go4cas/quiver Vite plugin (R32-06, N213): editing a page so that it names an unknown layout prints the warning in the terminal at once, without a reload; a warning that stays is not printed again, on edits or on the reload after a meta.nav change; a scan overtaken by a newer one reports nothing. quiver app --watch prints each warning once while it stays, too
  • Router (R32-01, N201): a navigation a guard cancels no longer loses history. Where the browser has the Navigation API's precommit handlers (Chromium), the guards for a link click, go() or a replace run before the navigation commits, so a cancel leaves the URL, every history entry and the current position as they were (after going Back, the Forward entries stay), and a guard redirect commits once, at its target. Elsewhere, and for Back/Forward, the entry commits first and a cancel moves back, as before. In every browser, a cancel now keeps a fragment the browser set itself (#top, location.hash) instead of going back to the entry before it
  • createApp(app, options) (R32-02, N202): a startup that fails after its router started, such as an error view that throws while mounting, now stops that router again and empties the target, so a retry on the same target works without destroy(). Guards, hooks and keys provided before it are kept, as C-74 says
  • createApp(app, options) (R32-03, N203): a startup that destroy() interrupts rejects with createApp(): destroy() was called before this app mounted, so it was abandoned. and no longer removes config keys a newer app provided, even when the values are equal: undoing a provide() now checks who wrote the key, not what the value is
  • Pages that return a component() (R32-04, N204): events passed as the component call's second argument reach it again (emit was a no-op), with and without a layout
  • Guard redirects (S32-02, N205): a redirect is parsed once, against the document's base URL, and the router checks and navigates to that parsed URL; its path is the one the next guards see
  • initRouter({ middleware }) (R32-08, N206): a hole in a global or section guard array is rejected at startup with its index, instead of failing as an undefined guard during navigation
  • Link recipe (audit S32-02, N220): the policy now applies to the URL the browser resolves. Link parses the href it renders against document.baseURI; a path must land on this origin inside the app's base, and an absolute URL's parsed scheme must be http(s):, mailto: or tel:. A target such as \evil.example or a tab before /evil.example, which passed the old string check and became //evil.example at the root base, now renders without an href
  • Link recipe (audit R32-07, N220): the active state compares canonical segments, the way the router matches (percent-escapes decoded, Unicode NFC), so the generated menu link for release notes.js is current at /release%20notes; a query or hash in to no longer stops a match and external URLs are never active. aria-current="page" is set only on an exact match; the new data-active attribute (page or section) marks the current link and the links to sections above it, and the layouts recipe styles [data-active], so the sidebar looks as before. An app styling [aria-current="page"] to highlight a parent section should switch to [data-active]
  • useForm recipe (audit R32-09, N221): validate and onSubmit get one deep snapshot of the values that shares nothing with form, so an edit to a nested field during an async validate is neither submitted unvalidated nor lost (it stays for the next submit). Supported values are primitives and plain objects and arrays of them; anything else stops the submit with a message in form.message, and submitting is released
  • Recipe installs (audit R32-11, N222): recipes/README.md ("Existing files"), the docs and the /add-component, /add-composable, /add-layout and /add-theme commands check every destination a recipe's files lists, copy only the missing ones and keep each existing file unless the owner asks to replace it. One existing file such as src/layouts/menu.js no longer counts as the whole recipe, so a custom layouts/default.js stays while menu.js, layouts.css, the required recipes, packages and CSS lines are still added

Security

  • CI (audit S32-05, N230): a release tag now runs the full check suite on the tagged commit before anything is staged on npm. The checks moved into a reusable workflow, .github/workflows/checks.yml, which Tests runs on pull requests and main and Publish runs on each release tag; the stage job needs it to pass. Dry runs still only pack. Check names are now checks / unit, checks / audit, checks / e2e, checks / browsers, checks / pack and checks / screenshots
  • Repository settings (S32-05): .github/settings/ holds the main ruleset (pull requests, the six checks), the release-tag ruleset (admins only) and the npm environment's tag policy, with the commands to apply them in RELEASING.md
  • bun run audit (S32-04, N231): an accepted advisory that matches no locked version, or an exception naming a version the advisory doesn't match, now fails with a diagnostic instead of passing. The VitePress dev-server exceptions stay accepted until 2027-02-11
  • Docs (S32-06, N232): the app-config and middleware guides say that app.config.js, layouts, views and middleware ship to the browser, and show a session checked on the server

Changed

  • Tests (R32-10, N214): the CLI tests use the canonical temp directory (macOS /var → /private/var) and wait for the child's streams to close before reading its output
  • bun run pack:try (R32-12, N215): also builds tests/packed/bun-app, a small quiver:app app, with a real Bun.build (splitting: true) against the packed tarballs, and checks in Chromium at / and /sub/app/ its layout, the navigation from meta.nav, a section guard, lazily loaded page chunks, and that a broken source folder fails the build with the scanner's message. examples/bun keeps the manual setup
  • Recipes (D45, N200): component recipe files are PascalCase, like the app's own components: link.js → Link.js, toasts.js/toasts.css → Toasts.js/Toasts.css, theme-switcher.js/theme-switcher.css → ThemeSwitcher.js/ThemeSwitcher.css, in recipes/ and where they install (src/components/). Recipe names, /add-* names and every export are unchanged. An app that already copied a recipe keeps working; to match, rename the files and fix the imports and the @import lines in style.css
  • Starter: src/components/ holds only PascalCase files (Counter.js, UserCard.js, Link.js, Toasts.js, ThemeSwitcher.js)
  • Docs and both AGENTS.md: the file-name convention per folder (components PascalCase; composables and state camelCase; pages, layouts, views and middleware lower-case or kebab-case), in "App structure and config"; a new repo test, tests/repo/naming.test.js, checks the starter and the recipes
  • Docs (3.2.1 docs audit, N240): the /add-page command no longer offers a 'basic' layout or createApp({ layouts }) registration, and /add-layout in the AI guide and the plugin README no longer says it registers a layout; the routing guide's meta.layout comment names src/layouts/, and its Link line and startup section, the app-structure guide and the Bun API page match 3.2.1 (data-active, what a failed createApp(app, options) undoes, quiver:app under Bun); the examples page no longer calls the no-build manifest hand-written; the workflow guide's final page keeps its meta.nav; the migration guide gives the PascalCase recipe file names and a "Recipes copied from 3.2.0" section (aria-current to data-active); the layouts recipe page lists its real aliases; and README.md, CONTRIBUTING.md, the starter trees, the troubleshooting Node note and the link registry description were brought up to date

Full changelog: v3.2.0...v3.2.1