Skip to content

Commit ff42f74

Browse files
committed
wip(commitlint): add a no-op lifter
1 parent d1934f1 commit ff42f74

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

src/commitlint/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export {default as scaffold} from './scaffolder.js';
22
export {default as test} from './tester.js';
3+
export {default as lift} from './lifter.js';

src/commitlint/lifter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function () {
2+
return {};
3+
}

src/commitlint/lifter.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {describe, expect, it} from 'vitest';
2+
3+
import liftCommitlint from './lifter.js';
4+
5+
describe('commitlint lifter', () => {
6+
it('should return an empty result when config does not need the format to be changed', async () => {
7+
expect(await liftCommitlint()).toEqual({});
8+
});
9+
});

src/lifter.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import {applyEnhancers} from '@form8ion/core';
22

33
import * as semanticReleasePlugin from './semantic-release/index.js';
4+
import * as commitlintPlugin from './commitlint/index.js';
45

56
export default async function ({projectRoot}) {
67
return applyEnhancers({
78
options: {projectRoot},
8-
enhancers: {'semantic-release': semanticReleasePlugin}
9+
enhancers: {
10+
'semantic-release': semanticReleasePlugin,
11+
commitlint: commitlintPlugin
12+
}
913
});
1014
}

src/lifter.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {describe, expect, it, vi} from 'vitest';
55
import {when} from 'jest-when';
66

77
import * as semanticReleasePlugin from './semantic-release/index.js';
8+
import * as commitlintPlugin from './commitlint/index.js';
89
import lift from './lifter.js';
910

1011
vi.mock('@form8ion/core');
@@ -14,7 +15,13 @@ describe('lifter', () => {
1415
const projectRoot = any.string();
1516
const enhancerResults = any.simpleObject();
1617
when(applyEnhancers)
17-
.calledWith({options: {projectRoot}, enhancers: {'semantic-release': semanticReleasePlugin}})
18+
.calledWith({
19+
options: {projectRoot},
20+
enhancers: {
21+
'semantic-release': semanticReleasePlugin,
22+
commitlint: commitlintPlugin
23+
}
24+
})
1825
.mockResolvedValue(enhancerResults);
1926

2027
expect(await lift({projectRoot})).toEqual(enhancerResults);

0 commit comments

Comments
 (0)