Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update app to nx17 w/ ng16 #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,12 +23,12 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ testem.log
Thumbs.db

.angular

.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

/dist
/coverage

/.nx/cache
17 changes: 0 additions & 17 deletions angular.json

This file was deleted.

5 changes: 3 additions & 2 deletions apps/about-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "about-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/about-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/about-e2e/cypress.json",
"devServerTarget": "host:serve:development"
Expand All @@ -16,7 +17,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/about-e2e/**/*.{js,ts}"]
Expand Down
16 changes: 0 additions & 16 deletions apps/about/.browserslistrc

This file was deleted.

4 changes: 2 additions & 2 deletions apps/about/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand All @@ -29,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
15 changes: 8 additions & 7 deletions apps/about/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ export default {
displayName: 'about',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/about',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
Expand Down
13 changes: 7 additions & 6 deletions apps/about/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "about",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/about/src",
"prefix": "ng-module-federation",
"targets": {
"build": {
"executor": "@nrwl/angular:webpack-browser",
"executor": "@nx/angular:webpack-browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/about",
Expand Down Expand Up @@ -57,7 +58,7 @@
"defaultConfiguration": "production"
},
"serve": {
"executor": "@nrwl/angular:webpack-server",
"executor": "@nx/angular:webpack-dev-server",
"configurations": {
"production": {
"browserTarget": "about:build:production"
Expand All @@ -79,21 +80,21 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["apps/about/**/*.ts", "apps/about/**/*.html"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/about"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/about"],
"options": {
"jestConfig": "apps/about/jest.config.ts",
"passWithNoTests": true
}
},
"serve-static": {
"executor": "@nrwl/angular:file-server",
"executor": "@nrwl/web:file-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "about:build",
Expand Down
10 changes: 10 additions & 0 deletions apps/about/src/app/remote-entry/entry.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';

@Component({
selector: 'ng-module-federation-entry-about',
template: `<router-outlet name="about"></router-outlet>`,
standalone: true,
imports: [RouterModule]
})
export class RemoteEntryComponent {}
12 changes: 10 additions & 2 deletions apps/about/src/app/remote-entry/entry.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { NgModule } from '@angular/core';
import { AboutMainModule } from '@ng-module-federation/about-main';
import { RouterModule } from '@angular/router';
import { RemoteEntryComponent } from './entry.component';

@NgModule({
imports: [
AboutMainModule
RemoteEntryComponent,
RouterModule.forChild([
{
path: '',
component: RemoteEntryComponent,
loadChildren: () => import('@ng-module-federation/about-main').then((m) => m.AboutMainModule)
}
]),
],
providers: [],
})
Expand Down
3 changes: 2 additions & 1 deletion apps/about/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [],
"target": "ES2020"
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion apps/about/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { withModuleFederation } = require('@nrwl/angular/module-federation');
const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);
2 changes: 1 addition & 1 deletion apps/about/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { withModuleFederation } = require('@nrwl/angular/module-federation');
const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation({
...config,
Expand Down
5 changes: 3 additions & 2 deletions apps/cart-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "cart-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/cart-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/cart-e2e/cypress.json",
"devServerTarget": "host:serve:development"
Expand All @@ -16,7 +17,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/cart-e2e/**/*.{js,ts}"]
Expand Down
16 changes: 0 additions & 16 deletions apps/cart/.browserslistrc

This file was deleted.

4 changes: 2 additions & 2 deletions apps/cart/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand All @@ -29,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
15 changes: 8 additions & 7 deletions apps/cart/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ export default {
displayName: 'cart',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/cart',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
Expand Down
13 changes: 7 additions & 6 deletions apps/cart/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "cart",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/cart/src",
"prefix": "ng-module-federation",
"targets": {
"build": {
"executor": "@nrwl/angular:webpack-browser",
"executor": "@nx/angular:webpack-browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/cart",
Expand Down Expand Up @@ -57,7 +58,7 @@
"defaultConfiguration": "production"
},
"serve": {
"executor": "@nrwl/angular:webpack-server",
"executor": "@nx/angular:webpack-dev-server",
"configurations": {
"production": {
"browserTarget": "cart:build:production"
Expand All @@ -79,21 +80,21 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["apps/cart/**/*.ts", "apps/cart/**/*.html"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/cart"],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/cart"],
"options": {
"jestConfig": "apps/cart/jest.config.ts",
"passWithNoTests": true
}
},
"serve-static": {
"executor": "@nrwl/angular:file-server",
"executor": "@nrwl/web:file-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "cart:build",
Expand Down
3 changes: 2 additions & 1 deletion apps/cart/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [],
"target": "ES2020"
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.d.ts"],
Expand Down
2 changes: 1 addition & 1 deletion apps/cart/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { withModuleFederation } = require('@nrwl/angular/module-federation');
const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation(config);
2 changes: 1 addition & 1 deletion apps/cart/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { withModuleFederation } = require('@nrwl/angular/module-federation');
const { withModuleFederation } = require('@nx/angular/module-federation');
const config = require('./module-federation.config');
module.exports = withModuleFederation({
...config,
Expand Down
Loading