@nx/angular 20.1.0-canary.20241030-62f58eb → 20.1.0-canary.20241101-d4f4dac
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +7 -7
- package/src/generators/application/files/ng-module/src/app/app.component.html__tpl__ +8 -1
- package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__ +8 -1
- package/src/generators/component/files/__fileName__.__style__ +1 -1
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +4 -4
- package/src/generators/library/files/base/README.md__tpl__ +2 -2
- package/src/generators/utils/add-jest.js +4 -4
- package/src/generators/utils/add-vitest.js +5 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "20.1.0-canary.
|
3
|
+
"version": "20.1.0-canary.20241101-d4f4dac",
|
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, Playwright 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- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -80,12 +80,12 @@
|
|
80
80
|
"webpack-merge": "^5.8.0",
|
81
81
|
"webpack": "^5.88.0",
|
82
82
|
"@module-federation/enhanced": "0.6.9",
|
83
|
-
"@nx/devkit": "20.1.0-canary.
|
84
|
-
"@nx/js": "20.1.0-canary.
|
85
|
-
"@nx/eslint": "20.1.0-canary.
|
86
|
-
"@nx/webpack": "20.1.0-canary.
|
87
|
-
"@nx/web": "20.1.0-canary.
|
88
|
-
"@nx/workspace": "20.1.0-canary.
|
83
|
+
"@nx/devkit": "20.1.0-canary.20241101-d4f4dac",
|
84
|
+
"@nx/js": "20.1.0-canary.20241101-d4f4dac",
|
85
|
+
"@nx/eslint": "20.1.0-canary.20241101-d4f4dac",
|
86
|
+
"@nx/webpack": "20.1.0-canary.20241101-d4f4dac",
|
87
|
+
"@nx/web": "20.1.0-canary.20241101-d4f4dac",
|
88
|
+
"@nx/workspace": "20.1.0-canary.20241101-d4f4dac",
|
89
89
|
"piscina": "^4.4.0"
|
90
90
|
},
|
91
91
|
"peerDependencies": {
|
@@ -1 +1,8 @@
|
|
1
|
-
<% if(minimal) {
|
1
|
+
<%_ if(minimal) { _%>
|
2
|
+
<h1>Welcome <%= appName %></h1>
|
3
|
+
<%_ } else { _%>
|
4
|
+
<<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>>
|
5
|
+
<%_ } _%>
|
6
|
+
<%_ if(routing) { _%>
|
7
|
+
<router-outlet></router-outlet>
|
8
|
+
<%_ } _%>
|
package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__
CHANGED
@@ -1 +1,8 @@
|
|
1
|
-
<% if(minimal) {
|
1
|
+
<%_ if(minimal) { _%>
|
2
|
+
<h1>Welcome <%= appName %></h1>
|
3
|
+
<%_ } else { _%>
|
4
|
+
<<%= nxWelcomeSelector %>></<%= nxWelcomeSelector %>>
|
5
|
+
<%_ } _%>
|
6
|
+
<%_ if(routing) { _%>
|
7
|
+
<router-outlet></router-outlet>
|
8
|
+
<%_ } _%>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/angular';
|
2
2
|
import { <%=componentName%> } from './<%=componentFileName%>';
|
3
|
-
<% if ( interactionTests ) { %>
|
3
|
+
<%_ if ( interactionTests ) { _%>
|
4
4
|
import { within } from '@storybook/testing-library';
|
5
5
|
import { expect } from '@storybook/jest';
|
6
|
-
<% } %>
|
6
|
+
<%_ } _%>
|
7
7
|
|
8
8
|
const meta: Meta<<%= componentName %>> = {
|
9
9
|
component: <%= componentName %>,
|
@@ -18,7 +18,7 @@ export const Primary: Story = {
|
|
18
18
|
},
|
19
19
|
};
|
20
20
|
|
21
|
-
<% if ( interactionTests ) { %>
|
21
|
+
<%_ if ( interactionTests ) { _%>
|
22
22
|
export const Heading: Story = {
|
23
23
|
args: {<% for (let prop of props) { %>
|
24
24
|
<%= prop.name %>: <%- prop.defaultValue %>,<% } %>
|
@@ -28,4 +28,4 @@ export const Heading: Story = {
|
|
28
28
|
expect(canvas.getByText(/<%=componentNameSimple%> works!/gi)).toBeTruthy();
|
29
29
|
},
|
30
30
|
};
|
31
|
-
<% } %>
|
31
|
+
<%_ } _%>
|
@@ -24,10 +24,10 @@ async function addJest(tree, options) {
|
|
24
24
|
const contents = tree.read(setupFile, 'utf-8');
|
25
25
|
tree.write(setupFile, `// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
|
26
26
|
globalThis.ngJest = {
|
27
|
-
testEnvironmentOptions: {
|
28
|
-
|
29
|
-
|
30
|
-
},
|
27
|
+
testEnvironmentOptions: {
|
28
|
+
errorOnUnknownElements: true,
|
29
|
+
errorOnUnknownProperties: true,
|
30
|
+
},
|
31
31
|
};
|
32
32
|
${contents}`);
|
33
33
|
}
|
@@ -10,7 +10,7 @@ async function addVitest(tree, options) {
|
|
10
10
|
'@analogjs/vite-plugin-angular': versions_1.analogVitestAngular,
|
11
11
|
}, undefined, true);
|
12
12
|
}
|
13
|
-
const { createOrEditViteConfig,
|
13
|
+
const { createOrEditViteConfig, vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
14
14
|
const relativeTestSetupPath = (0, devkit_1.joinPathFragments)('src', 'test-setup.ts');
|
15
15
|
const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, relativeTestSetupPath);
|
16
16
|
if (!tree.exists(setupFile)) {
|
@@ -27,12 +27,13 @@ getTestBed().initTestEnvironment(
|
|
27
27
|
platformBrowserDynamicTesting()
|
28
28
|
);
|
29
29
|
`);
|
30
|
-
await
|
30
|
+
await vitestGenerator(tree, {
|
31
31
|
project: options.name,
|
32
|
-
newProject: true,
|
33
32
|
uiFramework: 'none',
|
34
|
-
|
33
|
+
skipViteConfig: true,
|
35
34
|
testEnvironment: 'jsdom',
|
35
|
+
coverageProvider: 'v8',
|
36
|
+
addPlugin: false,
|
36
37
|
});
|
37
38
|
createOrEditViteConfig(tree, {
|
38
39
|
project: options.name,
|