@ethima/semantic-release-configuration 4.1.1 → 5.0.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/LICENSE +1 -1
- package/README.md +5 -5
- package/package.json +7 -7
- package/src/branches.js +3 -3
- package/src/index.js +4 -4
- package/src/versioned-templates.js +10 -10
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ configuration supporting a range of languages and platforms supported by the
|
|
|
15
15
|
[`@semantic-release/release-notes-generator`][semantic-release-notes-generator-plugin-url].
|
|
16
16
|
- Updates templated content in files, e.g. a project's root-level `README.md`,
|
|
17
17
|
with updated version information using
|
|
18
|
-
[
|
|
19
|
-
|
|
18
|
+
[`semantic-release-replace-plugin`][semantic-release-replace-plugin-url] and
|
|
19
|
+
[`@semantic-release/git`][semantic-release-git-plugin-url].
|
|
20
20
|
- Maintains a `CHANGELOG.md` from the generated release notes using
|
|
21
21
|
[`@semantic-release/changelog`][semantic-release-changelog-plugin-url] and
|
|
22
22
|
[`@semantic-release/git`][semantic-release-git-plugin-url].
|
|
@@ -25,8 +25,8 @@ configuration supporting a range of languages and platforms supported by the
|
|
|
25
25
|
and [`@semantic-release/git`][semantic-release-git-plugin-url].
|
|
26
26
|
- (Conditionally) maintains Julia package files, i.e. `version` fields in
|
|
27
27
|
`Project.toml` files, using
|
|
28
|
-
[
|
|
29
|
-
|
|
28
|
+
[`semantic-release-replace-plugin`][semantic-release-replace-plugin-url] and
|
|
29
|
+
[`@semantic-release/git`][semantic-release-git-plugin-url].
|
|
30
30
|
- Publishes releases to the relevant hosting platform, i.e. GitHub or GitLab,
|
|
31
31
|
using the platform-specific release plugins
|
|
32
32
|
[`@semantic-release/github`][semantic-release-github-plugin-url] or
|
|
@@ -314,6 +314,6 @@ release by hand from the tag and changelog that was created by the
|
|
|
314
314
|
[semantic-release-notes-generator-plugin-url]: https://github.com/semantic-release/release-notes-generator
|
|
315
315
|
[semantic-release-npm-plugin-configuration-url]: https://github.com/semantic-release/npm#npm-registry-authentication
|
|
316
316
|
[semantic-release-npm-plugin-url]: https://www.npmjs.com/package/@semantic-release/npm
|
|
317
|
-
[semantic-release-replace-plugin-url]: https://github.com/
|
|
317
|
+
[semantic-release-replace-plugin-url]: https://github.com/jpoehnelt/semantic-release-replace-plugin
|
|
318
318
|
[semantic-release-url]: https://semantic-release.gitbook.io/
|
|
319
319
|
[semantic-versioning-prerelease-precedence-url]: https://semver.org/#spec-item-9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethima/semantic-release-configuration",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A shareable semantic release configuration supporting a range of languages and platforms supported by the Ethima organization.",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://gitlab.com/ethima/semantic-release-configuration#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@google/semantic-release-replace-plugin": "1.2.5",
|
|
25
24
|
"@semantic-release/changelog": "6.0.3",
|
|
26
25
|
"@semantic-release/git": "10.0.1",
|
|
27
|
-
"@semantic-release/github": "9.
|
|
28
|
-
"@semantic-release/gitlab": "12.
|
|
29
|
-
"conventional-changelog-conventionalcommits": "
|
|
30
|
-
"cosmiconfig": "8.
|
|
26
|
+
"@semantic-release/github": "9.2.5",
|
|
27
|
+
"@semantic-release/gitlab": "12.1.1",
|
|
28
|
+
"conventional-changelog-conventionalcommits": "7.0.2",
|
|
29
|
+
"cosmiconfig": "8.3.6",
|
|
30
|
+
"semantic-release-replace-plugin": "1.2.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"ava": "
|
|
33
|
+
"ava": "6.0.1"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/branches.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
function determinePrefixedBranchType(
|
|
8
8
|
branch,
|
|
9
|
-
{ maintenance_branch_prefix, prerelease_branch_prefix }
|
|
9
|
+
{ maintenance_branch_prefix, prerelease_branch_prefix },
|
|
10
10
|
) {
|
|
11
11
|
if (branch.startsWith(maintenance_branch_prefix)) {
|
|
12
12
|
return { branch_prefix: maintenance_branch_prefix, is_prerelease: false };
|
|
@@ -42,7 +42,7 @@ function BranchesConfiguration(branch, configuration) {
|
|
|
42
42
|
|
|
43
43
|
const { branch_prefix, is_prerelease } = determinePrefixedBranchType(
|
|
44
44
|
branch,
|
|
45
|
-
configuration
|
|
45
|
+
configuration,
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
// The matching pattern is configured to match all allowed permutations of
|
|
@@ -50,7 +50,7 @@ function BranchesConfiguration(branch, configuration) {
|
|
|
50
50
|
// that look valid, e.g. `N.z.q`, do not also accidentally match
|
|
51
51
|
const branch_prefix_separator = configuration.branch_prefix_separator ?? "-";
|
|
52
52
|
const version_branch_matcher = new RegExp(
|
|
53
|
-
`^${branch_prefix}${branch_prefix_separator}(?<major>\\d+)(?<minor>\\.(\\d+|x|y))?(\\.(x|z))
|
|
53
|
+
`^${branch_prefix}${branch_prefix_separator}(?<major>\\d+)(?<minor>\\.(\\d+|x|y))?(\\.(x|z))?$`,
|
|
54
54
|
);
|
|
55
55
|
if (version_branch_matcher.test(branch)) {
|
|
56
56
|
let {
|
package/src/index.js
CHANGED
|
@@ -39,7 +39,7 @@ try {
|
|
|
39
39
|
accessSync("Project.toml");
|
|
40
40
|
GIT_ASSETS.push("Project.toml");
|
|
41
41
|
JULIA_PROJECT_TOML_PLUGIN.push([
|
|
42
|
-
"
|
|
42
|
+
"semantic-release-replace-plugin",
|
|
43
43
|
{
|
|
44
44
|
replacements: [
|
|
45
45
|
{
|
|
@@ -89,7 +89,7 @@ const SEMANTIC_RELEASE_CONFIGURATION = {
|
|
|
89
89
|
},
|
|
90
90
|
],
|
|
91
91
|
VersionedTemplatesConfiguration(
|
|
92
|
-
CONFIGURATION.files_with_versioned_templates
|
|
92
|
+
CONFIGURATION.files_with_versioned_templates,
|
|
93
93
|
),
|
|
94
94
|
...NPM_PLUGIN,
|
|
95
95
|
...JULIA_PROJECT_TOML_PLUGIN,
|
|
@@ -98,12 +98,12 @@ const SEMANTIC_RELEASE_CONFIGURATION = {
|
|
|
98
98
|
{
|
|
99
99
|
assets: GIT_ASSETS,
|
|
100
100
|
message:
|
|
101
|
-
"
|
|
101
|
+
"build(release): ${nextRelease.version}\n\n${nextRelease.notes}",
|
|
102
102
|
},
|
|
103
103
|
],
|
|
104
104
|
...platformSpecificReleasePlugin(
|
|
105
105
|
"GITHUB_ACTIONS",
|
|
106
|
-
"@semantic-release/github"
|
|
106
|
+
"@semantic-release/github",
|
|
107
107
|
),
|
|
108
108
|
...platformSpecificReleasePlugin("GITLAB_CI", "@semantic-release/gitlab"),
|
|
109
109
|
],
|
|
@@ -99,14 +99,14 @@ function buildReplacement(
|
|
|
99
99
|
_, // Index of match start
|
|
100
100
|
_, // Searched text
|
|
101
101
|
filename,
|
|
102
|
-
context
|
|
102
|
+
context,
|
|
103
103
|
) {
|
|
104
104
|
const { next_version_placeholder_token, template_continuation_token } =
|
|
105
105
|
getTemplateTokenConfiguration(filename);
|
|
106
106
|
|
|
107
107
|
const normalized_template = stripTemplateContinuationTokens(
|
|
108
108
|
template_continuation_token,
|
|
109
|
-
template
|
|
109
|
+
template,
|
|
110
110
|
);
|
|
111
111
|
|
|
112
112
|
return [
|
|
@@ -115,7 +115,7 @@ function buildReplacement(
|
|
|
115
115
|
template_end,
|
|
116
116
|
normalized_template.replaceAll(
|
|
117
117
|
next_version_placeholder_token,
|
|
118
|
-
context.nextRelease.version
|
|
118
|
+
context.nextRelease.version,
|
|
119
119
|
),
|
|
120
120
|
replacement_end,
|
|
121
121
|
].join("");
|
|
@@ -155,7 +155,7 @@ function buildTemplateMatcher(filename) {
|
|
|
155
155
|
".*?",
|
|
156
156
|
`(\n[^\n]*${replacement_end_token}[^\n]*?)`,
|
|
157
157
|
].join(""),
|
|
158
|
-
"gs"
|
|
158
|
+
"gs",
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -190,7 +190,7 @@ function getTemplateTokenConfiguration(filename) {
|
|
|
190
190
|
*/
|
|
191
191
|
function stripTemplateContinuationTokens(
|
|
192
192
|
template_continuation_token,
|
|
193
|
-
template
|
|
193
|
+
template,
|
|
194
194
|
) {
|
|
195
195
|
// The capture group is only necessary when using this matcher in the context
|
|
196
196
|
// of replacement, i.e. where all the matched content should be replaced by
|
|
@@ -198,7 +198,7 @@ function stripTemplateContinuationTokens(
|
|
|
198
198
|
// largest common whitespace prefix for each line in the template
|
|
199
199
|
const indented_continuation_token_matcher = `^(\\s*)${template_continuation_token}`;
|
|
200
200
|
const continuation_prefix_matcher = new RegExp(
|
|
201
|
-
`${indented_continuation_token_matcher}(?<prefix>\\s*)
|
|
201
|
+
`${indented_continuation_token_matcher}(?<prefix>\\s*)`,
|
|
202
202
|
);
|
|
203
203
|
|
|
204
204
|
const prefix_lengths = template
|
|
@@ -213,7 +213,7 @@ function stripTemplateContinuationTokens(
|
|
|
213
213
|
|
|
214
214
|
const largest_common_prefix_matcher = new RegExp(
|
|
215
215
|
`${indented_continuation_token_matcher}\\s{${Math.min(...prefix_lengths)}}`,
|
|
216
|
-
"gm"
|
|
216
|
+
"gm",
|
|
217
217
|
);
|
|
218
218
|
|
|
219
219
|
return template.replaceAll(largest_common_prefix_matcher, "$1");
|
|
@@ -221,12 +221,12 @@ function stripTemplateContinuationTokens(
|
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* Returns the semantic release configuration for the
|
|
224
|
-
*
|
|
225
|
-
*
|
|
224
|
+
* `semantic-release-replace-plugin` set up to replace specific tokens with the
|
|
225
|
+
* next semantic release version in the provided {@param files}.
|
|
226
226
|
*/
|
|
227
227
|
function VersionedTemplatesConfiguration(files) {
|
|
228
228
|
return [
|
|
229
|
-
"
|
|
229
|
+
"semantic-release-replace-plugin",
|
|
230
230
|
{
|
|
231
231
|
replacements: [
|
|
232
232
|
{
|