Skip to content

Commit a0f0c7e

Browse files
committed
Ensure arguments forwarded to code-pushup binary
1 parent abdfc7a commit a0f0c7e

7 files changed

Lines changed: 22 additions & 22 deletions

File tree

__tests__/monorepo.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ describe('monorepo projects detection', () => {
6666
await expect(listMonorepoProjects(DEFAULT_INPUTS)).resolves.toEqual<
6767
ProjectConfig[]
6868
>([
69-
{ name: 'backend', bin: 'npx nx run backend:code-pushup' },
70-
{ name: 'frontend', bin: 'npx nx run frontend:code-pushup' }
69+
{ name: 'backend', bin: 'npx nx run backend:code-pushup --' },
70+
{ name: 'frontend', bin: 'npx nx run frontend:code-pushup --' }
7171
])
7272
})
7373

@@ -111,10 +111,10 @@ describe('monorepo projects detection', () => {
111111
await expect(listMonorepoProjects(DEFAULT_INPUTS)).resolves.toEqual<
112112
ProjectConfig[]
113113
>([
114-
{ name: 'backoffice', bin: 'npx turbo run code-pushup -F backoffice' },
115-
{ name: 'website', bin: 'npx turbo run code-pushup -F website' },
116-
{ name: 'api', bin: 'npx turbo run code-pushup -F api' },
117-
{ name: 'auth', bin: 'npx turbo run code-pushup -F auth' }
114+
{ name: 'backoffice', bin: 'npx turbo run code-pushup -F backoffice --' },
115+
{ name: 'website', bin: 'npx turbo run code-pushup -F website --' },
116+
{ name: 'api', bin: 'npx turbo run code-pushup -F api --' },
117+
{ name: 'auth', bin: 'npx turbo run code-pushup -F auth --' }
118118
])
119119
})
120120

@@ -145,9 +145,9 @@ describe('monorepo projects detection', () => {
145145
await expect(listMonorepoProjects(DEFAULT_INPUTS)).resolves.toEqual<
146146
ProjectConfig[]
147147
>([
148-
{ name: 'backend', bin: 'pnpm run code-pushup -F backend' },
149-
{ name: 'frontend', bin: 'pnpm run code-pushup -F frontend' },
150-
{ name: '@repo/utils', bin: 'pnpm run code-pushup -F @repo/utils' }
148+
{ name: 'backend', bin: 'pnpm -F backend run code-pushup' },
149+
{ name: 'frontend', bin: 'pnpm -F frontend run code-pushup' },
150+
{ name: '@repo/utils', bin: 'pnpm -F @repo/utils run code-pushup' }
151151
])
152152
})
153153

@@ -204,8 +204,8 @@ describe('monorepo projects detection', () => {
204204
await expect(listMonorepoProjects(DEFAULT_INPUTS)).resolves.toEqual<
205205
ProjectConfig[]
206206
>([
207-
{ name: 'backend', bin: 'npm -w backend exec code-pushup' },
208-
{ name: 'frontend', bin: 'npm -w frontend exec code-pushup' }
207+
{ name: 'backend', bin: 'npm -w backend exec code-pushup --' },
208+
{ name: 'frontend', bin: 'npm -w frontend exec code-pushup --' }
209209
])
210210
})
211211

dist/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/monorepo/handlers/npm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export const npmHandler: MonorepoToolHandler = {
2828
.map(({ name, packageJson }) => ({
2929
name,
3030
bin: hasScript(packageJson, options.task)
31-
? `npm -w ${name} run ${options.task}`
32-
: `npm -w ${name} exec ${options.task}`
31+
? `npm -w ${name} run ${options.task} --`
32+
: `npm -w ${name} exec ${options.task} --`
3333
}))
3434
}
3535
}

src/monorepo/handlers/nx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const nxHandler: MonorepoToolHandler = {
2222
const projects = parseProjects(stdout)
2323
return projects.map(project => ({
2424
name: project,
25-
bin: `npx nx run ${project}:${options.task}`
25+
bin: `npx nx run ${project}:${options.task} --`
2626
}))
2727
}
2828
}

src/monorepo/handlers/pnpm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const pnpmHandler: MonorepoToolHandler = {
3434
.map(({ name, packageJson }) => ({
3535
name,
3636
bin: hasScript(packageJson, options.task)
37-
? `pnpm run ${options.task} -F ${name}`
37+
? `pnpm -F ${name} run ${options.task}`
3838
: `pnpm -F ${name} exec ${options.task}`
3939
}))
4040
}

src/monorepo/handlers/turbo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const turboHandler: MonorepoToolHandler = {
2626
const projects = await handler.listProjects(options)
2727
return projects.map(({ name }) => ({
2828
name,
29-
bin: `npx turbo run ${options.task} -F ${name}`
29+
bin: `npx turbo run ${options.task} -F ${name} --`
3030
}))
3131
}
3232
}

0 commit comments

Comments
 (0)