Comments (7)
Set the
main
to the typescript file instead of the built javascript, that way the@internal
APIs are available and thetypings
property in the package manifest can just point to the trimmed rolled up.d.ts
file.
I guess to truly be as close from metal as possible you could go one step further and publish all your packages to a fake registry (for example a Verdaccio instance). That would trigger the full pack pipeline, including publishConfig.main
replacement.
Another alternative would be to make a hook (beforeWorkspacePacking
) that would have the ability to modify the manifest at publish-time. This would actually be interesting, because I had to duplicate the main
and module
logic for both pack
and publish
(since each of them require to transform the manifest independently) - this would give us a way to avoid doing that.
from berry.
I guess to truly be as close from metal as possible you could go one step further and publish all your packages to a fake registry (for example a Verdaccio instance). That would trigger the full pack pipeline, including publishConfig.main replacement.
Fair point, but how would that work with our tests that are contained within the workspace?
Another alternative would be to make a hook (beforeWorkspacePacking) that would have the ability to modify the manifest at publish-time.
I was thinking along the same lines, because it doesn't make sense to have to duplicate this between pack
and publish
. I was also wondering whether this should be part of the core or a separate plugin altogether. I'm leaning towards a separate plugin, which could also do the main
and module
change.
from berry.
This hook would also be useful for #133.
from berry.
(I don't understand why but my first post appears at the bottom of this thread which is pretty annoying. Github probably messed up a date somehow 😔)
Fair point, but how would that work with our tests that are contained within the workspace?
Solvable with a dedicated infra (you could run the tests from your workspaces that would access the dependencies from your remote registry), but probably a fair amount of work for a low impact 🤔
I was also wondering whether this should be part of the core or a separate plugin altogether. I'm leaning towards a separate plugin, which could also do the
main
andmodule
change.
I think main
and module
might be things we would want to have in plugin-essentials
(because they have a far-reaching impact, particularly main
which is recognized by Node), and types
could be defined by plugin-typescript
. Does that sound reasonable?
from berry.
Looks like they fixed it. Yesterday when I added my comments the OP and your comment were shown as "commented 3 hours from now" so they definitely messed up the dates.
I think main and module might be things we would want to have in plugin-essentials (because they have a far-reaching impact, particularly main which is recognized by Node), and types could be defined by plugin-typescript. Does that sound reasonable?
Sounds reasonable!
from berry.
Fixed by #148 👍
from berry.
I'm going to implement this in pnpm as well. This is an awesome feature!
from berry.
Related Issues (20)
- [Bug?]: {Windows, `yarn create vite`, Svelte, TypeScript}: "Unable to locate pnpapi" with two paths different only in drive letter case
- [Bug?]: `yarn set version` doesn't save `enableTransparentWorkspaces` setting in .yarnrc
- [Feature] Move from zip to erofs
- [Bug]: Command aliases don't work in version 4 HOT 1
- [Bug]: Yarn requires state files even when they aren't necessary HOT 6
- [Bug?]: Yarn v4 doesn't download dependencies HOT 3
- [annoyance]: yarn 4.1.1 bundles an api key for npm-search and other super-linter gitleaks warnings (yarnPath related) HOT 2
- [Bug?]: .pnp.cjs needs different `packageLocation` values on different machines HOT 3
- [Bug]: Explaining peer warning gives incorrect advice HOT 1
- [Bug?]: yarn install HOT 5
- [Bug?]: yarn up picking pre-release versions HOT 2
- [Bug?]: Usage Error: Couldn't find a script named "deploy" HOT 1
- [Bug?]: peerDependencies not supporting npm: protocol HOT 1
- [Bug?]: Adding yarn sdks vscode fails after upgrade to eslint flat config
- [Feature] add builder option to produces `esbuild`'s `metafile`
- [Bug?]: Producing and verifying integrity value for git dependencies
- [Bug?]: Yarn pnp / sdk generation doesn't work with ESLint new flat config support
- [Bug?]: Can't run Yarn at all HOT 1
- [Bug?]: yarn 4 logFilters is unable to filter most messages HOT 1
- [Bug?]: "yarn npm audit --environment production --recursive" is reporting nested dev dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berry.