diff --git a/angular.json b/angular.json index 4b4e0ec..7fb9ad3 100644 --- a/angular.json +++ b/angular.json @@ -139,6 +139,120 @@ } } } + }, + "global-form": { + "projectType": "application", + "schematics": {}, + "root": "apps/global-form", + "sourceRoot": "apps/global-form/src", + "prefix": "nested-forms", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/apps/global-form", + "index": "apps/global-form/src/index.html", + "main": "apps/global-form/src/main.ts", + "polyfills": "apps/global-form/src/polyfills.ts", + "tsConfig": "apps/global-form/tsconfig.app.json", + "aot": false, + "assets": [ + "apps/global-form/src/favicon.ico", + "apps/global-form/src/assets" + ], + "styles": ["apps/global-form/src/styles.css"], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "apps/global-form/src/environments/environment.ts", + "with": "apps/global-form/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "global-form:build" + }, + "configurations": { + "production": { + "browserTarget": "global-form:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "global-form:build" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "apps/global-form/tsconfig.app.json", + "apps/global-form/tsconfig.spec.json" + ], + "exclude": ["**/node_modules/**", "!apps/global-form/**"] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "apps/global-form/jest.config.js", + "tsConfig": "apps/global-form/tsconfig.spec.json", + "setupFile": "apps/global-form/src/test-setup.ts" + } + } + } + }, + "global-form-e2e": { + "root": "apps/global-form-e2e", + "sourceRoot": "apps/global-form-e2e/src", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@nrwl/cypress:cypress", + "options": { + "cypressConfig": "apps/global-form-e2e/cypress.json", + "tsConfig": "apps/global-form-e2e/tsconfig.e2e.json", + "devServerTarget": "global-form:serve" + }, + "configurations": { + "production": { + "devServerTarget": "global-form:serve:production" + } + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": ["apps/global-form-e2e/tsconfig.e2e.json"], + "exclude": ["**/node_modules/**", "!apps/global-form-e2e/**"] + } + } + } } }, "cli": { diff --git a/apps/global-form-e2e/cypress.json b/apps/global-form-e2e/cypress.json new file mode 100644 index 0000000..a8d8695 --- /dev/null +++ b/apps/global-form-e2e/cypress.json @@ -0,0 +1,11 @@ +{ + "fileServerFolder": ".", + "fixturesFolder": "./src/fixtures", + "integrationFolder": "./src/integration", + "pluginsFile": "./src/plugins/index", + "supportFile": false, + "video": true, + "videosFolder": "../../dist/cypress/apps/global-form-e2e/videos", + "screenshotsFolder": "../../dist/cypress/apps/global-form-e2e/screenshots", + "chromeWebSecurity": false +} diff --git a/apps/global-form-e2e/src/fixtures/example.json b/apps/global-form-e2e/src/fixtures/example.json new file mode 100644 index 0000000..294cbed --- /dev/null +++ b/apps/global-form-e2e/src/fixtures/example.json @@ -0,0 +1,4 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io" +} diff --git a/apps/global-form-e2e/src/integration/app.spec.ts b/apps/global-form-e2e/src/integration/app.spec.ts new file mode 100644 index 0000000..130e297 --- /dev/null +++ b/apps/global-form-e2e/src/integration/app.spec.ts @@ -0,0 +1,9 @@ +import { getGreeting } from '../support/app.po'; + +describe('global-form', () => { + beforeEach(() => cy.visit('/')); + + it('should display welcome message', () => { + getGreeting().contains('Welcome to global-form!'); + }); +}); diff --git a/apps/global-form-e2e/src/plugins/index.js b/apps/global-form-e2e/src/plugins/index.js new file mode 100644 index 0000000..bc34d63 --- /dev/null +++ b/apps/global-form-e2e/src/plugins/index.js @@ -0,0 +1,22 @@ +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); + +module.exports = (on, config) => { + // `on` is used to hook into various events Cypress emits + // `config` is the resolved Cypress config + + // Preprocess Typescript + on('file:preprocessor', preprocessTypescript(config)); +}; diff --git a/apps/global-form-e2e/src/support/app.po.ts b/apps/global-form-e2e/src/support/app.po.ts new file mode 100644 index 0000000..3293424 --- /dev/null +++ b/apps/global-form-e2e/src/support/app.po.ts @@ -0,0 +1 @@ +export const getGreeting = () => cy.get('h1'); diff --git a/apps/global-form-e2e/src/support/commands.ts b/apps/global-form-e2e/src/support/commands.ts new file mode 100644 index 0000000..ca4d256 --- /dev/null +++ b/apps/global-form-e2e/src/support/commands.ts @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add("login", (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/apps/global-form-e2e/src/support/index.ts b/apps/global-form-e2e/src/support/index.ts new file mode 100644 index 0000000..3d469a6 --- /dev/null +++ b/apps/global-form-e2e/src/support/index.ts @@ -0,0 +1,17 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands'; diff --git a/apps/global-form-e2e/tsconfig.e2e.json b/apps/global-form-e2e/tsconfig.e2e.json new file mode 100644 index 0000000..629b4c1 --- /dev/null +++ b/apps/global-form-e2e/tsconfig.e2e.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "sourceMap": false, + "outDir": "../../dist/out-tsc" + }, + "include": ["src/**/*.ts"] +} diff --git a/apps/global-form-e2e/tsconfig.json b/apps/global-form-e2e/tsconfig.json new file mode 100644 index 0000000..ee6531b --- /dev/null +++ b/apps/global-form-e2e/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["cypress", "node"] + }, + "include": ["**/*.ts"] +} diff --git a/apps/global-form-e2e/tslint.json b/apps/global-form-e2e/tslint.json new file mode 100644 index 0000000..04809f8 --- /dev/null +++ b/apps/global-form-e2e/tslint.json @@ -0,0 +1 @@ +{ "extends": "../../tslint.json", "rules": [] } diff --git a/apps/global-form/browserslist b/apps/global-form/browserslist new file mode 100644 index 0000000..8084853 --- /dev/null +++ b/apps/global-form/browserslist @@ -0,0 +1,12 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/apps/global-form/jest.config.js b/apps/global-form/jest.config.js new file mode 100644 index 0000000..1522103 --- /dev/null +++ b/apps/global-form/jest.config.js @@ -0,0 +1,9 @@ +module.exports = { + name: 'global-form', + preset: '../../jest.config.js', + coverageDirectory: '../../coverage/apps/global-form', + snapshotSerializers: [ + 'jest-preset-angular/AngularSnapshotSerializer.js', + 'jest-preset-angular/HTMLCommentSerializer.js' + ] +}; diff --git a/apps/global-form/src/app/app.component.css b/apps/global-form/src/app/app.component.css new file mode 100644 index 0000000..e69de29 diff --git a/apps/global-form/src/app/app.component.html b/apps/global-form/src/app/app.component.html new file mode 100644 index 0000000..803c853 --- /dev/null +++ b/apps/global-form/src/app/app.component.html @@ -0,0 +1,27 @@ +
+ This is an Angular app built with Nx. +
+🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**
+ +