From cc34d88a38f297974591e6b611b98d0926b30174 Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Sun, 6 Aug 2023 19:11:21 -0400 Subject: [PATCH] chore: analyze types distribution - https://github.com/arethetypeswrong/arethetypeswrong.github.io Signed-off-by: Lexus Drumgold --- .attw.json | 7 ++ .dictionary.txt | 1 + .eslintignore | 1 + .github/workflows/ci.yml | 11 ++- package.json | 4 +- scripts/release.sh | 27 +++--- yarn.lock | 193 +++++++++++++++++++++++++++++++++++++-- 7 files changed, 225 insertions(+), 19 deletions(-) create mode 100644 .attw.json diff --git a/.attw.json b/.attw.json new file mode 100644 index 00000000..a4bd686a --- /dev/null +++ b/.attw.json @@ -0,0 +1,7 @@ +{ + "color": true, + "emoji": true, + "format": "ascii", + "ignoreRules": ["cjs-resolves-to-esm"], + "summary": true +} diff --git a/.dictionary.txt b/.dictionary.txt index b6b5d360..85616a69 100644 --- a/.dictionary.txt +++ b/.dictionary.txt @@ -1,6 +1,7 @@ algoliasearch alogirthm ardatan +attw bdougie cefc changeextfn diff --git a/.eslintignore b/.eslintignore index 6f4471f7..28285d51 100644 --- a/.eslintignore +++ b/.eslintignore @@ -18,6 +18,7 @@ yarn.lock !**/__fixtures__/**/dist/ !**/__fixtures__/**/node_modules/ !**/typings/**/dist/ +!.attw.json !.codecov.yml !.commitlintrc.* !.cspell.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5912fb96..a6b103a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 diff --git a/package.json b/package.json index 346d7713..bbe61bbf 100644 --- a/package.json +++ b/package.json @@ -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}", @@ -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", diff --git a/scripts/release.sh b/scripts/release.sh index f6ec0875..01b77477 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -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) @@ -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 diff --git a/yarn.lock b/yarn.lock index f4e8300c..db6ac778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -216,6 +216,13 @@ __metadata: languageName: node linkType: hard +"@andrewbranch/untar.js@npm:^1.0.0": + version: 1.0.2 + resolution: "@andrewbranch/untar.js@npm:1.0.2" + checksum: 138d4020846d83e841835a24f7ead6d97147d245988fbb1c730bea0e898d7075274966528f5b61403427e84680ce1d1cab880d357810e249ee81a260021c9fab + languageName: node + linkType: hard + "@ardatan/sync-fetch@larsgw/sync-fetch#head=worker_threads": version: 0.3.1 resolution: "@ardatan/sync-fetch@https://github.com/larsgw/sync-fetch.git#commit=3fb71aeed5ff6655421064c4e4b234f524896cd2" @@ -226,6 +233,37 @@ __metadata: languageName: node linkType: hard +"@arethetypeswrong/cli@npm:0.7.1": + version: 0.7.1 + resolution: "@arethetypeswrong/cli@npm:0.7.1" + dependencies: + "@arethetypeswrong/core": "npm:0.7.0" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.3" + commander: "npm:^10.0.1" + marked: "npm:^5.1.0" + marked-terminal: "npm:^5.2.0" + node-fetch: "npm:^2.6.4" + bin: + attw: dist/index.js + checksum: 9a36dca16dac89a3b698d9fa772d97b8702c44c80b1ec4825b311243c9206a62a711e868d6529f79278cbae40b66ec3b83a5901d50f8ca26b09229f31c2f0cca + languageName: node + linkType: hard + +"@arethetypeswrong/core@npm:0.7.0": + version: 0.7.0 + resolution: "@arethetypeswrong/core@npm:0.7.0" + dependencies: + "@andrewbranch/untar.js": "npm:^1.0.0" + fetch-ponyfill: "npm:^7.1.0" + fflate: "npm:^0.7.4" + semver: "npm:^7.5.4" + typescript: "npm:^5.1.3" + validate-npm-package-name: "npm:^5.0.0" + checksum: e8559231446182734b64724f5b37cba57d040004cd9737d8fc1ceca8e0a80b5a57b606a9506af8b626539d0f81cc64924e9da56c6341be8b61300c0f7fb1a146 + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.18.6": version: 7.18.6 resolution: "@babel/code-frame@npm:7.18.6" @@ -389,6 +427,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 5e08870799494f68e5b3b79e9a337bbf5fd7e634904fbbe642769921bf158fe458c41c888f88edf051b78c5325e3339970f00b24e31421c3480bb58f02687218 + languageName: node + linkType: hard + "@commitlint/cli@npm:17.6.7": version: 17.6.7 resolution: "@commitlint/cli@npm:17.6.7" @@ -1525,6 +1570,7 @@ __metadata: version: 0.0.0-use.local resolution: "@flex-development/mlly@workspace:." dependencies: + "@arethetypeswrong/cli": "npm:0.7.1" "@commitlint/cli": "npm:17.6.7" "@commitlint/types": "npm:17.4.4" "@docsearch/react": "npm:3.5.1" @@ -3805,6 +3851,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^6.2.0": + version: 6.2.0 + resolution: "ansi-escapes@npm:6.2.0" + dependencies: + type-fest: "npm:^3.0.0" + checksum: 32ef889ff692e3082fae4e0cf5243487342cef80a621abb23967fc0c2fefdf2556c828d07e1cea04f24de2ca34b4c342a0a5a888d2ea493f8991aef057b47ff9 + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -3858,6 +3913,13 @@ __metadata: languageName: node linkType: hard +"ansicolors@npm:~0.3.2": + version: 0.3.2 + resolution: "ansicolors@npm:0.3.2" + checksum: ec244826ff48ce81097507b8d273d05b94d3378d2a83cdcd1643b71a547dcc744023fa783a4aadf1a8fc98aa6fc63e27b6e9f8855bb344b1b447973b7b8d98ae + languageName: node + linkType: hard + "aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" @@ -4174,6 +4236,15 @@ __metadata: languageName: node linkType: hard +"builtins@npm:^5.0.0": + version: 5.0.1 + resolution: "builtins@npm:5.0.1" + dependencies: + semver: "npm:^7.0.0" + checksum: d84d5abbe1480218e2f15c1179993047f291052614d6bc225359dc03932c6306002e94a3c86166a815478f1c9b2934a645dbfdee31c71ad50d71f128535d0c19 + languageName: node + linkType: hard + "busboy@npm:1.6.0, busboy@npm:^1.6.0": version: 1.6.0 resolution: "busboy@npm:1.6.0" @@ -4277,6 +4348,18 @@ __metadata: languageName: node linkType: hard +"cardinal@npm:^2.1.1": + version: 2.1.1 + resolution: "cardinal@npm:2.1.1" + dependencies: + ansicolors: "npm:~0.3.2" + redeyed: "npm:~2.1.0" + bin: + cdl: ./bin/cdl.js + checksum: 9e9716cde2c12612625cc1114d883c00ff19d511924772a5caad0646ef4fbf4912b52c8e35e990100ab3f08c7e8db81fce996b8407c198f7932e23ff7a79a829 + languageName: node + linkType: hard + "chai-each@npm:0.0.1": version: 0.0.1 resolution: "chai-each@npm:0.0.1" @@ -4482,6 +4565,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.3": + version: 0.6.3 + resolution: "cli-table3@npm:0.6.3" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 82fe6f515833019cdb7064c7276a546c5e3fe6bae6a1db4bf4b41e4bdcf9b119b086630f991461ac8556d82330ae5284fc4942a740118be6c8bbfcc69c118d0a + languageName: node + linkType: hard + "cli-truncate@npm:^2.1.0": version: 2.1.0 resolution: "cli-truncate@npm:2.1.0" @@ -6380,7 +6476,7 @@ __metadata: languageName: node linkType: hard -"esprima@npm:^4.0.1": +"esprima@npm:^4.0.1, esprima@npm:~4.0.0": version: 4.0.1 resolution: "esprima@npm:4.0.1" bin: @@ -6638,6 +6734,22 @@ __metadata: languageName: node linkType: hard +"fetch-ponyfill@npm:^7.1.0": + version: 7.1.0 + resolution: "fetch-ponyfill@npm:7.1.0" + dependencies: + node-fetch: "npm:~2.6.1" + checksum: 7e5ebfeef1ebfbebf3264a828e27fd88c97c52183108d8d70235f37503929351532556295f5030587b8f5f258c6c6869eb03e002c30d2daccaaeb3fd71b9b514 + languageName: node + linkType: hard + +"fflate@npm:^0.7.4": + version: 0.7.4 + resolution: "fflate@npm:0.7.4" + checksum: 162d79df3bca9e118eeebb715934f13a0aba6f405c878fcc315e164a312e8d92aa8ba88c02b98a9b2cdc1685a93e67e14e753a177c62830490a5cb96f535f76e + languageName: node + linkType: hard + "figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -8603,6 +8715,31 @@ __metadata: languageName: node linkType: hard +"marked-terminal@npm:^5.2.0": + version: 5.2.0 + resolution: "marked-terminal@npm:5.2.0" + dependencies: + ansi-escapes: "npm:^6.2.0" + cardinal: "npm:^2.1.1" + chalk: "npm:^5.2.0" + cli-table3: "npm:^0.6.3" + node-emoji: "npm:^1.11.0" + supports-hyperlinks: "npm:^2.3.0" + peerDependencies: + marked: ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + checksum: 5f99ad8743745372ea80eae9711dc84ee1a0489182417403d0ea1c0123bac9f65da05fe1b756630d8c47a26c32741691fe00bdb1820ff50d74e29b051152d209 + languageName: node + linkType: hard + +"marked@npm:^5.1.0": + version: 5.1.2 + resolution: "marked@npm:5.1.2" + bin: + marked: bin/marked.js + checksum: 411637c0449c44b96b86dd33e4b131711cc5acc0c755deb227f161dfbd911c9278f42f9bd1af35e495423b7a1081d6525c17ed27c97625d8ba25d814f7f45fbe + languageName: node + linkType: hard + "mdast-util-from-markdown@npm:^0.8.5": version: 0.8.5 resolution: "mdast-util-from-markdown@npm:0.8.5" @@ -9045,6 +9182,15 @@ __metadata: languageName: node linkType: hard +"node-emoji@npm:^1.11.0": + version: 1.11.0 + resolution: "node-emoji@npm:1.11.0" + dependencies: + lodash: "npm:^4.17.21" + checksum: d94fcc48d9c3dc1f2512bf525f5c614d0b88c9c711c7d116f06ec8adc6d25082959c1c6a37fe9ae431ba4018018ca13bed256f94e61c347e4618b1276b841d3c + languageName: node + linkType: hard + "node-fetch@npm:2.6.9": version: 2.6.9 resolution: "node-fetch@npm:2.6.9" @@ -9070,7 +9216,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7": +"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.4, node-fetch@npm:^2.6.7, node-fetch@npm:~2.6.1": version: 2.6.12 resolution: "node-fetch@npm:2.6.12" dependencies: @@ -10057,6 +10203,15 @@ __metadata: languageName: node linkType: hard +"redeyed@npm:~2.1.0": + version: 2.1.1 + resolution: "redeyed@npm:2.1.1" + dependencies: + esprima: "npm:~4.0.0" + checksum: 1278b73beed9164dc01f9f1b83349e6492b2fd5811bc58d644f6850d526135eb3dce08e9d468fa6f1475b1428a732da003dc8b5972b9eca218dcdc75526b6b77 + languageName: node + linkType: hard + "regenerator-runtime@npm:^0.13.4": version: 0.13.11 resolution: "regenerator-runtime@npm:0.13.11" @@ -10376,7 +10531,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.6, semver@npm:^7.3.8, semver@npm:^7.5.0, semver@npm:^7.5.3, semver@npm:^7.5.4": +"semver@npm:7.5.4, semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.6, semver@npm:^7.3.8, semver@npm:^7.5.0, semver@npm:^7.5.3, semver@npm:^7.5.4": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -10862,7 +11017,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.1.0": +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -10871,6 +11026,16 @@ __metadata: languageName: node linkType: hard +"supports-hyperlinks@npm:^2.3.0": + version: 2.3.0 + resolution: "supports-hyperlinks@npm:2.3.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 018edbc2b3c5c1bea3b525dfc0b4fe8a3ab21cb61cd5c4b23aee11da540b81e8ff8bb022fa8eae3c87c4779533a5b4b763f31da1f76bffc27613c9b15a863a13 + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -11287,6 +11452,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^3.0.0": + version: 3.13.1 + resolution: "type-fest@npm:3.13.1" + checksum: a7941a4d64ce006701a99f822b746c9e9ef5add1543b319db035ca1ed31935f939fe4bdf01a7e2dffebce1fe13139aaee45eefe0b810e441efaa7e8eca3bf055 + languageName: node + linkType: hard + "typed-array-buffer@npm:^1.0.0": version: 1.0.0 resolution: "typed-array-buffer@npm:1.0.0" @@ -11360,7 +11532,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.1.6, typescript@npm:^4.6.4 || ^5.0.0": +"typescript@npm:5.1.6, typescript@npm:^4.6.4 || ^5.0.0, typescript@npm:^5.1.3": version: 5.1.6 resolution: "typescript@npm:5.1.6" bin: @@ -11380,7 +11552,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.1.6#optional!builtin, typescript@patch:typescript@npm%3A^4.6.4 || ^5.0.0#optional!builtin": +"typescript@patch:typescript@npm%3A5.1.6#optional!builtin, typescript@patch:typescript@npm%3A^4.6.4 || ^5.0.0#optional!builtin, typescript@patch:typescript@npm%3A^5.1.3#optional!builtin": version: 5.1.6 resolution: "typescript@patch:typescript@npm%3A5.1.6#optional!builtin::version=5.1.6&hash=1f5320" bin: @@ -11647,6 +11819,15 @@ __metadata: languageName: node linkType: hard +"validate-npm-package-name@npm:^5.0.0": + version: 5.0.0 + resolution: "validate-npm-package-name@npm:5.0.0" + dependencies: + builtins: "npm:^5.0.0" + checksum: 18d5883d8bd10fa56fdeee755802f19b8b769313a85892b7291e50d8bdbb237b077d1ab7a0ae9612666719baa9fb5d1daf36e0b7ff318b0b2a61a54fba122a49 + languageName: node + linkType: hard + "value-or-promise@npm:1.0.12, value-or-promise@npm:^1.0.11, value-or-promise@npm:^1.0.12": version: 1.0.12 resolution: "value-or-promise@npm:1.0.12"