Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with release-it v15 #208

Merged
merged 7 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'],
scalvert marked this conversation as resolved.
Show resolved Hide resolved
},
],
'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';
scalvert marked this conversation as resolved.
Show resolved Hide resolved
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);