Merged
Conversation
6494587 to
9a0f1f0
Compare
fbc801b to
7a1e37e
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for configuring multiple package registries (including scoped registries and authentication) in the setup-bun GitHub Action.
Key changes:
- Introduce a new
registriesinput, parse it insrc/registry.ts, and wire it throughsrc/index.tsandsrc/action.ts. - Replace manual TOML concatenation with parsing and stringifying via
@iarna/tomlinsrc/bunfig.ts, and update tests accordingly. - Update documentation (
README.md,action.yml) and CI pipeline to cover the new feature.
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/tsconfig.json | Add test-specific TS config for Bun types |
| tests/registry.spec.ts | New unit tests for parseRegistries covering various input formats |
| tests/bunfig.spec.ts | New unit tests for writeBunfig, merging and formatting bunfig.toml |
| src/registry.ts | Implement parseRegistries to parse multi‐registry input |
| src/index.ts | Wire in registries input and maintain backwards compatibility |
| src/bunfig.ts | Switch to TOML parse/stringify for bunfig.toml generation |
| src/action.ts | Pass the new registries array into writeBunfig |
| package.json | Add @iarna/toml and Bun type definitions |
| bunfig.toml | Remove the placeholder bunfig template |
| action.yml | Define the new registries input and deprecate registry-url/scope |
| README.md | Document the registries input and format options |
| .github/workflows/test.yml | Add a CI job for running tests and example custom-registry test |
Comments suppressed due to low confidence (4)
action.yml:20
- The
registriesinput should explicitly specifytype: stringfor clearer action metadata and validation.
registries:
src/bunfig.ts:3
- The default
stringify(config)may not produce the nested table indentation or ordering expected by your tests. Consider usingstringify(config, null, 2)or building the TOML sections manually to preserve two-space indentation and the precise ordering.
import { parse, stringify } from "@iarna/toml";
src/bunfig.ts:1
- The
Registrytype is imported but not re-exported here, yetsrc/action.tstries to import it from this module. Addexport type { Registry } from './registry';to re-export it or adjust the import inaction.tsto pull directly fromregistry.ts.
import { existsSync, readFileSync, writeFileSync } from "node:fs";
src/action.ts:15
- There is no
Registryexport inbunfig.ts, so this import will fail. Either importRegistryfrom./registryhere or re-export it frombunfig.ts.
import { writeBunfig, Registry } from "./bunfig";
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #107
Closes #129
Closes #122
Thanks for initial pull request #39 by @vitoorgomes
Thanks for #117 by @h3rmanj