Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Update Builds Directories to Make Use of Both lib and dist#5739

Merged
Spacesai1or merged 10 commits into
4.xfrom
wyatt/4.x/fix-build
Jan 10, 2023
Merged

Update Builds Directories to Make Use of Both lib and dist#5739
Spacesai1or merged 10 commits into
4.xfrom
wyatt/4.x/fix-build

Conversation

@Spacesai1or

@Spacesai1or Spacesai1or commented Jan 10, 2023

Copy link
Copy Markdown
Contributor

This PR moves the tsc compiled files from dist/ to lib/ for all packages that weren't already doing so. Additionally, web3 and web3-validator will compile their web builds to dist/. These changes are to address an issue found when developing the Chainlink plugin that needs to build it's code for the browser. It was discovered that there was a filename conflict between files such as the tsc compiled web3_validator.ts and it's webpack compiled version. By putting tsc compiled files in lib/ and webpack compiled files in dist/, we completely avoid this issue for all packages, and users are able to pull in published 4.x Web3.js packages and build using webpack

@Spacesai1or Spacesai1or self-assigned this Jan 10, 2023
@Spacesai1or Spacesai1or added the 4.x 4.0 related label Jan 10, 2023
@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 03:03 Inactive
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 10, 2023

Copy link
Copy Markdown

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 266b612
Status: ✅  Deploy successful!
Preview URL: https://232e7388.web3-js-docs.pages.dev
Branch Preview URL: https://wyatt-4-x-fix-build.web3-js-docs.pages.dev

View logs

@Spacesai1or Spacesai1or marked this pull request as ready for review January 10, 2023 03:15
@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 03:20 Inactive
@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 06:25 Inactive
@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 06:38 Inactive
@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 06:53 Inactive
Comment thread packages/web3-core/package.json Outdated
"clean": "rimraf dist && rimraf lib",
"prebuild": "yarn clean",
"build": "tsc --build",
"build:check": "node -e \"require('./dist')\"",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to update build:check as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This commit addresses this

"license": "LGPL-3.0",
"files": [
"dist/**/*"
"lib/**/*"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For npm whitelisting only lib , this will filter out dist form including in published lib.
This will impact CDN as current CDN is configured to pick minified build through npm ( as per Greg info, I discussed with him last time ).

I personally like it, as it will reduce lib size , so users node_modules will be of less size ( by excluding minified builds) but we will need to configure explicitly CDN for 4.x.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created #5743 to track this

@jdevcs jdevcs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tsconfig of some of package is not updated ( web3-erros eth-ens iban http ws rpc-methods )?, all packages should have consistent lib output.

@Spacesai1or

Copy link
Copy Markdown
Contributor Author

tsconfig of some of package is not updated ( web3-erros eth-ens iban http ws rpc-methods )?, all packages should have consistent lib output.

@jdevcs These packages have a symlink for the tsconfig.json, so updating the template covers these packages

@github-actions github-actions Bot temporarily deployed to Preview: (wyatt/4.x/fix-build) January 10, 2023 17:31 Inactive
@Spacesai1or Spacesai1or merged commit 23805df into 4.x Jan 10, 2023
@Spacesai1or Spacesai1or deleted the wyatt/4.x/fix-build branch January 10, 2023 23:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

4.x 4.0 related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants