Skip to content

Comments

feat: support for multiple registries#109

Merged
xhyrom merged 36 commits intomainfrom
feat/multiple-registries
Jul 9, 2025
Merged

feat: support for multiple registries#109
xhyrom merged 36 commits intomainfrom
feat/multiple-registries

Conversation

@xhyrom
Copy link
Collaborator

@xhyrom xhyrom commented Nov 16, 2024

Fixes #107
Closes #129
Closes #122

Thanks for initial pull request #39 by @vitoorgomes
Thanks for #117 by @h3rmanj

@xhyrom xhyrom changed the title feat: support for multiple registries feat: support for multiple private registries Nov 16, 2024
@xhyrom xhyrom requested a review from Electroid November 16, 2024 11:14
@xhyrom xhyrom force-pushed the feat/multiple-registries branch from 6494587 to 9a0f1f0 Compare December 12, 2024 20:07
@xhyrom xhyrom mentioned this pull request Jun 30, 2025
@xhyrom xhyrom force-pushed the feat/multiple-registries branch from fbc801b to 7a1e37e Compare July 8, 2025 18:00
@xhyrom xhyrom changed the title feat: support for multiple private registries feat: support for multiple registries Jul 8, 2025
@xhyrom xhyrom requested review from Jarred-Sumner, RiskyMH and Copilot and removed request for Electroid July 8, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

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 adds support for configuring multiple package registries (including scoped registries and authentication) in the setup-bun GitHub Action.
Key changes:

  • Introduce a new registries input, parse it in src/registry.ts, and wire it through src/index.ts and src/action.ts.
  • Replace manual TOML concatenation with parsing and stringifying via @iarna/toml in src/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 registries input should explicitly specify type: string for 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 using stringify(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 Registry type is imported but not re-exported here, yet src/action.ts tries to import it from this module. Add export type { Registry } from './registry'; to re-export it or adjust the import in action.ts to pull directly from registry.ts.
import { existsSync, readFileSync, writeFileSync } from "node:fs";

src/action.ts:15

  • There is no Registry export in bunfig.ts, so this import will fail. Either import Registry from ./registry here or re-export it from bunfig.ts.
import { writeBunfig, Registry } from "./bunfig";

@xhyrom xhyrom merged commit 34f777a into main Jul 9, 2025
37 of 52 checks passed
@xhyrom xhyrom deleted the feat/multiple-registries branch January 3, 2026 23:44
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.

Only one scope supported? Support installing from npm and npm-compatible registries [BUG]: Cannot redefine key

1 participant