Skip to content

chore: Pass 2 — aggressive public-surface trim of all 4 osl-* forks#108

Draft
bjcorder wants to merge 1 commit into
mainfrom
feat/ozark-stdlib-trim-pass-2
Draft

chore: Pass 2 — aggressive public-surface trim of all 4 osl-* forks#108
bjcorder wants to merge 1 commit into
mainfrom
feat/ozark-stdlib-trim-pass-2

Conversation

@bjcorder

Copy link
Copy Markdown
Owner

Summary

Pass 2 of the Ozark internal-stdlib pilot. Each of the four runtime-dep forks now exposes only the surface deterministic-deps actually consumes; the rest of upstream's public API has been deleted from the fork.

Per-fork trim summary

Fork SHA bump Public exports Notable internal trims
osl-actions-core 23007f6d0839bc 28 → 6 (getInput, setOutput, warning, setFailed, summary, ExitCode) Deleted src/oidc-utils.ts, src/platform.ts, src/path-utils.ts. Trimmed Summary class to 4 methods. Dropped runtime deps @actions/exec + @actions/http-client (no longer reachable). Source LOC 1,192 → 407.
osl-glob 3d32991b1bf03d 18 → 1 (just glob()) Removed Glob class methods walkSync/stream/streamSync/iterate/iterateSync. Removed GlobStream class from walker.ts. Source LOC 2,116 → 1,833.
osl-js-yaml 721957eb04ff4f 15 → 4 (load, loadAll, DEFAULT_SCHEMA, YAMLException) Deleted lib/dumper.js entirely (~965 LOC) plus the CLI binary, browser bundles, examples/support/benchmark dirs, and argparse runtime dep.
osl-minimatch 4a0ff5b6e49846 10 → 3 (Minimatch class, sep, GLOBSTAR) Dropped top-level minimatch/filter/defaults/makeRe/match helpers. Removed Minimatch.defaults static + all minimatch.X = X chained properties. Deleted src/escape.ts.

Bundle impact

dist/index.js shrinks from 1,733 KB → 397 KB (77% reduction). Most of the drop comes from:

  • Removing the @actions/core OIDC code path (pulled in @actions/http-client + undici through the overrides block).
  • Deleting js-yaml's entire serializer (lib/dumper.js).

Self-discovered finding

After bumping the SHAs the first time, the dogfood scan emitted a single new finding: node/lockfile-coverage complaining that overrides.undici (in package.json) had no lockfile entry with integrity metadata. This was correct — undici had no consumer in the dep graph anymore (its only path was through the deleted OIDC code). Removed the dead override; dogfood goes back to 0 findings. The rule worked.

Verification

  • npm run all: lint + 157 tests + tsc + ncc bundle — green.
  • npm run format: clean. git diff --check: clean.
  • Dogfood node dist/index.js: 0 findings.

Test plan

…i override

Pass 2 of the Ozark stdlib pilot — public-surface trim across all four
forks. Each fork's exported surface is now reduced to what
deterministic-deps actually consumes, with internal class methods
trimmed where they were isolated from the kept surface.

osl-actions-core (23007f6 → d0839bc)
  - 28 exports → 6: getInput, setOutput, warning, setFailed, summary,
    ExitCode.
  - Deleted src/oidc-utils.ts, src/platform.ts, src/path-utils.ts.
  - Summary class trimmed from 14 methods to 4 (addHeading, addRaw,
    addEOL, write + private helpers).
  - Inlined error() into setFailed().
  - Runtime dependencies dropped from 2 (@actions/exec,
    @actions/http-client) to 0.
  - Source LOC: 1,192 → 407 (66% reduction).

osl-glob (3d32991 → b1bf03d)
  - 18 exports → 1: just the async glob() function.
  - Dropped globStreamSync/globStream/globSync/globIterateSync/
    globIterate + their stream/iterate/sync aliases + the Object.assign
    cluster.
  - Glob class methods walkSync/stream/streamSync/iterate/iterateSync
    plus Symbol.iterator/asyncIterator implementations removed.
  - GlobStream class removed from walker.ts.
  - Source LOC: 2,116 → 1,833 (13%).

osl-js-yaml (721957e → b04ff4f)
  - 15 exports → 4: load, loadAll, DEFAULT_SCHEMA, YAMLException.
  - Deleted lib/dumper.js (~965 LOC) and the CLI binary.
  - Removed the entire `types` registry export, dump/safe* shims, and
    named schemas other than DEFAULT_SCHEMA (the underlying files stay
    because DEFAULT_SCHEMA depends on them).
  - Runtime dependencies dropped from 1 (argparse) to 0.

osl-minimatch (4a0ff5b → 6e49846)
  - 10 exports → 3 + 6 type-only: Minimatch class, sep, GLOBSTAR.
  - Dropped top-level helpers: minimatch(), filter, defaults, makeRe,
    match. All minimatch.X = X attached properties removed. Static
    Minimatch.defaults removed.
  - Deleted src/escape.ts. Removed escape/unescape/AST re-exports.
  - Source LOC: 2,721 → 2,561 (6% — the Minimatch class is the core).

Consumer impact:
  - dist/index.js: 1,733 KB → 397 KB (77% reduction in the production
    bundle). Driven mainly by the dropped @actions/core OIDC code path
    (pulled in @actions/http-client + undici through the override) and
    lib/dumper.js.
  - Removed dead `overrides.undici` from package.json — the node/
    lockfile-coverage rule correctly caught the orphaned override on
    the first dogfood after the SHA bumps, since undici has no consumer
    in the dep graph after the OIDC trim.
  - All 157 tests pass. Lint, format, whitespace, dogfood all clean.
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