Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusts for angular microfrontend support #24747

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion generators/angular/templates/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
<%_ if (skipServer) { _%>
"sonar-scanner": "3.1.0",
<%_ } _%>
<%_ if (microfrontend && applicationTypeGateway) { _%>
<%_ if (microfrontend) { _%>
<%_ if (applicationTypeGateway) { _%>
"@angular-architects/module-federation-runtime": "<%= nodeDependencies['@angular-architects/module-federation-runtime'] %>",
<%_ } _%>
"@angular-architects/module-federation": "<%= nodeDependencies['@angular-architects/module-federation'] %>",
<%_ } _%>
<%_ if (communicationSpringWebsocket) { _%>
Expand Down
18 changes: 16 additions & 2 deletions generators/workspaces/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default class WorkspacesGenerator extends BaseWorkspacesGenerator {
loadConfig() {
this.parseJHipsterOptions(command.options);

// Generate workspaces file only when option passed or regenerating
this.generateWorkspaces = this.workspaces !== false || !!this.packageJson?.get('workspaces');
// Generate workspaces file if workspace option is passed, or if workspace option is ommitted and monorepository is enabled, or if regenerating.
this.generateWorkspaces = (this.workspaces ?? this.jhipsterConfig.monorepository) || Boolean(this.packageJson?.get('workspaces'));

// When generating workspaces, save to .yo-rc.json. Use a dummy config otherwise.
this.workspacesConfig = this.generateWorkspaces ? this.jhipsterConfig : {};
Expand Down Expand Up @@ -113,6 +113,20 @@ export default class WorkspacesGenerator extends BaseWorkspacesGenerator {
return this.delegateTasksToBlueprint(() => this.composing);
}

get loading() {
return this.asLoadingTaskGroup({
checkWorkspaces() {
if (this.generateWorkspaces && !this.jhipsterConfig.monorepository) {
throw new Error('Workspaces option is only supported with monorepositories.');
}
},
});
}

get [BaseWorkspacesGenerator.LOADING]() {
return this.delegateTasksToBlueprint(() => this.loading);
}

get loadingWorkspaces() {
return this.asDefaultTaskGroup({
configurePackageManager({ applications }) {
Expand Down
Loading