-
Notifications
You must be signed in to change notification settings - Fork 70
refactor: migrate user-agent packages to TS #1393
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
Conversation
|
FYI: I will rebase this branch once #1395 has been merged, so that it only contains the packages migration. |
acbeni
left a comment
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 looks good 🎖
there is just a repeated part as mentioned in the comment that i m not sure i ve got quite correctly.
|
the incremental approach sounds good for now, just one additional remark for the header and i think we re good to go 🎖 |
5d6853e to
6f7c7ad
Compare
| { | ||
| "files": "*.ts", | ||
| "options": { | ||
| "parser": "typescript" |
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.
Here we use the override feature to tell prettier to use typescript parser for the ts files, otherwise the babel-flow parser.
| @@ -0,0 +1,41 @@ | |||
| module.exports = { | |||
| parser: '@typescript-eslint/parser', | |||
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.
As mentioned before, for now TS packages should have their own eslint config, which is merged with the base one.
Once we've migrated all packages, we can merge this back with the base one.
|
Alright, this is now ready for review. /cc @tdeekens for awareness |
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.
Thanks. Looks good to me. I like that we're continuously moving all things into a similar direction from a setup tooling direction and spread the learnings as a result
9cd5a1f to
08b6375
Compare
| ) | ||
| }) | ||
| .catch((error: Error) => { | ||
| reject(error) |
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.
This was missing. Somehow the tests caught this now
| key: 'my-state', | ||
| } | ||
| expect(csvParser._transformTransitions(actual)).resolves.toEqual(actual) | ||
| return expect(csvParser._transformTransitions(actual)).resolves.toEqual( |
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.
There were a bunch of tests that did not return the expectation with the promise.
Codecov Report
@@ Coverage Diff @@
## master #1393 +/- ##
==========================================
+ Coverage 98.73% 98.74% +<.01%
==========================================
Files 121 123 +2
Lines 3167 3176 +9
Branches 728 729 +1
==========================================
+ Hits 3127 3136 +9
Misses 36 36
Partials 4 4
Continue to review full report at Codecov.
|
|
Alright, CI is green now. I'll leave this open for the rest of the day and merge it tomorrow. Then we can continue migrating packages step-by-step. |
acbeni
left a comment
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.
@emmenko took a look again, seems good already 👍
daern91
left a comment
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.
LGTM, thanks a ton! 🥇
| import { CartDiscountPagedQueryResponse } from './../../models/CartDiscount' | ||
| import { CartDiscount } from './../../models/CartDiscount' | ||
| import { Middleware } from './../../base/common-types' | ||
| import { ApiRequest } from './../../base/requests-utils' |
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.
@acbeni fixing these looks like something we should do in the generator :-)
Setup PR:
For now I migrated 2 small packages:
http-user-agentsdk-middleware-user-agentI also added a new package
sdk-types, which contains shared TS types (e.g. middleware).