penumbra-zone / web

Apache License 2.0
15 stars 16 forks source link

Script to enable `pnpm link` #1909

Closed JasonMHasperhoven closed 1 week ago

JasonMHasperhoven commented 1 week ago

Currently pnpm linking does not work because the exports inside the package.json files of the packages refer to the src files:

"exports": {
    ".": "./src/index.ts",
    "./*": "./src/*.ts"
  },

This script can temporarily set the exports to the value of the publishConfig.exports, so that the exports will point to the dist folder.

It would work like this:

// inside penumbra-zone/web
node scripts/link-externally.js enable
cd packages/ui && dev:pack

// inside dex-explorer
pnpm link ../penumbra-zone/web/packages/ui

// to revert:
node scripts/link-externally.js disable

PS: Possible improvement would be to directly build a monorepo's package within the dex-explorer as part of the build pipeline.

changeset-bot[bot] commented 1 week ago

⚠️ No Changeset found

Latest commit: e415f56acf465175945e74a27c4d6cb2c76ca7c9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

vacekj commented 1 week ago

Nice, lgtm.

grod220 commented 1 week ago

Would be helpful to get a demo of this local workflow in an upcoming sync

JasonMHasperhoven commented 1 week ago

Would be helpful to get a demo of this local workflow in an upcoming sync

Sure thing!