Skip to content

Commit

Permalink
client: inject workspace instead of override
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 6, 2024
1 parent 64960c3 commit a75433e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion generators/client/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,19 @@ export default class JHipsterClientGenerator extends BaseApplicationGenerator {
if (application.clientRootDir) {
// Add scripts to map to client package.json
this.packageJson.merge({
workspaces: [application.clientRootDir],
scripts: {
'webapp:build': `npm run -w ${application.clientRootDir} webapp:build`,
'ci:frontend:test': `npm run -w ${application.clientRootDir} ci:frontend:test`,
'e2e:headless': `npm run -w ${application.clientRootDir} e2e:headless`,
},
});

const clientWorkspace = application.clientRootDir.slice(-1);
const packageJson = this.packageJson.createProxy();
const workspaces = packageJson.workspaces as string[] | undefined;
if (!workspaces?.includes(clientWorkspace)) {
packageJson.workspaces = [...(workspaces ?? []), clientWorkspace];
}
}
},

Expand Down

0 comments on commit a75433e

Please sign in to comment.