-
Notifications
You must be signed in to change notification settings - Fork 188
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
build: refine project references #699
build: refine project references #699
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 23e4e56:
|
cfd672a
to
3ef5ebb
Compare
3ef5ebb
to
e12462e
Compare
.eslintrc.js
Outdated
}, | ||
}, | ||
{ | ||
files: ['**/__tests__/**'], | ||
rules: { | ||
'functional/no-expression-statement': ['off'], | ||
'import/no-extraneous-dependencies': ['off'], | ||
'import/no-named-as-default': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing the project references and including project: ['./']
in .eslint.js
(so it could find the tsconfig paths) must have let the eslint-plugin-import
better analyze the import statements, because it started failing this import.
import Big from 'big.js`;
The rule import/no-named-as-default
prefers:
import { Big } from 'big.js';
So we can change it or disable the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer fixing the imports and keeping the rule on. If there are imports that can't be fixed, we can ignore the rule locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnhooks This should be the last change before we can merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why I periodically had this error happening. But I'll look locally for the solution because it isn't in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard jumping between this and #667, I hadn't removed the rule as you suggested. THAT made the error come back lol.
e12462e
to
f3019e2
Compare
f3019e2
to
999e020
Compare
82559e9
to
68c84d1
Compare
a6a8b9b
to
bd9a77b
Compare
bd9a77b
to
25e2ab5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks great to me. I'll let you handle the final comments @johnhooks and we'll be good to merge.
@sarahdayan I made one last edit to Edit: That actually didn't resolve the issue... I'm looking into it. Do you that error in VSCode? What is weird Edit 2: I walked that back, it wasn't necessary, just an issue with my setup. |
@johnhooks Not seeing any issue locally, and the build seems fine in CI. |
Thanks I'll start trying to figure out what is wrong on my system and stop looking in the code. Edit: I was from jumping between this branch and #667 and not running |
82739f1
to
25e2ab5
Compare
There are some changes that need to happen in #667 for this to work. Once this is merged, I'll resolve them. |
.eslintrc.js
Outdated
}, | ||
}, | ||
{ | ||
files: ['**/__tests__/**'], | ||
rules: { | ||
'functional/no-expression-statement': ['off'], | ||
'import/no-extraneous-dependencies': ['off'], | ||
'import/no-named-as-default': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarahdayan with was the last edit from a previous comment. To fix this ESLint issue rather than ignore it.
bfa49d9
to
79caf63
Compare
79caf63
to
6933851
Compare
@sarahdayan I'm having some trouble with getting ESLint to recognize the The simplest solution would be to create a separate Otherwise we can hold off on this. I am still learning a lot about |
6933851
to
e92cdf6
Compare
After reading an article from Shopify and how they implemented ts project references, I learned a few things I wanted to apply. It should specifically speed up VSCode, and possibly any program using the ts lsp. [reference](https://shopify.engineering/migrating-large-typescript-codebases-project-references) build(tsc): update test:types script To use the project references the command `tsc -b` needs to be used, not `tsc --noEmit`. It will build the declarations, but will output to the lib folders in all the relevant packages, which are ignored from git build: add eslint-import-resolver-typescript
The new tsconfig file in the packages directory was causing an error because the docs route was trying to load it as a package. This fixes the issue, but not very elegantly.
e92cdf6
to
4a76029
Compare
@sarahdayan I'm going to rework this. Do you want me to close it and open it back up when it's ready? |
@johnhooks Yes, feel free to close and reopen when you're ready so we can keep the PR list clear 🙂 |
After reading an article from Shopify and how they implemented ts project references, I learned a few things I wanted to apply. It should specifically speed up VSCode, and possibly any program using the ts lsp. reference
The big suggestion from the article was that the top level
tsconfig.json
should be able to build the whole project, thats how VSCode will use it. I moved everything shared to atsconfig.base.json
and removed thetsconfig.declaration.json
because that didn't have a purpose with a shared base between root level and leaf leveltsconfig.json
files. It also required atsconfig.json
inside thepackages
directory, and some modifications to the one in thetest
directory.