pubm 0.2.12 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE +191 -21
  2. package/README.md +126 -63
  3. package/bin/cli.js +53 -8346
  4. package/dist/changeset/bump-utils.d.ts +3 -0
  5. package/dist/changeset/changelog.d.ts +11 -0
  6. package/dist/changeset/index.d.ts +8 -0
  7. package/dist/changeset/migrate.d.ts +7 -0
  8. package/dist/changeset/parser.d.ts +11 -0
  9. package/dist/changeset/reader.d.ts +2 -0
  10. package/dist/changeset/status.d.ts +12 -0
  11. package/dist/changeset/version.d.ts +7 -0
  12. package/dist/changeset/writer.d.ts +4 -0
  13. package/dist/commands/add.d.ts +2 -0
  14. package/dist/commands/changesets.d.ts +2 -0
  15. package/dist/commands/init.d.ts +2 -0
  16. package/dist/commands/migrate.d.ts +2 -0
  17. package/dist/commands/pre.d.ts +2 -0
  18. package/dist/commands/secrets.d.ts +2 -0
  19. package/dist/commands/snapshot.d.ts +2 -0
  20. package/dist/commands/status.d.ts +2 -0
  21. package/dist/commands/sync.d.ts +10 -0
  22. package/dist/commands/update.d.ts +2 -0
  23. package/dist/commands/version-cmd.d.ts +6 -0
  24. package/dist/config/defaults.d.ts +2 -0
  25. package/dist/config/index.d.ts +4 -0
  26. package/dist/config/loader.d.ts +2 -0
  27. package/dist/config/types.d.ts +47 -0
  28. package/dist/ecosystem/ecosystem.d.ts +12 -0
  29. package/dist/ecosystem/index.d.ts +6 -0
  30. package/dist/ecosystem/js.d.ts +13 -0
  31. package/dist/ecosystem/rust.d.ts +21 -0
  32. package/dist/error.d.ts +7 -0
  33. package/dist/git.d.ts +32 -0
  34. package/dist/index.cjs +24057 -4019
  35. package/dist/index.d.ts +20 -281
  36. package/dist/index.js +23969 -3935
  37. package/dist/monorepo/dependency-graph.d.ts +17 -0
  38. package/dist/monorepo/discover.d.ts +15 -0
  39. package/dist/monorepo/groups.d.ts +17 -0
  40. package/dist/monorepo/index.d.ts +4 -0
  41. package/dist/monorepo/workspace.d.ts +5 -0
  42. package/dist/options.d.ts +3 -0
  43. package/dist/plugin/index.d.ts +2 -0
  44. package/dist/plugin/runner.d.ts +14 -0
  45. package/dist/plugin/types.d.ts +47 -0
  46. package/dist/plugins/external-version-sync/index.d.ts +4 -0
  47. package/dist/plugins/external-version-sync/sync.d.ts +2 -0
  48. package/dist/plugins/external-version-sync/types.d.ts +14 -0
  49. package/dist/prerelease/index.d.ts +2 -0
  50. package/dist/prerelease/pre.d.ts +11 -0
  51. package/dist/prerelease/snapshot.d.ts +8 -0
  52. package/dist/registry/crates.d.ts +17 -0
  53. package/dist/registry/custom-registry.d.ts +5 -0
  54. package/dist/registry/index.d.ts +3 -0
  55. package/dist/registry/jsr.d.ts +36 -0
  56. package/dist/registry/npm.d.ts +25 -0
  57. package/dist/registry/registry.d.ts +20 -0
  58. package/dist/tasks/crates.d.ts +6 -0
  59. package/dist/tasks/custom-registry.d.ts +0 -0
  60. package/dist/tasks/dry-run-publish.d.ts +6 -0
  61. package/dist/tasks/github-release.d.ts +19 -0
  62. package/dist/tasks/jsr.d.ts +9 -0
  63. package/dist/tasks/npm.d.ts +4 -0
  64. package/dist/tasks/preflight.d.ts +3 -0
  65. package/dist/tasks/prerequisites-check.d.ts +3 -0
  66. package/dist/tasks/required-conditions-check.d.ts +3 -0
  67. package/dist/tasks/required-missing-information.d.ts +7 -0
  68. package/dist/tasks/runner.d.ts +10 -0
  69. package/dist/types/jsr-api.d.ts +91 -0
  70. package/dist/types/jsr-json.d.ts +10 -0
  71. package/dist/types/options.d.ts +115 -0
  72. package/dist/types/package-json.d.ts +84 -0
  73. package/dist/utils/cli.d.ts +2 -0
  74. package/dist/utils/crate-graph.d.ts +1 -0
  75. package/dist/utils/db.d.ts +6 -0
  76. package/dist/utils/engine-version.d.ts +2 -0
  77. package/dist/utils/exec.d.ts +23 -0
  78. package/dist/utils/listr.d.ts +2 -0
  79. package/dist/utils/notify-new-version.d.ts +1 -0
  80. package/dist/utils/open-url.d.ts +1 -0
  81. package/dist/utils/package-manager.d.ts +3 -0
  82. package/dist/utils/package-name.d.ts +4 -0
  83. package/dist/utils/package.d.ts +23 -0
  84. package/dist/utils/registries.d.ts +8 -0
  85. package/dist/utils/rollback.d.ts +6 -0
  86. package/dist/utils/runtime.d.ts +3 -0
  87. package/dist/utils/secure-store.d.ts +6 -0
  88. package/dist/utils/spawn-interactive.d.ts +10 -0
  89. package/dist/utils/token.d.ts +12 -0
  90. package/dist/validate/entry-points.d.ts +5 -0
  91. package/dist/validate/extraneous-files.d.ts +5 -0
  92. package/dist/validate/index.d.ts +2 -0
  93. package/package.json +30 -23
  94. package/postinstall.cjs +42 -0
  95. package/dist/index.d.cts +0 -291
@@ -0,0 +1,17 @@
1
+ export interface PackageNode {
2
+ name: string;
3
+ version: string;
4
+ path: string;
5
+ dependencies: Record<string, string>;
6
+ }
7
+ /**
8
+ * Builds an adjacency list of internal dependencies only.
9
+ * Each key is a package name, and the value is an array of internal package names it depends on.
10
+ */
11
+ export declare function buildDependencyGraph(packages: PackageNode[]): Map<string, string[]>;
12
+ /**
13
+ * Topological sort using Kahn's algorithm.
14
+ * Returns packages in dependency order (dependencies first).
15
+ * Throws an error if circular dependencies are detected.
16
+ */
17
+ export declare function topologicalSort(graph: Map<string, string[]>): string[];
@@ -0,0 +1,15 @@
1
+ import type { PackageConfig } from "../config/types.js";
2
+ import type { RegistryType } from "../types/options.js";
3
+ type EcosystemType = "js" | "rust";
4
+ export interface DiscoverOptions {
5
+ cwd: string;
6
+ ignore?: string[];
7
+ configPackages?: PackageConfig[];
8
+ }
9
+ export interface DiscoveredPackage {
10
+ path: string;
11
+ registries: RegistryType[];
12
+ ecosystem: EcosystemType;
13
+ }
14
+ export declare function discoverPackages(options: DiscoverOptions): DiscoveredPackage[];
15
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { BumpType } from "../changeset/parser.js";
2
+ /**
3
+ * Resolves glob patterns in groups to actual package names.
4
+ * Exact names are passed through; glob patterns are matched against allPackages.
5
+ */
6
+ export declare function resolveGroups(groups: string[][], allPackages: string[]): string[][];
7
+ /**
8
+ * Fixed group: all packages in the group get the maximum bump type,
9
+ * even those without changesets. If no packages in the group have bumps,
10
+ * nothing is changed.
11
+ */
12
+ export declare function applyFixedGroup(bumps: Map<string, BumpType>, group: string[]): void;
13
+ /**
14
+ * Linked group: only packages that already have bumps get aligned
15
+ * to the maximum bump type. Packages without bumps are not added.
16
+ */
17
+ export declare function applyLinkedGroup(bumps: Map<string, BumpType>, group: string[]): void;
@@ -0,0 +1,4 @@
1
+ export { buildDependencyGraph, type PackageNode, topologicalSort, } from "./dependency-graph.js";
2
+ export { type DiscoveredPackage, type DiscoverOptions, discoverPackages, } from "./discover.js";
3
+ export { applyFixedGroup, applyLinkedGroup, resolveGroups } from "./groups.js";
4
+ export { detectWorkspace, type WorkspaceInfo } from "./workspace.js";
@@ -0,0 +1,5 @@
1
+ export interface WorkspaceInfo {
2
+ type: "pnpm" | "npm" | "yarn";
3
+ patterns: string[];
4
+ }
5
+ export declare function detectWorkspace(cwd?: string): WorkspaceInfo | null;
@@ -0,0 +1,3 @@
1
+ import type { Options, ResolvedOptions } from "./types/options.js";
2
+ export declare const defaultOptions: Omit<Options, "version">;
3
+ export declare function resolveOptions(options: Options): ResolvedOptions;
@@ -0,0 +1,2 @@
1
+ export { PluginRunner } from "./runner.js";
2
+ export type { AfterReleaseHookFn, ErrorHookFn, HookFn, HookName, PluginCommand, PluginCommandOption, PluginHooks, PluginSubcommand, PubmPlugin, } from "./types.js";
@@ -0,0 +1,14 @@
1
+ import type { Ecosystem } from "../ecosystem/ecosystem.js";
2
+ import type { Registry } from "../registry/registry.js";
3
+ import type { ReleaseContext } from "../tasks/github-release.js";
4
+ import type { Ctx } from "../tasks/runner.js";
5
+ import type { HookName, PubmPlugin } from "./types.js";
6
+ export declare class PluginRunner {
7
+ private plugins;
8
+ constructor(plugins: PubmPlugin[]);
9
+ runHook(hookName: Exclude<HookName, "onError" | "afterRelease">, ctx: Ctx): Promise<void>;
10
+ runErrorHook(ctx: Ctx, error: Error): Promise<void>;
11
+ runAfterReleaseHook(ctx: Ctx, releaseCtx: ReleaseContext): Promise<void>;
12
+ collectRegistries(): Registry[];
13
+ collectEcosystems(): Ecosystem[];
14
+ }
@@ -0,0 +1,47 @@
1
+ import type { Ecosystem } from "../ecosystem/ecosystem.js";
2
+ import type { Registry } from "../registry/registry.js";
3
+ import type { ReleaseContext } from "../tasks/github-release.js";
4
+ import type { Ctx } from "../tasks/runner.js";
5
+ export type HookFn = (ctx: Ctx) => Promise<void> | void;
6
+ export type ErrorHookFn = (ctx: Ctx, error: Error) => Promise<void> | void;
7
+ export type AfterReleaseHookFn = (ctx: Ctx, releaseCtx: ReleaseContext) => Promise<void> | void;
8
+ export interface PluginHooks {
9
+ beforeTest?: HookFn;
10
+ afterTest?: HookFn;
11
+ beforeBuild?: HookFn;
12
+ afterBuild?: HookFn;
13
+ beforeVersion?: HookFn;
14
+ afterVersion?: HookFn;
15
+ beforePublish?: HookFn;
16
+ afterPublish?: HookFn;
17
+ beforePush?: HookFn;
18
+ afterPush?: HookFn;
19
+ afterRelease?: AfterReleaseHookFn;
20
+ onError?: ErrorHookFn;
21
+ onRollback?: HookFn;
22
+ onSuccess?: HookFn;
23
+ }
24
+ export type HookName = keyof PluginHooks;
25
+ export interface PluginCommandOption {
26
+ name: string;
27
+ description: string;
28
+ required?: boolean;
29
+ }
30
+ export interface PluginSubcommand {
31
+ name: string;
32
+ description: string;
33
+ options?: PluginCommandOption[];
34
+ action: (args: Record<string, unknown>) => Promise<void>;
35
+ }
36
+ export interface PluginCommand {
37
+ name: string;
38
+ description: string;
39
+ subcommands?: PluginSubcommand[];
40
+ }
41
+ export interface PubmPlugin {
42
+ name: string;
43
+ registries?: Registry[];
44
+ ecosystems?: Ecosystem[];
45
+ hooks?: PluginHooks;
46
+ commands?: PluginCommand[];
47
+ }
@@ -0,0 +1,4 @@
1
+ import type { PubmPlugin } from "../../plugin/types.js";
2
+ import type { ExternalVersionSyncOptions } from "./types.js";
3
+ export type { ExternalVersionSyncOptions, JsonTarget, RegexTarget, SyncTarget, } from "./types.js";
4
+ export declare function externalVersionSync(options: ExternalVersionSyncOptions): PubmPlugin;
@@ -0,0 +1,2 @@
1
+ import type { SyncTarget } from "./types.js";
2
+ export declare function syncVersionInFile(filePath: string, newVersion: string, target: SyncTarget): boolean;
@@ -0,0 +1,14 @@
1
+ export interface JsonTarget {
2
+ file: string;
3
+ jsonPath: string;
4
+ }
5
+ export interface RegexTarget {
6
+ file: string;
7
+ pattern: RegExp;
8
+ }
9
+ export type SyncTarget = JsonTarget | RegexTarget;
10
+ export interface ExternalVersionSyncOptions {
11
+ targets: SyncTarget[];
12
+ }
13
+ export declare function isJsonTarget(target: SyncTarget): target is JsonTarget;
14
+ export declare function isRegexTarget(target: SyncTarget): target is RegexTarget;
@@ -0,0 +1,2 @@
1
+ export { enterPreMode, exitPreMode, type PreState, readPreState, } from "./pre.js";
2
+ export { generateSnapshotVersion, type SnapshotOptions, } from "./snapshot.js";
@@ -0,0 +1,11 @@
1
+ export interface PreState {
2
+ mode: "pre";
3
+ tag: string;
4
+ packages: Record<string, {
5
+ baseVersion: string;
6
+ iteration: number;
7
+ }>;
8
+ }
9
+ export declare function readPreState(cwd?: string): PreState | null;
10
+ export declare function enterPreMode(tag: string, cwd?: string): void;
11
+ export declare function exitPreMode(cwd?: string): void;
@@ -0,0 +1,8 @@
1
+ export interface SnapshotOptions {
2
+ tag?: string;
3
+ baseVersion?: string;
4
+ useCalculatedVersion?: boolean;
5
+ template?: string;
6
+ commit?: string;
7
+ }
8
+ export declare function generateSnapshotVersion(options: SnapshotOptions): string;
@@ -0,0 +1,17 @@
1
+ import { Registry, type RegistryRequirements } from "./registry.js";
2
+ export declare class CratesRegistry extends Registry {
3
+ registry: string;
4
+ private get headers();
5
+ ping(): Promise<boolean>;
6
+ isInstalled(): Promise<boolean>;
7
+ distTags(): Promise<string[]>;
8
+ version(): Promise<string>;
9
+ publish(manifestDir?: string): Promise<boolean>;
10
+ dryRunPublish(manifestDir?: string): Promise<void>;
11
+ isVersionPublished(version: string): Promise<boolean>;
12
+ isPublished(): Promise<boolean>;
13
+ hasPermission(): Promise<boolean>;
14
+ getRequirements(): RegistryRequirements;
15
+ isPackageNameAvaliable(): Promise<boolean>;
16
+ }
17
+ export declare function cratesRegistry(packageName: string): Promise<CratesRegistry>;
@@ -0,0 +1,5 @@
1
+ import { NpmRegistry } from "./npm.js";
2
+ export declare class CustomRegistry extends NpmRegistry {
3
+ npm(args: string[]): Promise<string>;
4
+ }
5
+ export declare function customRegistry(): Promise<CustomRegistry>;
@@ -0,0 +1,3 @@
1
+ import type { RegistryType } from "../types/options.js";
2
+ import type { Registry } from "./registry.js";
3
+ export declare function getRegistry(registryKey: RegistryType, packageName?: string): Promise<Registry>;
@@ -0,0 +1,36 @@
1
+ import type { JsrApi } from "../types/jsr-api.js";
2
+ import { Registry, type RegistryRequirements } from "./registry.js";
3
+ export declare class JsrRegisry extends Registry {
4
+ registry: string;
5
+ client: JsrClient;
6
+ packageCreationUrls?: string[];
7
+ constructor(packageName: string, registry?: string);
8
+ protected jsr(args: string[]): Promise<string>;
9
+ isInstalled(): Promise<boolean>;
10
+ distTags(): Promise<string[]>;
11
+ ping(): Promise<boolean>;
12
+ publish(): Promise<boolean>;
13
+ dryRunPublish(): Promise<void>;
14
+ version(): Promise<string>;
15
+ isPublished(): Promise<boolean>;
16
+ isVersionPublished(version: string): Promise<boolean>;
17
+ hasPermission(): Promise<boolean>;
18
+ isPackageNameAvaliable(): Promise<boolean>;
19
+ getRequirements(): RegistryRequirements;
20
+ }
21
+ export declare class JsrClient {
22
+ apiEndpoint: string;
23
+ static token: string | null;
24
+ constructor(apiEndpoint: string);
25
+ protected fetch(endpoint: string, init?: RequestInit): Promise<Response>;
26
+ user(): Promise<JsrApi.Users.User | null>;
27
+ scopePermission(scope: string): Promise<JsrApi.Users.Scopes.Permission | null>;
28
+ scopes(): Promise<string[]>;
29
+ package(packageName: string): Promise<JsrApi.Scopes.Packages.Package | null>;
30
+ createScope(scope: string): Promise<boolean>;
31
+ deleteScope(scope: string): Promise<boolean>;
32
+ createPackage(packageName: string): Promise<boolean>;
33
+ deletePackage(packageName: string): Promise<boolean>;
34
+ searchPackage(query: string): Promise<JsrApi.Packages>;
35
+ }
36
+ export declare function jsrRegistry(): Promise<JsrRegisry>;
@@ -0,0 +1,25 @@
1
+ import { Registry, type RegistryRequirements } from "./registry.js";
2
+ export declare class NpmRegistry extends Registry {
3
+ registry: string;
4
+ protected npm(args: string[]): Promise<string>;
5
+ isInstalled(): Promise<boolean>;
6
+ installGlobally(packageName: string): Promise<boolean>;
7
+ isPublished(): Promise<boolean>;
8
+ isVersionPublished(version: string): Promise<boolean>;
9
+ userName(): Promise<string>;
10
+ isLoggedIn(): Promise<boolean>;
11
+ collaborators(): Promise<Record<string, string>>;
12
+ hasPermission(): Promise<boolean>;
13
+ distTags(): Promise<string[]>;
14
+ version(): Promise<string>;
15
+ ping(): Promise<boolean>;
16
+ publishProvenance(): Promise<boolean>;
17
+ publish(otp?: string): Promise<boolean>;
18
+ dryRunPublish(): Promise<void>;
19
+ twoFactorAuthMode(): Promise<string | null>;
20
+ isPackageNameAvaliable(): Promise<boolean>;
21
+ getRequirements(): RegistryRequirements;
22
+ private isProvenanceError;
23
+ private classifyPublishError;
24
+ }
25
+ export declare function npmRegistry(): Promise<NpmRegistry>;
@@ -0,0 +1,20 @@
1
+ export interface RegistryRequirements {
2
+ needsPackageScripts: boolean;
3
+ requiredManifest: string;
4
+ }
5
+ export declare abstract class Registry {
6
+ packageName: string;
7
+ registry?: string | undefined;
8
+ constructor(packageName: string, registry?: string | undefined);
9
+ abstract ping(): Promise<boolean>;
10
+ abstract isInstalled(): Promise<boolean>;
11
+ abstract distTags(): Promise<string[]>;
12
+ abstract version(): Promise<string>;
13
+ abstract publish(): Promise<boolean>;
14
+ abstract isPublished(): Promise<boolean>;
15
+ abstract isVersionPublished(version: string): Promise<boolean>;
16
+ abstract hasPermission(): Promise<boolean>;
17
+ abstract isPackageNameAvaliable(): Promise<boolean>;
18
+ abstract getRequirements(): RegistryRequirements;
19
+ dryRunPublish(_manifestDir?: string): Promise<void>;
20
+ }
@@ -0,0 +1,6 @@
1
+ import type { ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ export declare function createCratesAvailableCheckTask(packagePath?: string): ListrTask<Ctx>;
4
+ export declare function createCratesPublishTask(packagePath?: string): ListrTask<Ctx>;
5
+ export declare const cratesAvailableCheckTasks: ListrTask<Ctx>;
6
+ export declare const cratesPublishTasks: ListrTask<Ctx>;
File without changes
@@ -0,0 +1,6 @@
1
+ import type { ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ export declare const npmDryRunPublishTask: ListrTask<Ctx>;
4
+ export declare const jsrDryRunPublishTask: ListrTask<Ctx>;
5
+ export declare function createCratesDryRunPublishTask(packagePath?: string, siblingCrateNames?: string[]): ListrTask<Ctx>;
6
+ export declare const cratesDryRunPublishTask: ListrTask<Ctx>;
@@ -0,0 +1,19 @@
1
+ export interface ReleaseAsset {
2
+ name: string;
3
+ url: string;
4
+ sha256: string;
5
+ }
6
+ export interface ReleaseContext {
7
+ version: string;
8
+ tag: string;
9
+ releaseUrl: string;
10
+ assets: ReleaseAsset[];
11
+ }
12
+ interface Ctx {
13
+ version: string;
14
+ }
15
+ /**
16
+ * Create a GitHub Release using the GitHub REST API
17
+ */
18
+ export declare function createGitHubRelease(ctx: Ctx): Promise<ReleaseContext>;
19
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ interface JsrCtx extends Ctx {
4
+ scopeCreated?: boolean;
5
+ packageCreated?: boolean;
6
+ }
7
+ export declare const jsrAvailableCheckTasks: ListrTask<JsrCtx>;
8
+ export declare const jsrPublishTasks: ListrTask<Ctx>;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ export declare const npmAvailableCheckTasks: ListrTask<Ctx>;
4
+ export declare const npmPublishTasks: ListrTask<Ctx>;
@@ -0,0 +1,3 @@
1
+ export declare function collectTokens(registries: string[], task: any): Promise<Record<string, string>>;
2
+ export declare function syncGhSecrets(tokens: Record<string, string>): Promise<void>;
3
+ export declare function promptGhSecretsSync(tokens: Record<string, string>, task: any): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { Listr, ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ export declare const prerequisitesCheckTask: (options?: Omit<ListrTask<Ctx>, "title" | "task">) => Listr<Ctx>;
@@ -0,0 +1,3 @@
1
+ import type { Listr, ListrTask } from "listr2";
2
+ import type { Ctx } from "./runner.js";
3
+ export declare const requiredConditionsCheckTask: (options?: Omit<ListrTask<Ctx>, "title" | "task">) => Listr<Ctx>;
@@ -0,0 +1,7 @@
1
+ import { type Listr, type ListrTask } from "listr2";
2
+ interface Ctx {
3
+ version?: string;
4
+ tag: string;
5
+ }
6
+ export declare const requiredMissingInformationTasks: (options?: Omit<ListrTask<Ctx>, "title" | "task">) => Listr<Ctx>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { PluginRunner } from "../plugin/runner.js";
2
+ import type { ResolvedOptions } from "../types/options.js";
3
+ import { type ReleaseContext } from "./github-release.js";
4
+ export interface Ctx extends ResolvedOptions {
5
+ promptEnabled: boolean;
6
+ cleanWorkingTree: boolean;
7
+ pluginRunner: PluginRunner;
8
+ releaseContext?: ReleaseContext;
9
+ }
10
+ export declare function run(options: ResolvedOptions): Promise<void>;
@@ -0,0 +1,91 @@
1
+ export interface PackageInterface {
2
+ scope: string;
3
+ name: string;
4
+ description: string;
5
+ runtimeCompat: RuntimeCompat;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ githubRepository: GithubRepository;
9
+ score: number;
10
+ }
11
+ export interface RuntimeCompat {
12
+ browser: boolean;
13
+ deno: boolean;
14
+ node: boolean;
15
+ workerd: boolean;
16
+ bun: boolean;
17
+ }
18
+ export interface GithubRepository {
19
+ owner: string;
20
+ name: string;
21
+ }
22
+ export interface Scope {
23
+ scope: string;
24
+ creator: Creator;
25
+ quotas: Quotas;
26
+ ghActionsVerifyActor: boolean;
27
+ requirePublishingFromCI: boolean;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ }
31
+ export interface Creator {
32
+ id: string;
33
+ name: string;
34
+ email: string;
35
+ avatarUrl: string;
36
+ githubId: number;
37
+ isBlocked: boolean;
38
+ isStaff: boolean;
39
+ scopeUsage: number;
40
+ scopeLimit: number;
41
+ inviteCount: number;
42
+ createdAt: string;
43
+ updatedAt: string;
44
+ }
45
+ export interface Quotas {
46
+ packageUsage: number;
47
+ packageLimit: number;
48
+ newPackagePerWeekUsage: number;
49
+ newPackagePerWeekLimit: number;
50
+ publishAttemptsPerWeekUsage: number;
51
+ publishAttemptsPerWeekLimit: number;
52
+ }
53
+ export interface UserInfo {
54
+ id: string;
55
+ name: string;
56
+ email: string;
57
+ avatarUrl: string;
58
+ githubId: number;
59
+ isBlocked: boolean;
60
+ isStaff: boolean;
61
+ scopeUsage: number;
62
+ scopeLimit: number;
63
+ inviteCount: number;
64
+ createdAt: string;
65
+ updatedAt: string;
66
+ }
67
+ export interface PermissionInfo {
68
+ scope: string;
69
+ user: UserInfo;
70
+ isAdmin: boolean;
71
+ createdAt: string;
72
+ updatedAt: string;
73
+ }
74
+ export declare namespace JsrApi {
75
+ interface Packages {
76
+ items: PackageInterface[];
77
+ total: number;
78
+ }
79
+ namespace Scopes {
80
+ namespace Packages {
81
+ type Package = PackageInterface;
82
+ }
83
+ }
84
+ namespace Users {
85
+ type User = UserInfo;
86
+ type Scopes = Scope[];
87
+ namespace Scopes {
88
+ type Permission = PermissionInfo;
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,10 @@
1
+ export interface JsrJson {
2
+ name: string;
3
+ version: string;
4
+ exports: string | Record<string, string>;
5
+ publish?: {
6
+ include?: string[];
7
+ exclude?: string[];
8
+ };
9
+ [k: string]: unknown;
10
+ }
@@ -0,0 +1,115 @@
1
+ import type { PackageConfig } from "../config/types.js";
2
+ import type { PluginRunner } from "../plugin/runner.js";
3
+ export type RegistryType = "npm" | "jsr" | "crates" | string;
4
+ /**
5
+ * Options for configuring the {@linkcode pubm} function.
6
+ */
7
+ export interface Options {
8
+ /**
9
+ * @description Version to publish
10
+ */
11
+ version: string;
12
+ /**
13
+ * @description The npm script to run tests before publishing
14
+ * @default "test"
15
+ */
16
+ testScript?: string;
17
+ /**
18
+ * @description The npm script to run build before publishing
19
+ * @default "build"
20
+ */
21
+ buildScript?: string;
22
+ /**
23
+ * @description Run tasks without actually publishing
24
+ * @default false
25
+ */
26
+ preview?: boolean;
27
+ /**
28
+ * @description Target branch for the release
29
+ * @default "main"
30
+ */
31
+ branch?: string;
32
+ /**
33
+ * @description Allow publishing from any branch
34
+ * @default false
35
+ */
36
+ anyBranch?: boolean;
37
+ /**
38
+ * @description Skip running tests before publishing
39
+ * @default false
40
+ */
41
+ skipTests?: boolean;
42
+ /**
43
+ * @description Skip build before publishing
44
+ * @default false
45
+ */
46
+ skipBuild?: boolean;
47
+ /**
48
+ * @description Skip publishing task
49
+ * @default false
50
+ */
51
+ skipPublish?: boolean;
52
+ /**
53
+ * @description Skip creating a GitHub release draft
54
+ * @default false
55
+ */
56
+ skipReleaseDraft?: boolean;
57
+ /**
58
+ * @description Skip prerequisites check task
59
+ * @default false
60
+ */
61
+ skipPrerequisitesCheck?: boolean;
62
+ /**
63
+ * @description Skip required conditions check task
64
+ * @default false
65
+ */
66
+ skipConditionsCheck?: boolean;
67
+ /**
68
+ * @description Run only publish task for latest tag
69
+ * @default false
70
+ */
71
+ publishOnly?: boolean;
72
+ /**
73
+ * @description CI mode: publish from latest tag and create GitHub Release with assets
74
+ * @default false
75
+ */
76
+ ci?: boolean;
77
+ /**
78
+ * @description Simulate CI publish locally (dry-run with token-based auth)
79
+ * @default false
80
+ */
81
+ preflight?: boolean;
82
+ /**
83
+ * @description Publish under a specific dist-tag
84
+ * @default "latest"
85
+ */
86
+ tag?: string;
87
+ /**
88
+ * @description Subdirectory to publish
89
+ */
90
+ contents?: string;
91
+ /**
92
+ * @description Do not save jsr tokens (request the token each time)
93
+ * @default true
94
+ */
95
+ saveToken?: boolean;
96
+ /**
97
+ * @description Target registries for publish
98
+ * @default ['npm', 'jsr']
99
+ */
100
+ registries?: RegistryType[];
101
+ /**
102
+ * @description Per-package publish configuration (from pubm.config.ts)
103
+ */
104
+ packages?: PackageConfig[];
105
+ }
106
+ export interface ResolvedOptions extends Options {
107
+ testScript: string;
108
+ buildScript: string;
109
+ branch: string;
110
+ tag: string;
111
+ saveToken: boolean;
112
+ registries: RegistryType[];
113
+ packages?: PackageConfig[];
114
+ pluginRunner?: PluginRunner;
115
+ }