Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
09ec54b
chore: add plugin to nx.json
BioPhoton Aug 27, 2025
a449ca5
chore: add plugin to nx.json plugins
BioPhoton Aug 27, 2025
a2c3278
refactor: test use latest version
BioPhoton Aug 28, 2025
5ec4034
refactor: test use latest version 2
BioPhoton Aug 28, 2025
57bfc00
Merge branch 'main' into use-cp-nx-plugin
BioPhoton Aug 29, 2025
add0f3a
Merge branch 'main' into use-cp-nx-plugin
BioPhoton Sep 1, 2025
93e20e8
refactor: fix lint
BioPhoton Sep 1, 2025
3cb3a8d
refactor: wip
BioPhoton Sep 1, 2025
00e6fae
refactor: wip 2
BioPhoton Sep 1, 2025
2e8a05c
Merge branch 'main' into use-cp-nx-plugin
BioPhoton Sep 2, 2025
99d988a
refactor: update packages
BioPhoton Sep 2, 2025
0e66ac8
chore: update packages
BioPhoton Sep 3, 2025
f402ecb
refactor: use process.stdout.write
BioPhoton Sep 3, 2025
41bce2b
refactor: test pkg new
BioPhoton Sep 3, 2025
59a3f83
refactor: add output arg handling to nx-plugin args
BioPhoton Sep 3, 2025
06c94d9
docs: add release steps
BioPhoton Sep 4, 2025
e355699
Merge branch 'main' into use-cp-nx-plugin
BioPhoton Sep 4, 2025
e7da7ef
chore: update packages
BioPhoton Sep 4, 2025
8f69a5e
docs: update release section
BioPhoton Sep 4, 2025
8dced0b
docs: update release section
BioPhoton Sep 4, 2025
0049a64
chore: update packags
BioPhoton Sep 4, 2025
39d2357
Merge branch 'main' into use-cp-nx-plugin
BioPhoton Sep 5, 2025
8aa17d1
Merge branch 'main' into use-cp-nx-plugin
Nov 9, 2025
06f0b65
refactor: move plugin default exports
Nov 9, 2025
55c022b
refactor: remove bin option from config
Nov 9, 2025
e419189
refactor: update packages
Nov 9, 2025
3fb6747
refactor: remove bin options for config generator
Nov 9, 2025
4ba05a6
refactor: add env options and correct bin
Nov 10, 2025
d61fa16
Merge branch 'main' into use-cp-nx-plugin
Nov 10, 2025
71779ae
refactor: refactor plugin options
Nov 11, 2025
45e33a3
refactor: packages update
Nov 11, 2025
c8ab27c
refactor: fix text
Nov 11, 2025
4dcbedb
refactor: fix import
Nov 11, 2025
2d12182
refactor: fix logger spacing
Nov 11, 2025
804319b
refactor: add logger helper unit tests
Nov 11, 2025
a54e5dc
refactor: add env and cwd to logger in execProcess
Nov 11, 2025
0a8af75
refactor: fix unit tests
Nov 11, 2025
50d9f2c
refactor: wip
Nov 11, 2025
256ea00
refactor: wip revert
Nov 11, 2025
2b05307
refactor: wip 1
Nov 11, 2025
cbf9d19
refactor: move objToCliArgs parts and reuse
Nov 11, 2025
5559d5f
refactor: fix unit tests
Nov 11, 2025
0a5170f
refactor: wip
Nov 11, 2025
9a1558e
refactor: wip
Nov 11, 2025
b8c4659
refactor: wip
Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('nx-plugin', () => {
});

it('should consider plugin option projectPrefix in executor target', async () => {
const cwd = path.join(testFileDir, 'configuration-option-bin');
const cwd = path.join(testFileDir, 'configuration-option-projectPrefix');
registerPluginInWorkspace(tree, {
plugin: '@code-pushup/nx-plugin',
options: {
Expand Down
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@
"releaseTagPattern": "v{version}"
},
"plugins": [
{
"plugin": "@code-pushup/nx-plugin"
},
{
"plugin": "@push-based/nx-verdaccio",
"options": {
Expand Down
93 changes: 92 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
},
"devDependencies": {
"@beaussan/nx-knip": "^0.0.5-15",
"@code-pushup/cli": "^0.77.0",
"@code-pushup/eslint-config": "^0.14.2",
"@code-pushup/nx-plugin": "^0.77.0",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/config-nx-scopes": "^19.5.0",
Expand Down
19 changes: 8 additions & 11 deletions packages/nx-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import type { CreateNodesV2, NxPlugin } from '@nx/devkit';
import { createNodes, createNodesV2 } from './plugin/index.js';

// default export for nx.json#plugins
const plugin = {
name: '@code-pushup/nx-plugin',
createNodesV2,
// Keep for backwards compatibility with Nx < 21
createNodes,
};

export default plugin;

export { createNodes, createNodesV2 } from './plugin/index.js';
export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
export { objectToCliArgs } from './executors/internal/cli.js';
export { generateCodePushupConfig } from './generators/configuration/code-pushup-config.js';
Expand All @@ -22,4 +14,9 @@ export {
type ProcessConfig,
} from './internal/execute-process.js';
export * from './internal/versions.js';
export { createNodes, createNodesV2 } from './plugin/index.js';

export default {
name: 'code-pushup',
createNodesV2: createNodesV2 as CreateNodesV2,
createNodes,
} satisfies NxPlugin;
10 changes: 10 additions & 0 deletions packages/nx-plugin/src/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
import { NxPlugin } from '@nx/devkit';
import { createNodesV2 } from './plugin.js';

export { createNodes, createNodesV2 } from './plugin.js';
export type { CreateNodesOptions } from './types.js';

const plugin = {
createNodesV2,
name: 'code-pushup-nx-plugin',
} satisfies NxPlugin;

export default plugin;
5 changes: 3 additions & 2 deletions packages/nx-plugin/src/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ export const createNodes: CreateNodes = [
},
];

export const createNodesV2: CreateNodesV2<CreateNodesOptions> = [
export const createNodesV2: CreateNodesV2 = [
`**/${PROJECT_JSON_FILE_NAME}`,
async (
projectConfigurationFiles: readonly string[],
createNodesOptions: unknown,
context: CreateNodesContextV2,
): Promise<CreateNodesResultV2> => {
const parsedCreateNodesOptions = createNodesOptions as CreateNodesOptions;
const parsedCreateNodesOptions =
(createNodesOptions as CreateNodesOptions) ?? {};

return await Promise.all(
projectConfigurationFiles.map(async projectConfigurationFile => {
Expand Down
15 changes: 1 addition & 14 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@
"code-pushup-coverage": {},
"code-pushup-eslint": {},
"code-pushup-jsdocs": {},
"code-pushup-typescript": {},
"code-pushup": {
"dependsOn": ["code-pushup-*"],
"executor": "nx:run-commands",
"options": {
"args": [
"--no-progress",
"--verbose",
"--cache.read",
"--persist.outputDir={projectRoot}/.code-pushup",
"--upload.project={projectName}"
]
}
}
"code-pushup-typescript": {}
}
}
Loading