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

fix(manifest): default description need to come from package #839

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

alexandre-hallaine
Copy link
Contributor

@alexandre-hallaine alexandre-hallaine commented Mar 21, 2025

Description

Fixes an issue where the default description in the web app manifest was not being populated from the package.json file, despite the type definition indicating this behavior. This change ensures that if no explicit description is provided in the plugin options, the description from the project's package.json will be used as the default, aligning with the documented type definition in types.ts. This improves consistency and reduces the need for developers to duplicate the description in multiple places.

export interface ManifestOptions {
  /**
   * @default _npm_package_name_
   */
  name: string
  /**
   * @default _npm_package_name_
   */
  short_name: string
  /**
   * @default _npm_package_description_
   */
  description: string
  /**

Linked Issues

Additional Context

This change brings the runtime behavior in line with the existing type definition for ManifestOptions, ensuring that the description field defaults to the value in package.json, just like name and short_name. This provides a more complete and convenient default configuration for the web app manifest and avoids potential confusion for developers expecting the description to be automatically populated.

Copy link

netlify bot commented Mar 21, 2025

Deploy Preview for vite-plugin-pwa-legacy ready!

Name Link
🔨 Latest commit 2995734
🔍 Latest deploy log https://app.netlify.com/sites/vite-plugin-pwa-legacy/deploys/67dd720d22a34800080ad7e2
😎 Deploy Preview https://deploy-preview-839--vite-plugin-pwa-legacy.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 configuration.

Copy link
Member

@userquin userquin left a comment

Choose a reason for hiding this comment

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

thx ❤️

Copy link

pkg-pr-new bot commented Mar 21, 2025

npm i https://pkg.pr.new/vite-plugin-pwa@839

commit: 2995734

@alexandre-hallaine
Copy link
Contributor Author

This new commit adds the default theme_color to the defaultManifest. This ensures that if no theme_color is explicitly provided in the plugin options, it will default to #42b883, as defined in the ManifestOptions type definition. This brings the default configuration in line with the documented types.

@userquin userquin merged commit 53568d0 into vite-pwa:main Mar 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants