Skip to content

Commit c2e040c

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

File tree

7 files changed

+250
-28
lines changed

7 files changed

+250
-28
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
commitlintrc

.eslintignore

+1
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

+12-4
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ jobs:
282282
- gitguardian
283283
- preflight
284284
runs-on: ubuntu-latest
285+
env:
286+
TARFILE: |
287+
${{ 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) }}
285288
steps:
286289
- id: checkout
287290
name: Checkout ${{ env.REF_NAME }}
@@ -302,19 +305,24 @@ jobs:
302305
with:
303306
key: ${{ runner.os }}-${{ github.run_id }}
304307
path: ${{ env.CACHE_PATH }}
308+
- id: local-binaries
309+
name: Add local binaries to $PATH
310+
run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >> $GITHUB_PATH
305311
- id: pack
306312
name: Pack project
307-
run: yarn pack -o %s-%v.tgz
313+
run: yarn pack -o ${{ env.TARFILE }}
308314
- id: typecheck
309315
name: Run typecheck
310316
run: yarn check:types:build
317+
- id: attw
318+
name: Analyze types distribution
319+
run: attw ${{ env.TARFILE }}
311320
- id: pkg-size-report
312321
name: Package size report
313322
run: yarn pkg-size
314323
- id: archive
315324
name: Archive production artifacts
316325
uses: actions/upload-artifact@v3.1.2
317326
with:
318-
name: |
319-
${{ format('@{0}-{1}-{2}', github.repository_owner, github.event.repository.name, needs.preflight.outputs.version) }}
320-
path: '*.tgz'
327+
name: ${{ env.TARFILE }}
328+
path: ${{ env.TARFILE }}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
"scripts": {
3939
"build": "mkbuild",
4040
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
41-
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn pack -o %s-%v.tgz && yarn clean:pack && yarn check:types:build && yarn pkg-size",
41+
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn pack && yarn check:types:build && attw package.tgz && yarn clean:pack && yarn pkg-size",
4242
"check:format": "prettier --check .",
4343
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
4444
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
4545
"check:types": "tsc -p tsconfig.typecheck.json",
46+
"check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
4647
"check:types:build": "bash ./scripts/typecheck-build.sh",
4748
"check:upgrades": "yarn upgrade-interactive",
4849
"clean:build": "trash ./{dist,*.tgz}",
@@ -70,6 +71,7 @@
7071
"@flex-development/tutils": "6.0.0-alpha.11"
7172
},
7273
"devDependencies": {
74+
"@arethetypeswrong/cli": "0.7.0",
7375
"@commitlint/cli": "17.6.3",
7476
"@flex-development/commitlint-config": "1.0.1",
7577
"@flex-development/decorator-regex": "1.0.0",

scripts/release.sh

+15-10
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
# Local Release Workflow
44
#
55
# 1. run typecheck
6-
# 2. build project
6+
# 2. pack project
77
# 3. run postbuild typecheck
8-
# 4. print package size report
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. create pull request
8+
# 4. analyze types
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
17+
# 13. cleanup
1618
#
1719
# References:
1820
#
1921
# - https://cli.github.com/manual/gh_pr_create
22+
# - https://github.com/arethetypeswrong/arethetypeswrong.github.io
2023

2124
yarn typecheck
22-
yarn build
25+
yarn pack
2326
yarn check:types:build
27+
attw package.tgz
2428
yarn pkg-size
2529
VERSION=$(jq .version package.json -r)
2630
RELEASE_BRANCH=release/$VERSION
@@ -29,3 +33,4 @@ git add .
2933
git commit -s -m "release: $(jq .tagPrefix package.json -r)$VERSION"
3034
git push origin -u --no-verify $RELEASE_BRANCH
3135
gh pr create --assignee @me --label scope:release --web
36+
yarn clean:pack

0 commit comments

Comments
 (0)