Skip to content

Conversation

@emmenko
Copy link
Member

@emmenko emmenko commented Sep 9, 2019

Setup PR:

For now I migrated 2 small packages:

  • http-user-agent
  • sdk-middleware-user-agent

I also added a new package sdk-types, which contains shared TS types (e.g. middleware).

@emmenko
Copy link
Member Author

emmenko commented Sep 9, 2019

FYI: I will rebase this branch once #1395 has been merged, so that it only contains the packages migration.

acbeni
acbeni previously requested changes Sep 9, 2019
Copy link
Contributor

@acbeni acbeni left a 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.

@acbeni
Copy link
Contributor

acbeni commented Sep 9, 2019

the incremental approach sounds good for now, just one additional remark for the header and i think we re good to go 🎖

@emmenko emmenko force-pushed the nm-typescript-setup branch from 5d6853e to 6f7c7ad Compare September 9, 2019 15:50
@emmenko emmenko changed the title [WIP] refactor: setup ts config, fix flow errors, migrate some packages to ts refactor: migrate user-agent packages to TS Sep 9, 2019
@emmenko emmenko changed the base branch from master to nm-simple-rollup-config September 9, 2019 15:50
@emmenko emmenko marked this pull request as ready for review September 9, 2019 15:51
{
"files": "*.ts",
"options": {
"parser": "typescript"
Copy link
Member Author

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',
Copy link
Member Author

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.

@emmenko emmenko requested a review from acbeni September 9, 2019 15:54
@emmenko
Copy link
Member Author

emmenko commented Sep 9, 2019

Alright, this is now ready for review.

/cc @tdeekens for awareness

Copy link
Contributor

@tdeekens tdeekens left a 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

@emmenko emmenko changed the base branch from nm-simple-rollup-config to master September 9, 2019 19:23
@emmenko emmenko force-pushed the nm-typescript-setup branch from 9cd5a1f to 08b6375 Compare September 9, 2019 19:23
)
})
.catch((error: Error) => {
reject(error)
Copy link
Member Author

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(
Copy link
Member Author

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.

@emmenko emmenko dismissed acbeni’s stale review September 9, 2019 20:08

New changes, please review again

@codecov
Copy link

codecov bot commented Sep 10, 2019

Codecov Report

Merging #1393 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/sdk-middleware-user-agent/src/index.ts 100% <ø> (ø)
packages/http-user-agent/src/index.ts 100% <100%> (ø)
...ckages/sdk-middleware-user-agent/src/user-agent.ts 100% <100%> (ø)
packages/custom-objects-importer/src/main.js 100% <100%> (ø) ⬆️
packages/http-user-agent/src/create-user-agent.ts 100% <100%> (ø)
packages/csv-parser-state/src/main.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 770070a...12e25dd. Read the comment docs.

@emmenko
Copy link
Member Author

emmenko commented Sep 10, 2019

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.

Copy link
Contributor

@acbeni acbeni left a 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 👍

Copy link
Contributor

@daern91 daern91 left a 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'
Copy link
Contributor

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 :-)

@emmenko emmenko merged commit 73f49ff into master Sep 11, 2019
@emmenko emmenko deleted the nm-typescript-setup branch September 11, 2019 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants