Skip to content

Commit

Permalink
refactor(esm): converted the package to esm-only (#249)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `@semantic-release/error` is now an ES Module

BREAKING CHANGE: the minimum required version of node is now v18
  • Loading branch information
travi committed Jun 7, 2023
1 parent f0069bf commit d378487
Show file tree
Hide file tree
Showing 12 changed files with 2,848 additions and 17,566 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# style: prettier
59b36b44061cf622f2e73365f9a7722f9e6e5353
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
with:
cache: npm
node-version: lts/*
- run: npm ci
- run: npm clean-install
- run: npm audit signatures
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
strategy:
matrix:
node-version:
- 14.17
- 16
- 18.0.0
- 19
- 20

runs-on: ubuntu-latest

Expand All @@ -28,7 +29,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm clean-install
- run: npm audit signatures
- run: npm run test:ci

# separate job to set as required in branch protection,
Expand All @@ -40,9 +42,12 @@ jobs:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: 16
node-version: lts/*
cache: npm
- run: npm ci
- run: npm clean-install
- name: Ensure dependencies are compatible with the version of node
run: npx ls-engines
- run: npm run lint
# https://github.com/lirantal/lockfile-lint#readme
- name: Scan lockfile for security issues
run: npx lockfile-lint --path package-lock.json
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Any other type of error will be considered by [semantic-release](https://github.
## Usage

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

// Default
throw new SemanticReleaseError();
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = class SemanticReleaseError extends Error {
export default class SemanticReleaseError extends Error {
constructor(message, code, details) {
super(message);
Error.captureStackTrace(this, this.constructor);
this.name = 'SemanticReleaseError';
this.name = "SemanticReleaseError";
this.code = code;
this.details = details;
this.semanticRelease = true;
}
};
}

0 comments on commit d378487

Please sign in to comment.