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

Ng13 update #83

Merged
merged 26 commits into from
Aug 10, 2023
Merged
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
41 changes: 23 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: 2.1
orbs:
coveralls: coveralls/coveralls@1.0.4
cypress: cypress-io/cypress@1
coveralls: coveralls/coveralls@2.2.1
browser-tools: circleci/browser-tools@1.4.3
cypress: cypress-io/cypress@3.1.3
commands:
install:
description: 'Install project dependencies'
Expand Down Expand Up @@ -42,12 +43,15 @@ commands:
type: boolean
default: true
steps:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run: npx ng build --configuration production --project << parameters.project >>
- when:
condition: << parameters.run-tests >>
steps:
- run: cd ./node_modules/protractor && npm i webdriver-manager@latest
- run: npx ng test --code-coverage --watch=false --project << parameters.project >>
# - run: cd ./node_modules/protractor && npm i webdriver-manager@latest
# --code-coverage
- run: npx ng test --watch=false --project << parameters.project >>
- run: npx ng e2e << parameters.project >>
store:
description: 'Stores build_and_test artifacts'
Expand All @@ -57,8 +61,9 @@ commands:
default: 'lemon-mart'
steps:
- run:
name: Run Cypress tests
command: 'npx cypress run --record'
command: npx cypress run
# install-browsers: true
# start-command: npm start

- store_test_results:
path: ./test_results
Expand All @@ -68,7 +73,7 @@ commands:
# upload coverage report to coveralls for readme badge support
# requires config.yml version 2.1 and orbs: coveralls: coveralls/coveralls@1.0.4
# requires coveralls account and token named COVERALLS_REPO_TOKEN specific to repo to be stored in CircleCI
- coveralls/upload
# - coveralls/upload

- run:
name: Tar & Gzip compiled app
Expand Down Expand Up @@ -99,86 +104,86 @@ commands:
jobs:
initialize:
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install:
warm-cache: true
default:
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- lint
- build_and_test
- cypress/install
- store
deploy:
docker:
- image: circleci/node:lts
- image: cimg/node:lts
working_directory: ~/repo
steps:
- deploy_vercel

ch7: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch7'
ch8: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch8'
ch10: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch10'
ch11: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch11'
ch12: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch12'
ch13: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch13'
ch14: # this job is only here to verify sample code from the book, remove it in your own projects
docker:
- image: circleci/node:lts-browsers
- image: cimg/node:lts-browsers
working_directory: ~/repo
steps:
- install
- build_and_test:
project: 'ch14'

workflows:
version: 2
build-test-and-approval-deploy:
jobs:
- initialize
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand All @@ -45,5 +46,6 @@ Thumbs.db
/tests
cache
.firebase
cypress
*.tar**
cypress/videos
cypress/screenshots
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"jsxBracketSameLine": true
"bracketSameLine": true
}
16 changes: 5 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
"name": "Debug npm start with Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:5000/#",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceRoot}",
"runtimeArgs": [
"--remote-debugging-port=9222"
],
"runtimeArgs": ["--remote-debugging-port=9222"],
"sourceMaps": true,
"preLaunchTask": "npm: start"
},
{
"name": "Debug npm start with Edge",
"type": "edge",
"request": "launch",
"url": "http://localhost:5000/#",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"preLaunchTask": "npm: start"
Expand All @@ -28,9 +26,7 @@
"request": "launch",
"url": "http://localhost:9876/debug.html",
"webRoot": "${workspaceRoot}",
"runtimeArgs": [
"--remote-debugging-port=9222"
],
"runtimeArgs": ["--remote-debugging-port=9222"],
"sourceMaps": true,
"preLaunchTask": "npm: test"
},
Expand All @@ -49,9 +45,7 @@
"request": "launch",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"protocol": "inspector",
"args": [
"${workspaceRoot}/protractor.conf.js"
]
"args": ["${workspaceRoot}/protractor.conf.js"]
}
]
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@
"editorGroup": false
},
"ng-evergreen.upgradeChannel": "Latest",
"editor.autoIndent": "full"
"editor.autoIndent": "full",
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ If you'd like to use this project as a starter or a template project for your pr
### During Development

- Run `npm start` for a developmenet web server.
- Navigate to `http://localhost:5000/`. The app will automatically reload if you change any of the source files.
- Note that the port is different than the default Angular port of `4200` intentionally, so you can run test projects or proof of concepts side-by-side without the hassle of specifiying a new port.
- Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
- Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io).
- Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

Expand Down
84 changes: 0 additions & 84 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -310,17 +303,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch7/tsconfig.app.json",
"projects/ch7/tsconfig.spec.json",
"projects/ch7/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -442,17 +424,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch8/tsconfig.app.json",
"projects/ch8/tsconfig.spec.json",
"projects/ch8/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -574,17 +545,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch10/tsconfig.app.json",
"projects/ch10/tsconfig.spec.json",
"projects/ch10/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -706,17 +666,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch11/tsconfig.app.json",
"projects/ch11/tsconfig.spec.json",
"projects/ch11/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -838,17 +787,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch12/tsconfig.app.json",
"projects/ch12/tsconfig.spec.json",
"projects/ch12/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -970,17 +908,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch13/tsconfig.app.json",
"projects/ch13/tsconfig.spec.json",
"projects/ch13/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down Expand Up @@ -1102,17 +1029,6 @@
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ch14/tsconfig.app.json",
"projects/ch14/tsconfig.spec.json",
"projects/ch14/e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
Expand Down
19 changes: 19 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default {
projectId: 'lemon-mart',
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on: any, config: any) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'https://lemonmart.angularforenterprise.com',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
component: {
devServer: {
framework: 'angular',
bundler: 'webpack',
},
specPattern: '**/*.cy.ts',
},
}
Loading