Skip to content

Commit 381c249

Browse files
committedDec 30, 2024
Step 1 - Initialize nx.dev workspace for SSR plugin development; set up test app for SSR experiments.
0 parents  commit 381c249

36 files changed

+23904
-0
lines changed
 

‎.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

‎.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.nx/workspace-data
43+
44+
.angular

‎.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data
6+
.angular

‎.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

‎.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint",
6+
"firsttris.vscode-jest-runner"
7+
]
8+
}

‎README.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# NxAngularMf
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
✨ Your new, shiny [Nx workspace](https://nx.dev) is ready ✨.
6+
7+
[Learn more about this workspace setup and its capabilities](https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
8+
9+
## Run tasks
10+
11+
To run the dev server for your app, use:
12+
13+
```sh
14+
npx nx serve host-application
15+
```
16+
17+
To create a production bundle:
18+
19+
```sh
20+
npx nx build host-application
21+
```
22+
23+
To see all available targets to run for a project, run:
24+
25+
```sh
26+
npx nx show project host-application
27+
```
28+
29+
These targets are either [inferred automatically](https://nx.dev/concepts/inferred-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or defined in the `project.json` or `package.json` files.
30+
31+
[More about running tasks in the docs &raquo;](https://nx.dev/features/run-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
32+
33+
## Add new projects
34+
35+
While you could add new projects to your workspace manually, you might want to leverage [Nx plugins](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) and their [code generation](https://nx.dev/features/generate-code?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) feature.
36+
37+
Use the plugin's generator to create new projects.
38+
39+
To generate a new application, use:
40+
41+
```sh
42+
npx nx g @nx/angular:app demo
43+
```
44+
45+
To generate a new library, use:
46+
47+
```sh
48+
npx nx g @nx/angular:lib mylib
49+
```
50+
51+
You can use `npx nx list` to get a list of installed plugins. Then, run `npx nx list <plugin-name>` to learn about more specific capabilities of a particular plugin. Alternatively, [install Nx Console](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) to browse plugins and generators in your IDE.
52+
53+
[Learn more about Nx plugins &raquo;](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) | [Browse the plugin registry &raquo;](https://nx.dev/plugin-registry?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
54+
55+
## Set up CI!
56+
57+
### Step 1
58+
59+
To connect to Nx Cloud, run the following command:
60+
61+
```sh
62+
npx nx connect
63+
```
64+
65+
Connecting to Nx Cloud ensures a [fast and scalable CI](https://nx.dev/ci/intro/why-nx-cloud?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) pipeline. It includes features such as:
66+
67+
- [Remote caching](https://nx.dev/ci/features/remote-cache?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
68+
- [Task distribution across multiple machines](https://nx.dev/ci/features/distribute-task-execution?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
69+
- [Automated e2e test splitting](https://nx.dev/ci/features/split-e2e-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
70+
- [Task flakiness detection and rerunning](https://nx.dev/ci/features/flaky-tasks?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
71+
72+
### Step 2
73+
74+
Use the following command to configure a CI workflow for your workspace:
75+
76+
```sh
77+
npx nx g ci-workflow
78+
```
79+
80+
[Learn more about Nx on CI](https://nx.dev/ci/intro/ci-with-nx#ready-get-started-with-your-provider?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
81+
82+
## Install Nx Console
83+
84+
Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.
85+
86+
[Install Nx Console &raquo;](https://nx.dev/getting-started/editor-setup?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
87+
88+
## Useful links
89+
90+
Learn more:
91+
92+
- [Learn more about this workspace setup](https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx_project&amp;utm_medium=readme&amp;utm_campaign=nx_projects)
93+
- [Learn about Nx on CI](https://nx.dev/ci/intro/ci-with-nx?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
94+
- [Releasing Packages with Nx release](https://nx.dev/features/manage-releases?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
95+
- [What are Nx plugins?](https://nx.dev/concepts/nx-plugins?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
96+
97+
And join the Nx community:
98+
- [Discord](https://go.nx.dev/community)
99+
- [Follow us on X](https://twitter.com/nxdevtools) or [LinkedIn](https://www.linkedin.com/company/nrwl)
100+
- [Our Youtube channel](https://www.youtube.com/@nxdevtools)
101+
- [Our blog](https://nx.dev/blog?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects)
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const nx = require('@nx/eslint-plugin');
2+
const baseConfig = require('../../eslint.config.cjs');
3+
4+
module.exports = [
5+
...baseConfig,
6+
...nx.configs['flat/angular'],
7+
...nx.configs['flat/angular-template'],
8+
{
9+
files: ['**/*.ts'],
10+
rules: {
11+
'@angular-eslint/directive-selector': [
12+
'error',
13+
{
14+
type: 'attribute',
15+
prefix: 'app',
16+
style: 'camelCase',
17+
},
18+
],
19+
'@angular-eslint/component-selector': [
20+
'error',
21+
{
22+
type: 'element',
23+
prefix: 'app',
24+
style: 'kebab-case',
25+
},
26+
],
27+
},
28+
},
29+
{
30+
files: ['**/*.html'],
31+
// Override or add rules here
32+
rules: {},
33+
},
34+
];

‎apps/host-application/jest.config.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
displayName: 'host-application',
3+
preset: '../../jest.preset.js',
4+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
5+
coverageDirectory: '../../coverage/apps/host-application',
6+
transform: {
7+
'^.+\\.(ts|mjs|js|html)$': [
8+
'jest-preset-angular',
9+
{
10+
tsconfig: '<rootDir>/tsconfig.spec.json',
11+
stringifyContentPathRegex: '\\.(html|svg)$',
12+
},
13+
],
14+
},
15+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
16+
snapshotSerializers: [
17+
'jest-preset-angular/build/serializers/no-ng-attributes',
18+
'jest-preset-angular/build/serializers/ng-snapshot',
19+
'jest-preset-angular/build/serializers/html-comment',
20+
],
21+
};

‎apps/host-application/project.json

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"name": "host-application",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "application",
5+
"prefix": "app",
6+
"sourceRoot": "apps/host-application/src",
7+
"tags": [],
8+
"targets": {
9+
"build": {
10+
"executor": "@angular-devkit/build-angular:application",
11+
"outputs": ["{options.outputPath}"],
12+
"options": {
13+
"outputPath": "dist/apps/host-application",
14+
"index": "apps/host-application/src/index.html",
15+
"browser": "apps/host-application/src/main.ts",
16+
"polyfills": ["zone.js"],
17+
"tsConfig": "apps/host-application/tsconfig.app.json",
18+
"assets": [
19+
{
20+
"glob": "**/*",
21+
"input": "apps/host-application/public"
22+
}
23+
],
24+
"styles": ["apps/host-application/src/styles.css"],
25+
"scripts": [],
26+
"server": "apps/host-application/src/main.server.ts",
27+
"ssr": {
28+
"entry": "apps/host-application/src/server.ts"
29+
},
30+
"outputMode": "server"
31+
},
32+
"configurations": {
33+
"production": {
34+
"budgets": [
35+
{
36+
"type": "initial",
37+
"maximumWarning": "500kb",
38+
"maximumError": "1mb"
39+
},
40+
{
41+
"type": "anyComponentStyle",
42+
"maximumWarning": "4kb",
43+
"maximumError": "8kb"
44+
}
45+
],
46+
"outputHashing": "all"
47+
},
48+
"development": {
49+
"optimization": false,
50+
"extractLicenses": false,
51+
"sourceMap": true
52+
}
53+
},
54+
"defaultConfiguration": "production"
55+
},
56+
"serve": {
57+
"executor": "@angular-devkit/build-angular:dev-server",
58+
"configurations": {
59+
"production": {
60+
"buildTarget": "host-application:build:production"
61+
},
62+
"development": {
63+
"buildTarget": "host-application:build:development"
64+
}
65+
},
66+
"defaultConfiguration": "development"
67+
},
68+
"extract-i18n": {
69+
"executor": "@angular-devkit/build-angular:extract-i18n",
70+
"options": {
71+
"buildTarget": "host-application:build"
72+
}
73+
},
74+
"lint": {
75+
"executor": "@nx/eslint:lint"
76+
},
77+
"test": {
78+
"executor": "@nx/jest:jest",
79+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
80+
"options": {
81+
"jestConfig": "apps/host-application/jest.config.ts"
82+
}
83+
},
84+
"serve-static": {
85+
"executor": "@nx/web:file-server",
86+
"options": {
87+
"buildTarget": "host-application:build",
88+
"staticFilePath": "dist/apps/host-application/browser",
89+
"spa": true
90+
}
91+
}
92+
}
93+
}
14.7 KB
Binary file not shown.

‎apps/host-application/src/app/app.component.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<app-nx-welcome></app-nx-welcome>
2+
<router-outlet></router-outlet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
import { NxWelcomeComponent } from './nx-welcome.component';
4+
import { RouterModule } from '@angular/router';
5+
6+
describe('AppComponent', () => {
7+
beforeEach(async () => {
8+
await TestBed.configureTestingModule({
9+
imports: [AppComponent, NxWelcomeComponent, RouterModule.forRoot([])],
10+
}).compileComponents();
11+
});
12+
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(
18+
'Welcome host-application'
19+
);
20+
});
21+
22+
it(`should have as title 'host-application'`, () => {
23+
const fixture = TestBed.createComponent(AppComponent);
24+
const app = fixture.componentInstance;
25+
expect(app.title).toEqual('host-application');
26+
});
27+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from '@angular/core';
2+
import { RouterModule } from '@angular/router';
3+
import { NxWelcomeComponent } from './nx-welcome.component';
4+
5+
@Component({
6+
imports: [NxWelcomeComponent, RouterModule],
7+
selector: 'app-root',
8+
templateUrl: './app.component.html',
9+
styleUrl: './app.component.css',
10+
})
11+
export class AppComponent {
12+
title = 'host-application';
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2+
import { provideServerRendering } from '@angular/platform-server';
3+
import { provideServerRoutesConfig } from '@angular/ssr';
4+
import { appConfig } from './app.config';
5+
import { serverRoutes } from './app.routes.server';
6+
7+
const serverConfig: ApplicationConfig = {
8+
providers: [
9+
provideServerRendering(),
10+
provideServerRoutesConfig(serverRoutes),
11+
],
12+
};
13+
14+
export const config = mergeApplicationConfig(appConfig, serverConfig);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
import { appRoutes } from './app.routes';
4+
import {
5+
provideClientHydration,
6+
withEventReplay,
7+
} from '@angular/platform-browser';
8+
9+
export const appConfig: ApplicationConfig = {
10+
providers: [
11+
provideClientHydration(withEventReplay()),
12+
provideZoneChangeDetection({ eventCoalescing: true }),
13+
provideRouter(appRoutes),
14+
],
15+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { RenderMode, ServerRoute } from '@angular/ssr';
2+
3+
export const serverRoutes: ServerRoute[] = [
4+
{
5+
path: '**',
6+
renderMode: RenderMode.Prerender,
7+
},
8+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Route } from '@angular/router';
2+
3+
export const appRoutes: Route[] = [];

‎apps/host-application/src/app/nx-welcome.component.ts

+872
Large diffs are not rendered by default.

‎apps/host-application/src/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>host-application</title>
6+
<base href="/" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { AppComponent } from './app/app.component';
3+
import { config } from './app/app.config.server';
4+
5+
const bootstrap = () => bootstrapApplication(AppComponent, config);
6+
7+
export default bootstrap;

‎apps/host-application/src/main.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { appConfig } from './app/app.config';
3+
import { AppComponent } from './app/app.component';
4+
5+
bootstrapApplication(AppComponent, appConfig).catch((err) =>
6+
console.error(err)
7+
);

‎apps/host-application/src/server.ts

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import {
2+
AngularNodeAppEngine,
3+
createNodeRequestHandler,
4+
isMainModule,
5+
writeResponseToNodeResponse,
6+
} from '@angular/ssr/node';
7+
import express from 'express';
8+
import { dirname, resolve } from 'node:path';
9+
import { fileURLToPath } from 'node:url';
10+
11+
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
12+
const browserDistFolder = resolve(serverDistFolder, '../browser');
13+
14+
const app = express();
15+
const angularApp = new AngularNodeAppEngine();
16+
17+
/**
18+
* Example Express Rest API endpoints can be defined here.
19+
* Uncomment and define endpoints as necessary.
20+
*
21+
* Example:
22+
* ```ts
23+
* app.get('/api/**', (req, res) => {
24+
* // Handle API request
25+
* });
26+
* ```
27+
*/
28+
29+
/**
30+
* Serve static files from /browser
31+
*/
32+
app.use(
33+
express.static(browserDistFolder, {
34+
maxAge: '1y',
35+
index: false,
36+
redirect: false,
37+
})
38+
);
39+
40+
/**
41+
* Handle all other requests by rendering the Angular application.
42+
*/
43+
app.use('/**', (req, res, next) => {
44+
angularApp
45+
.handle(req)
46+
.then((response) =>
47+
response ? writeResponseToNodeResponse(response, res) : next()
48+
)
49+
.catch(next);
50+
});
51+
52+
/**
53+
* Start the server if this module is the main entry point.
54+
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000.
55+
*/
56+
if (isMainModule(import.meta.url)) {
57+
const port = process.env['PORT'] || 4000;
58+
app.listen(port, () => {
59+
console.log(`Node Express server listening on http://localhost:${port}`);
60+
});
61+
}
62+
63+
/**
64+
* The request handler used by the Angular CLI (dev-server and during build).
65+
*/
66+
export const reqHandler = createNodeRequestHandler(app);

‎apps/host-application/src/styles.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* You can add global styles to this file, and also import other style files */
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
2+
3+
setupZoneTestEnv({
4+
errorOnUnknownElements: true,
5+
errorOnUnknownProperties: true,
6+
});
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"types": ["node"]
6+
},
7+
"files": ["src/main.ts", "src/main.server.ts", "src/server.ts"],
8+
"include": ["src/**/*.d.ts"],
9+
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src/**/*.ts"],
4+
"compilerOptions": {},
5+
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
6+
}

‎apps/host-application/tsconfig.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2022",
4+
"esModuleInterop": true,
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noPropertyAccessFromIndexSignature": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true
11+
},
12+
"files": [],
13+
"include": [],
14+
"references": [
15+
{
16+
"path": "./tsconfig.editor.json"
17+
},
18+
{
19+
"path": "./tsconfig.app.json"
20+
},
21+
{
22+
"path": "./tsconfig.spec.json"
23+
}
24+
],
25+
"extends": "../../tsconfig.base.json",
26+
"angularCompilerOptions": {
27+
"enableI18nLegacyMessageIdFormat": false,
28+
"strictInjectionParameters": true,
29+
"strictInputAccessModifiers": true,
30+
"strictTemplates": true
31+
}
32+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"module": "commonjs",
6+
"target": "es2016",
7+
"types": ["jest", "node"]
8+
},
9+
"files": ["src/test-setup.ts"],
10+
"include": [
11+
"jest.config.ts",
12+
"src/**/*.test.ts",
13+
"src/**/*.spec.ts",
14+
"src/**/*.d.ts"
15+
]
16+
}

‎eslint.config.cjs

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const nx = require('@nx/eslint-plugin');
2+
3+
module.exports = [
4+
...nx.configs['flat/base'],
5+
...nx.configs['flat/typescript'],
6+
...nx.configs['flat/javascript'],
7+
{
8+
ignores: ['**/dist'],
9+
},
10+
{
11+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
12+
rules: {
13+
'@nx/enforce-module-boundaries': [
14+
'error',
15+
{
16+
enforceBuildableLibDependency: true,
17+
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?js$'],
18+
depConstraints: [
19+
{
20+
sourceTag: '*',
21+
onlyDependOnLibsWithTags: ['*'],
22+
},
23+
],
24+
},
25+
],
26+
},
27+
},
28+
{
29+
files: [
30+
'**/*.ts',
31+
'**/*.tsx',
32+
'**/*.js',
33+
'**/*.jsx',
34+
'**/*.cjs',
35+
'**/*.mjs',
36+
],
37+
// Override or add rules here
38+
rules: {},
39+
},
40+
];

‎jest.config.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getJestProjectsAsync } from '@nx/jest';
2+
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

‎jest.preset.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nx/jest/preset').default;
2+
3+
module.exports = { ...nxPreset };

‎nx.json

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3+
"namedInputs": {
4+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
5+
"production": [
6+
"default",
7+
"!{projectRoot}/.eslintrc.json",
8+
"!{projectRoot}/eslint.config.cjs",
9+
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
10+
"!{projectRoot}/tsconfig.spec.json",
11+
"!{projectRoot}/jest.config.[jt]s",
12+
"!{projectRoot}/src/test-setup.[jt]s",
13+
"!{projectRoot}/test-setup.[jt]s"
14+
],
15+
"sharedGlobals": []
16+
},
17+
"targetDefaults": {
18+
"@angular-devkit/build-angular:application": {
19+
"cache": true,
20+
"dependsOn": ["^build"],
21+
"inputs": ["production", "^production"]
22+
},
23+
"@nx/eslint:lint": {
24+
"cache": true,
25+
"inputs": [
26+
"default",
27+
"{workspaceRoot}/.eslintrc.json",
28+
"{workspaceRoot}/.eslintignore",
29+
"{workspaceRoot}/eslint.config.cjs"
30+
]
31+
},
32+
"@nx/jest:jest": {
33+
"cache": true,
34+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
35+
"options": {
36+
"passWithNoTests": true
37+
},
38+
"configurations": {
39+
"ci": {
40+
"ci": true,
41+
"codeCoverage": true
42+
}
43+
}
44+
}
45+
},
46+
"generators": {
47+
"@nx/angular:application": {
48+
"e2eTestRunner": "none",
49+
"linter": "eslint",
50+
"style": "css",
51+
"unitTestRunner": "jest"
52+
}
53+
}
54+
}

‎package-lock.json

+22,282
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "@nx-angular-mf/source",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {},
6+
"private": true,
7+
"dependencies": {
8+
"@angular/animations": "~19.0.0",
9+
"@angular/common": "~19.0.0",
10+
"@angular/compiler": "~19.0.0",
11+
"@angular/core": "~19.0.0",
12+
"@angular/forms": "~19.0.0",
13+
"@angular/platform-browser": "~19.0.0",
14+
"@angular/platform-browser-dynamic": "~19.0.0",
15+
"@angular/platform-server": "~19.0.0",
16+
"@angular/router": "~19.0.0",
17+
"@angular/ssr": "~19.0.0",
18+
"express": "~4.18.2",
19+
"rxjs": "~7.8.0",
20+
"zone.js": "~0.15.0"
21+
},
22+
"devDependencies": {
23+
"@angular-devkit/build-angular": "~19.0.0",
24+
"@angular-devkit/core": "~19.0.0",
25+
"@angular-devkit/schematics": "~19.0.0",
26+
"@angular/cli": "~19.0.0",
27+
"@angular/compiler-cli": "~19.0.0",
28+
"@angular/language-service": "~19.0.0",
29+
"@eslint/js": "^9.8.0",
30+
"@nx/angular": "20.3.0",
31+
"@nx/eslint": "20.3.0",
32+
"@nx/eslint-plugin": "20.3.0",
33+
"@nx/jest": "20.3.0",
34+
"@nx/js": "20.3.0",
35+
"@nx/web": "20.3.0",
36+
"@nx/workspace": "20.3.0",
37+
"@schematics/angular": "~19.0.0",
38+
"@swc-node/register": "~1.9.1",
39+
"@swc/core": "~1.5.7",
40+
"@swc/helpers": "~0.5.11",
41+
"@types/express": "4.17.14",
42+
"@types/jest": "^29.5.12",
43+
"@types/node": "18.16.9",
44+
"@typescript-eslint/utils": "^8.13.0",
45+
"angular-eslint": "^19.0.2",
46+
"eslint": "^9.8.0",
47+
"eslint-config-prettier": "^9.0.0",
48+
"jest": "^29.7.0",
49+
"jest-environment-jsdom": "^29.7.0",
50+
"jest-preset-angular": "~14.4.0",
51+
"nx": "20.3.0",
52+
"prettier": "^2.6.2",
53+
"ts-jest": "^29.1.0",
54+
"ts-node": "10.9.1",
55+
"tslib": "^2.3.0",
56+
"typescript": "~5.6.2",
57+
"typescript-eslint": "^8.13.0"
58+
}
59+
}

‎tsconfig.base.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"sourceMap": true,
6+
"declaration": false,
7+
"moduleResolution": "node",
8+
"emitDecoratorMetadata": true,
9+
"experimentalDecorators": true,
10+
"importHelpers": true,
11+
"target": "es2015",
12+
"module": "esnext",
13+
"lib": ["es2020", "dom"],
14+
"skipLibCheck": true,
15+
"skipDefaultLibCheck": true,
16+
"baseUrl": ".",
17+
"paths": {}
18+
},
19+
"exclude": ["node_modules", "tmp"]
20+
}

0 commit comments

Comments
 (0)
Please sign in to comment.