
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@pwaset/astro
Advanced tools
Effortlessly empower your Astro project with PWA capabilities.
This package is compatible with
astro@4.0.0
and above and only supports the latest Integrations API.
$ npm install @pwaset/astro
Step1: Complete the required configuration with the help of JSDoc. and Make sure // @ts-check
is turned on in astro.config.mjs
.
// @ts-check
import { defineConfig } from 'astro/config';
import pwaset from '@pwaset/astro';
export default defineConfig({
integrations: [
pwaset({
name: "PWAs: Progressive Web Applications",
})
]
})
Step2: Then provide at least one source image to the src/pwa
directory, default src/pwa/favicon.svg
.
Step3: npm run build
generates PWA assets in publicDir
Core interfaces: input
, themes
, manifest
, icons
, shourtcuts
, screenshots
. For details, see JSDoc or documentation.
The manifest is currently compatible with w3.org's manifest and some MS Edge manifests. If you need to extend it, please file an issue to
@pwas/core
to get the latest manifest type definition.
// @ts-check
import { defineConfig } from 'astro/config';
import pwaset from '@pwaset/astro';
import { readFile } from 'fs/promises';
// https://astro.build/config
export default defineConfig({
integrations: [
pwaset({
// input: ["src/pwa/favicon.svg", await readFile("src/pwa/logo.png")],
input: {
favicons: ["src/pwa/favicon.svg", await readFile("src/pwa/logo.png")],
pwaIcon: ["src/pwa/logo.png", "src/pwa/logo.svg"],
yandex: "src/pwa/shortcuts/icon-compose.png",
},
//
name: "Twitter",
themes: ["#fff", "#fff"],
background: "#000",
appleStatusBarStyle: "black-translucent",
manifest: {
name_localized: {
"zh-CN": { value: "推特", dir: "auto", lang: 'zh-CN' },
en: "Twitter"
},
short_name: "x",
short_name_localized: {
"zh-CN": "推特",
en: "x"
},
description: "Get breaking news, politics, trending music, world events, sports scores, and the latest global news stories as they unfold - all with less data.",
description_localized: {
"zh-CN": "获取突发新闻、政治、流行音乐、世界事件、体育比分以及最新的全球新闻报道 - 只需更少的数据。"
},
categories: ["beauty", "lifestyle", "fashion"],
start_url: "/?utm_source=homescreen&utm_medium=shortcut",
display_override: ["window-controls-overlay", "browser"],
prefer_related_applications: true,
related_applications: [
{
platform: "play",
url: "https://play.google.com/store/apps/details?id=com.example.app12",
id: "com.example.app1",
},
{
platform: "itunes",
url: "https://itunes.apple.com/app/example-app1/id123456789",
},
]
},
icons: {
favicons: true,
pwaIcon: true,
appleIcon: true,
appleStartup: true,
windowsTile: true,
yandex: true,
},
shortcuts: [
{
name: "New post",
url: "/compose/post?utm_source=jumplist&utm_medium=shortcut",
icon: "src/pwa/shortcuts/icon-compose.png",
}
],
screenshots: [
{
src: "src/pwa/screenshots/wide_2200x1650.png",
sizes: "1100x825",
form_factor: "wide",
platform: "webapp",
label: "Wide test"
},
{
src: "src/pwa/screenshots/iphone_pro_max_narrow.png",
form_factor: "narrow",
platform: "ios",
label: "Norow test"
}
],
manifestMaskable: true,
loadManifestWithCredentials: true,
cacheBustingQueryParam: 'v=1.0.0',
output: {
images: true,
files: true,
assetsPrefix: "https://www.example.com/assets/images"
},
version: "1.0.0"
})
]
});
Submit your issues or feedback on our GitHub channel.
MIT
FAQs
PWA and platform-specific asset generator for Astro projects.
The npm package @pwaset/astro receives a total of 0 weekly downloads. As such, @pwaset/astro popularity was classified as not popular.
We found that @pwaset/astro demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.