Skip to content

Commit

Permalink
Merge pull request #208 from bertdeblock/fix-compat-with-release-it-v15
Browse files Browse the repository at this point in the history
Fix compatibility with `release-it` v15
  • Loading branch information
scalvert committed Jul 19, 2022
2 parents a550ef0 + 7fed06b commit 9088903
Show file tree
Hide file tree
Showing 8 changed files with 12,957 additions and 7,398 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ module.exports = {
node: true,
},
rules: {
// See https://github.com/mysticatea/eslint-plugin-node/issues/255 for more info.
'node/no-missing-import': [
'error',
{
allowModules: ['release-it'],
},
],
'prettier/prettier': 'error',
},
overrides: [
Expand All @@ -19,5 +26,11 @@ module.exports = {
sourceType: 'script',
},
},
{
files: ['test.js'],
env: {
jest: true,
},
},
],
};
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2.4.0
Expand All @@ -45,7 +45,7 @@ jobs:

strategy:
matrix:
release-it-version: ["14.0.0", "14.1.0", "14.2.0"]
release-it-version: ["14.0.0", "14.1.0", "14.2.0", "15.0.0", "15.1.1"]

steps:
- uses: actions/checkout@v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EOL } from 'os';
import fs from 'fs';
import which from 'which';
import { Plugin } from 'release-it';
import { format } from 'release-it/lib/util.js';
import template from 'lodash.template';
import tmp from 'tmp';
import execa from 'execa';
import { fromMarkdown } from 'mdast-util-from-markdown';
Expand Down Expand Up @@ -42,7 +42,7 @@ export default class LernaChangelogGeneratorPlugin extends Plugin {
let { version } = this.config.getContext();

let tagName = this.config.getContext('git.tagName');
let nextVersion = tagName ? format(tagName, { version }) : version;
let nextVersion = tagName ? template(tagName)({ version }) : version;

return nextVersion;
}
Expand Down
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
setupFilesAfterEnv: ['./jest.setup.js'],
moduleFileExtensions: ['js', 'ts', 'mjs'],
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest',
},
moduleNameMapper: {
'#(.*)': '<rootDir>/node_modules/$1',
},
};
3 changes: 3 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { jest } from '@jest/globals';

jest.setTimeout(30000);

0 comments on commit 9088903

Please sign in to comment.