Skip to content

Commit d378487

Browse files
authored
refactor(esm): converted the package to esm-only (#249)
BREAKING CHANGE: `@semantic-release/error` is now an ES Module BREAKING CHANGE: the minimum required version of node is now v18
1 parent f0069bf commit d378487

File tree

12 files changed

+2848
-17566
lines changed

12 files changed

+2848
-17566
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# style: prettier
2+
59b36b44061cf622f2e73365f9a7722f9e6e5353

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
with:
2424
cache: npm
2525
node-version: lts/*
26-
- run: npm ci
26+
- run: npm clean-install
27+
- run: npm audit signatures
2728
- run: npx semantic-release
2829
env:
2930
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ jobs:
1616
strategy:
1717
matrix:
1818
node-version:
19-
- 14.17
20-
- 16
19+
- 18.0.0
20+
- 19
21+
- 20
2122

2223
runs-on: ubuntu-latest
2324

@@ -28,7 +29,8 @@ jobs:
2829
with:
2930
node-version: ${{ matrix.node-version }}
3031
cache: npm
31-
- run: npm ci
32+
- run: npm clean-install
33+
- run: npm audit signatures
3234
- run: npm run test:ci
3335

3436
# separate job to set as required in branch protection,
@@ -40,9 +42,12 @@ jobs:
4042
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
4143
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
4244
with:
43-
node-version: 16
45+
node-version: lts/*
4446
cache: npm
45-
- run: npm ci
47+
- run: npm clean-install
4648
- name: Ensure dependencies are compatible with the version of node
4749
run: npx ls-engines
4850
- run: npm run lint
51+
# https://github.com/lirantal/lockfile-lint#readme
52+
- name: Scan lockfile for security issues
53+
run: npx lockfile-lint --path package-lock.json

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ lib-cov
6363
# Coverage directory used by tools like istanbul
6464
coverage
6565

66-
# nyc test coverage
67-
.nyc_output
68-
6966
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
7067
.grunt
7168

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Any other type of error will be considered by [semantic-release](https://github.
1111
## Usage
1212

1313
```js
14-
const SemanticReleaseError = require("@semantic-release/error");
14+
import SemanticReleaseError from "@semantic-release/error";
1515

1616
// Default
1717
throw new SemanticReleaseError();

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module.exports = class SemanticReleaseError extends Error {
1+
export default class SemanticReleaseError extends Error {
22
constructor(message, code, details) {
33
super(message);
44
Error.captureStackTrace(this, this.constructor);
5-
this.name = 'SemanticReleaseError';
5+
this.name = "SemanticReleaseError";
66
this.code = code;
77
this.details = details;
88
this.semanticRelease = true;
99
}
10-
};
10+
}

0 commit comments

Comments
 (0)