-
Notifications
You must be signed in to change notification settings - Fork 1
Create Project using this boiler plate
A boiler-plate project to create an Open-Source Angular Application with set of most used and needed tooling. See version section for info about Angular and its packages' versions.
- Go to https://github.com/shhdharmen/angular-app-boilerplate
- Above the file list, click Use this template
- Follow the on-screen instructions
-
Create a Personal Access Token with
repo
access. Copy the token generated. -
Create a secret named
GH_TOKEN
and paste the token generated previously in Value. - Clone the newly created repo
- If needed, create new branch, preferably
beta
- Run
node init.js "<BOT_NAME>" "<YOUR_EMAIL_ADDRESS>" "<FULL_NAME>"
, or if you can do following manually:- Modify
--name
and--email
in.github/workflows/release.yaml
- Update name in
LICENSE
- Update email in
CODE_OF_CONDUCT
- Clear content of
CHANGELOG.md
- Change version in
package.json
to0.0.0
- Modify
- Find and replace
angular-app-boilerplate
with your app name - Install dependencies:
npm i
- All Contributors
- Initialize
all-contributors
usingnpx all-contributors init
- Add a contributor using
npx all-contributors add
- Generate all-contributors' table:
npx all-contributors generate
- Initialize
- Develop your app and test it
- Commit your changes using
npm run commit
- Push it and merge it with
main
branch
- All Contributors
- ESLint with help from Angular ESLint
- Prettier
- Semantic Release
- Stylelint
- Cypress with help from @briebug/cypress-schematic
- Husky
- Commitlint
- Commitizen CLI
- Angular CLI GH Pages
- Github Workflows/Actions
- Github Issue and Pull Request Templates
npm run commit
Always use above script to commit your changes. What happens when you run above command?
- Set of prompts will be presented to help you follow commit message guidelines
- Linting and formatting with possible fixes will be done on staged files using
lint-staged
:
"lint-staged": {
"src/**/*.ts": "eslint --cache --fix",
"src/**/*.{ts,js,css,md,json}": "prettier --write",
"src/**/*.css": "stylelint --fix",
"src/**/*.scss": "stylelint --syntax=scss --fix"
}
- If all of above checks run successfully, only then your files will be committed, else proper error messages will be presented
You can run e2e tests in 2 ways:
- Browser Mode (Usually helpful to run locally):
npm run start
# another terminal or session
npm run cy:open
- Headless Mode (Usually helpful to run in CI, this is ran through GitHub Actions in this project):
ng e2e
To add a contributor run:
npx all-contributors add
Semantic release config file is present at .releaserc.json
. This is triggered through GitHub Actions:
npx semantic-release
Above commands takes care of following things:
- Analyzes commit messages
- Generates release notes
- Creates or updates
CHANGELOG.md
- Updates version in
package.json
- Creates release tag
- Commits above changes
Checkout Release workflow recipes for more info on releases.
This helps to deploy your angular app on GitHub Pages.
npm run deploy
Above command is run through GitHub Actions.
This boiler-plate comes with 2 workflows:
Workflow | Runs-on | Tasks |
---|---|---|
release.yaml |
push on main branch |
✅ Build ✅ Release through Semantic Release ✅ Deploy on GitHub Pages |
test.yaml |
push on any branch except main
|
✅ Lint ✅ Unit Test ✅ E2E Test ✅ Pre-release through Semantic Release |
➜ angular-app-boilerplate git:(main) ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 12.2.5
Node: 14.16.1
Package Manager: npm 7.9.0
OS: darwin x64
Angular: 12.2.5
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1202.5
@angular-devkit/build-angular 12.2.5
@angular-devkit/core 12.2.5
@angular-devkit/schematics 12.2.5
@schematics/angular 12.2.5
rxjs 6.6.7
typescript 4.2.4
Thanks goes to these wonderful people (emoji key):
Dharmen Shah 💻 🖋 🎨 📖 🤔 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!