semantic-release-openapi 2.2.0 → 2.3.1

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
@@ -1,13 +1,20 @@
1
1
  # semantic-release-openapi
2
2
 
3
- [![npm](https://img.shields.io/npm/v/semantic-release-openapi)][npm]
4
- [![license](https://img.shields.io/github/license/aensley/semantic-release-openapi.svg)](https://github.com/aensley/semantic-release-openapi/blob/main/LICENSE)
5
- [![install size](https://packagephobia.com/badge?p=semantic-release-openapi)](https://packagephobia.com/result?p=semantic-release-openapi)
6
- [![npm downloads](https://img.shields.io/npm/dw/semantic-release-openapi)][npm]<br>
3
+ [![npm](https://img.shields.io/npm/v/semantic-release-openapi.svg)][npm]
7
4
  [![npm types](https://badgen.net/npm/types/semantic-release-openapi?icon=typescript)][npm]
8
- [![ci](https://github.com/aensley/semantic-release-openapi/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aensley/semantic-release-openapi/actions/workflows/ci.yml)
5
+ [![license](https://img.shields.io/github/license/aensley/semantic-release-openapi.svg)](https://github.com/aensley/semantic-release-openapi/blob/main/LICENSE)
6
+ [![prettier](https://img.shields.io/badge/prettier-ff69b4.svg?&logo=prettier&logoColor=fff)](https://prettier.io/)
7
+ [![standard](https://img.shields.io/badge/standard-f3df49.svg?logo=standardjs&logoColor=000)](https://standardjs.com/)
8
+ [![bundle size](https://img.shields.io/bundlephobia/min/semantic-release-openapi.svg?label=size)](https://bundlephobia.com/package/semantic-release-openapi)
9
+ [![npm downloads](https://img.shields.io/npm/dw/semantic-release-openapi.svg)][npm]
10
+ [![Dependabot badge](https://badgen.net/github/dependabot/aensley/semantic-release-openapi?icon=dependabot)](https://github.com/aensley/semantic-release-openapi/security/dependabot)<br>
9
11
  [![Maintainability](https://qlty.sh/gh/aensley/projects/semantic-release-openapi/maintainability.svg)][qltysh]
10
12
  [![Test Coverage](https://qlty.sh/gh/aensley/projects/semantic-release-openapi/coverage.svg)][qltysh]
13
+ [![test](https://github.com/aensley/semantic-release-openapi/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/aensley/semantic-release-openapi/actions/workflows/test.yml)
14
+ [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/aensley/semantic-release-openapi.svg?label=ossf)](https://scorecard.dev/viewer/?uri=github.com/aensley/semantic-release-openapi)
15
+ [![Socket](https://socket.dev/api/badge/npm/package/semantic-release-openapi)](https://socket.dev/npm/package/semantic-release-openapi)
16
+ [![snyk](https://snyk.io/test/npm/semantic-release-openapi/badge.svg)](https://security.snyk.io/package/npm/semantic-release-openapi)
17
+ [![dependencies](https://img.shields.io/librariesio/release/npm/semantic-release-openapi.svg?label=deps)](https://libraries.io/npm/semantic-release-openapi)
11
18
 
12
19
  A Semantic Release plugin to update versions in OpenAPI / Swagger specification files.
13
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-openapi",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "A Semantic Release plugin to update versions in OpenAPI / Swagger specification files",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,6 +20,7 @@
20
20
  "url": "https://andrewensley.com"
21
21
  },
22
22
  "type": "module",
23
+ "sideEffects": false,
23
24
  "license": "MIT",
24
25
  "bugs": {
25
26
  "url": "https://github.com/aensley/semantic-release-openapi/issues/new?template=bug-report.yml"
@@ -29,7 +30,7 @@
29
30
  "https://paypal.me/AndrewEnsley"
30
31
  ],
31
32
  "homepage": "https://github.com/aensley/semantic-release-openapi#readme",
32
- "main": "index.js",
33
+ "exports": "./index.js",
33
34
  "module": "index.js",
34
35
  "types": "index.d.ts",
35
36
  "source": "src/index.ts",
@@ -37,16 +38,19 @@
37
38
  "**/*"
38
39
  ],
39
40
  "engines": {
40
- "node": ">=16"
41
+ "node": ">= 22.14"
41
42
  },
42
43
  "platform": "node",
43
44
  "dependencies": {
44
45
  "@semantic-release/error": "^4.0.0",
45
46
  "fdir": "^6.5.0",
46
- "fs-extra": "^11.3.5",
47
- "replace-in-file": "^8.4.0"
47
+ "jsonfile": "^6.2.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "semantic-release": ">=20.0.0"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "provenance": true
51
55
  }
52
56
  }
package/prepare.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import SemanticReleaseError from '@semantic-release/error';
2
- import { readJsonSync, writeJsonSync } from 'fs-extra';
3
- import { replaceInFileSync } from 'replace-in-file';
2
+ import { readFileSync as readJsonSync, writeFileSync as writeJsonSync } from 'jsonfile';
3
+ import { readFileSync, writeFileSync } from 'node:fs';
4
4
  import { fdir } from 'fdir';
5
5
  /**
6
6
  * Prepare the API Spec files
@@ -43,14 +43,10 @@ const prepareApiSpecFiles = (apiSpecFiles, version, logger) => {
43
43
  * @returns {string[]} A list of altered files
44
44
  */
45
45
  const prepareApiSpecFileYml = (apiSpecFile, version) => {
46
- const changedFiles = replaceInFileSync({
47
- files: apiSpecFile,
48
- from: /version: ?.+$/im,
49
- to: 'version: ' + version
50
- })
51
- .filter((result) => result.hasChanged)
52
- .map((result) => result.file);
53
- return changedFiles;
46
+ const content = readFileSync(apiSpecFile, 'utf8');
47
+ const newContent = content.replace(/version: ?.+$/im, 'version: ' + version);
48
+ writeFileSync(apiSpecFile, newContent);
49
+ return [apiSpecFile];
54
50
  };
55
51
  /**
56
52
  * Prepares a single API spec file in JSON format
package/prepare.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.js","sourceRoot":"","sources":["../src/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGnD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B;;;;;;;;GAQ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