Skip to content

Commit 692066a

Browse files
chore(release): 1.0.1 [skip ci]
## [1.0.1](v1.0.0...v1.0.1) (2024-06-03) ### Bug Fixes * **package.json:** bumped semantic-release to v24.0.0 and added support for teams notify plugin ([63df3ae](63df3ae))
1 parent ff284ec commit 692066a

File tree

5 files changed

+42
-27
lines changed

5 files changed

+42
-27
lines changed

HISTORY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.0.1](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/compare/v1.0.0...v1.0.1) (2024-06-03)
2+
3+
4+
### Bug Fixes
5+
6+
* **package.json:** bumped semantic-release to v24.0.0 and added support for teams notify plugin ([63df3ae](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/commit/63df3ae8999e765439a40f848a2f9c84d8477711))
7+
18
# 1.0.0 (2024-03-27)
29

310

dist/index.test.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ import * as m from "./index.js";
1717
import fs from "fs-extra";
1818
import path from "path";
1919
import tmp from "tmp";
20-
import { Signale } from "signale";
20+
import { test, expect, beforeEach, afterEach } from "vitest";
2121
import { prepare } from "./index.js";
22-
import { test, beforeEach, afterEach } from "@jest/globals";
2322
const context = {
2423
stdout: process.stdout,
2524
stderr: process.stderr,
26-
logger: new Signale(),
25+
logger: {},
2726
cwd: "/path/to/your/repository",
2827
env: process.env,
2928
envCi: {
@@ -112,8 +111,11 @@ async function assertFileContents(name, expected) {
112111
expect(actual).toEqual(expected);
113112
}
114113
async function assertFileContentsContain(name, expected) {
115-
const actual = await fs.readFileSync(path.join(d.name, name), "utf-8");
116-
expect(actual).toEqual(expect.stringContaining(expected));
114+
const filePath = path.join(d.name, name);
115+
const actual = await fs.readFileSync(filePath, "utf-8");
116+
if (!actual.includes(expected)) {
117+
throw new Error(`File ${filePath} does not contain "${expected}"`);
118+
}
117119
}
118120
test("should expose prepare", async () => {
119121
expect(m.prepare).toBeDefined();
@@ -259,7 +261,9 @@ test("prepare accepts multi-argument `to` callback functions for regular express
259261
files: [path.join(d.name, "/foo.md")],
260262
from: /npm i (.+)@(.+)`/g,
261263
to: ((match, packageName, version) => {
262-
return match.replace(version, context.nextRelease?.version ?? version).replace(packageName, packageName.split("").reverse().join(""));
264+
return match
265+
.replace(version, context.nextRelease?.version ?? version)
266+
.replace(packageName, packageName.split("").reverse().join(""));
263267
}),
264268
},
265269
];
@@ -305,7 +309,11 @@ test("prepare accepts an array of `from` matchers", async () => {
305309
// to mean global replacements for improved JSON configuration
306310
// capabilities. The regular expression and function matchers should only
307311
// replace a single occurrence and hence only affect the `npm` line
308-
from: ["1.0.0", /install with/, (filename) => path.basename(filename, ".md")],
312+
from: [
313+
"1.0.0",
314+
/install with/,
315+
(filename) => path.basename(filename, ".md"),
316+
],
309317
to: "bar",
310318
},
311319
];

docs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ semantic-release-replace-plugin
2828

2929
#### Defined in
3030

31-
[index.ts:26](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L26)
31+
[index.ts:26](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L26)
3232

3333
___
3434

@@ -53,7 +53,7 @@ ___
5353

5454
#### Defined in
5555

56-
[index.ts:27](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L27)
56+
[index.ts:27](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L27)
5757

5858
___
5959

@@ -63,7 +63,7 @@ ___
6363

6464
#### Defined in
6565

66-
[index.ts:31](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L31)
66+
[index.ts:31](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L31)
6767

6868
___
6969

@@ -88,25 +88,25 @@ ___
8888

8989
#### Defined in
9090

91-
[index.ts:32](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L32)
91+
[index.ts:32](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L32)
9292

9393
## Functions
9494

9595
### prepare
9696

97-
**prepare**(`PluginConfig`, `context`): `Promise`<`void`\>
97+
**prepare**(`PluginConfig`, `context`): `Promise`\<`void`\>
9898

9999
#### Parameters
100100

101101
| Name | Type |
102102
| :------ | :------ |
103103
| `PluginConfig` | [`PluginConfig`](interfaces/PluginConfig.md) |
104-
| `context` | `Context` |
104+
| `context` | `VerifyReleaseContext` |
105105

106106
#### Returns
107107

108-
`Promise`<`void`\>
108+
`Promise`\<`void`\>
109109

110110
#### Defined in
111111

112-
[index.ts:163](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L163)
112+
[index.ts:163](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L163)

docs/interfaces/PluginConfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ An array of replacements to be made.
4444

4545
#### Defined in
4646

47-
[index.ts:132](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L132)
47+
[index.ts:132](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L132)

docs/interfaces/Replacement.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ with the difference being the single string for `to` and `from`.
2828

2929
#### Defined in
3030

31-
[index.ts:87](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L87)
31+
[index.ts:87](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L87)
3232

3333
___
3434

@@ -38,7 +38,7 @@ ___
3838

3939
#### Defined in
4040

41-
[index.ts:88](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L88)
41+
[index.ts:88](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L88)
4242

4343
___
4444

@@ -48,7 +48,7 @@ ___
4848

4949
#### Defined in
5050

51-
[index.ts:89](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L89)
51+
[index.ts:89](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L89)
5252

5353
___
5454

@@ -58,7 +58,7 @@ ___
5858

5959
#### Defined in
6060

61-
[index.ts:91](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L91)
61+
[index.ts:91](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L91)
6262

6363
___
6464

@@ -68,7 +68,7 @@ ___
6868

6969
#### Defined in
7070

71-
[index.ts:90](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L90)
71+
[index.ts:90](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L90)
7272

7373
___
7474

@@ -80,7 +80,7 @@ files to search for replacements
8080

8181
#### Defined in
8282

83-
[index.ts:42](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L42)
83+
[index.ts:42](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L42)
8484

8585
___
8686

@@ -104,7 +104,7 @@ conversion rules as mentioned above.
104104

105105
#### Defined in
106106

107-
[index.ts:58](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L58)
107+
[index.ts:58](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L58)
108108

109109
___
110110

@@ -114,20 +114,20 @@ ___
114114

115115
#### Defined in
116116

117-
[index.ts:86](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L86)
117+
[index.ts:86](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L86)
118118

119119
___
120120

121121
### results
122122

123-
`Optional` **results**: { `file`: `string` ; `hasChanged`: `boolean` ; `numMatches?`: `number` ; `numReplacements?`: `number` }[]
123+
`Optional` **results**: \{ `file`: `string` ; `hasChanged`: `boolean` ; `numMatches?`: `number` ; `numReplacements?`: `number` }[]
124124

125125
The results array can be passed to ensure that the expected replacements
126126
have been made, and if not, throw and exception with the diff.
127127

128128
#### Defined in
129129

130-
[index.ts:96](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L96)
130+
[index.ts:96](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L96)
131131

132132
___
133133

@@ -162,4 +162,4 @@ to match the amount of `from` matchers.
162162

163163
#### Defined in
164164

165-
[index.ts:85](https://github.com/jpoehnelt/semantic-release-replace-plugin/blob/c94a018/src/index.ts#L85)
165+
[index.ts:85](https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin/blob/ff284ec/src/index.ts#L85)

0 commit comments

Comments
 (0)