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

build(governance-sdk): generate commonjs and esmodules builds #491

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johnrees
Copy link
Contributor

@johnrees johnrees commented Jan 15, 2022

Another suggestion for a potentially nice but definitely not required feature which could make things a little easier for consumers of the governance-sdk npm package

this generates an esmodules and commonjs build of the package in lib/mjs and lib/cjs respectively.

A downside is that it increases the size of the tarball hosted on npm but the upside is that there is probably less configuration etc required by users and the increased package size doesn't really affect them as unused code wouldn't get bundled into their applications anyway.

I haven't thoroughly tested this yet which is why it's a draft, but happy to over the next few days if it'd be useful.

TODO

  • confirm that there is no issue with the extra package.json fields
  • test package in a new node and browser-based project

@vercel
Copy link

vercel bot commented Jan 15, 2022

@johnrees is attempting to deploy a commit to the Solana Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jan 15, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/solana-labs/oyster-governance/9qGcBzcp3g3sJx9w95EjvWYgfJL3
✅ Preview: https://oyster-governance-git-fork-johnrees-build-outputs-solana-labs.vercel.app

@SebastianBor
Copy link
Contributor

I haven't thoroughly tested this yet which is why it's a draft, but happy to over the next few days if it'd be useful.

Sounds like a good to have to me, but vercel doesn't like it :)

@johnrees
Copy link
Contributor Author

johnrees commented Jan 21, 2022

I haven't thoroughly tested this yet which is why it's a draft, but happy to over the next few days if it'd be useful.

Sounds like a good to have to me, but vercel doesn't like it :)

I'm actually a bit curious about why vercel is building the governance-sdk?

Shouldn't this be a job for dedicated CI tooling like github actions or travis? Or does it have some frontend code that I'm not aware of? Thanks 🙏

@johnrees
Copy link
Contributor Author

ah, I think I get it, nvm. It's building it alongside the packages/governance frontend

temporary workaround to make it less annoying than having to include

`@babel/plugin-proposal-class-properties` (https://git.io/vb4SL)

with webpack builds
@johnrees johnrees changed the title governance: generate commonjs and esmodules builds build(governance-sdk): generate commonjs and esmodules builds Jan 21, 2022
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.

2 participants