A package to automate the boring bits when setting up a new project
-
Initialise git if it hasn't already been initialised
-
Try to parse a package.json and determine the setup from this
-
If a package.json can't be found or this program encounters an error while trying to parse it, it will default to configuring a typescript project
Currently the only framework supported is Svelte
-
Install Eslint
Currently the only eslint configurations this will install are:
- Create a configured
.eslintrc.js
- Create a configured
-
Install Prettier
- Create a configured
.prettierrc
- Create a configured
-
Add a lint & lint fix script to the package.json
-
Install husky
- Create a pre-commit hook to run linting
- Create a pre-push hook to run tests
-
Install Jest
- Create a configured
jest.config.js
- Add linting support for Jest
- Add a test & coverage command to the package.json
- Create a src/tests/unit directory
- Create a src/tests/integration directory
- Create a configured
-
Create ignore files
.eslintignore
.gitignore
.prettierignore
-
Create Github Actions:
- Build
- Code Coverage
- Lint
- Test
-
Create project shields:
If a git remote is detected owner and repository placeholders will be replaced with respective values
- "https://img.shields.io/codeclimate/issues/\/<REPOSITORY>?logo=codeclimate&logoWidth=20"
- "https://img.shields.io/codeclimate/tech-debt/\/<REPOSITORY>?logo=codeclimate&logoWidth=20"
- "https://img.shields.io/codefactor/grade/github/\/<REPOSITORY>/master?logo=codefactor&logoWidth=20"
- "https://img.shields.io/snyk/vulnerabilities/github/\/<REPOSITORY>?logo=snyk&logoWidth=20"
- "https://img.shields.io/github/languages/code-size/\/<REPOSITORY>?logo=github&logoWidth=20"
- "https://img.shields.io/github/repo-size/\/<REPOSITORY>?logo=github&logoWidth=20"
- "https://img.shields.io/github/issues-raw/\/<REPOSITORY>?logo=github&logoWidth=20"
- "https://img.shields.io/github/last-commit/\/<REPOSITORY>?logo=github&logoWidth=20"
- "https://img.shields.io/coveralls/github/\/<REPOSITORY>?logo=coveralls&logoWidth=20"
- "https://sonarcloud.io/api/project_badges/measure?project=\_<REPOSITORY>&metric=alert_status"
- Shields for each github action
-
Create a list of TODOs
These TODOs are generally additional setup which is required for the shields
-
Create a template README
-
Perform cleanup removing the setup directory
- Install playwright
- Install playwright dependencies for Chromium, Firefox & Webkit
- Create a configured
playwright.config.ts
- Add a test:e2e script to the package.json
- Add a test:e2e:headless script to the package.json
- Create a src/tests/e2e directory
- Create a Github Action to run e2e tests
- Install stylelint
- Create a configured
.stylelint.rc.json
- Create a configured
- Add the following shields
- "https://img.shields.io/w3c-validation/default?targetUrl=WEBSITEURL"
- "https://img.shields.io/security-headers?url=WEBSITEURL"
- "https://img.shields.io/mozilla-observatory/grade-score/WEBSITEURL?logo=mozilla&logoWidth=20"
- "https://img.shields.io/uptimerobot/ratio/:monitorSpecificKey"
- "https://img.shields.io/uptimerobot/status/:monitorSpecificKey"
- Node v14 or greater
- Npm version 7 or greater
- Unix based system
- Have a node project initialised, e.g.
npm init
Clone this repository into a directory named setup:
npx degit https://github.com/shanelucy/project-boilerplate-setup setup --force
Go to setup
cd setup
Install dependencies
npm i
Go back to parent directory
cd ..
Run the setup script
npx ts-node setup/src/index.ts
- When TypeScript support for ES Modules isn't behind an experimental flag compile and publish this package to the npm registry
- Create a prompt mode of this program which will let a user decide yes/no for each step & define any packages to be installed