lilnasy / gratelets

A collection of purpose-built, small, third-party integrations for Astro.
The Unlicense
105 stars 6 forks source link

support carton in every environment #63

Closed rishi-raj-jain closed 9 months ago

rishi-raj-jain commented 9 months ago

This PR aims at extending carton in every environment: npm, pnpm, bun and yarn.

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: ca3367d190efe4d2f6cfaa895cd1dbcfae78aee0

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

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

lilnasy commented 9 months ago

Thanks for getting this started! This is definitely the next step.

I would be surprised if the current approach works, however, since "dist" is not in astro.packageJson.exports.

lilnasy commented 9 months ago

Yeah, the approach doesn't work.

image

(The way you have to test it is by creating a tarball with pnpm pack.)

No worries, though, I already know a way it could work.

rishi-raj-jain commented 9 months ago

Thanks for the quick review!

No worries, though, I already know a way it could work.

May you help me with that? I'd love to contribute and learn!

rishi-raj-jain commented 9 months ago

woah, I didn't know import.meta.resolve('module') was an API

lilnasy commented 9 months ago

Just needs a changeset and readme update now.

rishi-raj-jain commented 9 months ago

Sure, on it

Curious, does import.meta.resolve('node:crypto') work in similar fashion? what if node:crypto is not available?

rishi-raj-jain commented 9 months ago

@lilnasy

Updated the README and added changeset

lilnasy commented 9 months ago

Curious, does import.meta.resolve('node:crypto') work in similar fashion? what if node:crypto is not available?

Just tried it and it just returns "node:crypto" unchanged.

rishi-raj-jain commented 9 months ago

My pleasure!