Skip to content

Commit 7df7b64

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

File tree

7 files changed

+239
-28
lines changed

7 files changed

+239
-28
lines changed

.attw.json

Lines changed: 7 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ardatan
2+
attw
23
bdougie
34
cefc
45
codecov

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ yarn.lock
1818
!**/__fixtures__/**/dist/
1919
!**/__fixtures__/**/node_modules/
2020
!**/typings/**/dist/
21+
!.attw.json
2122
!.codecov.yml
2223
!.commitlintrc.*
2324
!.cspell.json

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ jobs:
347347
- gitguardian
348348
- preflight
349349
runs-on: ubuntu-latest
350+
env:
351+
TARFILE: |
352+
${{ 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) }}
350353
steps:
351354
- id: checkout
352355
name: Checkout ${{ env.REF_NAME }}
@@ -367,19 +370,24 @@ jobs:
367370
with:
368371
key: ${{ runner.os }}-${{ github.run_id }}
369372
path: ${{ env.CACHE_PATH }}
373+
- id: local-binaries
374+
name: Add local binaries to $PATH
375+
run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >> $GITHUB_PATH
370376
- id: pack
371377
name: Pack project
372-
run: yarn pack -o %s-%v.tgz
378+
run: yarn pack -o ${{ env.TARFILE }}
373379
- id: typecheck
374380
name: Run typecheck
375381
run: yarn check:types:build
382+
- id: attw
383+
name: Analyze types distribution
384+
run: attw ${{ env.TARFILE }}
376385
- id: pkg-size-report
377386
name: Package size report
378387
run: yarn pkg-size
379388
- id: archive
380389
name: Archive production artifacts
381390
uses: actions/upload-artifact@v3.1.2
382391
with:
383-
name: |
384-
${{ format('@{0}-{1}-{2}', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version) }}
385-
path: '*.tgz'
392+
name: ${{ env.TARFILE }}
393+
path: ${{ env.TARFILE }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
"scripts": {
3434
"build": "mkbuild",
3535
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
36-
"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",
36+
"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",
3737
"check:format": "prettier --check .",
3838
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
3939
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
4040
"check:types": "tsc -p tsconfig.typecheck.json",
41+
"check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
4142
"check:types:build": "bash ./scripts/typecheck-build.sh",
4243
"check:upgrades": "yarn upgrade-interactive",
4344
"clean:build": "trash ./{dist,*.tgz}",
@@ -69,6 +70,7 @@
6970
"typecheck:watch": "vitest typecheck"
7071
},
7172
"devDependencies": {
73+
"@arethetypeswrong/cli": "0.7.0",
7274
"@commitlint/cli": "17.6.7",
7375
"@flex-development/commitlint-config": "1.0.1",
7476
"@flex-development/esm-types": "1.0.0",

scripts/release.sh

Lines changed: 15 additions & 10 deletions
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)