@nx/angular 17.2.6 → 17.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +9 -4
  2. package/package.json +10 -10
  3. package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +3 -1
  4. package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +6 -4
  5. package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +3 -1
  6. package/src/generators/component/files/__fileName__.spec.ts__tpl__ +2 -3
  7. package/src/generators/component/lib/component.js +1 -1
  8. package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +13 -8
  9. package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +2 -2
  10. package/src/generators/component-test/component-test.d.ts +1 -1
  11. package/src/generators/component-test/component-test.js +4 -1
  12. package/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +9 -11
  13. package/src/generators/convert-to-with-mf/convert-to-with-mf.js +3 -1
  14. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +3 -2
  15. package/src/generators/convert-to-with-mf/schema.d.ts +1 -0
  16. package/src/generators/convert-to-with-mf/schema.json +6 -0
  17. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -1
  18. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -4
  19. package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -3
  20. package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +2 -2
  21. package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +1 -1
  22. package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +1 -1
  23. package/src/generators/library/lib/add-load-children.js +2 -2
  24. package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -5
  25. package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +3 -1
  26. package/src/generators/library-secondary-entry-point/schema.d.ts +1 -0
  27. package/src/generators/library-secondary-entry-point/schema.json +6 -0
  28. package/src/generators/ngrx/files/__directory__/__fileName__.models.ts__tmpl__ +1 -1
  29. package/src/generators/ngrx/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +1 -1
  30. package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.models.ts__tmpl__ +1 -1
  31. package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +1 -1
  32. package/src/generators/pipe/files/__fileName__.ts__tpl__ +0 -2
  33. package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +2 -2
  34. package/src/generators/remote/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -2
  35. package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +0 -1
  36. package/src/generators/scam/lib/convert-component-to-scam.js +2 -1
  37. package/src/generators/scam-directive/lib/convert-directive-to-scam.js +2 -1
  38. package/src/generators/scam-directive/scam-directive.js +3 -1
  39. package/src/generators/scam-directive/schema.d.ts +1 -0
  40. package/src/generators/scam-directive/schema.json +6 -0
  41. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +2 -1
  42. package/src/generators/scam-pipe/scam-pipe.js +3 -1
  43. package/src/generators/scam-pipe/schema.d.ts +1 -0
  44. package/src/generators/scam-pipe/schema.json +6 -0
  45. package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +3 -1
  46. package/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +1 -1
  47. package/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +12 -12
  48. package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
  49. package/src/generators/setup-mf/lib/add-remote-entry.js +1 -1
  50. package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -1
  51. package/src/generators/setup-mf/lib/fix-bootstrap.js +7 -6
  52. package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +10 -10
  53. package/src/generators/setup-mf/lib/update-host-app-routes.js +2 -2
  54. package/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ +4 -4
  55. package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +1 -1
  56. package/src/generators/utils/export-scam.js +2 -2
  57. package/src/generators/utils/testing.js +12 -1
  58. package/src/utils/nx-devkit/testing.js +27 -31
package/README.md CHANGED
@@ -1,4 +1,9 @@
1
- <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
2
7
 
3
8
  <div style="text-align: center;">
4
9
 
@@ -15,9 +20,9 @@
15
20
 
16
21
  <hr>
17
22
 
18
- # Nx: Smart, Fast and Extensible Build System
23
+ # Nx: Smart Monorepos · Fast CI
19
24
 
20
- Nx is a next generation build system with first class monorepo support and powerful integrations.
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
21
26
 
22
27
  This package is an [Angular plugin for Nx](https://nx.dev/packages/angular).
23
28
 
@@ -59,5 +64,5 @@ npx nx@latest init
59
64
  - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
60
65
 
61
66
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
62
- width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
67
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
63
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "17.2.6",
3
+ "version": "17.3.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -78,15 +78,15 @@
78
78
  "tslib": "^2.3.0",
79
79
  "webpack": "^5.80.0",
80
80
  "webpack-merge": "^5.8.0",
81
- "@nx/devkit": "17.2.6",
82
- "@nx/cypress": "17.2.6",
83
- "@nx/jest": "17.2.6",
84
- "@nx/js": "17.2.6",
85
- "@nx/eslint": "17.2.6",
86
- "@nx/webpack": "17.2.6",
87
- "@nx/web": "17.2.6",
88
- "@nx/workspace": "17.2.6",
89
- "@nrwl/angular": "17.2.6"
81
+ "@nx/devkit": "17.3.0-beta.1",
82
+ "@nx/cypress": "17.3.0-beta.1",
83
+ "@nx/jest": "17.3.0-beta.1",
84
+ "@nx/js": "17.3.0-beta.1",
85
+ "@nx/eslint": "17.3.0-beta.1",
86
+ "@nx/webpack": "17.3.0-beta.1",
87
+ "@nx/web": "17.3.0-beta.1",
88
+ "@nx/workspace": "17.3.0-beta.1",
89
+ "@nrwl/angular": "17.3.0-beta.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -15,7 +15,9 @@ describe('AppComponent', () => {
15
15
  const fixture = TestBed.createComponent(AppComponent);
16
16
  fixture.detectChanges();
17
17
  const compiled = fixture.nativeElement as HTMLElement;
18
- expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
18
+ expect(compiled.querySelector('h1')?.textContent).toContain(
19
+ 'Welcome <%= appName %>'
20
+ );
19
21
  });<% if(!minimal) { %>
20
22
 
21
23
  it(`should have as title '<%= appName %>'`, () => {
@@ -11,10 +11,12 @@ describe('AppComponent', () => {
11
11
  });
12
12
 
13
13
  it('should render title', () => {
14
- const fixture = TestBed.createComponent(AppComponent);
15
- fixture.detectChanges();
16
- const compiled = fixture.nativeElement as HTMLElement;
17
- expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
14
+ const fixture = TestBed.createComponent(AppComponent);
15
+ fixture.detectChanges();
16
+ const compiled = fixture.nativeElement as HTMLElement;
17
+ expect(compiled.querySelector('h1')?.textContent).toContain(
18
+ 'Welcome <%= appName %>'
19
+ );
18
20
  });<% if(!minimal) { %>
19
21
 
20
22
  it(`should have as title '<%= appName %>'`, () => {
@@ -2,4 +2,6 @@ import { bootstrapApplication } from '@angular/platform-browser';
2
2
  import { appConfig } from './app/app.config';
3
3
  import { AppComponent } from './app/app.component';
4
4
 
5
- bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));
5
+ bootstrapApplication(AppComponent, appConfig).catch((err) =>
6
+ console.error(err)
7
+ );
@@ -7,9 +7,8 @@ describe('<%= symbolName %>', () => {
7
7
 
8
8
  beforeEach(async () => {
9
9
  await TestBed.configureTestingModule({
10
- <%= standalone ? 'imports' : 'declarations' %>: [ <%= symbolName %> ]
11
- })
12
- .compileComponents();
10
+ <%= standalone ? 'imports' : 'declarations' %>: [<%= symbolName %>]
11
+ }).compileComponents();
13
12
 
14
13
  fixture = TestBed.createComponent(<%= symbolName %>);
15
14
  component = fixture.componentInstance;
@@ -28,7 +28,7 @@ function exportComponentInEntryPoint(tree, schema) {
28
28
  }
29
29
  const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, schema.filePath);
30
30
  const updateEntryPointContent = (0, devkit_1.stripIndents) `${tree.read(entryPointPath, 'utf-8')}
31
- export * from "${relativePathFromEntryPoint}";`;
31
+ export * from '${relativePathFromEntryPoint}';`;
32
32
  tree.write(entryPointPath, updateEntryPointContent);
33
33
  }
34
34
  exports.exportComponentInEntryPoint = exportComponentInEntryPoint;
@@ -1,12 +1,17 @@
1
1
  describe('<%=projectName%>', () => {
2
- beforeEach(() => cy.visit('/iframe.html?id=<%= componentName.toLowerCase() %>--primary<% if ( props && props.length > 0 ) { %>&args=<% } %><%
3
- for(let prop of props) {
4
- %><%=prop.name%><%
5
- if(prop.defaultValue !== undefined && (prop.defaultValue || prop.defaultValue === false)) {
6
- %>:<%=prop.defaultValue%><%
7
- } %>;<%
8
- }%>'));
2
+ beforeEach(() =>
3
+ cy.visit(
4
+ '/iframe.html?id=<%= componentName.toLowerCase() %>--primary<% if ( props && props.length > 0 ) { %>&args=<% } %><%
5
+ for(let prop of props) {
6
+ %><%=prop.name%><%
7
+ if(prop.defaultValue !== undefined && (prop.defaultValue || prop.defaultValue === false)) {
8
+ %>:<%=prop.defaultValue%><%
9
+ } %>;<%
10
+ }%>'
11
+ )
12
+ );
13
+
9
14
  it('should render the component', () => {
10
15
  cy.get('<%=componentSelector%>').should('exist');
11
16
  });
12
- });
17
+ });
@@ -14,14 +14,14 @@ type Story = StoryObj<<%=componentName%>>;
14
14
 
15
15
  export const Primary: Story = {
16
16
  args: {<% for (let prop of props) { %>
17
- <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
17
+ <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
18
18
  },
19
19
  };
20
20
 
21
21
  <% if ( interactionTests ) { %>
22
22
  export const Heading: Story = {
23
23
  args: {<% for (let prop of props) { %>
24
- <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
24
+ <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
25
25
  },
26
26
  play: async ({ canvasElement }) => {
27
27
  const canvas = within(canvasElement);
@@ -1,4 +1,4 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { ComponentTestSchema } from './schema';
3
- export declare function componentTestGenerator(tree: Tree, options: ComponentTestSchema): void;
3
+ export declare function componentTestGenerator(tree: Tree, options: ComponentTestSchema): Promise<void>;
4
4
  export default componentTestGenerator;
@@ -4,7 +4,7 @@ exports.componentTestGenerator = void 0;
4
4
  const cypress_version_1 = require("@nx/cypress/src/utils/cypress-version");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const storybook_inputs_1 = require("../utils/storybook-ast/storybook-inputs");
7
- function componentTestGenerator(tree, options) {
7
+ async function componentTestGenerator(tree, options) {
8
8
  (0, cypress_version_1.assertMinimumCypressVersion)(10);
9
9
  const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
10
10
  const componentDirPath = (0, devkit_1.joinPathFragments)(root, options.componentDir);
@@ -21,6 +21,9 @@ function componentTestGenerator(tree, options) {
21
21
  tpl: '',
22
22
  });
23
23
  }
24
+ if (!options.skipFormat) {
25
+ await (0, devkit_1.formatFiles)(tree);
26
+ }
24
27
  }
25
28
  exports.componentTestGenerator = componentTestGenerator;
26
29
  exports.default = componentTestGenerator;
@@ -2,22 +2,20 @@ import { TestBed } from '@angular/core/testing';
2
2
  import { <%= componentName %> } from './<%= componentFileName %>';
3
3
 
4
4
  describe(<%= componentName %>.name, () => {
5
-
6
5
  beforeEach(() => {
7
6
  TestBed.overrideComponent(<%= componentName %>, {
8
7
  add: {
9
8
  imports: [],
10
9
  providers: []
11
10
  }
12
- })
13
- })
11
+ });
12
+ });
14
13
 
15
14
  it('renders', () => {
16
- cy.mount(<%= componentName %>,<% if(props.length > 0) { %> {
17
- componentProperties: {<% for (let prop of props) { %>
18
- <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
19
- }
20
- }<% } %>);
21
- })
22
-
23
- })
15
+ cy.mount(<%= componentName %><% if(props.length > 0) { %>, {
16
+ componentProperties: {<% for (let prop of props) { %>
17
+ <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
18
+ }
19
+ }<% } %>);
20
+ });
21
+ });
@@ -24,7 +24,9 @@ async function convertToWithMF(tree, schema) {
24
24
  const [updatedWebpackConfig, mfConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
25
25
  tree.write(pathToWebpackConfig, updatedWebpackConfig);
26
26
  tree.write((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js'), mfConfig);
27
- await (0, devkit_1.formatFiles)(tree);
27
+ if (!schema.skipFormat) {
28
+ await (0, devkit_1.formatFiles)(tree);
29
+ }
28
30
  }
29
31
  exports.convertToWithMF = convertToWithMF;
30
32
  exports.default = convertToWithMF;
@@ -4,8 +4,9 @@ exports.writeNewWebpackConfig = void 0;
4
4
  const is_host_remote_config_1 = require("./is-host-remote-config");
5
5
  function writeNewWebpackConfig(ast, mfType, projectName) {
6
6
  const webpackConfig = `const { withModuleFederation } = require('@nx/angular/module-federation');
7
- const config = require('./module-federation.config');
8
- module.exports = withModuleFederation(config);`;
7
+ const config = require('./module-federation.config');
8
+ module.exports = withModuleFederation(config);
9
+ `;
9
10
  let mfeConfig = '';
10
11
  if (!mfType) {
11
12
  mfeConfig = `
@@ -1,3 +1,4 @@
1
1
  export interface Schema {
2
2
  project: string;
3
+ skipFormat?: boolean;
3
4
  }
@@ -22,6 +22,12 @@
22
22
  },
23
23
  "x-prompt": "What micro frontend project would you like to migrate?",
24
24
  "x-priority": "important"
25
+ },
26
+ "skipFormat": {
27
+ "description": "Skip formatting files.",
28
+ "type": "boolean",
29
+ "default": false,
30
+ "x-priority": "internal"
25
31
  }
26
32
  }
27
33
  }
@@ -4,5 +4,5 @@ import { CypressComponentConfigSchema } from './schema';
4
4
  * This is for cypress built in component testing, if you want to test with
5
5
  * storybook + cypress then use the componentCypressGenerator instead.
6
6
  */
7
- export declare function cypressComponentConfiguration(tree: Tree, options: CypressComponentConfigSchema): Promise<() => void>;
7
+ export declare function cypressComponentConfiguration(tree: Tree, options: CypressComponentConfigSchema): Promise<import("@nx/devkit").GeneratorCallback>;
8
8
  export default cypressComponentConfiguration;
@@ -25,9 +25,7 @@ async function cypressComponentConfiguration(tree, options) {
25
25
  if (!options.skipFormat) {
26
26
  await (0, devkit_1.formatFiles)(tree);
27
27
  }
28
- return () => {
29
- installTask();
30
- };
28
+ return installTask;
31
29
  }
32
30
  exports.cypressComponentConfiguration = cypressComponentConfiguration;
33
31
  async function addFiles(tree, projectConfig, options) {
@@ -49,7 +47,7 @@ async function addFiles(tree, projectConfig, options) {
49
47
  continue;
50
48
  }
51
49
  const componentDirFromProjectRoot = (0, path_1.relative)(projectConfig.root, (0, devkit_1.joinPathFragments)(info.moduleFolderPath, info.path));
52
- (0, component_test_1.componentTestGenerator)(tree, {
50
+ await (0, component_test_1.componentTestGenerator)(tree, {
53
51
  project: options.project,
54
52
  componentName: info.name,
55
53
  componentDir: componentDirFromProjectRoot,
@@ -5,7 +5,5 @@ import { Directive } from '@angular/core';
5
5
  standalone: true<%}%>
6
6
  })
7
7
  export class <%= symbolName %> {
8
-
9
- constructor() { }
10
-
8
+ constructor() {}
11
9
  }
@@ -1,4 +1,4 @@
1
- import {withModuleFederationForSSR} from '@nx/angular/module-federation';
1
+ import { withModuleFederationForSSR } from '@nx/angular/module-federation';
2
2
  import config from './module-federation.config';
3
3
 
4
- export default withModuleFederationForSSR(config)
4
+ export default withModuleFederationForSSR(config);
@@ -1,5 +1,5 @@
1
1
  import { Route } from '@angular/router';
2
2
 
3
3
  export const <%= libPropertyName %>Routes: Route[] = [
4
- /* {path: '', pathMatch: 'full', component: InsertYourComponentHere} */
4
+ /* { path: '', pathMatch: 'full', component: InsertYourComponentHere } */
5
5
  ];
@@ -2,5 +2,5 @@ import { Route } from '@angular/router';
2
2
  import { <%= libClassName %>Component } from './<%= pathToComponent %>.component';
3
3
 
4
4
  export const <%= libPropertyName %>Routes: Route[] = [
5
- {path: '', component: <%= libClassName %>Component}
5
+ { path: '', component: <%= libClassName %>Component }
6
6
  ];
@@ -14,9 +14,9 @@ function addLoadChildren(tree, options) {
14
14
  }
15
15
  const moduleSource = tree.read(options.parent, 'utf-8');
16
16
  const sourceFile = tsModule.createSourceFile(options.parent, moduleSource, tsModule.ScriptTarget.Latest, true);
17
- const route = `{path: '${(0, devkit_1.names)(options.fileName).fileName}', loadChildren: () => import('${options.importPath}').then(m => m.${options.standalone
17
+ const route = `{ path: '${(0, devkit_1.names)(options.fileName).fileName}', loadChildren: () => import('${options.importPath}').then(m => m.${options.standalone
18
18
  ? `${(0, devkit_1.names)(options.name).propertyName}Routes`
19
- : options.moduleName})}`;
19
+ : options.moduleName}) }`;
20
20
  (0, route_utils_1.addRoute)(tree, options.parent, route);
21
21
  }
22
22
  exports.addLoadChildren = addLoadChildren;
@@ -1,5 +1 @@
1
- <% if (!skipModule) { %>
2
- export * from './lib/<%= fileName %>.module';
3
- <% } else { %>
4
- export const greeting = 'Hello World!';
5
- <% } %>
1
+ <% if (!skipModule) { %>export * from './lib/<%= fileName %>.module';<% } else { %>export const greeting = 'Hello World!';<% } %>
@@ -8,7 +8,9 @@ async function librarySecondaryEntryPointGenerator(tree, rawOptions) {
8
8
  (0, lib_1.addFiles)(tree, options);
9
9
  (0, lib_1.addPathMapping)(tree, options);
10
10
  (0, lib_1.updateTsConfigIncludedFiles)(tree, options);
11
- await (0, devkit_1.formatFiles)(tree);
11
+ if (!options.skipFormat) {
12
+ await (0, devkit_1.formatFiles)(tree);
13
+ }
12
14
  }
13
15
  exports.librarySecondaryEntryPointGenerator = librarySecondaryEntryPointGenerator;
14
16
  exports.default = librarySecondaryEntryPointGenerator;
@@ -4,6 +4,7 @@ export interface GeneratorOptions {
4
4
  library: string;
5
5
  name: string;
6
6
  skipModule?: boolean;
7
+ skipFormat?: boolean;
7
8
  }
8
9
 
9
10
  export interface NormalizedGeneratorOptions extends GeneratorOptions {
@@ -29,6 +29,12 @@
29
29
  "type": "boolean",
30
30
  "description": "Skip generating a module for the secondary entry point.",
31
31
  "default": false
32
+ },
33
+ "skipFormat": {
34
+ "description": "Skip formatting files.",
35
+ "type": "boolean",
36
+ "default": false,
37
+ "x-priority": "internal"
32
38
  }
33
39
  },
34
40
  "additionalProperties": false,
@@ -4,4 +4,4 @@
4
4
  export interface <%= className %>Entity {
5
5
  id: string | number; // Primary ID
6
6
  name: string;
7
- };
7
+ }
@@ -20,7 +20,7 @@ describe('<%= className %> Selectors', () => {
20
20
  create<%= className %>Entity('PRODUCT-CCC')
21
21
  ], {
22
22
  ...initial<%= className %>State,
23
- selectedId : 'PRODUCT-BBB',
23
+ selectedId: 'PRODUCT-BBB',
24
24
  error: ERROR_MSG,
25
25
  loaded: true
26
26
  })
@@ -4,4 +4,4 @@
4
4
  export interface <%= className %>Entity {
5
5
  id: string | number; // Primary ID
6
6
  name: string;
7
- };
7
+ }
@@ -20,7 +20,7 @@ describe('<%= className %> Selectors', () => {
20
20
  create<%= className %>Entity('PRODUCT-CCC')
21
21
  ], {
22
22
  ...initial<%= className %>State,
23
- selectedId : 'PRODUCT-BBB',
23
+ selectedId: 'PRODUCT-BBB',
24
24
  error: ERROR_MSG,
25
25
  loaded: true
26
26
  })
@@ -5,9 +5,7 @@ import { Pipe, PipeTransform } from '@angular/core';
5
5
  standalone: true<%}%>
6
6
  })
7
7
  export class <%= symbolName %> implements PipeTransform {
8
-
9
8
  transform(value: unknown, ...args: unknown[]): unknown {
10
9
  return null;
11
10
  }
12
-
13
11
  }
@@ -1,4 +1,4 @@
1
- import {withModuleFederationForSSR} from '@nx/angular/module-federation';
1
+ import { withModuleFederationForSSR } from '@nx/angular/module-federation';
2
2
  import config from './module-federation.config';
3
3
 
4
- export default withModuleFederationForSSR(config)
4
+ export default withModuleFederationForSSR(config);
@@ -31,7 +31,6 @@ export function app(): express.Express {
31
31
  server.set('view engine', 'html');
32
32
  server.set('views', browserBundles);
33
33
 
34
-
35
34
  // Example Express Rest API endpoints
36
35
  // server.get('/api/**', (req, res) => { });
37
36
  // Serve static files from /browser
@@ -41,7 +40,6 @@ export function app(): express.Express {
41
40
 
42
41
  // All regular routes use the Universal engine
43
42
  server.get('*', (req, res) => {
44
-
45
43
  res.render(indexHtml, {
46
44
  req,
47
45
  providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],
@@ -24,7 +24,6 @@ export function app(): express.Express {
24
24
  server.set('view engine', 'html');
25
25
  server.set('views', browserBundles);
26
26
 
27
-
28
27
  // Example Express Rest API endpoints
29
28
  // server.get('/api/**', (req, res) => { });
30
29
  // Serve static files from /browser
@@ -39,5 +39,6 @@ function getNgModuleDeclaration(componentClassName) {
39
39
  declarations: [${componentClassName}],
40
40
  exports: [${componentClassName}],
41
41
  })
42
- export class ${componentClassName}Module {}`;
42
+ export class ${componentClassName}Module {}
43
+ `;
43
44
  }
@@ -39,5 +39,6 @@ function getNgModuleDeclaration(directiveClassName) {
39
39
  declarations: [${directiveClassName}],
40
40
  exports: [${directiveClassName}],
41
41
  })
42
- export class ${directiveClassName}Module {}`;
42
+ export class ${directiveClassName}Module {}
43
+ `;
43
44
  }
@@ -18,7 +18,9 @@ async function scamDirectiveGenerator(tree, rawOptions) {
18
18
  });
19
19
  (0, lib_1.convertDirectiveToScam)(tree, options);
20
20
  (0, export_scam_1.exportScam)(tree, options);
21
- await (0, devkit_1.formatFiles)(tree);
21
+ if (!options.skipFormat) {
22
+ await (0, devkit_1.formatFiles)(tree);
23
+ }
22
24
  }
23
25
  exports.scamDirectiveGenerator = scamDirectiveGenerator;
24
26
  exports.default = scamDirectiveGenerator;
@@ -9,6 +9,7 @@ export interface Schema {
9
9
  prefix?: string;
10
10
  selector?: string;
11
11
  export?: boolean;
12
+ skipFormat?: boolean;
12
13
  /**
13
14
  * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
14
15
  */
@@ -84,6 +84,12 @@
84
84
  "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
85
85
  "default": true,
86
86
  "x-priority": "important"
87
+ },
88
+ "skipFormat": {
89
+ "description": "Skip formatting files.",
90
+ "type": "boolean",
91
+ "default": false,
92
+ "x-priority": "internal"
87
93
  }
88
94
  },
89
95
  "required": ["name"]
@@ -39,5 +39,6 @@ function getNgModuleDeclaration(pipeClassName) {
39
39
  declarations: [${pipeClassName}],
40
40
  exports: [${pipeClassName}],
41
41
  })
42
- export class ${pipeClassName}Module {}`;
42
+ export class ${pipeClassName}Module {}
43
+ `;
43
44
  }
@@ -18,7 +18,9 @@ async function scamPipeGenerator(tree, rawOptions) {
18
18
  });
19
19
  (0, lib_1.convertPipeToScam)(tree, options);
20
20
  (0, export_scam_1.exportScam)(tree, options);
21
- await (0, devkit_1.formatFiles)(tree);
21
+ if (!options.skipFormat) {
22
+ await (0, devkit_1.formatFiles)(tree);
23
+ }
22
24
  }
23
25
  exports.scamPipeGenerator = scamPipeGenerator;
24
26
  exports.default = scamPipeGenerator;
@@ -7,6 +7,7 @@ export interface Schema {
7
7
  skipTests?: boolean;
8
8
  inlineScam?: boolean;
9
9
  export?: boolean;
10
+ skipFormat?: boolean;
10
11
  /**
11
12
  * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
12
13
  */
@@ -65,6 +65,12 @@
65
65
  "description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
66
66
  "default": true,
67
67
  "x-priority": "important"
68
+ },
69
+ "skipFormat": {
70
+ "description": "Skip formatting files.",
71
+ "type": "boolean",
72
+ "default": false,
73
+ "x-priority": "internal"
68
74
  }
69
75
  },
70
76
  "required": ["name"]
@@ -37,6 +37,8 @@ describe('AppComponent', () => {
37
37
  tick();
38
38
  fixture.detectChanges();
39
39
  const compiled = fixture.nativeElement as HTMLElement;
40
- expect(compiled.querySelector('h1')?.textContent).toContain('Welcome <%= appName %>');
40
+ expect(compiled.querySelector('h1')?.textContent).toContain(
41
+ 'Welcome <%= appName %>'
42
+ );
41
43
  }));
42
44
  });
@@ -1,4 +1,4 @@
1
- import {withModuleFederation} from '@nx/angular/module-federation';
1
+ import { withModuleFederation } from '@nx/angular/module-federation';
2
2
  import config from './module-federation.config';
3
3
 
4
4
  export default withModuleFederation(config);
@@ -1,16 +1,16 @@
1
- import {withModuleFederation} from '@nx/angular/module-federation';
1
+ import { withModuleFederation } from '@nx/angular/module-federation';
2
2
  import config from './module-federation.config';
3
3
 
4
4
  export default withModuleFederation({
5
- ...config,
6
- /*
7
- * Remote overrides for production.
8
- * Each entry is a pair of a unique name and the URL where it is deployed.
9
- *
10
- * e.g.
11
- * remotes: [
12
- * ['app1', 'https://app1.example.com'],
13
- * ['app2', 'https://app2.example.com'],
14
- * ]
15
- */
5
+ ...config,
6
+ /*
7
+ * Remote overrides for production.
8
+ * Each entry is a pair of a unique name and the URL where it is deployed.
9
+ *
10
+ * e.g.
11
+ * remotes: [
12
+ * ['app1', 'https://app1.example.com'],
13
+ * ['app2', 'https://app2.example.com'],
14
+ * ]
15
+ */
16
16
  });
@@ -17,4 +17,4 @@ module.exports = {
17
17
  './Routes': '<%= projectRoot %>/src/app/remote-entry/entry.routes.ts',<% } else { %>
18
18
  './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',<% } %>
19
19
  },<% } %>
20
- }
20
+ };
@@ -16,7 +16,7 @@ function addRemoteEntry(tree, { appName, routing, prefix, standalone }, appRoot)
16
16
  (0, route_utils_1.addRoute)(tree, (0, devkit_1.joinPathFragments)(appRoot, 'src/app/app.routes.ts'), `{path: '', loadChildren: () => import('./remote-entry/entry.routes').then(m => m.remoteRoutes)}`);
17
17
  }
18
18
  else if (routing) {
19
- (0, route_utils_1.addRoute)(tree, (0, devkit_1.joinPathFragments)(appRoot, 'src/app/app.routes.ts'), `{path: '', loadChildren: () => import('./remote-entry/entry.module').then(m => m.RemoteEntryModule)}`);
19
+ (0, route_utils_1.addRoute)(tree, (0, devkit_1.joinPathFragments)(appRoot, 'src/app/app.routes.ts'), `{ path: '', loadChildren: () => import('./remote-entry/entry.module').then(m => m.RemoteEntryModule) }`);
20
20
  }
21
21
  }
22
22
  exports.addRemoteEntry = addRemoteEntry;
@@ -102,7 +102,7 @@ function addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType) {
102
102
  if (appComponent.includes(`<ul class="remote-menu">`) &&
103
103
  appComponent.includes('</ul>')) {
104
104
  const indexOfClosingMenuTag = appComponent.indexOf('</ul>');
105
- const newAppComponent = `${appComponent.slice(0, indexOfClosingMenuTag)}<li><a routerLink='${options.appName}'>${(0, devkit_1.names)(options.appName).className}</a></li>\n${appComponent.slice(indexOfClosingMenuTag)}`;
105
+ const newAppComponent = `${appComponent.slice(0, indexOfClosingMenuTag)}<li><a routerLink="${options.appName}">${(0, devkit_1.names)(options.appName).className}</a></li>\n${appComponent.slice(indexOfClosingMenuTag)}`;
106
106
  tree.write(pathToAppComponentTemplate, newAppComponent);
107
107
  }
108
108
  }
@@ -11,10 +11,10 @@ function fixBootstrap(tree, appRoot, options) {
11
11
  else {
12
12
  tree.write((0, devkit_1.joinPathFragments)(appRoot, 'src/bootstrap.ts'), bootstrapCode);
13
13
  }
14
- const bootstrapImportCode = `import('./bootstrap').catch(err => console.error(err))`;
14
+ const bootstrapImportCode = `import('./bootstrap').catch(err => console.error(err));`;
15
15
  const fetchMFManifestCode = `import { setRemoteDefinitions } from '@nx/angular/mf';
16
16
 
17
- fetch('/assets/module-federation.manifest.json')
17
+ fetch('/assets/module-federation.manifest.json')
18
18
  .then((res) => res.json())
19
19
  .then(definitions => setRemoteDefinitions(definitions))
20
20
  .then(() => ${bootstrapImportCode})`;
@@ -23,10 +23,11 @@ function fixBootstrap(tree, appRoot, options) {
23
23
  : bootstrapImportCode);
24
24
  }
25
25
  exports.fixBootstrap = fixBootstrap;
26
- const standaloneBootstrapCode = () => `import {bootstrapApplication} from "@angular/platform-browser";
27
- import {appConfig} from './app/app.config';
28
- import {RemoteEntryComponent} from './app/remote-entry/entry.component';
26
+ const standaloneBootstrapCode = () => `import { bootstrapApplication } from '@angular/platform-browser';
27
+ import { appConfig } from './app/app.config';
28
+ import { RemoteEntryComponent } from './app/remote-entry/entry.component';
29
29
 
30
30
  bootstrapApplication(RemoteEntryComponent, appConfig).catch((err) =>
31
31
  console.error(err)
32
- );`;
32
+ );
33
+ `;
@@ -30,16 +30,16 @@ import { RouterModule } from '@angular/router';
30
30
  import { AppComponent } from './app.component';
31
31
 
32
32
  @NgModule({
33
- declarations: [AppComponent],
34
- imports: [
35
- BrowserModule,
36
- RouterModule.forRoot([{
37
- path: '',
38
- loadChildren: () => import('./remote-entry/entry.module').then(m => m.RemoteEntryModule)
39
- }], { initialNavigation: 'enabledBlocking' }),
40
- ],
41
- providers: [],
42
- bootstrap: [AppComponent],
33
+ declarations: [AppComponent],
34
+ imports: [
35
+ BrowserModule,
36
+ RouterModule.forRoot([{
37
+ path: '',
38
+ loadChildren: () => import('./remote-entry/entry.module').then(m => m.RemoteEntryModule)
39
+ }], { initialNavigation: 'enabledBlocking' }),
40
+ ],
41
+ providers: [],
42
+ bootstrap: [AppComponent],
43
43
  })
44
44
  export class AppModule {}`);
45
45
  }
@@ -15,7 +15,7 @@ function updateHostAppRoutes(tree, options) {
15
15
  ? options.remotes.reduce((routes, remote) => `${routes}\n<li><a routerLink='${remote}'>${(0, devkit_1.names)(remote).className}</a></li>`, '')
16
16
  : '';
17
17
  tree.write((0, devkit_1.joinPathFragments)(sourceRoot, 'app/app.component.html'), `<ul class="remote-menu">
18
- <li><a routerLink='/'>Home</a></li>${remoteRoutes}
18
+ <li><a routerLink="/">Home</a></li>${remoteRoutes}
19
19
  </ul>
20
20
  <router-outlet></router-outlet>
21
21
  `);
@@ -31,7 +31,7 @@ function updateHostAppRoutes(tree, options) {
31
31
  component: NxWelcomeComponent
32
32
  }`);
33
33
  tree.write(pathToHostRootRoutingFile, `import { NxWelcomeComponent } from './nx-welcome.component';
34
- ${tree.read(pathToHostRootRoutingFile, 'utf-8')}`);
34
+ ${tree.read(pathToHostRootRoutingFile, 'utf-8')}`);
35
35
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/host-files'), (0, devkit_1.joinPathFragments)(sourceRoot, 'app'), {
36
36
  appName: options.appName,
37
37
  standalone: options.standalone,
@@ -1,10 +1,10 @@
1
1
  import 'zone.js/dist/zone-node';
2
2
 
3
- import {APP_BASE_HREF} from '@angular/common';
4
- import {ngExpressEngine} from '@nguniversal/express-engine';
3
+ import { APP_BASE_HREF } from '@angular/common';
4
+ import { ngExpressEngine } from '@nguniversal/express-engine';
5
5
  import * as express from 'express';
6
- import {existsSync} from 'fs';
7
- import {join} from 'path';
6
+ import { existsSync } from 'fs';
7
+ import { join } from 'path';
8
8
  import <% if (standalone) { %>bootstrap<% } else { %>{ <%= rootModuleClassName %> }<% } %> from './src/<%= main.slice(0, -3) %>';
9
9
 
10
10
  // The Express app is exported so that it can be used by serverless Functions.
@@ -72,7 +72,7 @@ function updateRouterModuleForRootCallExpression(node) {
72
72
  (0, typescript_1.isIdentifier)(exp.name) &&
73
73
  exp.name.text === 'initialNavigation')))
74
74
  : typescript_1.factory.createNodeArray();
75
- const enabledLiteral = typescript_1.factory.createStringLiteral('enabledBlocking');
75
+ const enabledLiteral = typescript_1.factory.createStringLiteral('enabledBlocking', true);
76
76
  const initialNavigationProperty = typescript_1.factory.createPropertyAssignment('initialNavigation', enabledLiteral);
77
77
  const routerOptions = existingOptions
78
78
  ? typescript_1.factory.updateObjectLiteralExpression(existingOptions, typescript_1.factory.createNodeArray([
@@ -25,12 +25,12 @@ function exportScam(tree, options) {
25
25
  const relativePathFromEntryPoint = (0, path_1.getRelativeImportToFile)(entryPointPath, options.filePath);
26
26
  const entryPointContent = tree.read(entryPointPath, 'utf-8');
27
27
  let updatedEntryPointContent = (0, devkit_1.stripIndents) `${entryPointContent}
28
- export * from "${relativePathFromEntryPoint}";`;
28
+ export * from '${relativePathFromEntryPoint}';`;
29
29
  if (!options.inlineScam) {
30
30
  const moduleFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${(0, devkit_1.names)(options.name).fileName}.module.ts`);
31
31
  const relativePathFromModule = (0, path_1.getRelativeImportToFile)(entryPointPath, moduleFilePath);
32
32
  updatedEntryPointContent = (0, devkit_1.stripIndents) `${updatedEntryPointContent}
33
- export * from "${relativePathFromModule}";`;
33
+ export * from '${relativePathFromModule}';`;
34
34
  }
35
35
  tree.write(entryPointPath, updatedEntryPointContent);
36
36
  }
@@ -51,7 +51,7 @@ async function createStorybookTestWorkspaceForLib(libName) {
51
51
  linter: eslint_1.Linter.EsLint,
52
52
  publishable: false,
53
53
  simpleName: false,
54
- skipFormat: false,
54
+ skipFormat: true,
55
55
  unitTestRunner: test_runners_1.UnitTestRunner.Jest,
56
56
  projectNameAndRootFormat: 'as-provided',
57
57
  standalone: false,
@@ -60,6 +60,7 @@ async function createStorybookTestWorkspaceForLib(libName) {
60
60
  name: 'test-button',
61
61
  project: libName,
62
62
  standalone: false,
63
+ skipFormat: true,
63
64
  });
64
65
  tree.write(`${libName}/src/lib/test-button/test-button.component.ts`, `import { Component, Input } from '@angular/core';
65
66
 
@@ -91,6 +92,7 @@ export class TestButtonComponent {
91
92
  path: `${libName}/src/lib/barrel`,
92
93
  module: 'barrel',
93
94
  standalone: false,
95
+ skipFormat: true,
94
96
  });
95
97
  tree.write(`${libName}/src/lib/barrel/barrel-button/index.ts`, `export * from './barrel-button.component';`);
96
98
  tree.write(`${libName}/src/lib/barrel/barrel.module.ts`, `import { NgModule } from '@angular/core';
@@ -113,6 +115,7 @@ export class BarrelModule {}`);
113
115
  path: `${libName}/src/lib/variable-declare`,
114
116
  module: 'variable-declare',
115
117
  standalone: false,
118
+ skipFormat: true,
116
119
  });
117
120
  await (0, component_1.componentGenerator)(tree, {
118
121
  name: 'variable-declare-view',
@@ -120,6 +123,7 @@ export class BarrelModule {}`);
120
123
  path: `${libName}/src/lib/variable-declare`,
121
124
  module: 'variable-declare',
122
125
  standalone: false,
126
+ skipFormat: true,
123
127
  });
124
128
  tree.write(`${libName}/src/lib/variable-declare/variable-declare.module.ts`, `import { NgModule } from '@angular/core';
125
129
  import { CommonModule } from '@angular/common';
@@ -148,6 +152,7 @@ export class VariableDeclareModule {}`);
148
152
  path: `${libName}/src/lib/variable-spread-declare`,
149
153
  module: 'variable-spread-declare',
150
154
  standalone: false,
155
+ skipFormat: true,
151
156
  });
152
157
  await (0, component_1.componentGenerator)(tree, {
153
158
  name: 'variable-spread-declare-view',
@@ -155,6 +160,7 @@ export class VariableDeclareModule {}`);
155
160
  path: `${libName}/src/lib/variable-spread-declare`,
156
161
  module: 'variable-spread-declare',
157
162
  standalone: false,
163
+ skipFormat: true,
158
164
  });
159
165
  await (0, component_1.componentGenerator)(tree, {
160
166
  name: 'variable-spread-declare-anotherview',
@@ -162,6 +168,7 @@ export class VariableDeclareModule {}`);
162
168
  path: `${libName}/src/lib/variable-spread-declare`,
163
169
  module: 'variable-spread-declare',
164
170
  standalone: false,
171
+ skipFormat: true,
165
172
  });
166
173
  tree.write(`${libName}/src/lib/variable-spread-declare/variable-spread-declare.module.ts`, `import { NgModule } from '@angular/core';
167
174
  import { CommonModule } from '@angular/common';
@@ -190,6 +197,7 @@ export class VariableSpreadDeclareModule {}`);
190
197
  path: `${libName}/src/lib/static-member-declarations`,
191
198
  module: 'static-member-declarations',
192
199
  standalone: false,
200
+ skipFormat: true,
193
201
  });
194
202
  await (0, component_1.componentGenerator)(tree, {
195
203
  name: 'cmp2',
@@ -197,6 +205,7 @@ export class VariableSpreadDeclareModule {}`);
197
205
  path: `${libName}/src/lib/static-member-declarations`,
198
206
  module: 'static-member-declarations',
199
207
  standalone: false,
208
+ skipFormat: true,
200
209
  });
201
210
  tree.write(`${libName}/src/lib/static-member-declarations/static-member-declarations.module.ts`, `import { NgModule } from '@angular/core';
202
211
  import { CommonModule } from '@angular/common';
@@ -223,11 +232,13 @@ export class StaticMemberDeclarationsModule {
223
232
  module: 'nested',
224
233
  path: `${libName}/src/lib/nested`,
225
234
  standalone: false,
235
+ skipFormat: true,
226
236
  });
227
237
  await (0, component_1.componentGenerator)(tree, {
228
238
  name: 'test-other',
229
239
  project: libName,
230
240
  standalone: false,
241
+ skipFormat: true,
231
242
  });
232
243
  return tree;
233
244
  }
@@ -19,26 +19,24 @@ function createApp(tree, appName, routing = true) {
19
19
  appName,
20
20
  appModule: `${appName}/src/app/app.module.ts`,
21
21
  };
22
- tree.write(appConfig.appModule, `
23
- import { NgModule } from '@angular/core';
24
- import { BrowserModule } from '@angular/platform-browser';
25
- ${routing ? "import { RouterModule } from '@angular/router'" : ''};
26
- import { AppComponent } from './app.component';
27
- @NgModule({
28
- imports: [BrowserModule, ${routing ? 'RouterModule.forRoot([])' : ''}],
29
- declarations: [AppComponent],
30
- bootstrap: [AppComponent]
31
- })
32
- export class AppModule {}
33
- `);
34
- tree.write(`${appName}/src/main.ts`, `
35
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
22
+ tree.write(appConfig.appModule, `import { NgModule } from '@angular/core';
23
+ import { BrowserModule } from '@angular/platform-browser';
24
+ ${routing ? "import { RouterModule } from '@angular/router'" : ''};
25
+ import { AppComponent } from './app.component';
26
+ @NgModule({
27
+ imports: [BrowserModule, ${routing ? 'RouterModule.forRoot([])' : ''}],
28
+ declarations: [AppComponent],
29
+ bootstrap: [AppComponent]
30
+ })
31
+ export class AppModule {}
32
+ `);
33
+ tree.write(`${appName}/src/main.ts`, `import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
36
34
 
37
- import { AppModule } from './app/app.module';
35
+ import { AppModule } from './app/app.module';
38
36
 
39
- platformBrowserDynamic()
40
- .bootstrapModule(AppModule)
41
- .catch(err => console.log(err));
37
+ platformBrowserDynamic()
38
+ .bootstrapModule(AppModule)
39
+ .catch(err => console.log(err));
42
40
  `);
43
41
  tree.write(`${appName}/tsconfig.app.json`, JSON.stringify({
44
42
  include: ['**/*.ts'],
@@ -70,19 +68,17 @@ function createLib(tree, libName) {
70
68
  module: `${propertyName}/src/lib/${fileName}.module.ts`,
71
69
  barrel: `${propertyName}/src/index.ts`,
72
70
  };
73
- tree.write(libConfig.module, `
74
- import { NgModule } from '@angular/core';
75
- import { CommonModule } from '@angular/common';
76
- @NgModule({
77
- imports: [
78
- CommonModule
79
- ],
80
- providers: []
81
- })
82
- export class ${className}Module { }
83
- `);
84
- tree.write(libConfig.barrel, `
85
- export * from './lib/${fileName}.module';
71
+ tree.write(libConfig.module, `import { NgModule } from '@angular/core';
72
+ import { CommonModule } from '@angular/common';
73
+ @NgModule({
74
+ imports: [
75
+ CommonModule
76
+ ],
77
+ providers: []
78
+ })
79
+ export class ${className}Module { }
86
80
  `);
81
+ tree.write(libConfig.barrel, `export * from './lib/${fileName}.module';
82
+ `);
87
83
  }
88
84
  exports.createLib = createLib;