Skip to content

Commit 0101c06

Browse files
authored
Clean up scripts & resources (#1861)
Removes some unused resources, renames and organizes scripts to make them easier to follow, organizes package.json to have a clear line between public and development information.
1 parent 351f9e6 commit 0101c06

File tree

5 files changed

+52
-54
lines changed

5 files changed

+52
-54
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- main
1010

1111
jobs:
12-
test:
13-
name: 'Test'
12+
lint:
13+
name: 'Lint'
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v2
@@ -23,12 +23,11 @@ jobs:
2323
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
2424
restore-keys: ${{ runner.OS }}-node-
2525
- run: npm ci
26-
- run: npm run build
27-
- run: npm run testonly
28-
- run: npm run check:git-clean
26+
- run: npm run lint
27+
- run: npm run check-git-clean
2928

30-
lint:
31-
name: 'Lint'
29+
type-check:
30+
name: 'Type Check'
3231
runs-on: ubuntu-latest
3332
steps:
3433
- uses: actions/checkout@v2
@@ -40,12 +39,17 @@ jobs:
4039
path: ~/.npm
4140
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
4241
restore-keys: ${{ runner.OS }}-node-
42+
- uses: actions/cache@v2
43+
with:
44+
path: ~/.dts
45+
key: ${{ runner.OS }}-dts-${{ hashFiles('**/package-lock.json') }}
46+
restore-keys: ${{ runner.OS }}-dts-
4347
- run: npm ci
44-
- run: npm run lint
45-
- run: npm run check:git-clean
48+
- run: npm run type-check
49+
- run: npm run check-git-clean
4650

47-
type-check:
48-
name: 'Type Check'
51+
unit-test:
52+
name: 'Build & Unit Test'
4953
runs-on: ubuntu-latest
5054
steps:
5155
- uses: actions/checkout@v2
@@ -57,14 +61,10 @@ jobs:
5761
path: ~/.npm
5862
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
5963
restore-keys: ${{ runner.OS }}-node-
60-
- uses: actions/cache@v2
61-
with:
62-
path: ~/.dts
63-
key: ${{ runner.OS }}-dts-${{ hashFiles('**/package-lock.json') }}
64-
restore-keys: ${{ runner.OS }}-dts-
6564
- run: npm ci
66-
- run: npm run type-check
67-
- run: npm run check:git-clean
65+
- run: npm run build
66+
- run: npm run unit-test
67+
- run: npm run check-git-clean
6868

6969
website:
7070
name: 'Build Website'
@@ -83,11 +83,11 @@ jobs:
8383
restore-keys: ${{ runner.OS }}-node-
8484
- run: npm ci
8585
- run: npm run website:build
86-
- run: npm run check:git-clean
86+
- run: npm run check-git-clean
8787

8888
publish:
8989
name: 'Publish'
90-
needs: [test, lint, type-check, website]
90+
needs: [lint, type-check, unit-test, website]
9191
if: github.ref == 'refs/heads/main'
9292
runs-on: ubuntu-latest
9393
steps:

package.json

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@
1919
"module": "dist/immutable.es.js",
2020
"sideEffects": false,
2121
"types": "dist/immutable.d.ts",
22+
"files": [
23+
"dist",
24+
"README.md",
25+
"LICENSE"
26+
],
27+
"keywords": [
28+
"immutable",
29+
"persistent",
30+
"lazy",
31+
"data",
32+
"datastructure",
33+
"functional",
34+
"collection",
35+
"stateless",
36+
"sequence",
37+
"iteration"
38+
],
2239
"publishKeys": [
2340
"name",
2441
"version",
@@ -39,28 +56,27 @@
3956
"npm": ">=7.0.0"
4057
},
4158
"scripts": {
42-
"check:all": "run-s lint:format test",
43-
"build": "run-s clean:dist bundle:dist bundle:es copy:dist stats:dist prepare:dist",
44-
"clean:dist": "rimraf dist",
45-
"bundle:dist": "rollup -c ./resources/rollup-config.js",
46-
"bundle:es": "rollup -c ./resources/rollup-config-es.js",
47-
"copy:dist": "cp ./type-definitions/immutable.* dist",
48-
"stats:dist": "node ./resources/dist-stats.js",
49-
"prepare:dist": "./resources/prepare-dist.sh",
59+
"test": "run-s format lint type-check build unit-test",
5060
"format": "npm run lint:format -- --write",
5161
"lint": "run-s lint:*",
52-
"lint:ts": "tslint --project type-definitions/tsconfig.json \"{__tests__,src,type-definitions,website/src}/**/*.{ts,tsx}\"",
53-
"lint:js": "eslint \"{__tests__,src,website/src}/**/*.js\"",
5462
"lint:format": "prettier --check \"{__tests__,src,type-definitions,website/src,perf,resources}/**/*{.js,.ts,.tsx,.flow,.css}\"",
55-
"testonly": "jest",
56-
"test": "run-s format build lint testonly type-check",
57-
"check:git-clean": "./resources/check-changes",
63+
"lint:js": "eslint \"{__tests__,src,website/src}/**/*.js\"",
64+
"lint:ts": "tslint --project type-definitions/tsconfig.json \"{__tests__,src,type-definitions,website/src}/**/*.{ts,tsx}\"",
5865
"type-check": "run-s type-check:*",
5966
"type-check:ts": "tsc --project type-definitions/tsconfig.json && tsc --project __tests__/tsconfig.json && dtslint type-definitions/ts-tests",
6067
"type-check:flow": "flow check type-definitions/flow-tests --include-warnings",
61-
"perf": "node ./resources/bench.js",
68+
"build": "run-s build:*",
69+
"build:clean": "rimraf dist",
70+
"build:dist": "rollup -c ./resources/rollup-config.js",
71+
"build:esm": "rollup -c ./resources/rollup-config-es.js",
72+
"build:copy": "cp ./type-definitions/immutable.* dist",
73+
"build:prepare": "./resources/prepare-dist.sh",
74+
"build:stats": "node ./resources/dist-stats.js",
75+
"unit-test": "jest",
6276
"website:build": "cd website && next build && next-sitemap && next export",
6377
"website:dev": "cd website && next dev",
78+
"check-git-clean": "./resources/check-git-clean.sh",
79+
"benchmark": "node ./resources/benchmark.js",
6480
"publish": "echo 'ONLY PUBLISH VIA CI'; exit 1;"
6581
},
6682
"prettier": {
@@ -122,22 +138,5 @@
122138
"typescript": "4.3.4",
123139
"uglify-js": "3.11.1",
124140
"uglify-save-license": "0.4.1"
125-
},
126-
"files": [
127-
"dist",
128-
"README.md",
129-
"LICENSE"
130-
],
131-
"keywords": [
132-
"immutable",
133-
"persistent",
134-
"lazy",
135-
"data",
136-
"datastructure",
137-
"functional",
138-
"collection",
139-
"stateless",
140-
"sequence",
141-
"iteration"
142-
]
141+
}
143142
}
File renamed without changes.

resources/check-changes renamed to resources/check-git-clean.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if ! git diff --quiet; then echo "
44
5-
$(tput setf 4)The Travis build resulted in additional changed files.
5+
$(tput setf 4)The CI build resulted in additional changed files.
66
Typically this is due to not running $(tput smul)npm test$(tput rmul) locally before
77
submitting a pull request.
88

resources/immutable-global.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)