Skip to content

Commit 7d066c8

Browse files
committed
🔧 move scripts to bash run strategy
closes #9
1 parent d3bf748 commit 7d066c8

File tree

4 files changed

+91
-9
lines changed

4 files changed

+91
-9
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 20.17.0

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
### NumberParseable
1818

19-
Ƭ **NumberParseable**: `number` \| `string` \| `boolean` & { `isNumberParseble`: unique `symbol` }
19+
Ƭ **NumberParseable**: `number` \| `string` \| `boolean` & \{ `isNumberParseble`: unique `symbol` }
2020

2121
A Branded Type for values parseable to number.
2222

2323
#### Defined in
2424

25-
[index.ts:4](https://github.com/VitorLuizC/typescript-library-boilerplate/blob/c48c9c1/src/index.ts#L4)
25+
[index.ts:4](https://github.com/VitorLuizC/typescript-library-boilerplate/blob/d3bf74861b541a3d38c99355f79a0fde1127a9f7/src/index.ts#L4)
2626

2727
## Functions
2828

@@ -58,4 +58,4 @@ return Number(value);
5858

5959
#### Defined in
6060

61-
[index.ts:24](https://github.com/VitorLuizC/typescript-library-boilerplate/blob/c48c9c1/src/index.ts#L24)
61+
[index.ts:24](https://github.com/VitorLuizC/typescript-library-boilerplate/blob/d3bf74861b541a3d38c99355f79a0fde1127a9f7/src/index.ts#L24)

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@
4444
"typescript": "^5.2.2"
4545
},
4646
"scripts": {
47-
"doc": "typedoc src/index.ts",
48-
"test": "jest",
49-
"lint": "eslint \"*/**/*.{ts,js,json}\"",
50-
"lint:fix": "eslint \"*/**/*.{ts,js,json}\" --fix",
51-
"build": "rollup --config ./rollup.config.mjs",
52-
"prepublishOnly": "npm run doc && npm run lint && npm run test && npm run build"
47+
"test": "bash run test",
48+
"prepublishOnly": "bash run prepublish-only"
5349
},
5450
"repository": {
5551
"type": "git",

run

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
if [ -d "./node_modules/.bin" ]; then
6+
export PATH="./node_modules/.bin:$PATH"
7+
fi
8+
9+
function setup() {
10+
echo -e "🔄 updating asdf…\n"
11+
asdf update
12+
13+
echo -e ""
14+
echo -e "🔄 updating asdf's plugins…\n"
15+
asdf plugin update nodejs
16+
17+
echo -e ""
18+
echo -e "⬇️ installing asdf's packages…\n"
19+
asdf install
20+
21+
echo -e ""
22+
echo -e "🔄 updating npm…\n"
23+
npm up npm --global
24+
25+
echo -e ""
26+
echo -e "⬇️ installing packages with npm…\n"
27+
npm ci
28+
}
29+
30+
function cleanup() {
31+
echo -e "🗑️ deleting './node_modules' folder…\n"
32+
rm -rf ./node_modules
33+
34+
echo -e ""
35+
echo -e "🗑️ deleting './package-lock.json' file…\n"
36+
rm ./package-lock.json
37+
38+
echo -e ""
39+
echo -e "⬇️ installing packages with npm…\n"
40+
npm install
41+
}
42+
43+
function doc() {
44+
echo -e "🤖 generating documentation with Typedoc…\n"
45+
typedoc "./src/index.ts"
46+
}
47+
48+
function test() {
49+
echo -e "🧪 executing unit tests with Jest…\n"
50+
jest
51+
}
52+
53+
function lint() {
54+
echo -e "🕵 linting source code with ESLint…\n"
55+
eslint "*/**/*.{ts,js,json}"
56+
}
57+
58+
function autofix() {
59+
echo -e "👨‍🔧 automatically fixing source code with ESLint…\n"
60+
eslint "*/**/*.{ts,js,json}" --fix
61+
}
62+
63+
function bundle() {
64+
echo -e "📦 bundling source code with Rollup…\n"
65+
rollup --config ./rollup.config.mjs
66+
}
67+
68+
function prepublish-only() {
69+
echo -e "▶ executing 'doc' command…\n"
70+
bash run doc
71+
72+
echo ""
73+
echo -e "▶ executing 'lint' command…\n"
74+
bash run lint
75+
76+
echo ""
77+
echo -e "▶ executing 'test' command…\n"
78+
bash run test
79+
80+
echo ""
81+
echo -e "▶ executing 'bundle' command…\n"
82+
bash run bundle
83+
}
84+
85+
eval "$@"

0 commit comments

Comments
 (0)