Skip to content

Commit cf15ee5

Browse files
committed
chore: analyze types distribution
- https://github.com/arethetypeswrong/arethetypeswrong.github.io Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 1c7f5fd commit cf15ee5

File tree

7 files changed

+245
-28
lines changed

7 files changed

+245
-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/[email protected]
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
@@ -35,11 +35,12 @@
3535
"scripts": {
3636
"build": "mkbuild",
3737
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
38-
"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",
38+
"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",
3939
"check:format": "prettier --check .",
4040
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
4141
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
4242
"check:types": "tsc -p tsconfig.typecheck.json",
43+
"check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
4344
"check:types:build": "bash ./scripts/typecheck-build.sh",
4445
"check:upgrades": "yarn upgrade-interactive",
4546
"clean:build": "trash ./{dist,*.tgz}",
@@ -76,6 +77,7 @@
7677
"@flex-development/tutils": "6.0.0-alpha.14"
7778
},
7879
"devDependencies": {
80+
"@arethetypeswrong/cli": "0.7.0",
7981
"@commitlint/cli": "17.6.7",
8082
"@flex-development/commitlint-config": "1.0.1",
8183
"@flex-development/decorator-regex": "1.0.0",

scripts/release.sh

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
#!/bin/sh
22

33
# Local Release Workflow
4-
4+
#
55
# 1. run typecheck
66
# 2. run tests
77
# 3. pack project
88
# 4. run postbuild typecheck
9-
# 5. get new package version
10-
# 6. get release branch name
11-
# 7. switch to release branch
12-
# 8. stage changes
13-
# 9. commit changes
14-
# 10. push release branch to origin
15-
# 11. cleanup
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
19+
#
20+
# References:
21+
#
22+
# - https://cli.github.com/manual/gh_pr_create
23+
# - https://github.com/arethetypeswrong/arethetypeswrong.github.io
1624

1725
yarn typecheck
1826
yarn test:cov
19-
yarn pack -o %s-%v.tgz
27+
yarn pack
2028
yarn check:types:build
29+
attw package.tgz
30+
yarn pkg-size
2131
VERSION=$(jq .version package.json -r)
2232
RELEASE_BRANCH=release/$VERSION
2333
git switch -c $RELEASE_BRANCH
2434
git add .
25-
git commit -s -m "release: $(jq .tagPrefix package.json -r)$VERSION" --no-verify
35+
git commit -s -m "release: $(jq .tagPrefix package.json -r)$VERSION"
2636
git push origin -u --no-verify $RELEASE_BRANCH
37+
gh pr create --assignee @me --label scope:release --web
2738
yarn clean:pack

0 commit comments

Comments
 (0)