Skip to content

chore: declare sideEffects: false across all 11 packages — closes queue #70#88

Open
Goosterhof wants to merge 2 commits into
mainfrom
armorer/queue-70-sideeffects-manifest-compliance
Open

chore: declare sideEffects: false across all 11 packages — closes queue #70#88
Goosterhof wants to merge 2 commits into
mainfrom
armorer/queue-70-sideeffects-manifest-compliance

Conversation

@Goosterhof
Copy link
Copy Markdown
Contributor

Summary

Closes war-room enforcement queue #70 by adding "sideEffects": false to each of the 11 packages/*/package.json files. Restores gate 6 (lint:pkg) to GREEN on main and every subsequent PR.

The Red Gate

publint 0.3.21 (introduced via #82, merged 2026-05-11) added a new Suggestion:

The package appears to be consumed by bundlers but does not specify "sideEffects". Consider adding "sideEffects": false so bundlers can optimize tree-shaking if your package has no side effects.

The queue #31 wrapper at scripts/lint-pkg.mjs correctly elevates publint Suggestions to fatal — its entire purpose is to harden against silent advisory drift (queue #31 seed: the PR #35 git+ regression that drifted silently across 10 packages because the unenforced wrapper only printed the suggestion). The wrapper is doing its job; the manifests needed to match the new publint Suggestion.

Net effect since 2026-05-11: every fs-packages PR inherited a red gate-6 regardless of scope. PR #86 and PR #87 both flagged the red as "pre-existing, not introduced here."

Per-Package Side-Effect Audit

All 11 packages audited: read src/index.ts + every re-exported file. Checked for console.*, global mutation, CSS imports, IIFE side effects, polyfill installation, prototype patches, top-level Object.defineProperty, bare side-effect-only imports. All 11 audit-cleared — zero top-level side effects. The factory + barrel doctrine ensures every package's src/index.ts is either a pure re-export or a file whose top-level statements are imports, type declarations, and const/function factory declarations only.

Package Audit verdict sideEffects: false Post-flip gate 6
fs-adapter-store audit-cleared added PASS
fs-cached-adapter-store audit-cleared added PASS
fs-dialog audit-cleared added PASS
fs-helpers audit-cleared added PASS
fs-http audit-cleared added PASS
fs-loading audit-cleared added PASS
fs-router audit-cleared added PASS
fs-storage audit-cleared added PASS
fs-theme audit-cleared added PASS
fs-toast audit-cleared added PASS
fs-translation audit-cleared added PASS

Gate-6 Evidence

Before:

lint:pkg gate FAILED (11):
  - @script-development/fs-adapter-store: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-cached-adapter-store: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-dialog: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-helpers: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-http: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-loading: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-router: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-storage: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-theme: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-toast: publint emitted "Suggestions:" block (fail-on-suggestion gate)
  - @script-development/fs-translation: publint emitted "Suggestions:" block (fail-on-suggestion gate)

After:

lint:pkg gate PASS — 11 packages + root clean (engines.node present; publint suggestions/warnings/errors all treated as fatal).

Each package now reports All good! from publint and 🟢 across the attw node10 / node16 (from CJS) / node16 (from ESM) / bundler matrix.

Local CI: All 8 Gates Green

Gate Status
1. npm audit PASS — 0 vulnerabilities
2. npm run format:check PASS — all 145 files clean (oxfmt repositioned the new key alongside type per its canonical shape)
3. npm run lint PASS — 0 warnings, 0 errors, 92 files
4. npm run build PASS — 11 packages dual ESM + CJS
5. npm run typecheck PASS — all packages clean
6. npm run lint:pkg PASS — queue #70 closed
7. npm run test:coverage PASS — 487/487 tests, 100% coverage
8. npm run test:mutation PASS — all packages ≥90% (translation 93.33% with the documented unkillable equivalents)

Lockfile sanity: npm install produced no drift (pure metadata change, no dependency-graph shift).

Coordination With PR #87

#87 (streamRequest removal, fs-http 0.4.0) is currently open at the time of this PR opening and modifies 4 of the 11 manifests:

  • packages/http/package.json (version 0.3.0 → 0.4.0)
  • packages/loading/package.json (peer-range widen + patch bump)
  • packages/adapter-store/package.json (peer-range widen + patch bump)
  • packages/cached-adapter-store/package.json (peer-range widen + patch bump)

The two PRs target main independently. The file-level edits are disjoint within each shared manifest: #87 edits "version" and "peerDependencies"; this PR adds a new "sideEffects" key alongside "type". Whichever PR merges second will need a trivial rebase — the "sideEffects": false key addition does not conflict semantically with a "version" bump, and git's three-way merge handles it cleanly. If an auto-merge surfaces a textual conflict, resolution is mechanical (both edits land; key ordering is the only question).

What This Doesn't Touch

  • No source files. Pure manifest-only dispatch — packages/*/src/ is unchanged.
  • No tests. Tests are unaffected by the sideEffects declaration.
  • No version bumps. Metadata-only change; no API surface change.
  • No CHANGELOGs. Per the convention dispositioned during feat(http)!: remove streamRequest in 0.4.0 — closes queue #64 + supersedes PR #86 #87's review, cascade peers do not carry CHANGELOGs, and this dispatch carries no version bumps.

Doctrine Update

A new bullet "No top-level side effects" added under CLAUDE.md ## Conventions, alongside the existing factory / barrel / peer / loose-coupling / no-direct-axios family. Locks the convention so a future package author doesn't ship without the flag and re-fire gate 6.

Commit Shape

Two atomic commits — reviewers should diff the first commit (mechanical manifest sweep) and the second commit (doctrine bullet) separately:

  1. chore: declare sideEffects: false across all 11 published packages (closes queue #70) — 11 files, +11 lines
  2. docs(fs-packages): codify no-top-level-side-effects convention in § Conventions — 1 file, +1 line

🤖 Generated with Claude Code

Goosterhof and others added 2 commits May 15, 2026 15:47
…loses queue #70)

publint 0.3.21 (introduced via PR #82, merged 2026-05-11) added a
"sideEffects" Suggestion: "package.json should declare \"sideEffects\":
false so bundlers can tree-shake the module under deep import." The
queue #31 wrapper at scripts/lint-pkg.mjs correctly elevates publint
Suggestions to fatal, so every fs-packages PR has inherited a red
gate-6 since 2026-05-11 regardless of scope.

This commit closes the red by adding "sideEffects": false to each of
the 11 packages/*/package.json files. Per-package audit (read src/index.ts
+ everything it re-exports) confirms zero top-level side effects across
all 11 packages: no console.*, no global mutation, no CSS imports, no
IIFE side effects, no polyfill installation, no prototype patches. The
factory + barrel doctrine is structurally side-effect-free; this commit
makes it explicit and bundler-actionable.

No version bumps. No CHANGELOG entries. Pure metadata change — bundlers
may treat the manifest more aggressively (more tree-shaking), but the
public API surface is unchanged.

Coordination with PR #87 (streamRequest removal, also open at dispatch
time): PR #87 modifies 4 of 11 manifests (fs-http + the three cascade
peers) by editing "version" and "peerDependencies"; this PR adds the new
"sideEffects" key. The two PRs target main independently; whichever
merges second will need a trivial rebase, mechanical at worst.

Gate-6 evidence: before — 11 packages each emit one publint Suggestion
that the wrapper elevates to fatal (lint:pkg gate FAILED with 11
entries). After — every package shows publint "All good!" and attw 🟢
across the node10/node16(CJS/ESM)/bundler matrix (lint:pkg gate PASS).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…onventions

Adds a "No top-level side effects" bullet under ## Conventions, alongside
the existing Factory pattern / Single entry point / Peer dependencies /
Loose coupling / Test environment / Identical build config / No direct
axios imports family.

Locks in the convention so a future package author doesn't ship without
the "sideEffects": false manifest entry and re-fire gate-6 with the
publint Suggestion. The factory + barrel pattern is structurally
side-effect-free; the manifest entry makes it explicit and
bundler-actionable. Closes enforcement queue #70.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying fs-packages with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43edb06
Status: ✅  Deploy successful!
Preview URL: https://b665a159.fs-packages.pages.dev
Branch Preview URL: https://armorer-queue-70-sideeffects.fs-packages.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant