-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupTSProject.bash
More file actions
executable file
·41 lines (32 loc) · 1.22 KB
/
setupTSProject.bash
File metadata and controls
executable file
·41 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
npm init
npm install -D @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-prettier nodemon prettier rimraf typescript @types/jest jest ts-jest
wget https://raw.githubusercontent.com/Suppen/dotfiles/master/.prettierrc.json
wget https://raw.githubusercontent.com/Suppen/dotfiles/master/.eslintrc.cjs
wget https://raw.githubusercontent.com/Suppen/dotfiles/master/.gitignore
wget https://raw.githubusercontent.com/Suppen/dotfiles/master/tsconfig.json
node -e "
const fs = require(\"fs\");
const package = require(\"./package.json\");
package.scripts = {
\"prebuild\": \"npm run clean\",
\"build\": \"tsc\",
\"prebuild:dev\": \"npm run clean\",
\"build:dev\": \"tsc --watch --preserveWatchOutput\",
\"start\": \"NODE_ENV=\\\"production\\\" node dist/app\",
\"start:dev\": \"NODE_ENV=\\\"development\\\" nodemon dist/app\",
\"test\": \"jest\",
\"test:dev\": \"jest --watchAll\",
\"lint\": \"eslint src/**\",
\"clean\": \"rimraf dist\"
};
package.jest = {
\"preset\": \"ts-jest\",
\"testEnvironment\": \"node\",
\"rootDir\": \"src/\"
};
fs.writeFileSync(\"./package.json\", JSON.stringify(package, null, 2));
"
mkdir src
touch src/app.ts
touch src/app.test.ts