Skip to content

Commit 1b53c2d

Browse files
authored
feat: make defaultPackage optional (#69)
1 parent 172d4b9 commit 1b53c2d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/publish.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const publish: typeof def = async ({
2525

2626
if (version.startsWith("v")) version = version.slice(1);
2727

28+
if (pkgName === undefined)
29+
throw new Error(
30+
`Package name should be specified in tag "${tag}" when defaultPackage is not set`,
31+
);
32+
2833
const { pkg, pkgDir } = getPackageInfo(pkgName, getPkgDir);
2934
if (pkg.version !== version)
3035
throw new Error(

src/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export declare function publish(options: {
2-
defaultPackage: string;
2+
defaultPackage?: string;
33
getPkgDir?: (pkg: string) => string;
44
/**
55
* Enables npm package provenance https://docs.npmjs.com/generating-provenance-statements

0 commit comments

Comments
 (0)