Skip to content

Vault Publisher 0.1.2

Choose a tag to compare

@NoteNerdOfficial NoteNerdOfficial released this 07 Nov 07:28
· 34 commits to main since this release

A blank preview now explains itself, and the setup it was blocking on is
mostly automated.

A preview that renders nothing now says why

A vault holding an unbuilt Angular or React project publishes exactly one
index.html: the framework's shell. <app-root></app-root>, a root-absolute
<base href="/">, and no <script> anywhere. It copies perfectly, travels
perfectly, and can never render -- there is no application in it yet.

The condition was already detected, and reported to a build report nobody
opens. Now the preview says so on the page itself, and as a notice when the
build finishes.

A new settings section for built apps

Scan looks for Angular, Vite, create-react-app and Next projects and
reports four things per project:

  • Built? -- whether the output folder exists and holds an index.html
  • Fresh? -- whether anything in src/ is newer than that index.html.
    A stale build is the worst of these: the app renders, and it renders last
    week. Nothing caught it before.
  • Base href -- whether references will resolve beside the page or from
    the root of the server
  • Wired up? -- whether a Publish folders whole entry covers it

Each one comes with its remedy: the build command to copy, a Fix it for
the base href, an Add it for the folder entry.

The build itself is never run. An app launched from Finder does not see
the node your terminal sees, and running a project's build script means
running code found in a vault. So the command is handed over to paste, in
the npx form that works without a global install -- which is the form that
would have saved the session this release came out of.

Base href, the fault that leaves no evidence

A build with <base href="/"> and one with <base href="./"> are otherwise
byte-identical. Published to a subfolder, the first resolves every script
from the root of the server and renders nothing.

Fix it writes the config so it survives the next build and patches the
file already on disk so the fix is visible without rebuilding. The config
edit is made in the text, so an angular.json comes back with one line
added and every other byte unchanged. It takes two presses, and the first
one names the file and the key.

A Vite config is executable TypeScript rather than data, so that one is
shown to paste, not edited.

A folder that publishes everything except its index

dist/app when the build wrote dist/app/browser: healthy file count,
healthy byte total, 404 at the address. Reported now.

"Anchor lost" came and went

Two separate bugs in the review overlay, which is why it flickered:

  • The restamp timer repositioned pins without re-rendering the panel, so
    the panel's verdict was whatever it had been at the last view change.
  • Block ids carry an occurrence number, so duplicating a line renumbered
    every block after it and orphaned their comments. A comment now recovers
    its block when exactly one unclaimed candidate shares its hash, and when
    it genuinely cannot, the message distinguishes the two causes instead of
    blaming a rewrite for both.

Smaller

The settings page folds into sections now, core ones open.