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

publish useful packages #1305

Merged
merged 31 commits into from
Jun 18, 2024
Merged

publish useful packages #1305

merged 31 commits into from
Jun 18, 2024

Conversation

turbocrime
Copy link
Contributor

@turbocrime turbocrime commented Jun 14, 2024

use tsc for package builds, instead of vite lib mode.

build is much faster.

all remaining packages are correctly dependent, minimally chunked/bundled/polyfilled for target, and should be usable outside the repository.

@turbocrime turbocrime requested review from grod220, VanishMax and a team June 14, 2024 21:24
Copy link

changeset-bot bot commented Jun 14, 2024

🦋 Changeset detected

Latest commit: 656db1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@penumbra-zone/transport-chrome Major
@repo/tailwind-config Major
@repo/eslint-config Major
@penumbra-zone/transport-dom Major
@penumbra-zone/perspective Major
@penumbra-zone/protobuf Major
@penumbra-zone/services Major
@repo/tsconfig Major
node-status Major
@penumbra-zone/bech32m Major
@penumbra-zone/getters Major
@penumbra-zone/storage Major
@penumbra-zone/client Major
@penumbra-zone/crypto-web Major
@penumbra-zone/zquery Major
minifront Major
@penumbra-zone/query Major
@penumbra-zone/types Major
@penumbra-zone/wasm Major
@repo/ui Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

package.json Outdated Show resolved Hide resolved
@TalDerei
Copy link
Contributor

high-level question, what's generally the difference between building with turbo versus tsup?

@turbocrime
Copy link
Contributor Author

turbocrime commented Jun 15, 2024

turbo is the task runner.

the change is away from vite build lib mode.

vite is primarily a website bundler and required a lot of configuration to build packages for publishing/consumption. lib mode is definitely an afterthought, and the plugins we needed to achieve things simply like external deps or typescript output were not well maintained - config didnt merge well, there were quirks to work around, etc

tsup was something we looked at initially but was decided against. @VanishMax demonstrated a pretty concise use of it that seemed much nicer than our vite build configs.

so this publishes the remainder of the packages that we should publish, applies package config that solves issues experienced by consumers, and uses tsup for all package builds, except wasm. wasm might be done with a bit more effort.

@turbocrime
Copy link
Contributor Author

tsc was also used directly for some builds, but there are internal deps like polyfills that we do want to inline.

vite and tsup both use esbuild and rollup internally.

@turbocrime
Copy link
Contributor Author

this also avoids api-extractor which is very slow. api-extractor has benefits and features over rollup but we don't use them, and it lags behind typescript releases. we can enable it with a tsup flag if we choose.

@turbocrime turbocrime changed the title reconfigure package builds publish useful packages Jun 15, 2024
@turbocrime turbocrime force-pushed the turbocrime/package-builds branch 2 times, most recently from 76b33ba to 246521a Compare June 17, 2024 01:43
apps/minifront/vite.config.ts Show resolved Hide resolved
packages/query/src/block-processor.ts Show resolved Hide resolved
packages/ui/components/ui/box.tsx Outdated Show resolved Hide resolved
packages/ui/package.json Outdated Show resolved Hide resolved
packages/client/package.json Outdated Show resolved Hide resolved
packages/client/tsup.config.ts Outdated Show resolved Hide resolved
packages/ui/package.json Outdated Show resolved Hide resolved
packages/ui/package.json Outdated Show resolved Hide resolved
@VanishMax
Copy link
Contributor

@turbocrime It is great to see how you took over the packages build configuration and perfected the use of tsup. Awesome changes!

Copy link
Contributor

@TalDerei TalDerei left a comment

Choose a reason for hiding this comment

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

before merging, can we ensure that peer deps and tsup config are in-fact working? There were some issues last night that I'm not sure were resolved

@turbocrime
Copy link
Contributor Author

before merging, can we ensure that peer deps and tsup config are in-fact working? There were some issues last night that I'm not sure were resolved

tsup was not in fact working. turns out it mangles types due to some underlying esbuild issue, and that was what was causing peer issues and prevented services init.

i ended up removing tsup. all package builds now use bare tsc.

@TalDerei TalDerei self-requested a review June 18, 2024 04:24
Copy link
Contributor

@TalDerei TalDerei left a comment

Choose a reason for hiding this comment

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

testing against prax-wallet/prax#34 seems to work for me

@turbocrime turbocrime merged commit f067fab into main Jun 18, 2024
6 checks passed
@turbocrime turbocrime deleted the turbocrime/package-builds branch June 18, 2024 04:54
@turbocrime turbocrime mentioned this pull request Jun 18, 2024
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.

4 participants