Skip to content

Commit 06f0b65

Browse files
author
John Doe
committed
refactor: move plugin default exports
1 parent 8aa17d1 commit 06f0b65

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

packages/nx-plugin/src/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { CreateNodesV2, NxPlugin } from '@nx/devkit';
2-
import { createNodes, createNodesV2 } from './plugin/index.js';
1+
import { plugin } from './plugin/index.js';
32

43
export { createNodes, createNodesV2 } from './plugin/index.js';
54
export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
@@ -11,8 +10,4 @@ export { initGenerator, initSchematic } from './generators/init/generator.js';
1110
export { type InitGeneratorSchema } from './generators/init/schema.js';
1211
export * from './internal/versions.js';
1312

14-
export default {
15-
name: 'code-pushup',
16-
createNodesV2: createNodesV2 as CreateNodesV2,
17-
createNodes,
18-
} satisfies NxPlugin;
13+
export default plugin;
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
import type { NxPlugin } from '@nx/devkit';
2-
import { createNodesV2 } from './plugin.js';
3-
4-
export { createNodes, createNodesV2 } from './plugin.js';
1+
export { createNodes, createNodesV2, plugin } from './plugin.js';
52
export type { CreateNodesOptions } from './types.js';
6-
7-
const plugin = {
8-
createNodesV2,
9-
name: 'code-pushup-nx-plugin',
10-
} satisfies NxPlugin;
11-
12-
export default plugin;

packages/nx-plugin/src/plugin/plugin.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
CreateNodesResult,
66
CreateNodesResultV2,
77
CreateNodesV2,
8+
NxPlugin,
89
} from '@nx/devkit';
910
import { PROJECT_JSON_FILE_NAME } from '../internal/constants.js';
1011
import { createTargets } from './target/targets.js';
@@ -70,3 +71,9 @@ export const createNodesV2: CreateNodesV2 = [
7071
);
7172
},
7273
];
74+
75+
export const plugin = {
76+
name: 'code-pushup',
77+
createNodesV2: createNodesV2 as CreateNodesV2,
78+
createNodes,
79+
} satisfies NxPlugin;

0 commit comments

Comments
 (0)