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

chore: set esModuleInterop to true in clients #1512

Merged
merged 2 commits into from
Sep 10, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 9, 2020

Issue #, if available:
Refs: smithy-lang/smithy-typescript#212
Fixes: #1511

Description of changes:
set esModuleInterop to true in clients

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr
Copy link
Member Author

trivikr commented Sep 10, 2020

Converting to draft as local build is failing because of some issue in @types/jest:

Details
lerna ERR! yarn run build exited 2 in '@aws-sdk/client-lex-runtime-service'
lerna ERR! yarn run build stdout:
$ yarn build:cjs && yarn build:es
$ tsc -p tsconfig.json
../../node_modules/@types/jest/index.d.ts(35,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'HookFunction', but here has type 'Lifecycle'.
../../node_modules/@types/jest/index.d.ts(37,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'HookFunction', but here has type 'Lifecycle'.
../../node_modules/@types/jest/index.d.ts(38,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'SuiteFunction', but here has type 'Describe'.
../../node_modules/@types/jest/index.d.ts(40,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'PendingSuiteFunction', but here has type 'Describe'.
../../node_modules/@types/jest/index.d.ts(41,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'it' must be of type 'TestFunction', but here has type 'It'.
../../node_modules/@types/jest/index.d.ts(43,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'xit' must be of type 'PendingTestFunction', but here has type 'It'.
../../node_modules/@types/jest/index.d.ts(44,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'TestFunction', but here has type 'It'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@trivikr trivikr marked this pull request as draft September 10, 2020 13:27
@trivikr
Copy link
Member Author

trivikr commented Sep 10, 2020

Error when build is run in clients/client-lex-runtime-service:

Details
yarn run v1.22.5
$ yarn build:cjs && yarn build:es
$ tsc -p tsconfig.json
../../node_modules/@types/jest/index.d.ts:35:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

35 declare var beforeEach: jest.Lifecycle;
               ~~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2734:13
    2734 declare var beforeEach: Mocha.HookFunction;
                     ~~~~~~~~~~
    'beforeEach' was also declared here.

../../node_modules/@types/jest/index.d.ts:37:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

37 declare var afterEach: jest.Lifecycle;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2752:13
    2752 declare var afterEach: Mocha.HookFunction;
                     ~~~~~~~~~
    'afterEach' was also declared here.

../../node_modules/@types/jest/index.d.ts:38:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'SuiteFunction', but here has type 'Describe'.

38 declare var describe: jest.Describe;
               ~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2768:13
    2768 declare var describe: Mocha.SuiteFunction;
                     ~~~~~~~~
    'describe' was also declared here.

../../node_modules/@types/jest/index.d.ts:40:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'PendingSuiteFunction', but here has type 'Describe'.

40 declare var xdescribe: jest.Describe;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2789:13
    2789 declare var xdescribe: Mocha.PendingSuiteFunction;
                     ~~~~~~~~~
    'xdescribe' was also declared here.

../../node_modules/@types/jest/index.d.ts:41:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'it' must be of type 'TestFunction', but here has type 'It'.

41 declare var it: jest.It;
               ~~

  node_modules/@types/mocha/index.d.ts:2803:13
    2803 declare var it: Mocha.TestFunction;
                     ~~
    'it' was also declared here.

../../node_modules/@types/jest/index.d.ts:43:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xit' must be of type 'PendingTestFunction', but here has type 'It'.

43 declare var xit: jest.It;
               ~~~

  node_modules/@types/mocha/index.d.ts:2824:13
    2824 declare var xit: Mocha.PendingTestFunction;
                     ~~~
    'xit' was also declared here.

../../node_modules/@types/jest/index.d.ts:44:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'TestFunction', but here has type 'It'.

44 declare var test: jest.It;
               ~~~~

  node_modules/@types/mocha/index.d.ts:2817:13
    2817 declare var test: Mocha.TestFunction;
                     ~~~~
    'test' was also declared here.


Found 7 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@trivikr trivikr marked this pull request as ready for review September 10, 2020 17:51
@codecov-commenter
Copy link

Codecov Report

Merging #1512 into master will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1512      +/-   ##
==========================================
- Coverage   79.80%   79.63%   -0.17%     
==========================================
  Files         298      299       +1     
  Lines       11502    11634     +132     
  Branches     2475     2483       +8     
==========================================
+ Hits         9179     9265      +86     
- Misses       2323     2369      +46     
Impacted Files Coverage Δ
...l_tests/aws-json/commands/EmptyOperationCommand.ts 90.00% <0.00%> (-10.00%) ⬇️
...ts/aws-query/commands/NoInputAndNoOutputCommand.ts 90.00% <0.00%> (-10.00%) ⬇️
.../aws-restxml/commands/NoInputAndNoOutputCommand.ts 90.00% <0.00%> (-10.00%) ⬇️
...aws-restjson/commands/NoInputAndNoOutputCommand.ts 90.00% <0.00%> (-10.00%) ⬇️
protocol_tests/aws-ec2/commands/XmlBlobsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
protocol_tests/aws-ec2/commands/XmlEnumsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
protocol_tests/aws-ec2/commands/XmlListsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
...rotocol_tests/aws-query/commands/XmlMapsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
...otocol_tests/aws-query/commands/XmlBlobsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
...otocol_tests/aws-query/commands/XmlEnumsCommand.ts 95.00% <0.00%> (-5.00%) ⬇️
... and 115 more

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 282b344...8717361. Read the comment docs.

@trivikr
Copy link
Member Author

trivikr commented Sep 10, 2020

Verified that e2e tests are successful:

Details
$ yarn test:e2e
...
packages to run e2e test:
/local/home/trivikr/workspace/aws-sdk-js-v3/clients/client-cognito-identity
/local/home/trivikr/workspace/aws-sdk-js-v3/clients/client-s3

lerna notice cli v3.22.1
lerna info versioning independent
lerna notice filter including "{@aws-sdk/client-cognito-identity,@aws-sdk/client-s3,}"
lerna info filter [ '{@aws-sdk/client-cognito-identity,@aws-sdk/client-s3,}' ]
lerna info Executing command in 2 packages: "yarn run test:e2e"
lerna info run Ran npm script 'test:e2e' in '@aws-sdk/client-cognito-identity' in 11.6s:
$ mocha **/cjs/**/*.ispec.js && karma start karma.conf.js


  @aws-sdk/client-cognito-identity
    ✓ should successfully fetch Id and get credentials (78ms)


  1 passing (81ms)

ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
ℹ 「wdm」:    191 modules
ℹ 「wdm」: Compiled successfully.
Chrome Headless 85.0.4183.102 (Linux x86_64): Executed 1 of 1 SUCCESS (0.155 secs / 0.178 secs)
Firefox 68.0 (Linux x86_64): Executed 1 of 1 SUCCESS (0.143 secs / 0.18 secs)
TOTAL: 2 SUCCESS
lerna info run Ran npm script 'test:e2e' in '@aws-sdk/client-s3' in 18.6s:
$ mocha **/cjs/**/*.ispec.js && karma start karma.conf.js


  @aws-sdk/client-s3
    PutObject
      ✓ should succeed with Node.js readable stream body (125ms)
    GetObject
      ✓ should succeed with valid body payload (106ms)
    ListObjects
      ✓ should succeed with valid bucket (234ms)
      ✓ should throw with invalid bucket (143ms)
    MultipartUpload
      ✓ should successfully create, upload list and complete (143ms)
      ✓ should successfully create, abort, and list upload (65ms)


  6 passing (973ms)

ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
ℹ 「wdm」:    354 modules
ℹ 「wdm」: Compiled successfully.
Chrome Headless 85.0.4183.102 (Linux x86_64): Executed 8 of 8 SUCCESS (0.996 secs / 0.764 secs)
Firefox 68.0 (Linux x86_64): Executed 8 of 8 SUCCESS (1.092 secs / 0.866 secs)
TOTAL: 16 SUCCESS
lerna success run Ran npm script 'test:e2e' in 2 packages in 30.1s:
lerna success - @aws-sdk/client-cognito-identity
lerna success - @aws-sdk/client-s3
Done in 57.65s.

@trivikr trivikr merged commit 601ba0a into aws:master Sep 10, 2020
@trivikr trivikr deleted the add-default-import branch September 10, 2020 20:08
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable esModuleInterop to use default imports instead of whole module imports
3 participants