Skip to content

Commit

Permalink
fix(angular): export generators correctly #12434 (#12460)
Browse files Browse the repository at this point in the history
(cherry picked from commit 32189d5)
  • Loading branch information
Coly010 authored and FrozenPandaz committed Oct 11, 2022
1 parent 4a30fcd commit 3569a6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { joinPathFragments, logger, Tree } from '@nrwl/devkit';
import {
formatFiles,
joinPathFragments,
logger,
readProjectConfiguration,
Tree,
} from '@nrwl/devkit';
import type { Schema } from './schema';

import { readProjectConfiguration, formatFiles } from '@nrwl/devkit';
import { getMFProjects } from '../../utils/get-mf-projects';
import {
checkOutputNameMatchesProjectName,
Expand All @@ -12,7 +16,7 @@ import {
writeNewWebpackConfig,
} from './lib';

export default async function convertToWithMF(tree: Tree, schema: Schema) {
export async function convertToWithMF(tree: Tree, schema: Schema) {
const projects = new Set(getMFProjects(tree, { legacy: true }));

if (!projects.has(schema.project)) {
Expand Down Expand Up @@ -56,3 +60,5 @@ export default async function convertToWithMF(tree: Tree, schema: Schema) {

await formatFiles(tree);
}

export default convertToWithMF;
4 changes: 3 additions & 1 deletion packages/angular/src/generators/host/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { addStandaloneRoute } from '../../utils/nx-devkit/standalone-utils';
import { setupMf } from '../setup-mf/setup-mf';
import { E2eTestRunner } from '../../utils/test-runners';

export default async function host(tree: Tree, options: Schema) {
export async function host(tree: Tree, options: Schema) {
const projects = getProjects(tree);

const remotesToGenerate: string[] = [];
Expand Down Expand Up @@ -158,3 +158,5 @@ ${remoteRoutes}
}
);
}

export default host;
4 changes: 3 additions & 1 deletion packages/angular/src/generators/remote/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function findNextAvailablePort(tree: Tree) {
return nextAvailablePort;
}

export default async function remote(tree: Tree, options: Schema) {
export async function remote(tree: Tree, options: Schema) {
const projects = getProjects(tree);
if (options.host && !projects.has(options.host)) {
throw new Error(
Expand Down Expand Up @@ -152,3 +152,5 @@ export class AppModule {}`
tree.write(pathToIndexHtml, newIndexContents);
}
}

export default remote;

0 comments on commit 3569a6f

Please sign in to comment.