@stacksjs/docs 0.66.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -4
- package/package.json +8 -10
- package/dist/index.js.map +0 -13
- package/src/index.ts +0 -71
- package/src/meta.ts +0 -31
- package/src/plugins.ts +0 -4
- package/src/scripts/pwa.ts +0 -118
package/dist/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{alias as
|
|
3
|
-
|
|
4
|
-
//# debugId=CCB439C2DDB1221664756E2164756E21
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import{alias as p}from"@stacksjs/alias";import{kolorist as s}from"@stacksjs/cli";import{docs as c}from"@stacksjs/config";import{path as r}from"@stacksjs/path";import{server as h}from"@stacksjs/server";import{withPwa as j}from"@vite-pwa/vitepress";import{defineConfig as y}from"vitepress";var e="0.68.0";import{docs as t}from"@stacksjs/config";import{frameworkPath as m}from"@stacksjs/path";var D="https://fonts.googleapis.com",I="https://fonts.gstatic.com",O="https://fonts.googleapis.com/css2?family=Readex+Pro:wght@200;400;600&display=swap",q="https://stacksjs.org/",z="https://stacksjs.org/og.png",A="https://github.com/stacksjs/stacks",C="https://github.com/stacksjs/stacks/releases",G="https://github.com/stacksjs/stacks/blob/main/CONTRIBUTING.md",H="https://chat.stacksjs.org",J="https://twitter.com/stacksjs",K=["https://fonts.googleapis.com","https://fonts.gstatic.com"],L=["https://fonts.googleapis.com","https://fonts.gstatic.com"],i=new RegExp("^https://fonts.googleapis.com/.*","i"),d=new RegExp("^https://fonts.gstatic.com/.*","i"),u=/^https:\/\/((i.ibb.co)|((raw|user-images).githubusercontent.com))\/.*/i;var k={outDir:m("docs/dist"),registerType:"autoUpdate",manifest:{id:"/",name:t.title,short_name:t.title,description:t.description,theme_color:"#ffffff",start_url:"/",lang:"en-US",dir:"ltr",orientation:"natural",display:"standalone",display_override:["window-controls-overlay"],categories:["development","developer tools"],icons:[{src:"pwa-64x64.png",sizes:"64x64",type:"image/png"},{src:"pwa-192x192.png",sizes:"192x192",type:"image/png"},{src:"pwa-512x512.png",sizes:"512x512",type:"image/png",purpose:"any"},{src:"maskable-icon.png",sizes:"512x512",type:"image/png",purpose:"maskable"}],screenshots:[{src:"og.png",sizes:"2258x1185",type:"image/png",label:`Screenshot of ${t.title}`}],handle_links:"preferred",launch_handler:{client_mode:["navigate-existing","auto"]},edge_side_panel:{preferred_width:480}},workbox:{navigateFallbackDenylist:[/^\/new$/],maximumFileSizeToCacheInBytes:3145728,globPatterns:["**/*.{css,js,html,png,svg,ico,txt,woff2,json}"],dontCacheBustURLsMatching:/^assets\//,runtimeCaching:[{urlPattern:i,handler:"CacheFirst",options:{cacheName:"google-fonts-cache",expiration:{maxEntries:10,maxAgeSeconds:31536000},cacheableResponse:{statuses:[0,200]}}},{urlPattern:d,handler:"CacheFirst",options:{cacheName:"gstatic-fonts-cache",expiration:{maxEntries:10,maxAgeSeconds:31536000},cacheableResponse:{statuses:[0,200]}}},{urlPattern:u,handler:"CacheFirst",options:{cacheName:"githubusercontent-images-cache",expiration:{maxEntries:10,maxAgeSeconds:31536000},cacheableResponse:{statuses:[0,200]}}}]},experimental:{includeAllowlist:!0}};import{transformerTwoslash as Z}from"vitepress-plugin-twoslash";import $ from"vitepress-plugin-twoslash/client";var E={base:"/docs/",cleanUrls:!0,srcDir:r.projectPath("docs"),outDir:r.storagePath("framework/docs"),cacheDir:r.storagePath("framework/cache/docs"),assetsDir:"/assets",vite:{envDir:r.projectPath(),envPrefix:"FRONTEND_",server:h({type:"docs"}),resolve:{alias:p},plugins:[{name:"stacks-plugin",configureServer(o){o.printUrls=()=>{console.log(` ${s.blue(s.bold("STACKS"))} ${s.blue(e)}`),console.log(` ${s.green("\u279C")} ${s.bold("Docs")}: ${s.green("https://stacks.localhost/docs")}`),console.log(` ${s.green("\u279C")} ${s.bold("Temp URL")}: ${s.green("http://stacksjs.test:3000")}`)}}}]},pwa:k},B={...E,...c},M=j(y(B)),ts=M;export{J as twitter,Z as transformerTwoslash,C as releases,i as pwaFontsRegex,d as pwaFontStylesRegex,k as pwaDocs,K as preconnectLinks,L as preconnectHomeLinks,q as ogUrl,z as ogImage,I as gstatic,D as googleapis,u as githubusercontentRegex,A as github,E as frameworkDefaults,O as font,H as discord,ts as default,G as contributing,$ as TwoSlashFloatingVue};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.68.0",
|
|
5
5
|
"description": "The Stacks way to document.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -19,32 +19,30 @@
|
|
|
19
19
|
"keywords": ["docs", "utilities", "functions", "stacks"],
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
-
"bun": "./src/index.ts",
|
|
23
22
|
"import": "./dist/index.js"
|
|
24
23
|
},
|
|
25
24
|
"./*": {
|
|
26
|
-
"bun": "./src/*",
|
|
27
25
|
"import": "./dist/*"
|
|
28
26
|
}
|
|
29
27
|
},
|
|
30
28
|
"module": "dist/index.js",
|
|
31
29
|
"types": "dist/index.d.ts",
|
|
32
|
-
"files": ["README.md", "dist"
|
|
30
|
+
"files": ["README.md", "dist"],
|
|
33
31
|
"scripts": {
|
|
34
32
|
"build": "bun build.ts",
|
|
35
33
|
"typecheck": "bun tsc --noEmit",
|
|
36
34
|
"prepublishOnly": "bun run build"
|
|
37
35
|
},
|
|
38
36
|
"dependencies": {
|
|
39
|
-
"@stacksjs/alias": "0.
|
|
40
|
-
"@stacksjs/config": "0.
|
|
41
|
-
"@stacksjs/path": "0.
|
|
42
|
-
"@stacksjs/server": "0.
|
|
43
|
-
"vitepress": "1.4.
|
|
37
|
+
"@stacksjs/alias": "0.67.0",
|
|
38
|
+
"@stacksjs/config": "0.67.0",
|
|
39
|
+
"@stacksjs/path": "0.67.0",
|
|
40
|
+
"@stacksjs/server": "0.67.0",
|
|
41
|
+
"vitepress": "1.4.1",
|
|
44
42
|
"vitepress-plugin-twoslash": "^0.10.2"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
|
-
"@stacksjs/development": "0.
|
|
45
|
+
"@stacksjs/development": "0.67.0",
|
|
48
46
|
"@vite-pwa/assets-generator": "^0.2.6",
|
|
49
47
|
"@vite-pwa/vitepress": "^0.5.3"
|
|
50
48
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/scripts/pwa.ts", "../src/meta.ts", "../src/plugins.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { ViteDevServer } from 'vite'\nimport type { DefaultTheme, UserConfigExport, UserConfig as VitePressConfig } from 'vitepress'\nimport { alias } from '@stacksjs/alias'\nimport { kolorist as c } from '@stacksjs/cli'\nimport { docs } from '@stacksjs/config'\nimport { path as p } from '@stacksjs/path'\nimport { server } from '@stacksjs/server'\nimport { withPwa } from '@vite-pwa/vitepress'\nimport { defineConfig } from 'vitepress'\nimport { version } from '../package.json'\nimport { pwaDocs as pwa } from './scripts/pwa'\n\nexport const frameworkDefaults: VitePressConfig = {\n base: '/docs/',\n cleanUrls: true,\n srcDir: p.projectPath('docs'),\n outDir: p.storagePath('framework/docs'),\n cacheDir: p.storagePath('framework/cache/docs'),\n assetsDir: '/assets',\n // sitemap: {\n // hostname: 'stacks.localhost',\n // },\n\n vite: {\n envDir: p.projectPath(),\n envPrefix: 'FRONTEND_',\n\n server: server({\n type: 'docs',\n }),\n\n resolve: {\n alias,\n },\n\n plugins: [\n {\n name: 'stacks-plugin',\n configureServer(server: ViteDevServer) {\n // const base = server.config.base || '/'\n // const _print = server.printUrls\n server.printUrls = () => {\n // eslint-disable-next-line no-console\n console.log(` ${c.blue(c.bold('STACKS'))} ${c.blue(version)}`)\n\n // console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green('http://stacks.localhost:3000/docs')}`)\n // eslint-disable-next-line no-console\n console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green('https://stacks.localhost/docs')}`)\n // eslint-disable-next-line no-console\n console.log(` ${c.green('➜')} ${c.bold('Temp URL')}: ${c.green('http://stacksjs.test:3000')}`)\n }\n },\n },\n ],\n },\n\n pwa,\n}\n\nconst combinedConfig: VitePressConfig = {\n ...frameworkDefaults,\n ...docs,\n}\n\nexport * from './meta'\nexport * from './plugins'\nexport * from './scripts/pwa'\n\nconst conf: Promise<UserConfigExport<DefaultTheme.Config>> = withPwa(defineConfig(combinedConfig))\n\nexport default conf\n",
|
|
6
|
-
"import type { PwaOptions } from '@vite-pwa/vitepress'\nimport { docs } from '@stacksjs/config'\nimport { frameworkPath } from '@stacksjs/path'\nimport { githubusercontentRegex, pwaFontsRegex, pwaFontStylesRegex } from '../meta'\n\nexport const pwaDocs: PwaOptions = {\n outDir: frameworkPath('docs/dist'),\n registerType: 'autoUpdate',\n // include all static assets under public/\n manifest: {\n id: '/',\n name: docs.title,\n short_name: docs.title,\n description: docs.description,\n theme_color: '#ffffff',\n start_url: '/',\n lang: 'en-US',\n dir: 'ltr',\n orientation: 'natural',\n display: 'standalone',\n display_override: ['window-controls-overlay'],\n categories: ['development', 'developer tools'],\n icons: [\n {\n src: 'pwa-64x64.png',\n sizes: '64x64',\n type: 'image/png',\n },\n {\n src: 'pwa-192x192.png',\n sizes: '192x192',\n type: 'image/png',\n },\n {\n src: 'pwa-512x512.png',\n sizes: '512x512',\n type: 'image/png',\n purpose: 'any',\n },\n {\n src: 'maskable-icon.png',\n sizes: '512x512',\n type: 'image/png',\n purpose: 'maskable',\n },\n ],\n screenshots: [\n {\n src: 'og.png',\n sizes: '2258x1185',\n type: 'image/png',\n label: `Screenshot of ${docs.title}`,\n },\n ],\n handle_links: 'preferred',\n launch_handler: {\n client_mode: ['navigate-existing', 'auto'],\n },\n edge_side_panel: {\n preferred_width: 480,\n },\n },\n workbox: {\n navigateFallbackDenylist: [/^\\/new$/],\n // warning: sponsors/antfu.svg is 2.51 MB, and won't be precached\n maximumFileSizeToCacheInBytes: 3 * 1024 * 1024, // <== 3MB\n globPatterns: ['**/*.{css,js,html,png,svg,ico,txt,woff2,json}'],\n // Rollup 4 change the layout: don't calculate revision (hash)\n dontCacheBustURLsMatching: /^assets\\//,\n runtimeCaching: [\n {\n urlPattern: pwaFontsRegex,\n handler: 'CacheFirst',\n options: {\n cacheName: 'google-fonts-cache',\n expiration: {\n maxEntries: 10,\n maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days\n },\n cacheableResponse: {\n statuses: [0, 200],\n },\n },\n },\n {\n urlPattern: pwaFontStylesRegex,\n handler: 'CacheFirst',\n options: {\n cacheName: 'gstatic-fonts-cache',\n expiration: {\n maxEntries: 10,\n maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days\n },\n cacheableResponse: {\n statuses: [0, 200],\n },\n },\n },\n {\n urlPattern: githubusercontentRegex,\n handler: 'CacheFirst',\n options: {\n cacheName: 'githubusercontent-images-cache',\n expiration: {\n maxEntries: 10,\n maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days\n },\n cacheableResponse: {\n statuses: [0, 200],\n },\n },\n },\n ],\n },\n experimental: {\n includeAllowlist: true,\n },\n}\n",
|
|
7
|
-
"// noinspection ES6PreferShortImport: IntelliJ IDE hint to avoid warning to use `~/contributors`, will fail on build if changed\n\n/* Texts */\n// export const stacksName = 'Stacks'\n// export const stacksShortName = 'Stacks'\n// export const stacksDescription = 'Rapid application, cloud & library development framework'\n\n/* CDN fonts and styles */\nexport const googleapis = 'https://fonts.googleapis.com'\nexport const gstatic = 'https://fonts.gstatic.com'\nexport const font = `${googleapis}/css2?family=Readex+Pro:wght@200;400;600&display=swap`\n\n/* vitepress head */\nexport const ogUrl = 'https://stacksjs.org/'\nexport const ogImage = `${ogUrl}og.png`\n\n/* GitHub and social links */\nexport const github = 'https://github.com/stacksjs/stacks'\nexport const releases = 'https://github.com/stacksjs/stacks/releases'\nexport const contributing = 'https://github.com/stacksjs/stacks/blob/main/CONTRIBUTING.md'\nexport const discord = 'https://chat.stacksjs.org'\nexport const twitter = 'https://twitter.com/stacksjs'\n\n/* Avatar/Image/Sponsors servers */\nexport const preconnectLinks = [googleapis, gstatic]\nexport const preconnectHomeLinks = [googleapis, gstatic]\n\n/* PWA runtime caching urlPattern regular expressions */\nexport const pwaFontsRegex = new RegExp(`^${googleapis}/.*`, 'i')\nexport const pwaFontStylesRegex = new RegExp(`^${gstatic}/.*`, 'i')\nexport const githubusercontentRegex = /^https:\\/\\/((i.ibb.co)|((raw|user-images).githubusercontent.com))\\/.*/i\n",
|
|
8
|
-
"import { transformerTwoslash } from 'vitepress-plugin-twoslash'\nimport TwoSlashFloatingVue from 'vitepress-plugin-twoslash/client'\n\nexport { transformerTwoslash, TwoSlashFloatingVue }\n"
|
|
9
|
-
],
|
|
10
|
-
"mappings": "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",
|
|
11
|
-
"debugId": "CCB439C2DDB1221664756E2164756E21",
|
|
12
|
-
"names": []
|
|
13
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from 'vite'
|
|
2
|
-
import type { DefaultTheme, UserConfigExport, UserConfig as VitePressConfig } from 'vitepress'
|
|
3
|
-
import { alias } from '@stacksjs/alias'
|
|
4
|
-
import { kolorist as c } from '@stacksjs/cli'
|
|
5
|
-
import { docs } from '@stacksjs/config'
|
|
6
|
-
import { path as p } from '@stacksjs/path'
|
|
7
|
-
import { server } from '@stacksjs/server'
|
|
8
|
-
import { withPwa } from '@vite-pwa/vitepress'
|
|
9
|
-
import { defineConfig } from 'vitepress'
|
|
10
|
-
import { version } from '../package.json'
|
|
11
|
-
import { pwaDocs as pwa } from './scripts/pwa'
|
|
12
|
-
|
|
13
|
-
export const frameworkDefaults: VitePressConfig = {
|
|
14
|
-
base: '/docs/',
|
|
15
|
-
cleanUrls: true,
|
|
16
|
-
srcDir: p.projectPath('docs'),
|
|
17
|
-
outDir: p.storagePath('framework/docs'),
|
|
18
|
-
cacheDir: p.storagePath('framework/cache/docs'),
|
|
19
|
-
assetsDir: '/assets',
|
|
20
|
-
// sitemap: {
|
|
21
|
-
// hostname: 'stacks.localhost',
|
|
22
|
-
// },
|
|
23
|
-
|
|
24
|
-
vite: {
|
|
25
|
-
envDir: p.projectPath(),
|
|
26
|
-
envPrefix: 'FRONTEND_',
|
|
27
|
-
|
|
28
|
-
server: server({
|
|
29
|
-
type: 'docs',
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
resolve: {
|
|
33
|
-
alias,
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
plugins: [
|
|
37
|
-
{
|
|
38
|
-
name: 'stacks-plugin',
|
|
39
|
-
configureServer(server: ViteDevServer) {
|
|
40
|
-
// const base = server.config.base || '/'
|
|
41
|
-
// const _print = server.printUrls
|
|
42
|
-
server.printUrls = () => {
|
|
43
|
-
// eslint-disable-next-line no-console
|
|
44
|
-
console.log(` ${c.blue(c.bold('STACKS'))} ${c.blue(version)}`)
|
|
45
|
-
|
|
46
|
-
// console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green('http://stacks.localhost:3000/docs')}`)
|
|
47
|
-
// eslint-disable-next-line no-console
|
|
48
|
-
console.log(` ${c.green('➜')} ${c.bold('Docs')}: ${c.green('https://stacks.localhost/docs')}`)
|
|
49
|
-
// eslint-disable-next-line no-console
|
|
50
|
-
console.log(` ${c.green('➜')} ${c.bold('Temp URL')}: ${c.green('http://stacksjs.test:3000')}`)
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
pwa,
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const combinedConfig: VitePressConfig = {
|
|
61
|
-
...frameworkDefaults,
|
|
62
|
-
...docs,
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export * from './meta'
|
|
66
|
-
export * from './plugins'
|
|
67
|
-
export * from './scripts/pwa'
|
|
68
|
-
|
|
69
|
-
const conf: Promise<UserConfigExport<DefaultTheme.Config>> = withPwa(defineConfig(combinedConfig))
|
|
70
|
-
|
|
71
|
-
export default conf
|
package/src/meta.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// noinspection ES6PreferShortImport: IntelliJ IDE hint to avoid warning to use `~/contributors`, will fail on build if changed
|
|
2
|
-
|
|
3
|
-
/* Texts */
|
|
4
|
-
// export const stacksName = 'Stacks'
|
|
5
|
-
// export const stacksShortName = 'Stacks'
|
|
6
|
-
// export const stacksDescription = 'Rapid application, cloud & library development framework'
|
|
7
|
-
|
|
8
|
-
/* CDN fonts and styles */
|
|
9
|
-
export const googleapis = 'https://fonts.googleapis.com'
|
|
10
|
-
export const gstatic = 'https://fonts.gstatic.com'
|
|
11
|
-
export const font = `${googleapis}/css2?family=Readex+Pro:wght@200;400;600&display=swap`
|
|
12
|
-
|
|
13
|
-
/* vitepress head */
|
|
14
|
-
export const ogUrl = 'https://stacksjs.org/'
|
|
15
|
-
export const ogImage = `${ogUrl}og.png`
|
|
16
|
-
|
|
17
|
-
/* GitHub and social links */
|
|
18
|
-
export const github = 'https://github.com/stacksjs/stacks'
|
|
19
|
-
export const releases = 'https://github.com/stacksjs/stacks/releases'
|
|
20
|
-
export const contributing = 'https://github.com/stacksjs/stacks/blob/main/CONTRIBUTING.md'
|
|
21
|
-
export const discord = 'https://chat.stacksjs.org'
|
|
22
|
-
export const twitter = 'https://twitter.com/stacksjs'
|
|
23
|
-
|
|
24
|
-
/* Avatar/Image/Sponsors servers */
|
|
25
|
-
export const preconnectLinks = [googleapis, gstatic]
|
|
26
|
-
export const preconnectHomeLinks = [googleapis, gstatic]
|
|
27
|
-
|
|
28
|
-
/* PWA runtime caching urlPattern regular expressions */
|
|
29
|
-
export const pwaFontsRegex = new RegExp(`^${googleapis}/.*`, 'i')
|
|
30
|
-
export const pwaFontStylesRegex = new RegExp(`^${gstatic}/.*`, 'i')
|
|
31
|
-
export const githubusercontentRegex = /^https:\/\/((i.ibb.co)|((raw|user-images).githubusercontent.com))\/.*/i
|
package/src/plugins.ts
DELETED
package/src/scripts/pwa.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import type { PwaOptions } from '@vite-pwa/vitepress'
|
|
2
|
-
import { docs } from '@stacksjs/config'
|
|
3
|
-
import { frameworkPath } from '@stacksjs/path'
|
|
4
|
-
import { githubusercontentRegex, pwaFontsRegex, pwaFontStylesRegex } from '../meta'
|
|
5
|
-
|
|
6
|
-
export const pwaDocs: PwaOptions = {
|
|
7
|
-
outDir: frameworkPath('docs/dist'),
|
|
8
|
-
registerType: 'autoUpdate',
|
|
9
|
-
// include all static assets under public/
|
|
10
|
-
manifest: {
|
|
11
|
-
id: '/',
|
|
12
|
-
name: docs.title,
|
|
13
|
-
short_name: docs.title,
|
|
14
|
-
description: docs.description,
|
|
15
|
-
theme_color: '#ffffff',
|
|
16
|
-
start_url: '/',
|
|
17
|
-
lang: 'en-US',
|
|
18
|
-
dir: 'ltr',
|
|
19
|
-
orientation: 'natural',
|
|
20
|
-
display: 'standalone',
|
|
21
|
-
display_override: ['window-controls-overlay'],
|
|
22
|
-
categories: ['development', 'developer tools'],
|
|
23
|
-
icons: [
|
|
24
|
-
{
|
|
25
|
-
src: 'pwa-64x64.png',
|
|
26
|
-
sizes: '64x64',
|
|
27
|
-
type: 'image/png',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
src: 'pwa-192x192.png',
|
|
31
|
-
sizes: '192x192',
|
|
32
|
-
type: 'image/png',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
src: 'pwa-512x512.png',
|
|
36
|
-
sizes: '512x512',
|
|
37
|
-
type: 'image/png',
|
|
38
|
-
purpose: 'any',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
src: 'maskable-icon.png',
|
|
42
|
-
sizes: '512x512',
|
|
43
|
-
type: 'image/png',
|
|
44
|
-
purpose: 'maskable',
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
screenshots: [
|
|
48
|
-
{
|
|
49
|
-
src: 'og.png',
|
|
50
|
-
sizes: '2258x1185',
|
|
51
|
-
type: 'image/png',
|
|
52
|
-
label: `Screenshot of ${docs.title}`,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
handle_links: 'preferred',
|
|
56
|
-
launch_handler: {
|
|
57
|
-
client_mode: ['navigate-existing', 'auto'],
|
|
58
|
-
},
|
|
59
|
-
edge_side_panel: {
|
|
60
|
-
preferred_width: 480,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
workbox: {
|
|
64
|
-
navigateFallbackDenylist: [/^\/new$/],
|
|
65
|
-
// warning: sponsors/antfu.svg is 2.51 MB, and won't be precached
|
|
66
|
-
maximumFileSizeToCacheInBytes: 3 * 1024 * 1024, // <== 3MB
|
|
67
|
-
globPatterns: ['**/*.{css,js,html,png,svg,ico,txt,woff2,json}'],
|
|
68
|
-
// Rollup 4 change the layout: don't calculate revision (hash)
|
|
69
|
-
dontCacheBustURLsMatching: /^assets\//,
|
|
70
|
-
runtimeCaching: [
|
|
71
|
-
{
|
|
72
|
-
urlPattern: pwaFontsRegex,
|
|
73
|
-
handler: 'CacheFirst',
|
|
74
|
-
options: {
|
|
75
|
-
cacheName: 'google-fonts-cache',
|
|
76
|
-
expiration: {
|
|
77
|
-
maxEntries: 10,
|
|
78
|
-
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
|
|
79
|
-
},
|
|
80
|
-
cacheableResponse: {
|
|
81
|
-
statuses: [0, 200],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
urlPattern: pwaFontStylesRegex,
|
|
87
|
-
handler: 'CacheFirst',
|
|
88
|
-
options: {
|
|
89
|
-
cacheName: 'gstatic-fonts-cache',
|
|
90
|
-
expiration: {
|
|
91
|
-
maxEntries: 10,
|
|
92
|
-
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
|
|
93
|
-
},
|
|
94
|
-
cacheableResponse: {
|
|
95
|
-
statuses: [0, 200],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
urlPattern: githubusercontentRegex,
|
|
101
|
-
handler: 'CacheFirst',
|
|
102
|
-
options: {
|
|
103
|
-
cacheName: 'githubusercontent-images-cache',
|
|
104
|
-
expiration: {
|
|
105
|
-
maxEntries: 10,
|
|
106
|
-
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
|
|
107
|
-
},
|
|
108
|
-
cacheableResponse: {
|
|
109
|
-
statuses: [0, 200],
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
experimental: {
|
|
116
|
-
includeAllowlist: true,
|
|
117
|
-
},
|
|
118
|
-
}
|