Skip to content
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cbe02f2
feat(nx-plugin): add support for local code execution
BioPhoton Sep 5, 2025
b556bd8
refactor: revert plugin options
BioPhoton Sep 5, 2025
4bba9cd
test: update e2e tests
BioPhoton Sep 5, 2025
47bc389
refactor: adjust target options
BioPhoton Sep 5, 2025
695acbc
refactor: add int test for env vars
BioPhoton Sep 5, 2025
5d4fd60
refactor: remove dependencies on packages, use latest
BioPhoton Sep 5, 2025
052e18c
refactor: fix missing bin in command
BioPhoton Sep 5, 2025
e6ac40d
refactor: add colored formatting
BioPhoton Sep 5, 2025
311679f
refactor: fix tests for colored formatting
BioPhoton Sep 5, 2025
8f3b7fa
chore: cache nxv-e2e-setup
BioPhoton Sep 5, 2025
e9e4a3a
refactor: wip
BioPhoton Sep 5, 2025
a1d0f9d
refactor: wip 2
BioPhoton Sep 5, 2025
f1dd383
refactor: wip 3
BioPhoton Sep 5, 2025
93d1d40
refactor: fix e2e
BioPhoton Sep 5, 2025
41c900b
refactor: fix unit test
BioPhoton Sep 5, 2025
60183db
refactor: fix lint
BioPhoton Sep 5, 2025
ea73523
refactor: fix lint
BioPhoton Sep 5, 2025
454960b
refactor: fix lint
BioPhoton Sep 5, 2025
b368ac0
refactor: fix lint
BioPhoton Sep 6, 2025
d5e05a4
refactor: adjust command logic
BioPhoton Sep 6, 2025
2041093
refactor: adjust command logic
BioPhoton Sep 6, 2025
bebae7c
refactor: wip
BioPhoton Sep 6, 2025
f947823
refactor: wip
BioPhoton Sep 6, 2025
752a97e
refactor: wip
BioPhoton Sep 6, 2025
4e90518
refactor: wip
BioPhoton Sep 6, 2025
a180d5c
test(nx-plugin): add tests for buildCommandString
BioPhoton Sep 6, 2025
41f9af2
refactor: wip
BioPhoton Sep 6, 2025
9dff7c4
refactor: revert versions change
BioPhoton Sep 6, 2025
0f3ba3a
Update CONTRIBUTING.md
BioPhoton Sep 8, 2025
cefe54d
Update packages/nx-plugin/src/executors/cli/executor.ts
BioPhoton Sep 8, 2025
d9b453f
Update CONTRIBUTING.md
BioPhoton Sep 8, 2025
7b307d0
Update CONTRIBUTING.md
BioPhoton Sep 8, 2025
a2892ba
refactor: move logic into command.ts
BioPhoton Sep 8, 2025
ff74241
refactor: adjust tests
BioPhoton Sep 8, 2025
fc990a6
refactor: fix build
BioPhoton Sep 8, 2025
b1875d3
refactor: adjust models
BioPhoton Sep 8, 2025
371e70b
refactor: adjust comments
BioPhoton Sep 8, 2025
ab3f5ed
refactor: adjust comments
BioPhoton Sep 8, 2025
aa0950a
refactor: remove comments
BioPhoton Sep 8, 2025
1d006f2
refactor: fix e2e
BioPhoton Sep 8, 2025
fe6d69b
refactor: fix int
BioPhoton Sep 8, 2025
57c13c6
refactor: fix int 2
BioPhoton Sep 8, 2025
39c112a
refactor: fix int 3
BioPhoton Sep 8, 2025
c8c04d2
refactor: revert
BioPhoton Sep 9, 2025
24b5d03
Merge remote-tracking branch 'origin/main' into feat/plugin-nx/allow-…
BioPhoton Sep 9, 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
51 changes: 14 additions & 37 deletions e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,6 @@ describe('nx-plugin', () => {
});
});

it('should consider plugin option bin in configuration target', async () => {
const cwd = path.join(testFileDir, 'configuration-option-bin');
registerPluginInWorkspace(tree, {
plugin: '@code-pushup/nx-plugin',
options: {
bin: 'XYZ',
},
});
await materializeTree(tree, cwd);

const { code, projectJson } = await nxShowProjectJson(cwd, project);

expect(code).toBe(0);

expect(projectJson.targets).toStrictEqual({
'code-pushup--configuration': expect.objectContaining({
options: {
command: `nx g XYZ:configuration --skipTarget --targetName="code-pushup" --project="${project}"`,
},
}),
});
});

it('should NOT add config targets dynamically if the project is configured', async () => {
const cwd = path.join(testFileDir, 'configuration-already-configured');
registerPluginInWorkspace(tree, '@code-pushup/nx-plugin');
Expand Down Expand Up @@ -189,28 +166,26 @@ describe('nx-plugin', () => {

await materializeTree(tree, cwd);

const { stdout, stderr } = await executeProcess({
const { stdout } = await executeProcess({
command: 'npx',
args: ['nx', 'run', `${project}:code-pushup`, '--dryRun'],
args: ['nx', 'run', `${project}:code-pushup`, '--dryRun', '--verbose'],
cwd,
});

const cleanStderr = removeColorCodes(stderr);
// @TODO create test environment for working plugin. This here misses package-lock.json to execute correctly
expect(cleanStderr).toContain('DryRun execution of: npx @code-pushup/cli');

const cleanStdout = removeColorCodes(stdout);
expect(cleanStdout).toContain(
'NX Successfully ran target code-pushup for project my-lib',
);
expect(cleanStdout).toContain('nx run my-lib:code-pushup');
expect(cleanStdout).toContain('$ npx @code-pushup/cli ');
expect(cleanStdout).toContain('--dryRun --verbose');
expect(cleanStdout).toContain(`--upload.project=\\"${project}\\"`);
});

it('should consider plugin option bin in executor target', async () => {
const cwd = path.join(testFileDir, 'configuration-option-bin');
it('should consider plugin option cliBin in executor target', async () => {
const cwd = path.join(testFileDir, 'executor-option-cliBin');
const cliBinPath = `packages/cli/dist`;
registerPluginInWorkspace(tree, {
plugin: '@code-pushup/nx-plugin',
options: {
bin: 'XYZ',
cliBin: cliBinPath,
},
});
const { root } = readProjectConfiguration(tree, project);
Expand All @@ -223,13 +198,15 @@ describe('nx-plugin', () => {

expect(projectJson.targets).toStrictEqual({
'code-pushup': expect.objectContaining({
executor: 'XYZ:cli',
options: {
bin: cliBinPath,
},
}),
});
});

it('should consider plugin option projectPrefix in executor target', async () => {
const cwd = path.join(testFileDir, 'configuration-option-bin');
const cwd = path.join(testFileDir, 'executor-option-projectPrefix');
registerPluginInWorkspace(tree, {
plugin: '@code-pushup/nx-plugin',
options: {
Expand Down
Loading