You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make snapshot. useCalculatedVersion a stable option and introduce snapshot.prereleaseTemplate option (changesets#858)
* Added `getCurrentCommitId` helper
* Added snapshotPreidTemplate
* added changeset
* fix lint
* fix ts build issues
* moved experimental docs to a new file
added docs for all existing experimental flags
fixed typos
* use regex for replacing placeholders
* improve Date mocks in tests
* prevent `--snapshot name` without `{tag}` placeholder
* fix lint
* Allow `--snapshot-preid-template` in cli
* simplify cli->assembleReleasePlan interface
improve validation for snapshot tags
* remove the dateRef from assembleReleasePlan and calcualte it internally
* Migrate to unified `snapshot` flag in config
* Make `snapshot` stable, avoid breaking changes and keep supporting `useCalculatedVersionForSnapshots`
* Tweak `mockGlobalDate`
* Refactor code around creating snapshot suffix
* Bring back the comment related to 0.0.0 versions used in snapshots by default
* Update .changeset/strong-geckos-divide.md
* Update .changeset/olive-ducks-camp.md
* Fixed `--snapshot-prerelease-template` CLI param in the help string
* Remove `null` from `WrittenConfig["snapshot"]["prereleaseTemplate"]`
* Juggle some docs and update `schema.json`
* Only get the current commit if the template uses the `{commit}` variable
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
A possibility to use the calculated version for snapshot releases is now stable 🥳 All snapshot-related config parameters are now grouped under a single config property called `snapshot`.
7
+
8
+
To migrate, make sure to update your `config.json`.
9
+
10
+
Old usage (still works, but comes with a deprecated warning):
Copy file name to clipboardExpand all lines: docs/config-file-options.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Changesets has a minimal amount of configuration options. Mostly these are for w
14
14
}
15
15
```
16
16
17
-
> NOTE: the `linked`, `updateInternalDependencies`, and `ignore` options are only for behaviour in monorepos.
17
+
> NOTE: the `linked`, `fixed`, `updateInternalDependencies`, `bumpVersionsWithWorkspaceProtocolOnly`, and `ignore` options are only for behaviour in monorepos.
18
18
19
19
## `commit` (`boolean`, or module path as a `string`, or a tuple like `[modulePath: string, options: any]`)
20
20
@@ -156,3 +156,40 @@ You would specify our github changelog generator with:
156
156
```
157
157
158
158
For more details on these functions and information on how to write your own see [changelog-functions](./modifying-changelog-format.md)
Determines whether Changesets should only bump dependency ranges that use workspace protocol of packages that are part of the workspace.
163
+
164
+
## `snapshot` (object or undefined)
165
+
166
+
Default value: `undefined`
167
+
168
+
### `useCalculatedVersion` (optional boolean)
169
+
170
+
Default value: `false`
171
+
172
+
When `changesets version --snapshot` is used, the default behavior is to use `0.0.0` as the base version for the snapshot release.
173
+
174
+
Setting `useCalculatedVersion: true` will change the default behavior and will use the calculated version, based on the changeset files.
175
+
176
+
### `prereleaseTemplate` (optional string)
177
+
178
+
Default value: `undefined` (see note below)
179
+
180
+
Configures the suffix for the snapshot releases, using a template with placeholders.
181
+
182
+
**Available placeholders:**
183
+
184
+
You can use the following placeholders for customizing the snapshot release version:
185
+
186
+
-`{tag}` - the name of the snapshot tag, as specified in `--snapshot something`
187
+
-`{commit}` - the Git commit ID
188
+
-`{timestamp}` - Unix timestamp of the time of the release
189
+
-`{datetime}` - date and time of the release (14 characters, for example, `20211213000730`)
190
+
191
+
> Note: if you are using `--snapshot` with empty tag name, you cannot use `{tag}` as placeholder - this will result in error.
192
+
193
+
**Default behavior**
194
+
195
+
If you are not specifying `prereleaseTemplate`, the default behavior will fall back to using the following template: `{tag}-{datetime}`, and in cases where the tag is empty (`--snapshot` with no tag name), it will use `{datetime}` only.
0 commit comments