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

feat: add VitePress integration #356

Closed
wants to merge 9 commits into from

Conversation

userquin
Copy link
Member

I need to change the docs

closes #355

@netlify
Copy link

netlify bot commented Aug 17, 2022

Deploy Preview for vite-plugin-pwa ready!

Name Link
🔨 Latest commit fa2f156
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa/deploys/630686cd12a5520008b1f4dc
😎 Deploy Preview https://deploy-preview-356--vite-plugin-pwa.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

chore: add var args to integration hook
docs: add old vitepress section in frameworks and point any link to 0.12.3 version
docs: add new vitepress section
export function createBuildEndHook(userOptions: Partial<VitePWAOptions>): (siteConfig: any) => Promise<void> {
return async (siteConfig: any) => {
// run first integration hook
await userOptions.integrationHook?.(siteConfig)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove that, ppl can do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@antfu Finally I have left this option included

@userquin userquin marked this pull request as ready for review August 24, 2022 20:17
@userquin userquin requested a review from antfu August 24, 2022 20:17
plugins: [VitePWA(userOptions)],
},
'build',
'production',
Copy link
Member Author

Choose a reason for hiding this comment

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

should these 2 options be configurable?

@antfu
Copy link
Member

antfu commented Aug 25, 2022

Can't we await Vite 3.1 for the object hook? I am still not a fan of having integration-specific logic built in.

@userquin
Copy link
Member Author

Can't we await Vite 3.1 for the object hook? I am still not a fan of having integration-specific logic built in.

We need to do this way for SvelteKit and VitePress, both repos reject the integration.

For VitePress there is no race condition we only need to use the build end hook

For SvelteKit we need both, the integration and the sequential hook.

An alternative can be split the repo similar to UnoCSS with separate integrations.

@@ -227,6 +308,7 @@ function prepareSidebar(idx: number) {
const ogUrl = 'https://vite-plugin-pwa.netlify.app/'
const ogImage = 'https://vite-plugin-pwa.netlify.app/og-image.png'

// @ts-expect-error avoid TS2321: Excessive stack depth comparing types
Copy link
Member Author

Choose a reason for hiding this comment

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

I need to remove this line, it seems on IntelliJ is not working but it works in VSCode.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, this error seems to appear and dissapear randomly, so we can keep it: https://discord.com/channels/325477692906536972/1012326745753530419/1012347386653319248

@userquin
Copy link
Member Author

userquin commented Oct 3, 2022

included in the integration repo

@userquin userquin closed this Oct 3, 2022
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.

add VitePress integration
2 participants