A starter template for Angular projects with ESLint, Prettier, and custom scripts. This template is designed to help you kickstart your Angular applications with the latest configurations and best practices. ๐
Clone the repository:
git clone https://github.com/Jagoda11/angular-template.git
cd angular-templateInstall dependencies:
npm installRunning the Development Server
To start the development server, run:
npm startThis will start the Angular development server and you can view your application at http://localhost:4200.
Building the Project
To build the project,run:
npm run buildThis will create a production build of your application in the dist/ directory.
Running Tests
To run the tests, use:
npm testThis will execute the unit tests using Karma and Jasmine.
Linting the Code
To lint the code, run:
npm run lintThis will run ESLint on your project to check for code quality issues.
Formatting the Code
To format the code using Prettier, run:
npm run formatThis will format your code according to the Prettier configuration.
Cleaning Up
To clean up the project (remove node_modules, dist, and package-lock.json), run:
npm run cleanGenerating Test Files
To generate missing test files, run:
npm run generate-testsThis will create test files for your Angular components, services, application configs, and other exports that do not already have corresponding test files. The generated test files will include appropriate test cases for exported members, lifecycle hooks, and other relevant aspects.
Here are the available scripts in this project:
start ๐: Starts the development servernpm run start
build ๐๏ธ: Builds the project for productionnpm run build
watch ๐: Rebuilds the project on file changesnpm run watch
test ๐งช: Runs tests for the projectnpm run test
lint ๐: Lints the project files using ESLintnpm run lint
lint-fix ๐ง: Lints and fixes issues in the codebasenpm run lint-fix
format โจ: Formats the codebase using Prettiernpm run format
clean ๐งฝ: Cleans up node_modules, dist, and package-lock.jsonnpm run clean
lint-staged ๐: Runs lint-staged to check and format only staged filesnpm run lint-staged
generate-tests ๐: Runs generate-tests to create test files and basic testsnpm run generate-tests
This template uses Husky to run lint-staged and tests automatically before each commit. This ensures all code meets quality standards and passes tests before merging into the main codebase.
This project includes several GitHub Actions workflows to automate various tasks and maintain the project efficiently:
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the terms of the Commercial License Agreement. For more details, see the LICENSE file.
ยฉ 2024 Jagoda11