Skip to content

Commit 3740903

Browse files
committed
chore: analyze types distribution
- https://github.com/arethetypeswrong/arethetypeswrong.github.io Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 41931cc commit 3740903

File tree

7 files changed

+226
-21
lines changed

7 files changed

+226
-21
lines changed

.attw.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"color": true,
3+
"emoji": true,
4+
"format": "ascii",
5+
"ignoreRules": ["cjs-resolves-to-esm"],
6+
"summary": true
7+
}

.dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ardatan
2+
attw
23
bdougie
34
cefc
45
codecov

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ yarn.lock
2020
!**/__fixtures__/**/dist/
2121
!**/__fixtures__/**/node_modules/
2222
!**/typings/**/dist/
23+
!.attw.json
2324
!.codecov.yml
2425
!.commitlintrc.*
2526
!.cspell.json

.github/workflows/ci.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ jobs:
354354
- gitguardian
355355
- preflight
356356
runs-on: ubuntu-latest
357+
env:
358+
TARFILE: |
359+
${{ startsWith(github.head_ref || github.ref_name, 'release/') && format('@{0}-{1}-{2}.tgz', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version) || format('@{0}-{1}-{2}+{3}.tgz', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version, github.event.pull_request.head.sha || github.sha) }}
357360
steps:
358361
- id: checkout
359362
name: Checkout ${{ env.REF_NAME }}
@@ -374,19 +377,24 @@ jobs:
374377
with:
375378
key: ${{ runner.os }}-${{ github.run_id }}
376379
path: ${{ env.CACHE_PATH }}
380+
- id: local-binaries
381+
name: Add local binaries to $PATH
382+
run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >> $GITHUB_PATH
377383
- id: pack
378384
name: Pack project
379-
run: yarn pack -o %s-%v.tgz
385+
run: yarn pack -o ${{ env.TARFILE }}
380386
- id: typecheck
381387
name: Run typecheck
382388
run: yarn check:types:build
389+
- id: attw
390+
name: Analyze types distribution
391+
run: attw ${{ env.TARFILE }}
383392
- id: pkg-size-report
384393
name: Package size report
385394
run: yarn pkg-size
386395
- id: archive
387396
name: Archive production artifacts
388397
uses: actions/upload-artifact@v3.1.2
389398
with:
390-
name: |
391-
${{ format('@{0}-{1}-{2}', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version) }}
392-
path: '*.tgz'
399+
name: ${{ env.TARFILE }}
400+
path: ${{ env.TARFILE }}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
"scripts": {
4040
"build": "mkbuild",
4141
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
42-
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && yarn pack -o %s-%v.tgz && yarn clean:pack && yarn check:types:build && yarn pkg-size",
42+
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && yarn pack && yarn check:types:build && attw package.tgz && yarn clean:pack && yarn pkg-size",
4343
"check:format": "prettier --check .",
4444
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
4545
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
4646
"check:types": "tsc -p tsconfig.typecheck.json",
47+
"check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
4748
"check:types:build": "bash ./scripts/typecheck-build.sh",
4849
"check:upgrades": "yarn upgrade-interactive",
4950
"clean:build": "trash ./{dist,*.tgz}",
@@ -84,6 +85,7 @@
8485
"strip-json-comments": "5.0.0"
8586
},
8687
"devDependencies": {
88+
"@arethetypeswrong/cli": "0.7.1",
8789
"@commitlint/cli": "17.6.7",
8890
"@faker-js/faker": "8.0.2",
8991
"@flex-development/commitlint-config": "1.0.1",

scripts/release.sh

+15-10
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,29 @@
44
#
55
# 1. run typecheck
66
# 2. run tests
7-
# 3. build project
7+
# 3. pack project
88
# 4. run postbuild typecheck
9-
# 5. print package size report
10-
# 6. get new package version
11-
# 7. get release branch name
12-
# 8. switch to release branch
13-
# 9. stage changes
14-
# 10. commit changes
15-
# 11. push release branch to origin
16-
# 12. create pull request
9+
# 5. analyze types
10+
# 6. print package size report
11+
# 7. get new package version
12+
# 8. get release branch name
13+
# 9. switch to release branch
14+
# 10. stage changes
15+
# 11. commit changes
16+
# 12. push release branch to origin
17+
# 13. create pull request
18+
# 14. cleanup
1719
#
1820
# References:
1921
#
2022
# - https://cli.github.com/manual/gh_pr_create
23+
# - https://github.com/arethetypeswrong/arethetypeswrong.github.io
2124

2225
yarn typecheck
2326
yarn test:cov
24-
yarn build
27+
yarn pack
2528
yarn check:types:build
29+
attw package.tgz
2630
yarn pkg-size
2731
VERSION=$(jq .version package.json -r)
2832
RELEASE_BRANCH=release/$VERSION
@@ -31,3 +35,4 @@ git add .
3135
git commit -s -m "release: $(jq .tagPrefix package.json -r)$VERSION"
3236
git push origin -u --no-verify $RELEASE_BRANCH
3337
gh pr create --assignee @me --label scope:release --web
38+
yarn clean:pack

0 commit comments

Comments
 (0)