Skip to content

Commit a3f5d25

Browse files
committed
fix(nx-plugin): update command generation to correctly format plugin flags
1 parent c2059ae commit a3f5d25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('utils', () => {
119119
});
120120

121121
expect(command).toBe(
122-
'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @hey-api/typescript,@hey-api/sdk',
122+
'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @hey-api/typescript -p @hey-api/sdk',
123123
);
124124
});
125125

@@ -132,7 +132,7 @@ describe('utils', () => {
132132
});
133133

134134
expect(command).toBe(
135-
'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @tanstack/react-query,zod',
135+
'npx @hey-api/openapi-ts -i ./api/spec.yaml -o ./src/generated -c @hey-api/client-fetch -p @tanstack/react-query -p zod',
136136
);
137137
});
138138
});

packages/nx-plugin/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function generateClientCommand({
3232
plugins: Plugin[];
3333
specFile: string;
3434
}) {
35-
return `npx @hey-api/openapi-ts -i ${specFile} -o ${outputPath} -c ${clientType}${plugins.length > 0 ? ` -p ${plugins.map(getPluginName).join(',')}` : ''}`;
35+
return `npx @hey-api/openapi-ts -i ${specFile} -o ${outputPath} -c ${clientType}${plugins.length > 0 ? ` ${plugins.map((plugin) => `-p ${getPluginName(plugin)}`).join(' ')}` : ''}`;
3636
}
3737

3838
/**

0 commit comments

Comments
 (0)