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

fix: Multibuild to esm and commonjs #183

Merged
merged 8 commits into from
Mar 20, 2023
Merged

fix: Multibuild to esm and commonjs #183

merged 8 commits into from
Mar 20, 2023

Conversation

enemycnt
Copy link
Contributor

@enemycnt enemycnt commented Mar 1, 2023

Description

Related Issue Or Context

Closes: #184

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@enemycnt enemycnt changed the title Multibuild to esm and commonjs fix: Multibuild to esm and commonjs Mar 1, 2023
@enemycnt enemycnt marked this pull request as ready for review March 1, 2023 14:18
@enemycnt enemycnt requested a review from Lykhoyda March 1, 2023 14:18
Copy link
Collaborator

@BeroBurny BeroBurny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert all changes made to example folder as is not in the scope of this PR.
and there is an issue in packages/sdk/.npmignore that needs to be addressed

ts configs look ok (by scanning them, dint go in deep)

packages/sdk/.npmignore Outdated Show resolved Hide resolved
Comment on lines 5 to 14
"main": "./dist-cjs/index.js",
"module": "./dist-esm/index.js",
"source": "./src/index.ts",
"types": "./types/src/index.d.ts",
"exports": {
".": {
"import": "./dist-esm/index.js",
"require": "./dist-cjs/index.js",
"types": "./types/src/index.d.ts"
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How sure are you that is configured correctly?
(Asking because I know is a pain in the ass to do it correctly)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue that I have is with CRA. But that is because they use outdated webpack config. That's why I've updated all examples that are based on CRA

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue with the globally Webpack or in the local setup?

Like the current latest webpack is 5.75.0 and it is pretty essential to work with it out of the box as have around ~50% of market-based on this statistics

Copy link
Contributor Author

@enemycnt enemycnt Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is not related to webpack as a standalone tool, but rather pertains to the default configuration of webpack provided by CRA. It should be noted that our examples and UI do not utilize the default configuration of CRA, but instead employ craco and react-app-rewired due to the need for node polyfills and etc.

Copy link
Collaborator

@BeroBurny BeroBurny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will not block merge, if someone has an objection please leave it, will give second approval

@BeroBurny BeroBurny self-requested a review March 20, 2023 10:12
BeroBurny
BeroBurny previously approved these changes Mar 20, 2023
Copy link
Collaborator

@BeroBurny BeroBurny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wainola build si broken please fix it

@enemycnt
Copy link
Contributor Author

enemycnt commented Mar 20, 2023

Conflicts resolved, lint error fixed. @BeroBurny @wainola

@enemycnt enemycnt merged commit bee7188 into main Mar 20, 2023
@enemycnt enemycnt deleted the fix/commonjs-esm branch March 20, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support build of esm and commonjs
3 participants