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 b5f905d
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(0, -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 b5f905d

Please sign in to comment.