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.
Files changed (95) hide show
  1. package/LICENSE +191 -21
  2. package/README.md +126 -63
  3. package/bin/cli.js +53 -8338
  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 +24070 -4016
  35. package/dist/index.d.ts +20 -281
  36. package/dist/index.js +23983 -3933
  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
package/dist/index.d.cts DELETED
@@ -1,291 +0,0 @@
1
- interface PackageConfig {
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
-
279
- /**
280
- * Runs the `pubm` function with the provided options.
281
- *
282
- * This function executes the publish process using the specified options.
283
- * The `version` field in the `options` parameter is required for the function
284
- * to run correctly.
285
- *
286
- * @async
287
- * @function
288
- */
289
- declare function pubm(options: Options): Promise<void>;
290
-
291
- export { type BumpType, type ChangelogEntry, type Changeset, type DependencyUpdate, type EntryPointError, type ExtraneousFile, type MigrationResult, type Options, type PackageConfig, type PackageNode, type PackageStatus, type PreState, type PubmConfig, type Release, type ResolvedPubmConfig, type SnapshotOptions, type Status, type VersionBump, type WorkspaceInfo, applyFixedGroup, applyLinkedGroup, buildDependencyGraph, calculateVersionBumps, defineConfig, detectExtraneousFiles, detectWorkspace, enterPreMode, exitPreMode, generateChangelog, generateChangesetContent, generateChangesetId, generateSnapshotVersion, getStatus, loadConfig, migrateFromChangesets, parseChangeset, pubm, readChangesets, readPreState, resolveConfig, resolveGroups, topologicalSort, validateEntryPoints, writeChangeset };