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

Adapt to astro's sharp version either on preinstall or postinstall #329

Closed
NikolaRHristov opened this issue Apr 4, 2024 · 7 comments
Closed
Assignees

Comments

@NikolaRHristov
Copy link
Member

NikolaRHristov commented Apr 4, 2024

When preinstalling make sure that the two versons of sharp mainly the one in @playform/compress and astro are the same. Use @playform/adapt

@NikolaRHristov NikolaRHristov self-assigned this Apr 4, 2024
@NikolaRHristov NikolaRHristov changed the title Adapt to Astro's sharp version on preinstall Adapt to astro's sharp version on preinstall Apr 4, 2024
@NikolaRHristov NikolaRHristov changed the title Adapt to astro's sharp version on preinstall Adapt to astro's sharp version either preinstall or postinstall Apr 4, 2024
@NikolaRHristov NikolaRHristov changed the title Adapt to astro's sharp version either preinstall or postinstall Adapt to astro's sharp version either on preinstall or postinstall Apr 4, 2024
@NikolaRHristov
Copy link
Member Author

And also adapt to astro's current / main version.

@azat-io
Copy link

azat-io commented May 21, 2024

Sorry if this is a stupid question. Why don't we remove Astro from dependencies and add it to peer-dependencies with caret ^?

@NikolaRHristov
Copy link
Member Author

@azat-io We use astro in devDependencies because it's required when developing the extension. Types, etc. Having it in peerDependencies would mean that someone must have it installed alongside astro-compress or @playform/compress when developing the extension and that's not the case.

We use a similar pattern for @playform/document in https://github.com/PlayForm/Document/blob/81d9d83c72a3ad9563d7c41a15141af1f8367ea6/package.json#L51-L58 Maybe this could work.

Thanks for the suggestion ! 🎉

@NikolaRHristov
Copy link
Member Author

NikolaRHristov commented May 23, 2024

I now see that astro is in dependencies

"astro": "4.8.6",
not even in devDependencies since we ship the AstroIntegration type in
import type { AstroIntegration } from "astro";

This

Compress/package.json

Lines 56 to 63 in cce04ce

"peerDependencies": {
"astro": "4.8.7"
},
"peerDependenciesMeta": {
"astro": {
"optional": true
}
},
should fix it.

@azat-io
Copy link

azat-io commented May 23, 2024

Nice. Let's do a release.

@NikolaRHristov
Copy link
Member Author

@azat-io Should be fixed the latest astro-compress v2.2.24 and @playform/compress v0.0.6 Can you give it a go ?

@azat-io
Copy link

azat-io commented May 24, 2024

Yes. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants