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,3 @@
1
+ import type { BumpType } from "./parser.js";
2
+ export declare const BUMP_ORDER: Record<BumpType, number>;
3
+ export declare function maxBump(a: BumpType, b: BumpType): BumpType;
@@ -0,0 +1,11 @@
1
+ import type { BumpType } from "./parser.js";
2
+ export interface ChangelogEntry {
3
+ summary: string;
4
+ type: BumpType;
5
+ id: string;
6
+ }
7
+ export interface DependencyUpdate {
8
+ name: string;
9
+ version: string;
10
+ }
11
+ export declare function generateChangelog(version: string, entries: ChangelogEntry[], depUpdates?: DependencyUpdate[]): string;
@@ -0,0 +1,8 @@
1
+ export { BUMP_ORDER, maxBump } from "./bump-utils.js";
2
+ export { type ChangelogEntry, type DependencyUpdate, generateChangelog, } from "./changelog.js";
3
+ export { type MigrationResult, migrateFromChangesets } from "./migrate.js";
4
+ export { type BumpType, type Changeset, parseChangeset, type Release, } from "./parser.js";
5
+ export { readChangesets } from "./reader.js";
6
+ export { getStatus, type PackageStatus, type Status } from "./status.js";
7
+ export { calculateVersionBumps, type VersionBump } from "./version.js";
8
+ export { generateChangesetContent, generateChangesetId, writeChangeset, } from "./writer.js";
@@ -0,0 +1,7 @@
1
+ export interface MigrationResult {
2
+ success: boolean;
3
+ error?: string;
4
+ migratedFiles: string[];
5
+ configMigrated: boolean;
6
+ }
7
+ export declare function migrateFromChangesets(cwd?: string): MigrationResult;
@@ -0,0 +1,11 @@
1
+ export type BumpType = "patch" | "minor" | "major";
2
+ export interface Release {
3
+ name: string;
4
+ type: BumpType;
5
+ }
6
+ export interface Changeset {
7
+ id: string;
8
+ summary: string;
9
+ releases: Release[];
10
+ }
11
+ export declare function parseChangeset(content: string, fileName: string): Changeset;
@@ -0,0 +1,2 @@
1
+ import type { Changeset } from "./parser.js";
2
+ export declare function readChangesets(cwd?: string): Changeset[];
@@ -0,0 +1,12 @@
1
+ import type { BumpType, Changeset } from "./parser.js";
2
+ export interface PackageStatus {
3
+ bumpType: BumpType;
4
+ changesetCount: number;
5
+ summaries: string[];
6
+ }
7
+ export interface Status {
8
+ packages: Map<string, PackageStatus>;
9
+ changesets: Changeset[];
10
+ hasChangesets: boolean;
11
+ }
12
+ export declare function getStatus(cwd?: string): Status;
@@ -0,0 +1,7 @@
1
+ import type { BumpType } from "./parser.js";
2
+ export interface VersionBump {
3
+ currentVersion: string;
4
+ newVersion: string;
5
+ bumpType: BumpType;
6
+ }
7
+ export declare function calculateVersionBumps(currentVersions: Map<string, string>, cwd?: string): Map<string, VersionBump>;
@@ -0,0 +1,4 @@
1
+ import type { Release } from "./parser.js";
2
+ export declare function generateChangesetId(): string;
3
+ export declare function generateChangesetContent(releases: Release[], summary: string): string;
4
+ export declare function writeChangeset(releases: Release[], summary: string, cwd?: string): string;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerAddCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerChangesetsCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerInitCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerMigrateCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerPreCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerSecretsCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerSnapshotCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerStatusCommand(parent: Command): void;
@@ -0,0 +1,10 @@
1
+ import type { Command } from "commander";
2
+ export interface DiscoveredReference {
3
+ file: string;
4
+ type: "json" | "pattern";
5
+ jsonPath?: string;
6
+ match?: string;
7
+ line?: number;
8
+ }
9
+ export declare function discoverVersionReferences(cwd: string, currentVersion: string): Promise<DiscoveredReference[]>;
10
+ export declare function registerSyncCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerUpdateCommand(parent: Command): void;
@@ -0,0 +1,6 @@
1
+ import type { Command } from "commander";
2
+ export interface VersionCommandOptions {
3
+ dryRun?: boolean;
4
+ }
5
+ export declare function runVersionCommand(cwd: string, options?: VersionCommandOptions): Promise<void>;
6
+ export declare function registerVersionCommand(parent: Command): void;
@@ -0,0 +1,2 @@
1
+ import type { PubmConfig, ResolvedPubmConfig } from "./types.js";
2
+ export declare function resolveConfig(config: PubmConfig): ResolvedPubmConfig;
@@ -0,0 +1,4 @@
1
+ export { resolveConfig } from "./defaults.js";
2
+ export { loadConfig } from "./loader.js";
3
+ export type { PackageConfig, PubmConfig, ResolvedPubmConfig, SnapshotConfig, ValidateConfig, } from "./types.js";
4
+ export { defineConfig } from "./types.js";
@@ -0,0 +1,2 @@
1
+ import type { PubmConfig } from "./types.js";
2
+ export declare function loadConfig(cwd?: string): Promise<PubmConfig | null>;
@@ -0,0 +1,47 @@
1
+ import type { PubmPlugin } from "../plugin/types.js";
2
+ import type { RegistryType } from "../types/options.js";
3
+ export interface PackageConfig {
4
+ path: string;
5
+ registries: RegistryType[];
6
+ ecosystem?: "js" | "rust";
7
+ buildCommand?: string;
8
+ testCommand?: string;
9
+ }
10
+ export interface ValidateConfig {
11
+ cleanInstall?: boolean;
12
+ entryPoints?: boolean;
13
+ extraneousFiles?: boolean;
14
+ }
15
+ export interface SnapshotConfig {
16
+ useCalculatedVersion?: boolean;
17
+ prereleaseTemplate?: string;
18
+ }
19
+ export interface PubmConfig {
20
+ versioning?: "independent" | "fixed";
21
+ branch?: string;
22
+ registries?: RegistryType[];
23
+ packages?: PackageConfig[];
24
+ changelog?: boolean | string;
25
+ changelogFormat?: "default" | "github" | string;
26
+ commit?: boolean;
27
+ access?: "public" | "restricted";
28
+ fixed?: string[][];
29
+ linked?: string[][];
30
+ updateInternalDependencies?: "patch" | "minor";
31
+ ignore?: string[];
32
+ validate?: ValidateConfig;
33
+ snapshot?: SnapshotConfig;
34
+ tag?: string;
35
+ contents?: string;
36
+ saveToken?: boolean;
37
+ releaseDraft?: boolean;
38
+ releaseNotes?: boolean;
39
+ rollbackStrategy?: "individual" | "all";
40
+ plugins?: PubmPlugin[];
41
+ }
42
+ export interface ResolvedPubmConfig extends Required<Omit<PubmConfig, "packages" | "validate" | "snapshot">> {
43
+ packages: PackageConfig[];
44
+ validate: Required<ValidateConfig>;
45
+ snapshot: Required<SnapshotConfig>;
46
+ }
47
+ export declare function defineConfig(config: PubmConfig): PubmConfig;
@@ -0,0 +1,12 @@
1
+ import type { RegistryType } from "../types/options.js";
2
+ export declare abstract class Ecosystem {
3
+ packagePath: string;
4
+ constructor(packagePath: string);
5
+ abstract packageName(): Promise<string>;
6
+ abstract readVersion(): Promise<string>;
7
+ abstract writeVersion(newVersion: string): Promise<void>;
8
+ abstract manifestFiles(): string[];
9
+ abstract defaultTestCommand(): Promise<string> | string;
10
+ abstract defaultBuildCommand(): Promise<string> | string;
11
+ abstract supportedRegistries(): RegistryType[];
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { RegistryType } from "../types/options.js";
2
+ import type { Ecosystem } from "./ecosystem.js";
3
+ export declare function detectEcosystem(packagePath: string, registries?: RegistryType[]): Promise<Ecosystem | null>;
4
+ export { Ecosystem } from "./ecosystem.js";
5
+ export { JsEcosystem } from "./js.js";
6
+ export { RustEcosystem } from "./rust.js";
@@ -0,0 +1,13 @@
1
+ import type { RegistryType } from "../types/options.js";
2
+ import { Ecosystem } from "./ecosystem.js";
3
+ export declare class JsEcosystem extends Ecosystem {
4
+ static detect(packagePath: string): Promise<boolean>;
5
+ private readPackageJson;
6
+ packageName(): Promise<string>;
7
+ readVersion(): Promise<string>;
8
+ writeVersion(newVersion: string): Promise<void>;
9
+ manifestFiles(): string[];
10
+ defaultTestCommand(): Promise<string>;
11
+ defaultBuildCommand(): Promise<string>;
12
+ supportedRegistries(): RegistryType[];
13
+ }
@@ -0,0 +1,21 @@
1
+ import type { RegistryType } from "../types/options.js";
2
+ import { Ecosystem } from "./ecosystem.js";
3
+ export declare class RustEcosystem extends Ecosystem {
4
+ static detect(packagePath: string): Promise<boolean>;
5
+ private readCargoToml;
6
+ packageName(): Promise<string>;
7
+ readVersion(): Promise<string>;
8
+ writeVersion(newVersion: string): Promise<void>;
9
+ /**
10
+ * Update the `version` field of dependencies that match sibling crate names.
11
+ * This ensures `cargo publish` works when crates depend on each other via path.
12
+ */
13
+ updateSiblingDependencyVersions(siblingVersions: Map<string, string>): Promise<boolean>;
14
+ syncLockfile(): Promise<string | undefined>;
15
+ private findLockfile;
16
+ dependencies(): Promise<string[]>;
17
+ manifestFiles(): string[];
18
+ defaultTestCommand(): string;
19
+ defaultBuildCommand(): string;
20
+ supportedRegistries(): RegistryType[];
21
+ }
@@ -0,0 +1,7 @@
1
+ export declare class AbstractError extends Error {
2
+ cause?: unknown;
3
+ constructor(message: string, { cause }?: {
4
+ cause?: unknown;
5
+ });
6
+ }
7
+ export declare function consoleError(error: string | Error): void;
package/dist/git.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ export declare class Git {
2
+ git(args: string[]): Promise<string>;
3
+ userName(): Promise<string>;
4
+ latestTag(): Promise<string | null>;
5
+ tags(): Promise<string[]>;
6
+ previousTag(tag: string): Promise<string | null>;
7
+ dryFetch(): Promise<string>;
8
+ fetch(): Promise<boolean>;
9
+ pull(): Promise<boolean>;
10
+ revisionDiffsCount(): Promise<number>;
11
+ status(): Promise<string>;
12
+ commits(leftRev: string, rightRev: string): Promise<{
13
+ id: string;
14
+ message: string;
15
+ }[]>;
16
+ version(): Promise<string>;
17
+ branch(): Promise<string>;
18
+ switch(branch: string): Promise<boolean>;
19
+ checkTagExist(tag: string): Promise<boolean>;
20
+ deleteTag(tag: string): Promise<boolean>;
21
+ stageAll(): Promise<boolean>;
22
+ stash(): Promise<boolean>;
23
+ popStash(): Promise<boolean>;
24
+ stage(file: string): Promise<boolean>;
25
+ reset(rev?: string, option?: string): Promise<boolean>;
26
+ latestCommit(): Promise<string>;
27
+ firstCommit(): Promise<string>;
28
+ commit(message: string): Promise<string>;
29
+ repository(): Promise<string>;
30
+ createTag(tag: string, commitRev?: string): Promise<boolean>;
31
+ push(options?: string): Promise<boolean>;
32
+ }