Skip to content

Commit

Permalink
chore: analyze types distribution
Browse files Browse the repository at this point in the history
- https://github.com/arethetypeswrong/arethetypeswrong.github.io

Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Aug 6, 2023
1 parent 037e2c0 commit cc34d88
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .attw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"color": true,
"emoji": true,
"format": "ascii",
"ignoreRules": ["cjs-resolves-to-esm"],
"summary": true
}
1 change: 1 addition & 0 deletions .dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
algoliasearch
alogirthm
ardatan
attw
bdougie
cefc
changeextfn
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ yarn.lock
!**/__fixtures__/**/dist/
!**/__fixtures__/**/node_modules/
!**/typings/**/dist/
!.attw.json
!.codecov.yml
!.commitlintrc.*
!.cspell.json
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ jobs:
- gitguardian
- preflight
runs-on: ubuntu-latest
env:
TARFILE: |
${{ 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) }}
steps:
- id: checkout
name: Checkout ${{ env.REF_NAME }}
Expand All @@ -371,12 +374,18 @@ jobs:
with:
key: ${{ runner.os }}-${{ github.run_id }}
path: ${{ env.CACHE_PATH }}
- id: local-binaries
name: Add local binaries to $PATH
run: echo "$GITHUB_WORKSPACE/$CACHE_PATH/.bin" >> $GITHUB_PATH
- id: pack
name: Pack project
run: yarn pack -o %s-%v.tgz
run: yarn pack -o ${{ env.TARFILE }}
- id: typecheck
name: Run typecheck
run: yarn check:types:build
- id: attw
name: Analyze types distribution
run: attw ${{ env.TARFILE }}
- id: pkg-size-report
name: Package size report
run: yarn pkg-size
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
"scripts": {
"build": "mkbuild",
"changelog": "node --loader=./loader.mjs ./config/changelog.config",
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && yarn build && yarn check:types:build && yarn pkg-size && yarn docs:build",
"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 && yarn docs:build",
"check:format": "prettier --check .",
"check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
"check:types": "vue-tsc -p tsconfig.typecheck.json",
"check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
"check:types:build": "bash ./scripts/typecheck-build.sh",
"check:upgrades": "yarn upgrade-interactive",
"clean:build": "trash ./{dist,*.tgz}",
Expand Down Expand Up @@ -87,6 +88,7 @@
"@flex-development/tutils": "6.0.0-alpha.15"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.7.1",
"@commitlint/cli": "17.6.7",
"@commitlint/types": "17.4.4",
"@docsearch/react": "3.5.1",
Expand Down
27 changes: 16 additions & 11 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@
#
# 1. run typecheck
# 2. run tests
# 3. build project
# 3. pack project
# 4. run postbuild typecheck
# 5. print package size report
# 6. build docs
# 7. get new package version
# 8. get release branch name
# 9. switch to release branch
# 10. stage changes
# 11. commit changes
# 12. push release branch to origin
# 13. create pull request
# 5. analyze types
# 6. print package size report
# 7. build docs
# 8. get new package version
# 9. get release branch name
# 10. switch to release branch
# 11. stage changes
# 12. commit changes
# 13. push release branch to origin
# 14. create pull request
# 15. cleanup
#
# References:
#
# - https://cli.github.com/manual/gh_pr_create
# - https://github.com/arethetypeswrong/arethetypeswrong.github.io

yarn typecheck
yarn test:cov
yarn build
yarn pack
yarn check:types:build
attw package.tgz
yarn pkg-size
yarn docs:build
VERSION=$(jq .version package.json -r)
Expand All @@ -33,3 +37,4 @@ git add .
git commit -s -m "release: $(jq .tagPrefix package.json -r)$VERSION"
git push origin -u --no-verify $RELEASE_BRANCH
gh pr create --assignee @me --label scope:release --web
yarn clean:pack

0 comments on commit cc34d88

Please sign in to comment.