-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkpkg.sh
More file actions
79 lines (68 loc) · 2.01 KB
/
mkpkg.sh
File metadata and controls
79 lines (68 loc) · 2.01 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /usr/bin/bash
cd packages
echo "What do you want to call the new package?"
read packageName
echo "What should the description of the package be?"
read description
mkdir "$packageName"
cd "$packageName"
# set up source
mkdir src && echo '// Entry point of the project' > src/index.ts
mkdir src/typings
# set up tests
mkdir tests && echo '// Main tests here' > tests/index.ts
# ignore files
echo $'node_modules/\n.DS_Store\ndist/' > .gitignore
echo $'tests/\nsrc/\ndocs/\n.gitignore\ntsconfig.json' > .npmignore
# npm files
echo "{
\"name\": \"@infinite-fansub/$packageName\",
\"version\": \"1.0.0\",
\"description\": \"$description\",
\"author\": \"Infinite\",
\"license\": \"AGPL-3.0\",
\"main\": \"dist/index.js\",
\"types\": \"dist\",
\"scripts\": {
\"test\": \"ts-node tests/index.ts\",
\"lint\": \"eslint src/**/*.ts\",
\"lint:fix\": \"eslint src/**/*.ts --fix\",
\"docs\": \"rm -rf docs && typedoc && typedoc --plugin typedoc-plugin-coverage --plugin typedoc-plugin-markdown\",
\"build\": \"rm -rf dist && tsc\",
\"build:watch\": \"rm -rf dist && tsc --watch\",
\"build:test\": \"tsc --noEmit\",
\"node\": \"node .\",
\"tsn\": \"ts-node src/index.ts\"
},
\"repository\": {
\"type\": \"git\",
\"url\": \"https://github.com/Infinite-Fansub/infinite.git\"
},
\"homepage\": \"https://github.com/Infinite-Fansub/infinite/tree/main/packages/$packageName\"
}" > package.json
# typescript shenanigans
echo '{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"baseUrl": "."
},
"typedocOptions": {
"entryPoints": [
"./src/index.ts"
],
"entryPointStrategy": "expand",
"plugin": [
"typedoc-theme-hierarchy",
"typedoc-plugin-coverage"
],
"theme": "hierarchy"
},
"include": [
"src/**/*"
]
}' > tsconfig.json
npm i tslib
cd ../..
npm i