@mnaoumov/typescript-dev-toolkit 6.0.2 → 6.1.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 CHANGED
@@ -12,6 +12,24 @@ npm install --save-dev @mnaoumov/typescript-dev-toolkit
12
12
 
13
13
  The guides and the API reference are at <https://mnaoumov.dev/typescript-dev-toolkit/>.
14
14
 
15
+ ## Publish release assets before the version bump
16
+
17
+ For a project whose updater reads a version file on its default branch and then downloads matching GitHub release assets, opt into publication before the branch push:
18
+
19
+ ```typescript
20
+ import { updateVersion } from '@mnaoumov/typescript-dev-toolkit/version';
21
+
22
+ await updateVersion('patch', {
23
+ getReleaseAssetPaths: () => Promise.resolve(['dist/main.js']),
24
+ shouldEditChangelog: false,
25
+ shouldPublishBeforePush: true
26
+ });
27
+ ```
28
+
29
+ Use `updateVersionInExtraFiles` to update project-specific version files and `prepareGitHubRelease` to prepare assets. Preparation and asset validation finish before any push. The release tag is pushed to `origin` first, then the release is published and checked for its exact tag, non-draft status and completed asset uploads. Only then is the verified version commit pushed to the original branch, followed by issue closing. Missing assets or a failed publication or verification leave the remote branch unchanged. Local commits and tags, and any remote tag or release already created, remain for recovery; this mode does not roll them back.
30
+
31
+ The default npm release order is unchanged. `shouldRelease: false` keeps all work local with either order.
32
+
15
33
  ## Where it fits
16
34
 
17
35
  It is one of five packages that replace [`obsidian-dev-utils`](https://github.com/mnaoumov/obsidian-dev-utils): [`@mnaoumov/typescript-lib`](https://github.com/mnaoumov/typescript-lib), [`@mnaoumov/typescript-test-toolkit`](https://github.com/mnaoumov/typescript-test-toolkit), [`@mnaoumov/typescript-dev-toolkit`](https://github.com/mnaoumov/typescript-dev-toolkit), [`@mnaoumov/obsidian-lib`](https://github.com/mnaoumov/obsidian-lib) and [`@mnaoumov/obsidian-dev-toolkit`](https://github.com/mnaoumov/obsidian-dev-toolkit). It depends on [`@mnaoumov/typescript-lib`](https://github.com/mnaoumov/typescript-lib). It moved here from that repository with its history.