A Minimal boilerplate for Puppeteer and typescript with jest setup ❤️
Since last couple of mounts, my (boss ❤️ brother)[https://github.com/entprtaher] started to mentoring mine along with my team mate :blessing: about learning 🤖 web automation using Puppeteer. 🚀 It's amazing ❤️
Nowadays I started to adapt myself with Typescript
instead of writing Vanilla JavaScript 🚀
Thats why, Everytime I just have to install puppeteer
first, then node-ts
,...? <...?.> 😱 I forgot to install debug
~ tslint-plugin-prettier"
~ pre-commit
....
Doing boring 🤮 task continiously isn't smart at all. After all, I'm learning to automate 🤖 web this days ❤️
- Clone the repo:
git clone https://github.com/shaonkabir8/boilerplate-typescript-puppeteer.git
- remove
git info
to start a new project 💥
rm -rf .git
- Insall
dependencies
anddevDependencies
yarn
- Write my code here
src/index.ts
Obviously, I do add,modify or delete contents from:
\t - src directory
\t - scripts from package.json
Finally, It's time to run our crowler. 💥
yarn start
// Friday Task:
- Create
- Write a blog on dev.to describing how I create a tiny boilerplate package for my daily needs.
yarn create ts-puppeteer projectName
A basic Typescript Puppeteer Boilerplate initially looks like this:
.
├── dist
│ ├── lib
│ │ └── headerConfig.js
│ └── src
│ ├── index.js
│ └── tests
│ └── index.test.js
├── lib
│ └── headerConfig.ts
├── src
│ ├── index.ts
│ └── tests
│ └── index.test.ts
├── .env
├── .gitignore
├── .prettierrc
├── jest.config.js
├── LICENSE
├── package.json
├── readme.md
├── tsconfig.json
├── tslint.json
└── yarn.lock
- This repo is created to automate my daily works according to puppereer-typescript and jest setup. Actually my boss (Taher)[https://github.com/entprtaher], CEO of CodeEatingsAnts and CO-Founder of Automatio.co started to mentoring my team mates for a big dil. I just stared to adapt myself with Typescript🔥 && Obviously I just love fall in love with Typescript 🚀
So, Let's have a look what's inside of our package.json
.
"dependencies": {
"debug": "^4.3.1",
"dotenv": "^8.2.0",
"puppeteer": "^1.18.1",
"typescript": "^3.5.3"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.20",
"@types/node": "^10.14.13",
"@types/puppeteer": "^1.12.4",
"jest": "^26.6.3",
"jest-puppeteer": "^4.4.0",
"pre-commit": "^1.2.2",
"prettier": "^1.19.1",
"ts-jest": "^26.4.4",
"ts-node": "^7.0.1",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"eslint": "^6.7.2",
"husky": "^3.1.0",
"lint-staged": "^9.5.0"
}