Skip to content

chore: Drop the docs server in favor of opening the files - #246

Merged
RobinBol merged 1 commit into
masterfrom
chore/docs-preview-without-serve
Oct 23, 2026
Merged

RobinBol merged 1 commit into
masterfrom
chore/docs-preview-without-serve

Conversation

@RobinBol

@RobinBol RobinBol commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What

Drops the docs server. serve, watch and concurrently go without a replacement, along with build:clean and build:watch. A new npm run docs builds the docs and opens them:

"docs": "npm run build && open build/index.html"

AGENTS.md documents it, and how to view the docs off macOS.

Why

The generated docs need no server. They are a static site with no fetch, no XHR, no module scripts, only relative classic <script src> tags, so they work straight from disk. Checked over file:// in Chrome and Safari: stylesheets, the sidebar filter, dark mode (including localStorage), syntax highlighting, deep links and navigation all work, and the console output is identical to serving it over http.

The three packages were expensive for what they did. 148 transitive dependencies and 5 of the 9 audit findings, for a preview that never runs in CI. concurrently@5 is from 2020 and watch@1.0.2 from 2016, neither released since.

Rebuilding on change goes too. The old setup had no live reload either, so a change already meant a manual refresh; rerunning npm run docs does the same.

open is macOS only. Elsewhere it is npm run build and opening build/index.html, which AGENTS.md now says.

While in that block, the lint line in AGENTS.md stops referring to the eslint-config-athom setup that #244 removed.

Testing

npm run build produces build/index.html. npm test 114 passing, lint and format:check clean. npm audit 9 -> 4, lockfile 391 -> 241 entries.

@RobinBol
RobinBol force-pushed the chore/docs-preview-without-serve branch from 598d9b9 to 8b055a7 Compare October 22, 2026 15:05
@RobinBol
RobinBol requested a balanced review from Copilot October 22, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The preview drops per-rebuild cleanup and uses executable shims that fail on Windows.

3 open issues
What changed in this PR

This PR simplifies the local JSDoc preview tooling and reduces development dependencies without changing the Zigbee library itself.

Changes:

  • Replaces the existing preview commands with a Node script that runs watch mode and a localhost HTTP server.
  • Replaces serve, watch, and concurrently with http-server and updates the lockfile.
  • Enables ECMAScript module parsing for .mjs files in ESLint.
File Description
scripts/​serve-docs.mjs Adds documentation watching, serving, and signal handling.
package.json Simplifies preview scripts and replaces dependencies.
package-lock.json Updates the resolved development dependency tree.
eslint.config.js Configures module parsing for .mjs scripts.

Review effort: Balanced

Comment thread scripts/serve-docs.mjs Outdated
Comment thread scripts/serve-docs.mjs Outdated
Comment thread scripts/serve-docs.mjs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation-tooling changes are narrowly scoped, previous feedback is resolved, and no blocking issues remain.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused tooling changes address the prior cleanup and Windows launch issues, with no unresolved blocking findings.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused preview-tooling changes address prior feedback, with no unresolved blocking issues identified.

No open issues 🎉

Review effort: Balanced

@RobinBol
RobinBol force-pushed the chore/docs-preview-without-serve branch from bd3b924 to 98eabb9 Compare October 23, 2026 07:32
@RobinBol RobinBol changed the title chore: replace serve, watch and concurrently with node --watch and npx chore: Replace serve, watch and concurrently with node --watch Oct 23, 2026
@RobinBol
RobinBol requested a balanced review from Copilot October 23, 2026 07:33
Base automatically changed from chore/prettier to master October 23, 2026 07:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues remain; Node 22.14.0 source confirms Linux support for the explicit directory-watching path used here.

No open issues 🎉

Review effort: Balanced

@RobinBol RobinBol changed the title chore: Replace serve, watch and concurrently with node --watch chore: Replace serve, watch and concurrently with http-server Oct 23, 2026
The generated docs are a static site that works straight from disk: no
fetch, no XHR, no module scripts, only relative classic script tags.
Checked over file:// in Chrome and Safari, with stylesheets, the sidebar
filter, dark mode, syntax highlighting and deep links all working, and
console output identical to serving it over http.

So serve, watch and concurrently go without a replacement, along with
build:clean and build:watch. Together they pulled in 148 transitive
dependencies and 5 audit findings for a preview that never runs in CI;
concurrently@5 is from 2020 and watch@1.0.2 from 2016.

npm run docs builds and opens build/index.html with macOS open. AGENTS.md
says how to view the docs elsewhere, and its lint line no longer refers
to the eslint-config-athom setup that #244 removed.
@RobinBol RobinBol changed the title chore: Replace serve, watch and concurrently with http-server chore: Drop the docs server in favor of opening the files Oct 23, 2026
@RobinBol
RobinBol force-pushed the chore/docs-preview-without-serve branch from 98eabb9 to 96d21d5 Compare October 23, 2026 08:05
@RobinBol
RobinBol requested a balanced review from Copilot October 23, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues remain; the existing build command is unchanged, and the macOS-only shortcut has a documented alternative.

No open issues 🎉

Review effort: Balanced

@RobinBol
RobinBol merged commit 187ca5e into master Oct 23, 2026
3 checks passed
@RobinBol
RobinBol deleted the chore/docs-preview-without-serve branch October 23, 2026 08:08
@RobinBol RobinBol added the internal Tooling, CI or docs, left out of the release notes label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Tooling, CI or docs, left out of the release notes

Development

Successfully merging this pull request may close these issues.

2 participants