Skip to content

Commit

Permalink
chore(migrate to nx v17): updated nx from 16 to 17 and angular packag… (
Browse files Browse the repository at this point in the history
#25)

* chore(migrate to nx v17): updated nx from 16 to 17 and angular packages from 16 to 16.2

* style(util-core): lint fix Function

fixed error lint in use Function type

* test(feature): fix test module import animations
  • Loading branch information
guiseek authored Oct 28, 2023
1 parent 65d12cf commit f6c6e41
Show file tree
Hide file tree
Showing 13 changed files with 26,436 additions and 7,295 deletions.
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
.angular

/.nx/cache
2 changes: 1 addition & 1 deletion apps/getlab/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/getlab/**/*.ts", "apps/getlab/**/*.html"]
Expand Down
5 changes: 3 additions & 2 deletions libs/data-access/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"outputPath": "dist/libs/data-access",
"main": "libs/data-access/src/index.ts",
"tsConfig": "libs/data-access/tsconfig.lib.json",
"assets": []
"assets": [],
"updateBuildableProjectDepsInPackageJson": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/data-access/**/*.ts"]
Expand Down
5 changes: 3 additions & 2 deletions libs/domain/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"outputPath": "dist/libs/domain",
"main": "libs/domain/src/index.ts",
"tsConfig": "libs/domain/tsconfig.lib.json",
"assets": []
"assets": [],
"updateBuildableProjectDepsInPackageJson": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/domain/**/*.ts"]
Expand Down
2 changes: 1 addition & 1 deletion libs/feature/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/feature/**/*.ts", "libs/feature/**/*.html"]
Expand Down
6 changes: 4 additions & 2 deletions libs/feature/src/lib/feature.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FeatureComponent } from './feature.component';
import { MATERIAL_MODULES } from './material-modules';
import { ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BrowserTestingModule } from '@angular/platform-browser/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { SidenavMenuComponent } from './components';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

describe('FeatureComponent', () => {
let component: FeatureComponent;
Expand All @@ -13,8 +14,9 @@ describe('FeatureComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
BrowserAnimationsModule,
MATERIAL_MODULES,
NoopAnimationsModule,
BrowserTestingModule,
RouterTestingModule,
ReactiveFormsModule,
],
Expand Down
5 changes: 3 additions & 2 deletions libs/util-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"outputPath": "dist/libs/util-core",
"main": "libs/util-core/src/index.ts",
"tsConfig": "libs/util-core/tsconfig.lib.json",
"assets": []
"assets": [],
"updateBuildableProjectDepsInPackageJson": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/util-core/**/*.ts"]
Expand Down
6 changes: 5 additions & 1 deletion libs/util-core/src/lib/di/types/type.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export interface Type<T> extends Function {
interface Fn {
readonly name: string;
}

export interface Type<T> extends Fn {
new (...params: unknown[]): T;
}
122 changes: 122 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"migrations": [
{
"cli": "nx",
"version": "16.6.0-beta.6",
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
"package": "nx",
"name": "16.6.0-prefix-outputs"
},
{
"cli": "nx",
"version": "16.8.0-beta.3",
"description": "Escape $ in env variables",
"implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables",
"package": "nx",
"name": "16.8.0-escape-dollar-sign-env"
},
{
"cli": "nx",
"version": "17.0.0-beta.1",
"description": "Updates the default cache directory to .nx/cache",
"implementation": "./src/migrations/update-17-0-0/move-cache-directory",
"package": "nx",
"name": "17.0.0-move-cache-directory"
},
{
"cli": "nx",
"version": "17.0.0-beta.3",
"description": "Use minimal config for tasksRunnerOptions",
"implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options",
"package": "nx",
"name": "17.0.0-use-minimal-config-for-tasks-runner-options"
},
{
"version": "17.0.0-rc.1",
"description": "Migration for v17.0.0-rc.1",
"implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope",
"package": "nx",
"name": "rm-default-collection-npm-scope"
},
{
"cli": "nx",
"version": "16.6.0-beta.0",
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
"package": "@nx/js",
"name": "explicitly-set-projects-to-update-buildable-deps"
},
{
"cli": "nx",
"version": "16.8.2-beta.0",
"description": "Remove invalid options (strict, noInterop) for ES6 type modules.",
"factory": "./src/migrations/update-16-8-2/update-swcrc",
"package": "@nx/js",
"name": "16-8-2-update-swcrc"
},
{
"cli": "nx",
"version": "16.5.0-beta.2",
"description": "Add test-setup.ts to ignored files in production input",
"implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
"package": "@nx/jest",
"name": "add-test-setup-to-inputs-ignore"
},
{
"cli": "nx",
"version": "16.4.0-beta.6",
"requires": {
"@angular-eslint/eslint-plugin-template": ">=16.0.0"
},
"description": "Remove the 'accessibility-' prefix from '@angular-eslint/eslint-plugin-template' rules.",
"factory": "./src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules",
"package": "@nx/angular",
"name": "rename-angular-eslint-accesibility-rules"
},
{
"cli": "nx",
"version": "16.4.0-beta.11",
"requires": {
"@angular/core": ">=16.1.0"
},
"description": "Update the @angular/cli package version to ~16.1.0.",
"factory": "./src/migrations/update-16-4-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-16-1-0"
},
{
"cli": "nx",
"version": "16.6.0-beta.0",
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
"package": "@nx/angular",
"name": "explicitly-set-projects-to-update-buildable-deps"
},
{
"cli": "nx",
"version": "16.7.0-beta.6",
"requires": {
"@angular/core": ">=16.2.0"
},
"description": "Update the @angular/cli package version to ~16.2.0.",
"factory": "./src/migrations/update-16-7-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-16-2-0"
},
{
"version": "16.8.0",
"description": "update-16-8-0-add-ignored-files",
"implementation": "./src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files",
"package": "@nx/eslint",
"name": "update-16-8-0-add-ignored-files"
},
{
"version": "17.0.0-beta.7",
"description": "update-17-0-0-rename-to-eslint",
"implementation": "./src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint",
"package": "@nx/eslint",
"name": "update-17-0-0-rename-to-eslint"
}
]
}
27 changes: 13 additions & 14 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "ODQ4MjllNjctNWE5Mi00NDU3LTg0NWYtM2UzNGJiMzY4OGI4fHJlYWQtd3JpdGU="
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"lint": {
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore"
]
],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"e2e": {
"cache": true
}
},
"namedInputs": {
Expand All @@ -32,7 +29,8 @@
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
],
"sharedGlobals": []
},
Expand All @@ -51,5 +49,6 @@
"style": "scss"
}
},
"defaultProject": "getlab"
"defaultProject": "getlab",
"nxCloudAccessToken": "ODQ4MjllNjctNWE5Mi00NDU3LTg0NWYtM2UzNGJiMzY4OGI4fHJlYWQtd3JpdGU="
}
Loading

0 comments on commit f6c6e41

Please sign in to comment.