Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove monorepo-wide tsconfig #1285

Merged
merged 19 commits into from
Nov 2, 2022
Merged

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Oct 28, 2022

🌟 What is the purpose of this PR?

This PR removes top-level tsconfig.json and moves tsconfig.base.json into a workspace named @local/tsconfig. Thus, all monorepo workspaces explicitly extend @local/tsconfig/block.json or @local/tsconfig/legacy-base-to-refactor.json. Dropping top-level tsconfig.json enables further improvements in the monorepo’s TSC / ESLint setup.

🔗 Related links

🚫 Blocked by

🔍 What does this change?

  • @hashintel/tsconfig is moved from packages/hash/tsconfig to libs/javascript/@local/tsconfig and the workspace is renamed to @local/tsconfig. The plan is to move more workspaces to libs/javascript in the future, this is just a start.

  • Each tsconfig.json file explicitly extends from @local/tsconfig.

  • Each TypeScript workspace explicitly depends on @local/tsconfig and typescript, which ensures that dependency topology is accurate. This enables Yarn PnP and focused installs in the future.

  • Workspace-specific ESlint configs are configured to use local tsconfig files in order to correctly apply @typescript-eslint/* rules.

  • Bonus: Top-level yarn codegen is migrated to Turborepo for faster switches between branches. It is also possible to run yarn turbo run build if needed (although this is not used anywhere yet).

📜 Does this require a change to the docs?

  • I’ve removed an out-of-date section on monorepo management.

⚠️ Known issues

  • ESLint checks are still partially broken when it comes to comparing the results between CLI and the editor. This is because CLI narrow down the lists of files covered by ESLint. For example, packages/hash/frontend/next.config.js shows ESLint errors, but yarn lint:eslint does not fail because this script calls eslint --ext .js,.ts,.tsx ./src/. This is an inherited problem and its fix is out of this PR's scope.

🐾 Next steps

  • Continue iterating on TSC config
  • Continue iterating on ESLint config

🛡 What tests cover this?

❓ How to test this?

  1. Check CI output

@github-actions github-actions bot added A-backend area/blocks Relates to first-party blocks (area) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) labels Oct 28, 2022
CiaranMn
CiaranMn previously approved these changes Nov 2, 2022
packages/hash/README.md Outdated Show resolved Hide resolved
Co-authored-by: Ciaran Morinan <37743469+CiaranMn@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #1285 (d50f9fc) into main (aef4943) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main    #1285   +/-   ##
=======================================
  Coverage   40.01%   40.01%           
=======================================
  Files         320      320           
  Lines       16424    16424           
  Branches      819      819           
=======================================
  Hits         6572     6572           
  Misses       9847     9847           
  Partials        5        5           
Flag Coverage Δ
backend-integration-tests 2.85% <ø> (ø)
unit-tests 1.15% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...pi/src/email/transporters/DummyEmailTransporter.ts 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kachkaev kachkaev merged commit 687d67c into main Nov 2, 2022
@kachkaev kachkaev deleted the ak/remove-monorepo-wide-tsconfig branch November 2, 2022 11:18
@vilkinsons vilkinsons added type/eng > frontend Owned by the @frontend team area/apps > hash-search-loader area/apps > hash-realtime area/tests > playwright New or updated Playwright tests area/tests > integration New or updated integration tests type/eng > backend Owned by the @backend team and removed area: frontend labels Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps > hash-realtime area/apps > hash-search-loader area/blocks Relates to first-party blocks (area) area/infra > docker area/infra Relates to version control, CI, CD or IaC (area) area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team
Development

Successfully merging this pull request may close these issues.

3 participants