Skip to content

Commit dbbb17e

Browse files
syi0808claude
andcommitted
fix: consolidate duplicate PubmConfig types and add missing registries field
Remove legacy `src/types/config.ts` and unify on `src/config/types.ts` as the single source of truth for PubmConfig. Add top-level `registries` field that was missing from the defineConfig type, and remove duplicate defineConfig from loader.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 621d05b commit dbbb17e

File tree

6 files changed

+6
-27
lines changed

6 files changed

+6
-27
lines changed

src/config/defaults.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const defaultConfig = {
3232
saveToken: true,
3333
releaseDraft: true,
3434
releaseNotes: true,
35+
registries: ["npm", "jsr"] as string[],
3536
rollbackStrategy: "individual" as const,
3637
};
3738

src/config/loader.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { stat } from "node:fs/promises";
22
import path from "node:path";
3-
import type { PubmConfig } from "../types/config.js";
3+
import type { PubmConfig } from "./types.js";
44

55
const CONFIG_FILES = [
66
"pubm.config.ts",
@@ -11,10 +11,6 @@ const CONFIG_FILES = [
1111
"pubm.config.cjs",
1212
];
1313

14-
export function defineConfig(config: PubmConfig): PubmConfig {
15-
return config;
16-
}
17-
1814
async function findConfigFile(cwd: string): Promise<string | null> {
1915
for (const file of CONFIG_FILES) {
2016
const filePath = path.join(cwd, file);

src/config/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface SnapshotConfig {
2121
export interface PubmConfig {
2222
versioning?: "independent" | "fixed";
2323
branch?: string;
24+
registries?: RegistryType[];
2425
packages?: PackageConfig[];
2526
changelog?: boolean | string;
2627
changelogFormat?: "default" | "github" | string;

src/types/config.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/unit/config/loader.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from "node:path";
22
import { describe, expect, it } from "vitest";
3-
import { defineConfig, loadConfig } from "../../../src/config/loader.js";
3+
import { loadConfig } from "../../../src/config/loader.js";
4+
import { defineConfig } from "../../../src/config/types.js";
45

56
describe("defineConfig", () => {
67
it("returns the config as-is (identity function)", () => {

tests/unit/types/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest";
2-
import type { PackageConfig, PubmConfig } from "../../../src/types/config.js";
2+
import type { PackageConfig, PubmConfig } from "../../../src/config/types.js";
33

44
describe("Config types", () => {
55
it("allows PackageConfig with required fields", () => {

0 commit comments

Comments
 (0)