Skip to content
Snippets Groups Projects
Commit ae2d3d73 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4320 OZG-4488 Migrate to Nx 16.10.0 + Angular 16

parent 98c127c9
No related branches found
No related tags found
No related merge requests found
Showing
with 330 additions and 1386 deletions
node_modules
......@@ -7,7 +7,7 @@
"project": "./tsconfig.*?.json"
},
"ignorePatterns": ["**/*"],
"plugins": ["@typescript-eslint", "@nrwl/nx"],
"plugins": ["@typescript-eslint", "@nx"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
......@@ -19,7 +19,7 @@
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
......
tmp
/test
/build
node_modules
/package.json
/pnpm-lock.yaml
packages/workspace/src/generators/**/files/**/*.json
This diff is collapsed.
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
//Cypress config is generated by JenkinsFile
......@@ -11,6 +11,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
//Cypress config is generated by JenkinsFile
......@@ -11,6 +11,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
const cypressConfig = require('./cypress.config.json');
......@@ -10,6 +10,6 @@ export default defineConfig({
...cypressConfig,
setupNodeEvents(on, config) {
return cypressEvents(on, config);
}
},
},
});
{
"name": "goofy-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/goofy-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/goofy-e2e/cypress.config.ts",
"tsConfig": "apps/goofy-e2e/tsconfig.e2e.json",
"devServerTarget": "goofy:serve",
"testingType": "e2e"
},
"configurations": {
"production": {
"devServerTarget": "goofy:serve:production"
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/goofy-e2e/**/*.{js,ts}",
"apps/goofy-e2e/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
}
},
"tags": [],
"implicitDependencies": ["goofy"]
}
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
......@@ -28,12 +28,7 @@ export default {
displayName: 'goofy',
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/goofy',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
......@@ -41,7 +36,13 @@ export default {
'jest-preset-angular/build/serializers/html-comment',
],
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$)'],
};
{
"name": "goofy",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"sourceRoot": "apps/goofy/src",
"prefix": "goofy-client",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": ["file-saver"],
"outputPath": "dist/apps/goofy",
"index": "apps/goofy/src/index.html",
"main": "apps/goofy/src/main.ts",
"polyfills": "apps/goofy/src/polyfills.ts",
"tsConfig": "apps/goofy/tsconfig.app.json",
"assets": [
"apps/goofy/src/assets",
"apps/goofy/src/silent-refresh.html",
{
"input": "apps/goofy/src/favicon",
"glob": "**/*",
"output": ""
},
{
"input": "libs/ui/src/lib/assets",
"glob": "**/*",
"output": "assets/icons"
}
],
"styles": ["apps/goofy/src/styles/main.scss"],
"scripts": [],
"stylePreprocessorOptions": {
"includePaths": [
"apps/goofy/src/styles/abstracts",
"apps/goofy/src/styles/material",
"node_modules/@angular",
"node_modules/include-media",
"node_modules/typeface-roboto"
]
},
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/goofy/src/environments/environment.ts",
"with": "apps/goofy/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "goofy:build",
"proxyConfig": "proxy.conf.mjs"
},
"configurations": {
"production": {
"browserTarget": "goofy:build:production"
}
}
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "goofy:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/goofy/src/**/*.ts",
"apps/goofy/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"tsConfig": "apps/goofy/tsconfig.spec.json",
"jestConfig": "apps/goofy/jest.config.ts",
"passWithNoTests": true
},
"outputs": ["{workspaceRoot}/coverage/apps/goofy"]
}
},
"tags": []
}
......@@ -50,9 +50,11 @@ const cp = require('child_process');
const isWindows = os.platform() === 'win32';
let output;
try {
output = require('@nrwl/workspace').output;
output = require('@nx/workspace').output;
} catch (e) {
console.warn('Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.');
console.warn(
'Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed.'
);
process.exit(0);
}
......@@ -69,16 +71,23 @@ function symlinkNgCLItoNxCLI() {
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
['', '.cmd', '.ps1'].forEach(ext => {
if (fs.existsSync(nxPath + ext)) fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
['', '.cmd', '.ps1'].forEach((ext) => {
if (fs.existsSync(nxPath + ext))
fs.writeFileSync(
ngPath + ext,
fs.readFileSync(nxPath + ext)
);
});
} else {
// If unix-based, symlink
cp.execSync(`ln -sf ./nx ${ngPath}`);
}
}
catch(e) {
output.error({ title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message });
} catch (e) {
output.error({
title:
'Unable to create a symlink from the Angular CLI to the Nx CLI:' +
e.message,
});
throw e;
}
}
......@@ -86,7 +95,11 @@ function symlinkNgCLItoNxCLI() {
try {
symlinkNgCLItoNxCLI();
require('@nrwl/cli/lib/decorate-cli').decorateCli();
output.log({ title: 'Angular CLI has been decorated to enable computation caching.' });
output.log({
title: 'Angular CLI has been decorated to enable computation caching.',
});
} catch (e) {
output.error({ title: 'Decoration of the Angular CLI did not complete successfully' });
output.error({
title: 'Decoration of the Angular CLI did not complete successfully',
});
}
......@@ -21,6 +21,6 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');
export default { projects: getJestProjects() };
......@@ -21,7 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require('@nx/jest/preset').default;
module.exports = {
...nxPreset,
......
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
......@@ -28,12 +28,7 @@ export default {
displayName: 'api-root-shared',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/api-root-shared',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
......@@ -41,7 +36,13 @@ export default {
'jest-preset-angular/build/serializers/html-comment',
],
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$)'],
};
{
"name": "api-root-shared",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/api-root-shared/src",
"prefix": "goofy-client",
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/api-root-shared/src/**/*.ts",
"libs/api-root-shared/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"tsConfig": "libs/api-root-shared/tsconfig.spec.json",
"jestConfig": "libs/api-root-shared/jest.config.ts",
"passWithNoTests": true
},
"outputs": ["{workspaceRoot}/coverage/libs/api-root-shared"]
}
},
"generators": {
"@schematics/angular:component": {
"style": "scss"
}
},
"tags": []
}
......@@ -26,7 +26,7 @@ import { TestBed } from '@angular/core/testing';
import { mock } from '@goofy-client/test-utils';
import { EffectsModule } from '@ngrx/effects';
import { Store, StoreModule } from '@ngrx/store';
import { readFirst } from '@nrwl/angular/testing';
import { readFirst } from '@nx/angular/testing';
import { createApiRootResource } from 'libs/api-root-shared/test/api-root';
import { of } from 'rxjs';
import { ApiRootResource } from '../api-root.model';
......
......@@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
......@@ -26,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment