pubm 0.2.11 → 0.3.3
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.
- package/LICENSE +191 -21
- package/README.md +126 -63
- package/bin/cli.js +53 -8338
- package/dist/changeset/bump-utils.d.ts +3 -0
- package/dist/changeset/changelog.d.ts +11 -0
- package/dist/changeset/index.d.ts +8 -0
- package/dist/changeset/migrate.d.ts +7 -0
- package/dist/changeset/parser.d.ts +11 -0
- package/dist/changeset/reader.d.ts +2 -0
- package/dist/changeset/status.d.ts +12 -0
- package/dist/changeset/version.d.ts +7 -0
- package/dist/changeset/writer.d.ts +4 -0
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/changesets.d.ts +2 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/pre.d.ts +2 -0
- package/dist/commands/secrets.d.ts +2 -0
- package/dist/commands/snapshot.d.ts +2 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/sync.d.ts +10 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/version-cmd.d.ts +6 -0
- package/dist/config/defaults.d.ts +2 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/config/types.d.ts +47 -0
- package/dist/ecosystem/ecosystem.d.ts +12 -0
- package/dist/ecosystem/index.d.ts +6 -0
- package/dist/ecosystem/js.d.ts +13 -0
- package/dist/ecosystem/rust.d.ts +21 -0
- package/dist/error.d.ts +7 -0
- package/dist/git.d.ts +32 -0
- package/dist/index.cjs +24070 -4016
- package/dist/index.d.ts +20 -281
- package/dist/index.js +23983 -3933
- package/dist/monorepo/dependency-graph.d.ts +17 -0
- package/dist/monorepo/discover.d.ts +15 -0
- package/dist/monorepo/groups.d.ts +17 -0
- package/dist/monorepo/index.d.ts +4 -0
- package/dist/monorepo/workspace.d.ts +5 -0
- package/dist/options.d.ts +3 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/runner.d.ts +14 -0
- package/dist/plugin/types.d.ts +47 -0
- package/dist/plugins/external-version-sync/index.d.ts +4 -0
- package/dist/plugins/external-version-sync/sync.d.ts +2 -0
- package/dist/plugins/external-version-sync/types.d.ts +14 -0
- package/dist/prerelease/index.d.ts +2 -0
- package/dist/prerelease/pre.d.ts +11 -0
- package/dist/prerelease/snapshot.d.ts +8 -0
- package/dist/registry/crates.d.ts +17 -0
- package/dist/registry/custom-registry.d.ts +5 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/jsr.d.ts +36 -0
- package/dist/registry/npm.d.ts +25 -0
- package/dist/registry/registry.d.ts +20 -0
- package/dist/tasks/crates.d.ts +6 -0
- package/dist/tasks/custom-registry.d.ts +0 -0
- package/dist/tasks/dry-run-publish.d.ts +6 -0
- package/dist/tasks/github-release.d.ts +19 -0
- package/dist/tasks/jsr.d.ts +9 -0
- package/dist/tasks/npm.d.ts +4 -0
- package/dist/tasks/preflight.d.ts +3 -0
- package/dist/tasks/prerequisites-check.d.ts +3 -0
- package/dist/tasks/required-conditions-check.d.ts +3 -0
- package/dist/tasks/required-missing-information.d.ts +7 -0
- package/dist/tasks/runner.d.ts +10 -0
- package/dist/types/jsr-api.d.ts +91 -0
- package/dist/types/jsr-json.d.ts +10 -0
- package/dist/types/options.d.ts +115 -0
- package/dist/types/package-json.d.ts +84 -0
- package/dist/utils/cli.d.ts +2 -0
- package/dist/utils/crate-graph.d.ts +1 -0
- package/dist/utils/db.d.ts +6 -0
- package/dist/utils/engine-version.d.ts +2 -0
- package/dist/utils/exec.d.ts +23 -0
- package/dist/utils/listr.d.ts +2 -0
- package/dist/utils/notify-new-version.d.ts +1 -0
- package/dist/utils/open-url.d.ts +1 -0
- package/dist/utils/package-manager.d.ts +3 -0
- package/dist/utils/package-name.d.ts +4 -0
- package/dist/utils/package.d.ts +23 -0
- package/dist/utils/registries.d.ts +8 -0
- package/dist/utils/rollback.d.ts +6 -0
- package/dist/utils/runtime.d.ts +3 -0
- package/dist/utils/secure-store.d.ts +6 -0
- package/dist/utils/spawn-interactive.d.ts +10 -0
- package/dist/utils/token.d.ts +12 -0
- package/dist/validate/entry-points.d.ts +5 -0
- package/dist/validate/extraneous-files.d.ts +5 -0
- package/dist/validate/index.d.ts +2 -0
- package/package.json +30 -23
- package/postinstall.cjs +42 -0
- package/dist/index.d.cts +0 -291
package/dist/index.d.ts
CHANGED
|
@@ -1,281 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
path: string;
|
|
3
|
-
registries: RegistryType[];
|
|
4
|
-
ecosystem?: "js" | "rust";
|
|
5
|
-
buildCommand?: string;
|
|
6
|
-
testCommand?: string;
|
|
7
|
-
}
|
|
8
|
-
interface ValidateConfig {
|
|
9
|
-
cleanInstall?: boolean;
|
|
10
|
-
entryPoints?: boolean;
|
|
11
|
-
extraneousFiles?: boolean;
|
|
12
|
-
}
|
|
13
|
-
interface SnapshotConfig {
|
|
14
|
-
useCalculatedVersion?: boolean;
|
|
15
|
-
prereleaseTemplate?: string;
|
|
16
|
-
}
|
|
17
|
-
interface PubmConfig {
|
|
18
|
-
versioning?: "independent" | "fixed";
|
|
19
|
-
branch?: string;
|
|
20
|
-
registries?: RegistryType[];
|
|
21
|
-
packages?: PackageConfig[];
|
|
22
|
-
changelog?: boolean | string;
|
|
23
|
-
changelogFormat?: "default" | "github" | string;
|
|
24
|
-
commit?: boolean;
|
|
25
|
-
access?: "public" | "restricted";
|
|
26
|
-
fixed?: string[][];
|
|
27
|
-
linked?: string[][];
|
|
28
|
-
updateInternalDependencies?: "patch" | "minor";
|
|
29
|
-
ignore?: string[];
|
|
30
|
-
validate?: ValidateConfig;
|
|
31
|
-
snapshot?: SnapshotConfig;
|
|
32
|
-
tag?: string;
|
|
33
|
-
contents?: string;
|
|
34
|
-
saveToken?: boolean;
|
|
35
|
-
releaseDraft?: boolean;
|
|
36
|
-
releaseNotes?: boolean;
|
|
37
|
-
rollbackStrategy?: "individual" | "all";
|
|
38
|
-
}
|
|
39
|
-
interface ResolvedPubmConfig extends Required<Omit<PubmConfig, "packages" | "validate" | "snapshot">> {
|
|
40
|
-
packages: PackageConfig[];
|
|
41
|
-
validate: Required<ValidateConfig>;
|
|
42
|
-
snapshot: Required<SnapshotConfig>;
|
|
43
|
-
}
|
|
44
|
-
declare function defineConfig(config: PubmConfig): PubmConfig;
|
|
45
|
-
|
|
46
|
-
type RegistryType = "npm" | "jsr" | "crates" | string;
|
|
47
|
-
/**
|
|
48
|
-
* Options for configuring the {@linkcode pubm} function.
|
|
49
|
-
*/
|
|
50
|
-
interface Options {
|
|
51
|
-
/**
|
|
52
|
-
* @description Version to publish
|
|
53
|
-
*/
|
|
54
|
-
version: string;
|
|
55
|
-
/**
|
|
56
|
-
* @description The npm script to run tests before publishing
|
|
57
|
-
* @default "test"
|
|
58
|
-
*/
|
|
59
|
-
testScript?: string;
|
|
60
|
-
/**
|
|
61
|
-
* @description The npm script to run build before publishing
|
|
62
|
-
* @default "build"
|
|
63
|
-
*/
|
|
64
|
-
buildScript?: string;
|
|
65
|
-
/**
|
|
66
|
-
* @description Run tasks without actually publishing
|
|
67
|
-
* @default false
|
|
68
|
-
*/
|
|
69
|
-
preview?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* @description Target branch for the release
|
|
72
|
-
* @default "main"
|
|
73
|
-
*/
|
|
74
|
-
branch?: string;
|
|
75
|
-
/**
|
|
76
|
-
* @description Allow publishing from any branch
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
anyBranch?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* @description Skip running tests before publishing
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
skipTests?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* @description Skip build before publishing
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
skipBuild?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* @description Skip publishing task
|
|
92
|
-
* @default false
|
|
93
|
-
*/
|
|
94
|
-
skipPublish?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* @description Skip creating a GitHub release draft
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
skipReleaseDraft?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* @description Skip prerequisites check task
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
skipPrerequisitesCheck?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* @description Skip required conditions check task
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
skipConditionsCheck?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* @description Run only publish task for latest tag
|
|
112
|
-
* @default false
|
|
113
|
-
*/
|
|
114
|
-
publishOnly?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* @description Simulate CI publish locally (dry-run with token-based auth)
|
|
117
|
-
* @default false
|
|
118
|
-
*/
|
|
119
|
-
preflight?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* @description Publish under a specific dist-tag
|
|
122
|
-
* @default "latest"
|
|
123
|
-
*/
|
|
124
|
-
tag?: string;
|
|
125
|
-
/**
|
|
126
|
-
* @description Subdirectory to publish
|
|
127
|
-
*/
|
|
128
|
-
contents?: string;
|
|
129
|
-
/**
|
|
130
|
-
* @description Do not save jsr tokens (request the token each time)
|
|
131
|
-
* @default true
|
|
132
|
-
*/
|
|
133
|
-
saveToken?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* @description Target registries for publish
|
|
136
|
-
* @default ['npm', 'jsr']
|
|
137
|
-
*/
|
|
138
|
-
registries?: RegistryType[];
|
|
139
|
-
/**
|
|
140
|
-
* @description Per-package publish configuration (from pubm.config.ts)
|
|
141
|
-
*/
|
|
142
|
-
packages?: PackageConfig[];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
type BumpType = "patch" | "minor" | "major";
|
|
146
|
-
interface Release {
|
|
147
|
-
name: string;
|
|
148
|
-
type: BumpType;
|
|
149
|
-
}
|
|
150
|
-
interface Changeset {
|
|
151
|
-
id: string;
|
|
152
|
-
summary: string;
|
|
153
|
-
releases: Release[];
|
|
154
|
-
}
|
|
155
|
-
declare function parseChangeset(content: string, fileName: string): Changeset;
|
|
156
|
-
|
|
157
|
-
interface ChangelogEntry {
|
|
158
|
-
summary: string;
|
|
159
|
-
type: BumpType;
|
|
160
|
-
id: string;
|
|
161
|
-
}
|
|
162
|
-
interface DependencyUpdate {
|
|
163
|
-
name: string;
|
|
164
|
-
version: string;
|
|
165
|
-
}
|
|
166
|
-
declare function generateChangelog(version: string, entries: ChangelogEntry[], depUpdates?: DependencyUpdate[]): string;
|
|
167
|
-
|
|
168
|
-
interface MigrationResult {
|
|
169
|
-
success: boolean;
|
|
170
|
-
error?: string;
|
|
171
|
-
migratedFiles: string[];
|
|
172
|
-
configMigrated: boolean;
|
|
173
|
-
}
|
|
174
|
-
declare function migrateFromChangesets(cwd?: string): MigrationResult;
|
|
175
|
-
|
|
176
|
-
declare function readChangesets(cwd?: string): Changeset[];
|
|
177
|
-
|
|
178
|
-
interface PackageStatus {
|
|
179
|
-
bumpType: BumpType;
|
|
180
|
-
changesetCount: number;
|
|
181
|
-
summaries: string[];
|
|
182
|
-
}
|
|
183
|
-
interface Status {
|
|
184
|
-
packages: Map<string, PackageStatus>;
|
|
185
|
-
changesets: Changeset[];
|
|
186
|
-
hasChangesets: boolean;
|
|
187
|
-
}
|
|
188
|
-
declare function getStatus(cwd?: string): Status;
|
|
189
|
-
|
|
190
|
-
interface VersionBump {
|
|
191
|
-
currentVersion: string;
|
|
192
|
-
newVersion: string;
|
|
193
|
-
bumpType: BumpType;
|
|
194
|
-
}
|
|
195
|
-
declare function calculateVersionBumps(currentVersions: Map<string, string>, cwd?: string): Map<string, VersionBump>;
|
|
196
|
-
|
|
197
|
-
declare function generateChangesetId(): string;
|
|
198
|
-
declare function generateChangesetContent(releases: Release[], summary: string): string;
|
|
199
|
-
declare function writeChangeset(releases: Release[], summary: string, cwd?: string): string;
|
|
200
|
-
|
|
201
|
-
declare function resolveConfig(config: PubmConfig): ResolvedPubmConfig;
|
|
202
|
-
|
|
203
|
-
declare function loadConfig(cwd?: string): Promise<PubmConfig | null>;
|
|
204
|
-
|
|
205
|
-
interface PackageNode {
|
|
206
|
-
name: string;
|
|
207
|
-
version: string;
|
|
208
|
-
path: string;
|
|
209
|
-
dependencies: Record<string, string>;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Builds an adjacency list of internal dependencies only.
|
|
213
|
-
* Each key is a package name, and the value is an array of internal package names it depends on.
|
|
214
|
-
*/
|
|
215
|
-
declare function buildDependencyGraph(packages: PackageNode[]): Map<string, string[]>;
|
|
216
|
-
/**
|
|
217
|
-
* Topological sort using Kahn's algorithm.
|
|
218
|
-
* Returns packages in dependency order (dependencies first).
|
|
219
|
-
* Throws an error if circular dependencies are detected.
|
|
220
|
-
*/
|
|
221
|
-
declare function topologicalSort(graph: Map<string, string[]>): string[];
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Resolves glob patterns in groups to actual package names.
|
|
225
|
-
* Exact names are passed through; glob patterns are matched against allPackages.
|
|
226
|
-
*/
|
|
227
|
-
declare function resolveGroups(groups: string[][], allPackages: string[]): string[][];
|
|
228
|
-
/**
|
|
229
|
-
* Fixed group: all packages in the group get the maximum bump type,
|
|
230
|
-
* even those without changesets. If no packages in the group have bumps,
|
|
231
|
-
* nothing is changed.
|
|
232
|
-
*/
|
|
233
|
-
declare function applyFixedGroup(bumps: Map<string, BumpType>, group: string[]): void;
|
|
234
|
-
/**
|
|
235
|
-
* Linked group: only packages that already have bumps get aligned
|
|
236
|
-
* to the maximum bump type. Packages without bumps are not added.
|
|
237
|
-
*/
|
|
238
|
-
declare function applyLinkedGroup(bumps: Map<string, BumpType>, group: string[]): void;
|
|
239
|
-
|
|
240
|
-
interface WorkspaceInfo {
|
|
241
|
-
type: "pnpm" | "npm" | "yarn";
|
|
242
|
-
patterns: string[];
|
|
243
|
-
}
|
|
244
|
-
declare function detectWorkspace(cwd?: string): WorkspaceInfo | null;
|
|
245
|
-
|
|
246
|
-
interface PreState {
|
|
247
|
-
mode: "pre";
|
|
248
|
-
tag: string;
|
|
249
|
-
packages: Record<string, {
|
|
250
|
-
baseVersion: string;
|
|
251
|
-
iteration: number;
|
|
252
|
-
}>;
|
|
253
|
-
}
|
|
254
|
-
declare function readPreState(cwd?: string): PreState | null;
|
|
255
|
-
declare function enterPreMode(tag: string, cwd?: string): void;
|
|
256
|
-
declare function exitPreMode(cwd?: string): void;
|
|
257
|
-
|
|
258
|
-
interface SnapshotOptions {
|
|
259
|
-
tag?: string;
|
|
260
|
-
baseVersion?: string;
|
|
261
|
-
useCalculatedVersion?: boolean;
|
|
262
|
-
template?: string;
|
|
263
|
-
commit?: string;
|
|
264
|
-
}
|
|
265
|
-
declare function generateSnapshotVersion(options: SnapshotOptions): string;
|
|
266
|
-
|
|
267
|
-
interface EntryPointError {
|
|
268
|
-
field: string;
|
|
269
|
-
path: string;
|
|
270
|
-
}
|
|
271
|
-
declare function validateEntryPoints(pkg: Record<string, unknown>, cwd: string): EntryPointError[];
|
|
272
|
-
|
|
273
|
-
interface ExtraneousFile {
|
|
274
|
-
file: string;
|
|
275
|
-
reason: string;
|
|
276
|
-
}
|
|
277
|
-
declare function detectExtraneousFiles(files: string[]): ExtraneousFile[];
|
|
278
|
-
|
|
1
|
+
import type { Options } from "./types/options.js";
|
|
279
2
|
/**
|
|
280
3
|
* Runs the `pubm` function with the provided options.
|
|
281
4
|
*
|
|
@@ -286,6 +9,22 @@ declare function detectExtraneousFiles(files: string[]): ExtraneousFile[];
|
|
|
286
9
|
* @async
|
|
287
10
|
* @function
|
|
288
11
|
*/
|
|
289
|
-
declare function pubm(options: Options): Promise<void>;
|
|
290
|
-
|
|
291
|
-
export {
|
|
12
|
+
export declare function pubm(options: Options): Promise<void>;
|
|
13
|
+
export type { BumpType, ChangelogEntry, Changeset, DependencyUpdate, MigrationResult, PackageStatus, Release, Status, VersionBump, } from "./changeset/index.js";
|
|
14
|
+
export { calculateVersionBumps, generateChangelog, generateChangesetContent, generateChangesetId, getStatus, migrateFromChangesets, parseChangeset, readChangesets, writeChangeset, } from "./changeset/index.js";
|
|
15
|
+
export type { PackageConfig, PubmConfig, ResolvedPubmConfig, } from "./config/index.js";
|
|
16
|
+
export { defineConfig, loadConfig, resolveConfig } from "./config/index.js";
|
|
17
|
+
export type { PackageNode, WorkspaceInfo } from "./monorepo/index.js";
|
|
18
|
+
export { applyFixedGroup, applyLinkedGroup, buildDependencyGraph, detectWorkspace, resolveGroups, topologicalSort, } from "./monorepo/index.js";
|
|
19
|
+
export type { AfterReleaseHookFn, ErrorHookFn, HookFn, HookName, PluginCommand, PluginCommandOption, PluginHooks, PluginSubcommand, PubmPlugin, } from "./plugin/index.js";
|
|
20
|
+
export { PluginRunner } from "./plugin/index.js";
|
|
21
|
+
export type { ExternalVersionSyncOptions, JsonTarget, RegexTarget, SyncTarget, } from "./plugins/external-version-sync/index.js";
|
|
22
|
+
export { externalVersionSync } from "./plugins/external-version-sync/index.js";
|
|
23
|
+
export type { PreState, SnapshotOptions } from "./prerelease/index.js";
|
|
24
|
+
export { enterPreMode, exitPreMode, generateSnapshotVersion, readPreState, } from "./prerelease/index.js";
|
|
25
|
+
export type { ReleaseAsset, ReleaseContext } from "./tasks/github-release.js";
|
|
26
|
+
export type { Options } from "./types/options.js";
|
|
27
|
+
export type { Runtime } from "./utils/runtime.js";
|
|
28
|
+
export { detectRuntime, isBun } from "./utils/runtime.js";
|
|
29
|
+
export type { EntryPointError, ExtraneousFile } from "./validate/index.js";
|
|
30
|
+
export { detectExtraneousFiles, validateEntryPoints, } from "./validate/index.js";
|