Skip to content

Split action internals into dedicated modules#79

Merged
j178 merged 1 commit into
mainfrom
stack/prek-manifest-runtime
Mar 15, 2026
Merged

Split action internals into dedicated modules#79
j178 merged 1 commit into
mainfrom
stack/prek-manifest-runtime

Conversation

@j178

@j178 j178 commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • split the action internals into dedicated modules
  • remove the shared.ts compatibility module
  • keep runtime behavior unchanged while reducing internal coupling

Stack

Base PR in this stack.

Copilot AI review requested due to automatic review settings March 15, 2026 12:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the GitHub Action’s internal logic into focused modules and switches prek version resolution to a bundled, checked-in release manifest (including SHA-256 verification of downloaded archives) to avoid runtime GitHub API dependency.

Changes:

  • Split prior shared.ts implementation into inputs, manifest, install, cache, and prek modules and re-export via shared.ts.
  • Add bundled src/version-manifest.json and resolve latest / semver ranges from it at runtime.
  • Verify downloaded prek archives against manifest-provided SHA-256 digests before extraction/caching.

Reviewed changes

Copilot reviewed 9 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tsconfig.test.json Include *.d.ts files in test compilation.
tsconfig.json Enable JSON imports (resolveJsonModule) and include *.d.ts in build.
src/types.ts Add shared constants and types for inputs and manifest structures.
src/shared.ts Convert to a re-export façade over the new modules.
src/semver.d.ts Add a local module stub for semver typing.
src/inputs.ts Move input parsing logic into a dedicated module.
src/manifest.ts Implement manifest-based version resolution and asset lookup.
src/install.ts Download prek assets from the manifest and verify SHA-256 before install.
src/cache.ts Move prek cache restore/save logic into a dedicated module.
src/prek.ts Move prek run, verbose log output, and cache pruning into a dedicated module.
src/version-manifest.json Add the bundled prek release/asset manifest used for runtime resolution.
package.json Add semver dependency and an update-version-manifest script.
package-lock.json Lockfile updates for the new dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/install.ts Outdated
Comment thread src/manifest.ts Outdated
Comment thread src/install.ts Outdated
Comment thread package.json Outdated
Comment thread src/manifest.ts Outdated
Comment thread src/manifest.ts Outdated
@j178 j178 force-pushed the stack/prek-manifest-runtime branch from fdc6f14 to 6d6c9c3 Compare March 15, 2026 12:34
@j178 j178 changed the title Refactor action internals and bundle prek manifest Split action internals into dedicated modules Mar 15, 2026
@j178 j178 force-pushed the stack/prek-manifest-runtime branch from 6d6c9c3 to ab90fe7 Compare March 15, 2026 12:43
@j178 j178 merged commit 4f7a938 into main Mar 15, 2026
9 checks passed
@j178 j178 deleted the stack/prek-manifest-runtime branch March 15, 2026 12:46
@j178 j178 added the internal label Mar 15, 2026
j178 added a commit that referenced this pull request Mar 15, 2026
## Summary
- resolve prek versions and asset URLs from a bundled release manifest
- add a scheduled workflow to refresh the manifest and open an update PR
- keep semver range parsing and archive checksum verification for later
PRs in the stack

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants