@nx/react 20.0.7 → 20.1.0-beta.0
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.
- package/mf/dynamic-federation.d.ts +64 -0
- package/mf/dynamic-federation.js +64 -0
- package/package.json +6 -6
- package/src/generators/application/files/base-rspack/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-rspack/src/main.tsx__tmpl__ +27 -6
- package/src/generators/application/files/base-rspack/tsconfig.app.json__tmpl__ +1 -1
- package/src/generators/application/files/base-vite/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-vite/src/main.tsx__tmpl__ +31 -6
- package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +1 -1
- package/src/generators/application/files/base-webpack/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-webpack/src/main.tsx__tmpl__ +22 -2
- package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +1 -1
- package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +3 -3
- package/src/generators/application/files/style-css-module/src/app/__fileName__.tsx__tmpl__ +26 -16
- package/src/generators/application/files/style-global-css/src/app/__fileName__.tsx__tmpl__ +29 -20
- package/src/generators/application/files/style-none/src/app/__fileName__.tsx__tmpl__ +26 -16
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +31 -22
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +30 -21
- package/src/generators/application/files/style-tailwind/src/app/__fileName__.tsx__tmpl__ +30 -18
- package/src/generators/application/lib/create-application-files.js +2 -0
- package/src/generators/application/lib/get-app-tests.js +8 -9
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +55 -56
- package/src/generators/component-story/files/jsx/__componentFileName__.stories.jsx__tmpl__ +5 -5
- package/src/generators/component-story/files/tsx/__componentFileName__.stories.tsx__tmpl__ +3 -4
- package/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +28 -21
- package/src/generators/host/files/common/src/main.js__tmpl__ +12 -9
- package/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +28 -28
- package/src/generators/host/files/common-ts/src/main.ts__tmpl__ +12 -9
- package/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +22 -13
- package/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +12 -9
- package/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +4 -4
- package/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +3 -1
- package/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +6 -4
- package/src/generators/host/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +6 -6
- package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +18 -18
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +23 -21
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +4 -4
- package/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +23 -21
- package/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +6 -6
- package/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +6 -6
- package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +18 -18
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +23 -21
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +1 -1
- package/src/generators/host/host.js +3 -1
- package/src/generators/host/lib/add-module-federation-files.js +1 -1
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +1 -1
- package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +7 -7
- package/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +4 -4
- package/src/generators/remote/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +4 -4
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +7 -7
- package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +7 -7
- package/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +4 -4
- package/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +4 -4
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +7 -7
- package/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +1 -1
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
@@ -1,5 +1,69 @@
|
|
1
1
|
export type ResolveRemoteUrlFunction = (remoteName: string) => string | Promise<string>;
|
2
|
+
/**
|
3
|
+
* @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
4
|
+
*/
|
2
5
|
export declare function setRemoteUrlResolver(_resolveRemoteUrl: ResolveRemoteUrlFunction): void;
|
6
|
+
/**
|
7
|
+
* @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
8
|
+
* If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:
|
9
|
+
* ```ts
|
10
|
+
* import { setRemoteDefinitions } from '@nx/react/mf';
|
11
|
+
*
|
12
|
+
* setRemoteDefinitions({
|
13
|
+
* 'my-remote-app': 'http://localhost:4201/mf-manifest.json'
|
14
|
+
* });
|
15
|
+
* ```
|
16
|
+
* to use init():
|
17
|
+
* ```ts
|
18
|
+
* import { init } from '@module-federation/enhanced/runtime';
|
19
|
+
*
|
20
|
+
* init({
|
21
|
+
* name: 'host',
|
22
|
+
* remotes: [{
|
23
|
+
* name: 'my-remote-app',
|
24
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
25
|
+
* }]
|
26
|
+
* });
|
27
|
+
* ```
|
28
|
+
*/
|
3
29
|
export declare function setRemoteDefinitions(definitions: Record<string, string>): void;
|
30
|
+
/**
|
31
|
+
* @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
32
|
+
* If you set a remote app with `setRemoteDefinition` such as:
|
33
|
+
* ```ts
|
34
|
+
* import { setRemoteDefinition } from '@nx/react/mf';
|
35
|
+
*
|
36
|
+
* setRemoteDefinition(
|
37
|
+
* 'my-remote-app',
|
38
|
+
* 'http://localhost:4201/mf-manifest.json'
|
39
|
+
* );
|
40
|
+
* ```
|
41
|
+
* change it to use registerRemotes():
|
42
|
+
* ```ts
|
43
|
+
* import { registerRemotes } from '@module-federation/enhanced/runtime';
|
44
|
+
*
|
45
|
+
* registerRemotes([
|
46
|
+
* {
|
47
|
+
* name: 'my-remote-app',
|
48
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
49
|
+
* }
|
50
|
+
* ]);
|
51
|
+
* ```
|
52
|
+
*/
|
4
53
|
export declare function setRemoteDefinition(remoteName: string, remoteUrl: string): void;
|
54
|
+
/**
|
55
|
+
* @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
56
|
+
* If you set a load a remote with `loadRemoteModule` such as:
|
57
|
+
* ```ts
|
58
|
+
* import { loadRemoteModule } from '@nx/react/mf';
|
59
|
+
*
|
60
|
+
* loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);
|
61
|
+
* ```
|
62
|
+
* change it to use loadRemote():
|
63
|
+
* ```ts
|
64
|
+
* import { loadRemote } from '@module-federation/enhanced/runtime';
|
65
|
+
*
|
66
|
+
* loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);
|
67
|
+
* ```
|
68
|
+
*/
|
5
69
|
export declare function loadRemoteModule(remoteName: string, moduleName: string): Promise<any>;
|
package/mf/dynamic-federation.js
CHANGED
@@ -9,15 +9,79 @@ let resolveRemoteUrl;
|
|
9
9
|
const remoteModuleMap = new Map();
|
10
10
|
const remoteContainerMap = new Map();
|
11
11
|
let initialSharingScopeCreated = false;
|
12
|
+
/**
|
13
|
+
* @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
14
|
+
*/
|
12
15
|
function setRemoteUrlResolver(_resolveRemoteUrl) {
|
13
16
|
resolveRemoteUrl = _resolveRemoteUrl;
|
14
17
|
}
|
18
|
+
/**
|
19
|
+
* @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
20
|
+
* If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:
|
21
|
+
* ```ts
|
22
|
+
* import { setRemoteDefinitions } from '@nx/react/mf';
|
23
|
+
*
|
24
|
+
* setRemoteDefinitions({
|
25
|
+
* 'my-remote-app': 'http://localhost:4201/mf-manifest.json'
|
26
|
+
* });
|
27
|
+
* ```
|
28
|
+
* to use init():
|
29
|
+
* ```ts
|
30
|
+
* import { init } from '@module-federation/enhanced/runtime';
|
31
|
+
*
|
32
|
+
* init({
|
33
|
+
* name: 'host',
|
34
|
+
* remotes: [{
|
35
|
+
* name: 'my-remote-app',
|
36
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
37
|
+
* }]
|
38
|
+
* });
|
39
|
+
* ```
|
40
|
+
*/
|
15
41
|
function setRemoteDefinitions(definitions) {
|
16
42
|
remoteUrlDefinitions = definitions;
|
17
43
|
}
|
44
|
+
/**
|
45
|
+
* @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
46
|
+
* If you set a remote app with `setRemoteDefinition` such as:
|
47
|
+
* ```ts
|
48
|
+
* import { setRemoteDefinition } from '@nx/react/mf';
|
49
|
+
*
|
50
|
+
* setRemoteDefinition(
|
51
|
+
* 'my-remote-app',
|
52
|
+
* 'http://localhost:4201/mf-manifest.json'
|
53
|
+
* );
|
54
|
+
* ```
|
55
|
+
* change it to use registerRemotes():
|
56
|
+
* ```ts
|
57
|
+
* import { registerRemotes } from '@module-federation/enhanced/runtime';
|
58
|
+
*
|
59
|
+
* registerRemotes([
|
60
|
+
* {
|
61
|
+
* name: 'my-remote-app',
|
62
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
63
|
+
* }
|
64
|
+
* ]);
|
65
|
+
* ```
|
66
|
+
*/
|
18
67
|
function setRemoteDefinition(remoteName, remoteUrl) {
|
19
68
|
remoteUrlDefinitions[remoteName] = remoteUrl;
|
20
69
|
}
|
70
|
+
/**
|
71
|
+
* @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
72
|
+
* If you set a load a remote with `loadRemoteModule` such as:
|
73
|
+
* ```ts
|
74
|
+
* import { loadRemoteModule } from '@nx/react/mf';
|
75
|
+
*
|
76
|
+
* loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);
|
77
|
+
* ```
|
78
|
+
* change it to use loadRemote():
|
79
|
+
* ```ts
|
80
|
+
* import { loadRemote } from '@module-federation/enhanced/runtime';
|
81
|
+
*
|
82
|
+
* loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);
|
83
|
+
* ```
|
84
|
+
*/
|
21
85
|
async function loadRemoteModule(remoteName, moduleName) {
|
22
86
|
const remoteModuleKey = `${remoteName}:${moduleName}`;
|
23
87
|
if (remoteModuleMap.has(remoteModuleKey)) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/react",
|
3
|
-
"version": "20.0.
|
3
|
+
"version": "20.1.0-beta.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -38,11 +38,11 @@
|
|
38
38
|
"minimatch": "9.0.3",
|
39
39
|
"picocolors": "^1.1.0",
|
40
40
|
"tslib": "^2.3.0",
|
41
|
-
"@module-federation/enhanced": "0.6.
|
42
|
-
"@nx/devkit": "20.0.
|
43
|
-
"@nx/js": "20.0.
|
44
|
-
"@nx/eslint": "20.0.
|
45
|
-
"@nx/web": "20.0.
|
41
|
+
"@module-federation/enhanced": "0.6.9",
|
42
|
+
"@nx/devkit": "20.1.0-beta.0",
|
43
|
+
"@nx/js": "20.1.0-beta.0",
|
44
|
+
"@nx/eslint": "20.1.0-beta.0",
|
45
|
+
"@nx/web": "20.1.0-beta.0",
|
46
46
|
"express": "^4.19.2",
|
47
47
|
"http-proxy-middleware": "^3.0.3"
|
48
48
|
},
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { render } from '@testing-library/react';
|
2
|
-
<% if (routing) { %>
|
2
|
+
<%_ if (routing) { _%>
|
3
3
|
import { BrowserRouter } from 'react-router-dom';
|
4
|
-
<% } %>
|
4
|
+
<%_ } _%>
|
5
5
|
|
6
6
|
import App from './<%= fileName %>';
|
7
7
|
|
8
8
|
describe('App', () => {
|
9
|
-
<%- appTests %>
|
9
|
+
<%- appTests _%>
|
10
10
|
});
|
@@ -1,11 +1,32 @@
|
|
1
|
-
<% if (strict) { %>import { StrictMode } from 'react';<% } %>
|
1
|
+
<%_ if (strict) { _%>import { StrictMode } from 'react';<%_ } _%>
|
2
2
|
import * as ReactDOM from 'react-dom/client';
|
3
|
-
<% if (routing) { %>import { BrowserRouter } from 'react-router-dom';<% } %>
|
4
|
-
|
3
|
+
<%_ if (routing) { _%>import { BrowserRouter } from 'react-router-dom';<%_ } _%>
|
5
4
|
import App from './app/<%= fileName %>';
|
6
|
-
|
5
|
+
<%_ if(hasStyleFile) { _%>
|
6
|
+
import './styles.<%= style %>'
|
7
|
+
<%_ } _%>
|
7
8
|
|
8
9
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
10
|
+
<%_ if(strict && !routing) { _%>
|
11
|
+
root.render(
|
12
|
+
<StrictMode>
|
13
|
+
<App/>
|
14
|
+
</StrictMode>
|
15
|
+
)
|
16
|
+
<%_ } _%>
|
17
|
+
<%_ if(!strict && routing) { _%>
|
18
|
+
root.render(
|
19
|
+
<BrowserRouter>
|
20
|
+
<App/>
|
21
|
+
</BrowserRouter>
|
22
|
+
)
|
23
|
+
<%_ } _%>
|
24
|
+
<%_ if(strict && routing) { _%>
|
9
25
|
root.render(
|
10
|
-
|
11
|
-
|
26
|
+
<StrictMode>
|
27
|
+
<BrowserRouter>
|
28
|
+
<App/>
|
29
|
+
</BrowserRouter>
|
30
|
+
</StrictMode>
|
31
|
+
)
|
32
|
+
<%_ } _%>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
5
5
|
"types": [
|
6
6
|
"node",
|
7
|
-
<% if (style === 'styled-jsx') { %>"@nx/react/typings/styled-jsx.d.ts",<% } %>
|
7
|
+
<%_ if (style === 'styled-jsx') { %>"@nx/react/typings/styled-jsx.d.ts",<% } _%>
|
8
8
|
"@nx/react/typings/cssmodule.d.ts",
|
9
9
|
"@nx/react/typings/image.d.ts"
|
10
10
|
]
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { render } from '@testing-library/react';
|
2
|
-
<% if (routing) { %>
|
2
|
+
<%_ if (routing) { _%>
|
3
3
|
import { BrowserRouter } from 'react-router-dom';
|
4
|
-
<% } %>
|
4
|
+
<%_ } _%>
|
5
5
|
|
6
6
|
import App from './<%= fileName %>';
|
7
7
|
|
8
8
|
describe('App', () => {
|
9
|
-
<%- appTests %>
|
9
|
+
<%- appTests _%>
|
10
10
|
});
|
@@ -1,10 +1,35 @@
|
|
1
|
-
<% if (strict) { %>
|
1
|
+
<%_ if (strict) { _%>
|
2
|
+
import { StrictMode } from 'react';
|
3
|
+
<%_ } _%>
|
4
|
+
<%_ if (routing) { _%>
|
5
|
+
import { BrowserRouter } from 'react-router-dom';
|
6
|
+
<%_ } _%>
|
2
7
|
import * as ReactDOM from 'react-dom/client';
|
3
|
-
<% if (routing) { %>import { BrowserRouter } from 'react-router-dom';<% } %>
|
4
|
-
|
5
8
|
import App from './app/<%= fileName %>';
|
6
9
|
|
7
|
-
const root = ReactDOM.createRoot(
|
8
|
-
|
9
|
-
<% if (strict) { %><StrictMode><% } %><% if (routing) { %><BrowserRouter><% } %><App /><% if (routing) { %></BrowserRouter><% } %><% if (strict) { %></StrictMode><% } %>
|
10
|
+
const root = ReactDOM.createRoot(
|
11
|
+
document.getElementById('root') as HTMLElement
|
10
12
|
);
|
13
|
+
|
14
|
+
root.render(
|
15
|
+
<%_ if(strict && !routing) { _%>
|
16
|
+
<StrictMode>
|
17
|
+
<App/>
|
18
|
+
</StrictMode>
|
19
|
+
<%_ } _%>
|
20
|
+
<%_ if(!strict && routing) { _%>
|
21
|
+
<BrowserRouter>
|
22
|
+
<App/>
|
23
|
+
</BrowserRouter>
|
24
|
+
<%_ } _%>
|
25
|
+
<%_ if(strict && routing) { _%>
|
26
|
+
<StrictMode>
|
27
|
+
<BrowserRouter>
|
28
|
+
<App/>
|
29
|
+
</BrowserRouter>
|
30
|
+
</StrictMode>
|
31
|
+
<%_ } _%>
|
32
|
+
<%_ if(!strict && !routing) { _%>
|
33
|
+
<App/>
|
34
|
+
<%_ } _%>
|
35
|
+
);
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
5
5
|
"types": [
|
6
6
|
"node",
|
7
|
-
<% if (style === 'styled-jsx') { %>"@nx/react/typings/styled-jsx.d.ts",<% } %>
|
7
|
+
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
8
8
|
"@nx/react/typings/cssmodule.d.ts",
|
9
9
|
"@nx/react/typings/image.d.ts"
|
10
10
|
]
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { render } from '@testing-library/react';
|
2
|
-
<% if (routing) { %>
|
2
|
+
<%_ if (routing) { _%>
|
3
3
|
import { BrowserRouter } from 'react-router-dom';
|
4
|
-
<% } %>
|
4
|
+
<%_ } _%>
|
5
5
|
|
6
6
|
import App from './<%= fileName %>';
|
7
7
|
|
8
8
|
describe('App', () => {
|
9
|
-
<%- appTests %>
|
9
|
+
<%- appTests _%>
|
10
10
|
});
|
@@ -5,6 +5,26 @@ import * as ReactDOM from 'react-dom/client';
|
|
5
5
|
import App from './app/<%= fileName %>';
|
6
6
|
|
7
7
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
8
|
+
<%_ if(strict && !routing) { _%>
|
8
9
|
root.render(
|
9
|
-
|
10
|
-
|
10
|
+
<StrictMode>
|
11
|
+
<App/>
|
12
|
+
</StrictMode>
|
13
|
+
)
|
14
|
+
<%_ } _%>
|
15
|
+
<%_ if(!strict && routing) { _%>
|
16
|
+
root.render(
|
17
|
+
<BrowserRouter>
|
18
|
+
<App/>
|
19
|
+
</BrowserRouter>
|
20
|
+
)
|
21
|
+
<%_ } _%>
|
22
|
+
<%_ if(strict && routing) { _%>
|
23
|
+
root.render(
|
24
|
+
<StrictMode>
|
25
|
+
<BrowserRouter>
|
26
|
+
<App/>
|
27
|
+
</BrowserRouter>
|
28
|
+
</StrictMode>
|
29
|
+
)
|
30
|
+
<%_ } _%>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
5
5
|
"types": [
|
6
6
|
"node",
|
7
|
-
<% if (style === 'styled-jsx') { %>"@nx/react/typings/styled-jsx.d.ts",<% } %>
|
7
|
+
<%_ if (style === 'styled-jsx') { _%>"@nx/react/typings/styled-jsx.d.ts",<%_ } _%>
|
8
8
|
"@nx/react/typings/cssmodule.d.ts",
|
9
9
|
"@nx/react/typings/image.d.ts"
|
10
10
|
]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if (webpackPluginOptions) { %>
|
1
|
+
<%_ if (webpackPluginOptions) { _%>
|
2
2
|
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
|
3
3
|
const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin');
|
4
4
|
const { join } = require('path');
|
@@ -34,7 +34,7 @@ module.exports = {
|
|
34
34
|
}),
|
35
35
|
],
|
36
36
|
};
|
37
|
-
<% } else { %>
|
37
|
+
<%_ } else { _%>
|
38
38
|
const { composePlugins, withNx } = require('@nx/webpack');
|
39
39
|
const { withReact } = require('@nx/react');
|
40
40
|
|
@@ -52,4 +52,4 @@ module.exports = composePlugins(
|
|
52
52
|
return config;
|
53
53
|
}
|
54
54
|
);
|
55
|
-
<% } %>
|
55
|
+
<%_ } _%>
|
@@ -1,35 +1,45 @@
|
|
1
1
|
<% if (classComponent) { %>
|
2
2
|
import { Component } from 'react';
|
3
|
-
<% } %>
|
3
|
+
<%_ } _%>
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
5
5
|
import styles from './<%= fileName %>.module.<%= style %>';
|
6
|
-
<% if (!minimal) { %>
|
6
|
+
<%_ if (!minimal) { _%>
|
7
7
|
import NxWelcome from "./nx-welcome";
|
8
|
-
<% } %>
|
8
|
+
<%_ } _%>
|
9
9
|
|
10
|
-
<% if (classComponent) { %>
|
10
|
+
<%_ if (classComponent) { _%>
|
11
11
|
export class App extends Component {
|
12
|
-
render() {
|
13
|
-
|
12
|
+
override render() {
|
13
|
+
return (
|
14
|
+
<div>
|
15
|
+
<%_ if (!minimal) { _%>
|
16
|
+
<NxWelcome title="<%= projectName %>"/>
|
17
|
+
<%_ } else { _%>
|
18
|
+
<h1>
|
19
|
+
<span> Hello there, </span>
|
20
|
+
Welcome <%= projectName %> 👋
|
21
|
+
</h1>
|
22
|
+
<%_ } _%>
|
23
|
+
</div>
|
24
|
+
);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
<%_ } else { _%>
|
14
28
|
export function App() {
|
15
|
-
<% } %>
|
16
29
|
return (
|
17
30
|
<div>
|
18
|
-
|
31
|
+
<%_ if (!minimal) { _%>
|
19
32
|
<NxWelcome title="<%= projectName %>"/>
|
20
|
-
|
33
|
+
<%_ } else { _%>
|
21
34
|
<h1>
|
22
35
|
<span> Hello there, </span>
|
23
36
|
Welcome <%= projectName %> 👋
|
24
37
|
</h1>
|
25
|
-
|
26
|
-
</div>
|
27
|
-
|
28
|
-
}
|
29
|
-
}
|
30
|
-
<% } else { %>
|
38
|
+
<%_ } _%>
|
39
|
+
</div>
|
40
|
+
);
|
31
41
|
}
|
32
|
-
<% } %>
|
42
|
+
<%_ } _%>
|
33
43
|
|
34
44
|
export default App;
|
35
45
|
|
@@ -1,35 +1,44 @@
|
|
1
|
-
<% if (classComponent) { %>
|
1
|
+
<%_ if (classComponent) { _%>
|
2
2
|
import { Component } from 'react';
|
3
|
-
<% } %>
|
3
|
+
<%_ } _%>
|
4
4
|
import './<%= fileName %>.<%= style %>';
|
5
|
-
<% if (!minimal) { %>
|
5
|
+
<%_ if (!minimal) { _%>
|
6
6
|
import NxWelcome from "./nx-welcome";
|
7
|
-
<% } %>
|
7
|
+
<%_ } _%>
|
8
8
|
|
9
|
-
<% if (classComponent) { %>
|
9
|
+
<%_ if (classComponent) { _%>
|
10
10
|
export class App extends Component {
|
11
|
-
render() {
|
12
|
-
|
11
|
+
override render() {
|
12
|
+
return (
|
13
|
+
<div>
|
14
|
+
<%_ if (!minimal) { _%>
|
15
|
+
<NxWelcome title="<%= projectName %>"/>
|
16
|
+
<%_ } else { _%>
|
17
|
+
<h1>
|
18
|
+
<span> Hello there, </span>
|
19
|
+
Welcome <%= projectName %> 👋
|
20
|
+
</h1>
|
21
|
+
<%_ } _%>
|
22
|
+
</div>
|
23
|
+
);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
<%_ } else { _%>
|
13
27
|
export function App() {
|
14
|
-
<% } %>
|
15
28
|
return (
|
16
|
-
|
17
|
-
<% if (!minimal) { %>
|
18
|
-
|
19
|
-
|
29
|
+
<div>
|
30
|
+
<%_ if (!minimal) { _%>
|
31
|
+
<NxWelcome title="<%= projectName %>"/>
|
32
|
+
<%_ } else { _%>
|
20
33
|
<h1>
|
21
34
|
<span> Hello there, </span>
|
22
35
|
Welcome <%= projectName %> 👋
|
23
36
|
</h1>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
37
|
+
<%_ } _%>
|
38
|
+
</div>
|
39
|
+
);
|
28
40
|
}
|
29
|
-
<% }
|
30
|
-
}
|
31
|
-
<% } %>
|
32
|
-
|
41
|
+
<%_ } _%>
|
33
42
|
export default App;
|
34
43
|
|
35
44
|
<% if (inSourceTests === true) { %> <%- inSourceVitestTests %> <% } %>
|
@@ -1,33 +1,43 @@
|
|
1
|
-
<% if (classComponent) { %>
|
1
|
+
<%_ if (classComponent) { _%>
|
2
2
|
import { Component } from 'react';
|
3
|
-
<% } %>
|
4
|
-
<% if (!minimal) { %>
|
3
|
+
<%_ } _%>
|
4
|
+
<%_ if (!minimal) { _%>
|
5
5
|
import NxWelcome from "./nx-welcome";
|
6
|
-
<% } %>
|
6
|
+
<%_ } _%>
|
7
7
|
|
8
|
-
<% if (classComponent) { %>
|
8
|
+
<%_ if (classComponent) { _%>
|
9
9
|
export class App extends Component {
|
10
10
|
override render() {
|
11
|
-
|
11
|
+
return (
|
12
|
+
<div>
|
13
|
+
<%_ if (!minimal) { _%>
|
14
|
+
<NxWelcome title="<%= projectName %>"/>
|
15
|
+
<%_ } else { _%>
|
16
|
+
<h1>
|
17
|
+
<span> Hello there, </span>
|
18
|
+
Welcome <%= projectName %> 👋
|
19
|
+
</h1>
|
20
|
+
<%_ } _%>
|
21
|
+
</div>
|
22
|
+
);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
<%_ } else { _%>
|
12
26
|
export function App() {
|
13
|
-
<% } %>
|
14
27
|
return (
|
15
28
|
<div>
|
16
|
-
|
29
|
+
<%_ if (!minimal) { _%>
|
17
30
|
<NxWelcome title="<%= projectName %>"/>
|
18
|
-
|
31
|
+
<%_ } else { _%>
|
19
32
|
<h1>
|
20
33
|
<span> Hello there, </span>
|
21
34
|
Welcome <%= projectName %> 👋
|
22
35
|
</h1>
|
23
|
-
|
24
|
-
</div>
|
25
|
-
|
26
|
-
}
|
27
|
-
}
|
28
|
-
<% } else { %>
|
36
|
+
<%_ } _%>
|
37
|
+
</div>
|
38
|
+
);
|
29
39
|
}
|
30
|
-
<% } %>
|
40
|
+
<%_ } _%>
|
31
41
|
|
32
42
|
export default App;
|
33
43
|
|
@@ -1,36 +1,45 @@
|
|
1
|
-
<% if (classComponent) { %>
|
1
|
+
<%_ if (classComponent) { _%>
|
2
2
|
import { Component } from 'react';
|
3
|
-
<% } %>
|
4
|
-
<% if (!minimal) { %>
|
3
|
+
<%_ } _%>
|
4
|
+
<%_ if (!minimal) { _%>
|
5
5
|
import NxWelcome from "./nx-welcome";
|
6
|
-
<% } %>
|
6
|
+
<%_ } _%>
|
7
7
|
|
8
|
-
<% if (classComponent) { %>
|
8
|
+
<%_ if (classComponent) { _%>
|
9
9
|
export class App extends Component {
|
10
|
-
render() {
|
11
|
-
|
10
|
+
override render() {
|
11
|
+
return (
|
12
|
+
<div>
|
13
|
+
<style jsx>{`/** your style here **/`}</style>
|
14
|
+
<%_ if (!minimal) { _%>
|
15
|
+
<NxWelcome title="<%= projectName %>"/>
|
16
|
+
<%_ } else { _%>
|
17
|
+
<h1>
|
18
|
+
<span> Hello there, </span>
|
19
|
+
Welcome <%= projectName %> 👋
|
20
|
+
</h1>
|
21
|
+
<%_ } _%>
|
22
|
+
</div>
|
23
|
+
);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
<%_ } else { _%>
|
12
27
|
export function App() {
|
13
|
-
<% } %>
|
14
28
|
return (
|
15
29
|
<div>
|
16
30
|
<style jsx>{`/** your style here **/`}</style>
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
31
|
+
<%_ if (!minimal) { _%>
|
32
|
+
<NxWelcome title="<%= projectName %>"/>
|
33
|
+
<%_ } else { _%>
|
34
|
+
<h1>
|
35
|
+
<span> Hello there, </span>
|
36
|
+
Welcome <%= projectName %> 👋
|
37
|
+
</h1>
|
38
|
+
<%_ } _%>
|
25
39
|
</div>
|
26
40
|
);
|
27
|
-
|
28
|
-
<% if (classComponent) { %>
|
29
|
-
}
|
30
|
-
}
|
31
|
-
<% } else { %>
|
32
41
|
}
|
33
|
-
<% } %>
|
42
|
+
<%_ } _%>
|
34
43
|
|
35
44
|
export default App;
|
36
45
|
|