@fairgarden/distribution 0.1.0-alpha.0
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/Readme.md +94 -0
- package/dist/add-module.d.ts +58 -0
- package/dist/add-module.d.ts.map +1 -0
- package/dist/add-module.js +250 -0
- package/dist/add-module.js.map +1 -0
- package/dist/canary.d.ts +58 -0
- package/dist/canary.d.ts.map +1 -0
- package/dist/canary.js +117 -0
- package/dist/canary.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +747 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-edit.d.ts +18 -0
- package/dist/config-edit.d.ts.map +1 -0
- package/dist/config-edit.js +166 -0
- package/dist/config-edit.js.map +1 -0
- package/dist/extends.d.ts +59 -0
- package/dist/extends.d.ts.map +1 -0
- package/dist/extends.js +163 -0
- package/dist/extends.js.map +1 -0
- package/dist/extract.d.ts +31 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +177 -0
- package/dist/extract.js.map +1 -0
- package/dist/git-url.d.ts +19 -0
- package/dist/git-url.d.ts.map +1 -0
- package/dist/git-url.js +55 -0
- package/dist/git-url.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/overrides.d.ts +32 -0
- package/dist/overrides.d.ts.map +1 -0
- package/dist/overrides.js +81 -0
- package/dist/overrides.js.map +1 -0
- package/dist/readme.d.ts +58 -0
- package/dist/readme.d.ts.map +1 -0
- package/dist/readme.js +299 -0
- package/dist/readme.js.map +1 -0
- package/dist/release.d.ts +140 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +409 -0
- package/dist/release.js.map +1 -0
- package/dist/scaffold.d.ts +46 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +389 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/submodules.d.ts +95 -0
- package/dist/submodules.d.ts.map +1 -0
- package/dist/submodules.js +225 -0
- package/dist/submodules.js.map +1 -0
- package/dist/workflows.d.ts +57 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +358 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +51 -0
package/dist/readme.js
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { readFile, readdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import semver from 'semver';
|
|
4
|
+
import { fromMarkdown } from 'mdast-util-from-markdown';
|
|
5
|
+
import { inspect, isDistribution, submodules, uninitialised, } from "./submodules.js";
|
|
6
|
+
import { readDistribution } from "./extends.js";
|
|
7
|
+
import { toHttps } from "./git-url.js";
|
|
8
|
+
const open = (marker) => `<!-- fg:${marker} -->`;
|
|
9
|
+
const close = (marker) => `<!-- /fg:${marker} -->`;
|
|
10
|
+
const offsets = (node) => [
|
|
11
|
+
node.position?.start.offset ?? 0,
|
|
12
|
+
node.position?.end.offset ?? 0,
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Replace the block a marker delimits, or add one.
|
|
16
|
+
*
|
|
17
|
+
* A new block goes after the first heading, which is where someone looking for
|
|
18
|
+
* a version would look first.
|
|
19
|
+
*/
|
|
20
|
+
export const updateSection = (source, marker, body,
|
|
21
|
+
/**
|
|
22
|
+
* Marker whose block this one belongs under, when it has to be inserted.
|
|
23
|
+
* Without it a new block goes straight after the first heading, which means
|
|
24
|
+
* whichever block is written last ends up on top.
|
|
25
|
+
*/
|
|
26
|
+
after) => {
|
|
27
|
+
const tree = fromMarkdown(source);
|
|
28
|
+
const comments = tree.children.filter((node) => node.type === 'html' && typeof node.value === 'string');
|
|
29
|
+
const start = comments.find((node) => node.value?.trim() === open(marker));
|
|
30
|
+
const end = comments.find((node) => node.value?.trim() === close(marker));
|
|
31
|
+
if (start && end) {
|
|
32
|
+
const [, from] = offsets(start);
|
|
33
|
+
const [to] = offsets(end);
|
|
34
|
+
return `${source.slice(0, from)}\n\n${body}\n\n${source.slice(to)}`;
|
|
35
|
+
}
|
|
36
|
+
const block = `${open(marker)}\n\n${body}\n\n${close(marker)}`;
|
|
37
|
+
// Under the block it belongs to if that is already here, otherwise under the
|
|
38
|
+
// heading — the top of the file is where a reader starts.
|
|
39
|
+
const anchor = (after && comments.find((node) => node.value?.trim() === close(after))) ??
|
|
40
|
+
tree.children.find((node) => node.type === 'heading');
|
|
41
|
+
if (!anchor)
|
|
42
|
+
return `${block}\n\n${source}`;
|
|
43
|
+
const [, at] = offsets(anchor);
|
|
44
|
+
return `${source.slice(0, at)}\n\n${block}${source.slice(at)}`;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* A remote as somewhere to browse, or undefined when there is nowhere.
|
|
48
|
+
*
|
|
49
|
+
* A local path is a real remote and has no web address, so linking to one
|
|
50
|
+
* would be worse than not linking at all.
|
|
51
|
+
*/
|
|
52
|
+
const browsableAt = (remote) => {
|
|
53
|
+
const https = toHttps(remote);
|
|
54
|
+
if (!/^https?:\/\//i.test(https))
|
|
55
|
+
return undefined;
|
|
56
|
+
return https.replace(/\.git$/, '');
|
|
57
|
+
};
|
|
58
|
+
const link = (text, href) => href ? `[${text}](${href})` : text;
|
|
59
|
+
/**
|
|
60
|
+
* What the distribution is actually pinned at.
|
|
61
|
+
*
|
|
62
|
+
* A tagged commit is a released version and links to the tag. Anything else is
|
|
63
|
+
* a commit after the last release, which is worth saying: the version in the
|
|
64
|
+
* manifest is not what is being shipped.
|
|
65
|
+
*/
|
|
66
|
+
const pinnedAs = (module) => {
|
|
67
|
+
const short = module.pinned.slice(0, 7);
|
|
68
|
+
if (module.released && module.tag) {
|
|
69
|
+
return link(module.tag, module.url && `${module.url}/tree/${module.tag}`);
|
|
70
|
+
}
|
|
71
|
+
const commit = link(short, module.url && `${module.url}/commit/${module.pinned}`);
|
|
72
|
+
return module.tag
|
|
73
|
+
? `${commit} — unreleased, after ${module.tag}`
|
|
74
|
+
: `${commit} — untagged`;
|
|
75
|
+
};
|
|
76
|
+
/** What a distribution ships, read from the checkouts. */
|
|
77
|
+
export const moduleVersions = async (root) => {
|
|
78
|
+
const found = [];
|
|
79
|
+
for (const submodule of submodules(root)) {
|
|
80
|
+
const manifest = await readManifest(submodule);
|
|
81
|
+
if (manifest)
|
|
82
|
+
found.push(manifest);
|
|
83
|
+
}
|
|
84
|
+
return found.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
85
|
+
};
|
|
86
|
+
const readManifest = async (submodule) => {
|
|
87
|
+
try {
|
|
88
|
+
const pkg = JSON.parse(await readFile(path.join(submodule.path, 'package.json'), 'utf8'));
|
|
89
|
+
if (!pkg.name || !pkg.version)
|
|
90
|
+
return undefined;
|
|
91
|
+
// Never fetches: this reads what is checked out, and writing a readme
|
|
92
|
+
// should not depend on the network.
|
|
93
|
+
const state = inspect(submodule, { fetch: false });
|
|
94
|
+
return {
|
|
95
|
+
name: pkg.name,
|
|
96
|
+
version: pkg.version,
|
|
97
|
+
description: typeof pkg.description === 'string' ? pkg.description : undefined,
|
|
98
|
+
relativePath: submodule.relativePath,
|
|
99
|
+
pinned: state.head,
|
|
100
|
+
tag: state.current,
|
|
101
|
+
released: state.exact,
|
|
102
|
+
url: browsableAt(submodule.url),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const modulesTable = (modules) => {
|
|
110
|
+
const rows = [
|
|
111
|
+
'| Module | Version | Pinned at | Path |',
|
|
112
|
+
'| --- | --- | --- | --- |',
|
|
113
|
+
...modules.map((module) => {
|
|
114
|
+
// Linked by name, so the table is also the index of where each lives.
|
|
115
|
+
const name = link(`\`${module.name}\``, module.url);
|
|
116
|
+
// An empty cell is honest: it shows which modules have yet to say what
|
|
117
|
+
// they are, rather than hiding it.
|
|
118
|
+
const what = module.description ? `<br>${module.description}` : '';
|
|
119
|
+
return `| ${name}${what} | ${module.version} | ${pinnedAs(module)} | \`${module.relativePath}\` |`;
|
|
120
|
+
}),
|
|
121
|
+
];
|
|
122
|
+
// Only worth explaining when something is actually unreleased.
|
|
123
|
+
if (modules.some((module) => !module.released)) {
|
|
124
|
+
rows.push('', 'A module pinned at a commit rather than a tag is being shipped ahead of', 'its last release, so its stated version is not what is deployed.');
|
|
125
|
+
}
|
|
126
|
+
return rows.join('\n');
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* A module states its own version and nothing else.
|
|
130
|
+
*
|
|
131
|
+
* Naming a distribution here would be a claim the module cannot make: the same
|
|
132
|
+
* module is shipped in several, which is the point of extending one. The
|
|
133
|
+
* distribution's readme is where the relationship belongs.
|
|
134
|
+
*/
|
|
135
|
+
const versionLine = (module) => `Version **${module.version}**`;
|
|
136
|
+
/**
|
|
137
|
+
* How to release this module, written into the module's own readme.
|
|
138
|
+
*
|
|
139
|
+
* The same words in every module, with this one's version and branch names
|
|
140
|
+
* filled in — so "how do I release this" is answered where someone is already
|
|
141
|
+
* standing, rather than in a document they have to know exists.
|
|
142
|
+
*/
|
|
143
|
+
export const releasingSection = (name, version) => {
|
|
144
|
+
const parsed = semver.parse(version);
|
|
145
|
+
// A prerelease has no line to maintain — there is no 2.0.0-alpha.0 that
|
|
146
|
+
// someone is still running and needs a fix for — so `release` only moves it
|
|
147
|
+
// forward, and saying otherwise here would contradict the command.
|
|
148
|
+
const prerelease = (parsed?.prerelease.length ?? 0) > 0;
|
|
149
|
+
const after = (bump) => (parsed && semver.inc(version, bump)) ?? '…';
|
|
150
|
+
const moveOn = prerelease
|
|
151
|
+
? [
|
|
152
|
+
'2. **Move it on.** `pnpm release` — opens a pull request bumping this branch',
|
|
153
|
+
` to \`${(parsed && semver.inc(version, 'prerelease')) ?? '…'}\`, or \`pnpm release --id rc\` to change`,
|
|
154
|
+
' identifier. A prerelease gets no maintenance branch; there is no released',
|
|
155
|
+
' line behind it yet.',
|
|
156
|
+
]
|
|
157
|
+
: [
|
|
158
|
+
'2. **Decide which way main moves on.** `pnpm release` on its own prints the',
|
|
159
|
+
' three and stops — it will not choose for you:',
|
|
160
|
+
'',
|
|
161
|
+
' | | Next | Leaves behind |',
|
|
162
|
+
' | --- | --- | --- |',
|
|
163
|
+
` | \`pnpm release --patch\` | \`${after('patch')}\` | nothing; this branch is the line |`,
|
|
164
|
+
` | \`pnpm release --minor\` | \`${after('minor')}\` | \`v${parsed?.major ?? 'x'}-${parsed?.minor ?? 'y'}\` at \`${after('patch')}\` |`,
|
|
165
|
+
` | \`pnpm release --major\` | \`${after('major')}\` | \`v${parsed?.major ?? 'x'}-${parsed?.minor ?? 'y'}\` at \`${after('patch')}\` |`,
|
|
166
|
+
'',
|
|
167
|
+
' The branch it leaves behind is where fixes to what you just released go.',
|
|
168
|
+
'3. **Fixing an older release.** Land it on main first, cherry-pick it onto that',
|
|
169
|
+
" release's `v<major>-<minor>` branch, then publish from there under its own",
|
|
170
|
+
' dist tag — never as `latest` unless that line is still the newest.',
|
|
171
|
+
];
|
|
172
|
+
const early = prerelease
|
|
173
|
+
? []
|
|
174
|
+
: [
|
|
175
|
+
'',
|
|
176
|
+
'### Starting the next line early',
|
|
177
|
+
'',
|
|
178
|
+
`\`pnpm exec fg-dist prerelease --major\` cuts \`v${(parsed?.major ?? 0) + 1}\` at`,
|
|
179
|
+
`\`${(parsed && semver.inc(version, 'premajor', 'alpha')) ?? '…'}\` and leaves main exactly where it is, so the next`,
|
|
180
|
+
'line can be worked on while this one goes on shipping. Release from that branch',
|
|
181
|
+
'under a dist tag of its own — `next`, say — so `latest` goes on meaning the line',
|
|
182
|
+
'main is shipping. `--minor` does the same for the next minor.',
|
|
183
|
+
];
|
|
184
|
+
return [
|
|
185
|
+
'## Releasing',
|
|
186
|
+
'',
|
|
187
|
+
`This module releases on its own. \`${version}\` is what main is working towards,`,
|
|
188
|
+
'not what is published — the version here is always the next one.',
|
|
189
|
+
'',
|
|
190
|
+
'1. **Publish it.** Run the *Publish* workflow from the Actions tab, picking the',
|
|
191
|
+
' dist tag. It refuses if that version is already on npm.',
|
|
192
|
+
...moveOn,
|
|
193
|
+
...early,
|
|
194
|
+
'',
|
|
195
|
+
`Every push to main publishes \`${name}@canary\`. A canary is not a release and`,
|
|
196
|
+
'carries no promise; it is there so main can be tried without a checkout.',
|
|
197
|
+
].join('\n');
|
|
198
|
+
};
|
|
199
|
+
/** The name and version of the repository this is run in. */
|
|
200
|
+
const ownManifest = async (root) => {
|
|
201
|
+
try {
|
|
202
|
+
const pkg = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
|
|
203
|
+
if (!pkg.name || !pkg.version)
|
|
204
|
+
return undefined;
|
|
205
|
+
return { name: pkg.name, version: pkg.version };
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* The readme this repository has, or what to call one if it has none.
|
|
213
|
+
*
|
|
214
|
+
* Hard-coding `Readme.md` writes a second file next to an existing `README.md`
|
|
215
|
+
* on Linux and edits the real one on macOS, so the same command passes locally
|
|
216
|
+
* and fails in CI.
|
|
217
|
+
*/
|
|
218
|
+
const readmeIn = async (dir) => {
|
|
219
|
+
const found = (await readdir(dir).catch(() => []))
|
|
220
|
+
.filter((entry) => /^readme\.md$/i.test(entry))
|
|
221
|
+
.sort();
|
|
222
|
+
return path.join(dir, found[0] ?? 'Readme.md');
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Write the versions into the distribution's readme and each module's.
|
|
226
|
+
*
|
|
227
|
+
* Idempotent: running it again when nothing has moved rewrites nothing.
|
|
228
|
+
*/
|
|
229
|
+
export const writeReadmes = async (root, { check = false } = {}) => {
|
|
230
|
+
const modules = await moduleVersions(root);
|
|
231
|
+
// Read from .gitmodules rather than from the checkouts: a clone made without
|
|
232
|
+
// --recurse-submodules has none of them, and calling that a module would
|
|
233
|
+
// write a module's readme over the distribution's.
|
|
234
|
+
const kind = isDistribution(root) ? 'distribution' : 'module';
|
|
235
|
+
if (kind === 'distribution') {
|
|
236
|
+
const absent = uninitialised(root);
|
|
237
|
+
if (absent.length > 0) {
|
|
238
|
+
throw new Error(`These submodules are not checked out, so their versions cannot be read: ` +
|
|
239
|
+
`${absent.join(', ')}.\nRun \`git submodule update --init\` first.`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const planned = [];
|
|
243
|
+
if (kind === 'module') {
|
|
244
|
+
const own = await ownManifest(root);
|
|
245
|
+
if (!own) {
|
|
246
|
+
throw new Error(`${root} has no submodules and no package.json version, so there is ` +
|
|
247
|
+
'nothing to record.');
|
|
248
|
+
}
|
|
249
|
+
const file = await readmeIn(root);
|
|
250
|
+
planned.push({ file, marker: 'version', body: `Version **${own.version}**`, heading: own.name }, {
|
|
251
|
+
file,
|
|
252
|
+
marker: 'releasing',
|
|
253
|
+
body: releasingSection(own.name, own.version),
|
|
254
|
+
heading: own.name,
|
|
255
|
+
after: 'version',
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
const distribution = readDistribution(root);
|
|
260
|
+
planned.push({
|
|
261
|
+
file: await readmeIn(root),
|
|
262
|
+
marker: 'modules',
|
|
263
|
+
body: modulesTable(modules),
|
|
264
|
+
heading: distribution.name,
|
|
265
|
+
});
|
|
266
|
+
for (const module of modules) {
|
|
267
|
+
const file = await readmeIn(path.join(root, module.relativePath));
|
|
268
|
+
planned.push({ file, marker: 'version', body: versionLine(module), heading: module.name }, {
|
|
269
|
+
file,
|
|
270
|
+
marker: 'releasing',
|
|
271
|
+
body: releasingSection(module.name, module.version),
|
|
272
|
+
heading: module.name,
|
|
273
|
+
after: 'version',
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// Grouped, because a file carries more than one block and reporting it once
|
|
278
|
+
// per block doubles both the listing and the count of what changed.
|
|
279
|
+
const byFile = new Map();
|
|
280
|
+
for (const entry of planned) {
|
|
281
|
+
byFile.set(entry.file, [...(byFile.get(entry.file) ?? []), entry]);
|
|
282
|
+
}
|
|
283
|
+
const updates = [];
|
|
284
|
+
for (const [file, blocks] of byFile) {
|
|
285
|
+
const original = await readFile(file, 'utf8').catch(() => undefined);
|
|
286
|
+
// Applied in order to the same text: a block that has to be inserted is
|
|
287
|
+
// placed relative to the ones before it.
|
|
288
|
+
let updated = original ?? `# ${blocks[0].heading}\n`;
|
|
289
|
+
for (const { marker, body, after } of blocks) {
|
|
290
|
+
updated = updateSection(updated, marker, body, after);
|
|
291
|
+
}
|
|
292
|
+
const changed = updated !== original;
|
|
293
|
+
if (changed && !check)
|
|
294
|
+
await writeFile(file, updated);
|
|
295
|
+
updates.push({ file, changed });
|
|
296
|
+
}
|
|
297
|
+
return { updates, modules, kind };
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=readme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme.js","sourceRoot":"","sources":["../src/readme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,OAAO,EACP,cAAc,EACd,UAAU,EACV,aAAa,GAEd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAuBtC,MAAM,IAAI,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,WAAW,MAAM,MAAM,CAAA;AAChE,MAAM,KAAK,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,YAAY,MAAM,MAAM,CAAA;AAElE,MAAM,OAAO,GAAG,CAAC,IAAU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AQ,CAAA;QACpC,IAAI,OAAO,IAAI,CAAC,KAAK;YAAE,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IACjC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AACnC,CAAC,CAAA"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export declare class ReleaseError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export interface Branch {
|
|
4
|
+
branch: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ReleasePlan {
|
|
8
|
+
/** The version that has just been released, read from the manifest. */
|
|
9
|
+
released: string;
|
|
10
|
+
/**
|
|
11
|
+
* Where fixes to the released version go. Undefined for a prerelease, which
|
|
12
|
+
* has nothing to maintain.
|
|
13
|
+
*/
|
|
14
|
+
maintenance: Branch | undefined;
|
|
15
|
+
/** The bump that main takes, opened as a pull request. */
|
|
16
|
+
next: Branch;
|
|
17
|
+
/** What the maintenance branch is cut from: the release tag, or HEAD. */
|
|
18
|
+
base: string;
|
|
19
|
+
/** Whether {@link base} is the release tag rather than wherever HEAD is. */
|
|
20
|
+
tagged: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Work out the two branches a release leaves behind.
|
|
24
|
+
*
|
|
25
|
+
* Main always carries the next unreleased version, so the release is the
|
|
26
|
+
* moment main moves on: once 1.6.0 is published, main becomes 1.7.0 and 1.6.x
|
|
27
|
+
* continues on its own branch, starting at the patch nobody has written yet.
|
|
28
|
+
*/
|
|
29
|
+
export type Bump = 'patch' | 'minor' | 'major';
|
|
30
|
+
/**
|
|
31
|
+
* Work out what a release leaves behind.
|
|
32
|
+
*
|
|
33
|
+
* Main always carries the next unreleased version, so the release is the moment
|
|
34
|
+
* main moves on. Which way it moves is a decision nobody else can make: a minor
|
|
35
|
+
* is the usual answer, a major says something was removed or changed meaning,
|
|
36
|
+
* and a patch says this branch *is* the line and stays on it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const planRelease: (released: string, { bump, id }?: {
|
|
39
|
+
bump?: Bump;
|
|
40
|
+
id?: string;
|
|
41
|
+
}) => Omit<ReleasePlan, "base" | "tagged">;
|
|
42
|
+
export interface PrereleasePlan {
|
|
43
|
+
/** The version the branch is cut to carry. */
|
|
44
|
+
version: string;
|
|
45
|
+
/** The branch it lives on, which becomes that line's branch if it ships. */
|
|
46
|
+
branch: string;
|
|
47
|
+
/** The version on the branch this was cut from, which keeps going. */
|
|
48
|
+
from: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Start the next line early, without main leaving the current one.
|
|
52
|
+
*
|
|
53
|
+
* Main is at 1.6.0 and still has 1.6.x and 1.7.0 to ship; 2.0.0 can be worked
|
|
54
|
+
* on anyway, on a branch of its own, published under a dist tag of its own.
|
|
55
|
+
* Nothing here touches main — that is the point.
|
|
56
|
+
*/
|
|
57
|
+
export declare const planPrerelease: (current: string, { bump, id }: {
|
|
58
|
+
bump: Exclude<Bump, "patch">;
|
|
59
|
+
id?: string;
|
|
60
|
+
}) => PrereleasePlan;
|
|
61
|
+
/**
|
|
62
|
+
* Set the version in package.json, leaving the rest of the file untouched.
|
|
63
|
+
*
|
|
64
|
+
* Spliced rather than re-serialised: a manifest carries key order, comments in
|
|
65
|
+
* some tools, and whatever indentation the repository settled on, and a
|
|
66
|
+
* release is no occasion to reformat it.
|
|
67
|
+
*/
|
|
68
|
+
export declare const setVersion: (source: string, version: string) => string;
|
|
69
|
+
/** Read the release the repository is standing on, without changing anything. */
|
|
70
|
+
export declare const readRelease: (root: string, { bump, id }?: {
|
|
71
|
+
bump?: Bump;
|
|
72
|
+
id?: string;
|
|
73
|
+
}) => Promise<ReleasePlan>;
|
|
74
|
+
export interface ReleaseOptions {
|
|
75
|
+
/** Which way main moves on. Required, unless this is a prerelease. */
|
|
76
|
+
bump?: Bump;
|
|
77
|
+
/** Prerelease identifier, for moving alpha to beta to rc. */
|
|
78
|
+
id?: string;
|
|
79
|
+
dryRun?: boolean;
|
|
80
|
+
/** Push the branches and open the pull request. On by default. */
|
|
81
|
+
push?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface ReleaseOutcome {
|
|
84
|
+
plan: ReleasePlan;
|
|
85
|
+
/** The branch this was released from, which the pull request is against. */
|
|
86
|
+
base: string;
|
|
87
|
+
/** Branches that were created, in the order they were created. */
|
|
88
|
+
created: string[];
|
|
89
|
+
pushed: boolean;
|
|
90
|
+
/** The pull request, when `gh` was there to open one. */
|
|
91
|
+
pullRequest: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Move a module on from the release it has just published.
|
|
95
|
+
*
|
|
96
|
+
* Two branches come out of it: `v1-6` where 1.6.x is maintained, and a pull
|
|
97
|
+
* request moving main to 1.7.0. The pull request is where main's bump gets
|
|
98
|
+
* reviewed like any other change; the maintenance branch is not a proposal, so
|
|
99
|
+
* it is just pushed.
|
|
100
|
+
*/
|
|
101
|
+
export declare const release: (root: string, { bump, id, dryRun, push }?: ReleaseOptions) => Promise<ReleaseOutcome>;
|
|
102
|
+
export interface Releasable {
|
|
103
|
+
name: string;
|
|
104
|
+
version: string;
|
|
105
|
+
tag: string;
|
|
106
|
+
/** Whether npm will generate provenance; it refuses for restricted packages. */
|
|
107
|
+
provenance: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Check that the version in the manifest is one that can be released.
|
|
111
|
+
*
|
|
112
|
+
* Main is meant to carry the next unreleased version, so finding that version
|
|
113
|
+
* already on npm means {@link release} has not run since the last one — and
|
|
114
|
+
* publishing would either fail or, worse, succeed as a republish.
|
|
115
|
+
*/
|
|
116
|
+
export declare const checkReleasable: (root: string, { published }?: {
|
|
117
|
+
published?: (spec: string) => string | undefined;
|
|
118
|
+
}) => Promise<Releasable>;
|
|
119
|
+
/** Hand the version to the workflow steps that tag and publish it. */
|
|
120
|
+
export declare const reportToActions: (releasable: Releasable) => Promise<void>;
|
|
121
|
+
export interface PrereleaseOutcome {
|
|
122
|
+
plan: PrereleasePlan;
|
|
123
|
+
created: boolean;
|
|
124
|
+
pushed: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Cut a branch carrying the next line, and leave main where it is.
|
|
128
|
+
*
|
|
129
|
+
* No pull request: this is not a change to the branch you are on, it is a
|
|
130
|
+
* second line starting beside it. Main goes on releasing what it was
|
|
131
|
+
* releasing, and this one publishes under a dist tag of its own until it is
|
|
132
|
+
* ready to become `latest`.
|
|
133
|
+
*/
|
|
134
|
+
export declare const startPrerelease: (root: string, { bump, id, dryRun, push, }: {
|
|
135
|
+
bump: Exclude<Bump, "patch">;
|
|
136
|
+
id?: string;
|
|
137
|
+
dryRun?: boolean;
|
|
138
|
+
push?: boolean;
|
|
139
|
+
}) => Promise<PrereleaseOutcome>;
|
|
140
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"AA0BA,qBAAa,YAAa,SAAQ,KAAK;CAAG;AAE1C,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAA;CAChB;AAKD;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAE9C;;;;;;;GAOG;AACH,eAAO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