From ff292880fef26b85fa534f7a544d14fcf88f5dae Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 6 Apr 2021 07:09:11 -0500 Subject: [PATCH] refactor: migrate angular.json to workspace.json v2, change all commands to use Nx CLI (#138) --- package.json | 14 +++---- angular.json => workspace.json | 69 +++++++++++++++++----------------- 2 files changed, 40 insertions(+), 43 deletions(-) rename angular.json => workspace.json (95%) diff --git a/package.json b/package.json index 2ee547c..acdbd16 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,11 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "ng": "ng", - "start": "ng serve", + "start": "nx serve", "build": "nx build", - "test": "ng test", - "lint": "nx workspace-lint && ng lint", - "e2e": "ng e2e", + "test": "nx test", + "lint": "nx workspace-lint && nx lint", + "e2e": "nx e2e", "affected:apps": "nx affected:apps", "affected:libs": "nx affected:libs", "affected:build": "nx affected:build", @@ -21,7 +20,6 @@ "format:write": "nx format:write", "format:check": "nx format:check", "update": "nx migrate latest", - "update:check": "ng update", "dep-graph": "nx dep-graph", "help": "nx help", "nx": "nx", @@ -41,6 +39,7 @@ "@emotion/babel-preset-css-prop": "11.0.0", "@emotion/react": "11.0.0", "@emotion/styled": "11.0.0", + "@ngrx/component-store": "11.0.0", "@ngrx/effects": "11.0.0", "@ngrx/entity": "11.0.0", "@ngrx/router-store": "11.0.0", @@ -54,8 +53,7 @@ "react-router-dom": "5.2.0", "rxjs": "~6.5.5", "tslib": "^2.0.0", - "zone.js": "~0.10.3", - "@ngrx/component-store": "11.0.0" + "zone.js": "~0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "0.1102.0", diff --git a/angular.json b/workspace.json similarity index 95% rename from angular.json rename to workspace.json index a7622b7..59cbe85 100644 --- a/angular.json +++ b/workspace.json @@ -1,11 +1,10 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, + "version": 2, "newProjectRoot": "", "projects": { "products": { "projectType": "application", - "schematics": { + "generators": { "@nrwl/workspace:component": { "style": "scss" } @@ -13,7 +12,7 @@ "root": "apps/products", "sourceRoot": "apps/products/src", "prefix": "nx-example", - "architect": { + "targets": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { @@ -125,7 +124,7 @@ "root": "apps/products-e2e", "sourceRoot": "apps/products-e2e/src", "projectType": "application", - "architect": { + "targets": { "e2e": { "builder": "@nrwl/cypress:cypress", "options": { @@ -152,8 +151,8 @@ "root": "apps/cart", "sourceRoot": "apps/cart/src", "projectType": "application", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "build": { "builder": "@nrwl/web:build", "options": { @@ -256,7 +255,7 @@ "root": "apps/cart-e2e", "sourceRoot": "apps/cart-e2e/src", "projectType": "application", - "architect": { + "targets": { "e2e": { "builder": "@nrwl/cypress:cypress", "options": { @@ -283,8 +282,8 @@ "root": "libs/shared/product/types", "sourceRoot": "libs/shared/product/types/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -298,8 +297,8 @@ "root": "libs/shared/product/data", "sourceRoot": "libs/shared/product/data/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -313,8 +312,8 @@ "root": "libs/shared/product/ui", "sourceRoot": "libs/shared/product/ui/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -340,7 +339,7 @@ "root": "libs/products/home-page", "sourceRoot": "libs/products/home-page/src", "prefix": "nx-example", - "architect": { + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -360,7 +359,7 @@ "outputs": ["coverage/libs/products/home-page"] } }, - "schematics": { + "generators": { "@nrwl/angular:component": { "styleext": "scss" } @@ -370,8 +369,8 @@ "root": "libs/cart/cart-page", "sourceRoot": "libs/cart/cart-page/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -396,8 +395,8 @@ "root": "libs/shared/e2e-utils", "sourceRoot": "libs/shared/e2e-utils/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -411,8 +410,8 @@ "root": "libs/shared/jsxify", "sourceRoot": "libs/shared/jsxify/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -427,7 +426,7 @@ "root": "libs/shared/cart/state", "sourceRoot": "libs/shared/cart/state/src", "prefix": "nx-example", - "architect": { + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -447,7 +446,7 @@ "outputs": ["coverage/libs/shared/cart/state"] } }, - "schematics": { + "generators": { "@nrwl/angular:component": { "styleext": "scss" } @@ -458,7 +457,7 @@ "root": "libs/shared/product/state", "sourceRoot": "libs/shared/product/state/src", "prefix": "nx-example", - "architect": { + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -478,7 +477,7 @@ "outputs": ["coverage/libs/shared/product/state"] } }, - "schematics": { + "generators": { "@nrwl/angular:component": { "styleext": "scss" } @@ -488,15 +487,15 @@ "root": "libs/shared/assets", "sourceRoot": "libs/shared/assets/src", "projectType": "library", - "schematics": {}, - "architect": {} + "generators": {}, + "targets": {} }, "shared-header": { "root": "libs/shared/header", "sourceRoot": "libs/shared/header/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -522,7 +521,7 @@ "root": "libs/products/product-detail-page", "sourceRoot": "libs/products/product-detail-page/src", "prefix": "nx-example", - "architect": { + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -545,7 +544,7 @@ "outputs": ["coverage/libs/products/product-detail-page"] } }, - "schematics": { + "generators": { "@nrwl/angular:component": { "styleext": "scss" } @@ -555,8 +554,8 @@ "root": "libs/shared/styles", "sourceRoot": "libs/shared/styles/src", "projectType": "library", - "schematics": {}, - "architect": { + "generators": {}, + "targets": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { @@ -575,7 +574,7 @@ "defaultCollection": "@nrwl/angular", "analytics": false }, - "schematics": { + "generators": { "@nrwl/angular:application": { "unitTestRunner": "jest", "e2eTestRunner": "cypress"