chore(web): remove obsolete PWA assets (#40082)

This commit is contained in:
yyh
2026-08-06 15:41:01 +08:00
committed by GitHub
parent cf88aef710
commit dc309ced59
20 changed files with 4 additions and 286 deletions
+4 -17
View File
@@ -552,9 +552,6 @@ catalogs:
server-only:
specifier: 0.0.1
version: 0.0.1
sharp:
specifier: 0.35.3
version: 0.35.3
shiki:
specifier: 4.4.2
version: 4.4.2
@@ -1443,9 +1440,6 @@ importers:
server-only:
specifier: 'catalog:'
version: 0.0.1
sharp:
specifier: 'catalog:'
version: 0.35.3(@types/node@25.9.5)
shiki:
specifier: 'catalog:'
version: 4.4.2
@@ -1978,9 +1972,6 @@ packages:
'@emnapi/core@1.9.2':
resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==}
'@emnapi/runtime@1.11.1':
resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==}
'@emnapi/runtime@1.11.2':
resolution: {integrity: sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==}
@@ -9738,11 +9729,6 @@ snapshots:
tslib: 2.8.1
optional: true
'@emnapi/runtime@1.11.1':
dependencies:
tslib: 2.8.1
optional: true
'@emnapi/runtime@1.11.2':
dependencies:
tslib: 2.8.1
@@ -10175,7 +10161,8 @@ snapshots:
'@iconify/types': 2.0.0
import-meta-resolve: 4.2.0
'@img/colour@1.1.0': {}
'@img/colour@1.1.0':
optional: true
'@img/sharp-darwin-arm64@0.35.3':
optionalDependencies:
@@ -10264,7 +10251,7 @@ snapshots:
'@img/sharp-wasm32@0.35.3':
dependencies:
'@emnapi/runtime': 1.11.1
'@emnapi/runtime': 1.11.2
optional: true
'@img/sharp-webcontainers-wasm32@0.35.3':
@@ -16705,6 +16692,7 @@ snapshots:
'@img/sharp-win32-ia32': 0.35.3
'@img/sharp-win32-x64': 0.35.3
'@types/node': 25.9.5
optional: true
shebang-command@2.0.0:
dependencies:
@@ -18031,7 +18019,6 @@ time:
remark-directive@4.0.0: '2025-02-27T15:15:20.630Z'
scheduler@0.27.0: '2025-10-01T21:39:15.208Z'
server-only@0.0.1: '2022-09-03T01:07:26.139Z'
sharp@0.35.3: '2026-07-01T11:28:34.077Z'
shiki@4.4.2: '2026-08-05T00:41:14.729Z'
socket.io-client@4.8.3: '2025-12-23T16:39:16.428Z'
sortablejs@1.15.7: '2026-02-11T22:42:31.720Z'
-1
View File
@@ -233,7 +233,6 @@ catalog:
remark-directive: 4.0.0
scheduler: 0.27.0
server-only: 0.0.1
sharp: 0.35.3
shiki: 4.4.2
socket.io-client: 4.8.3
sortablejs: 1.15.7
-7
View File
@@ -56,12 +56,5 @@ package-lock.json
mise.toml
# PWA generated files
public/sw.js
public/sw.js.map
public/workbox-*.js
public/workbox-*.js.map
public/fallback-*.js
.vscode/settings.json
.vscode/mcp.json

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

-12
View File
@@ -44,18 +44,6 @@ export default async function RootLayout({ children }: { children: React.ReactNo
return (
<html lang={locale ?? 'en'} className="h-full" suppressHydrationWarning>
<head>
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#1C64F2" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="Dify" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/icon-192x192.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/icon-192x192.png" />
<meta name="msapplication-TileColor" content="#1C64F2" />
<meta name="msapplication-config" content="/browserconfig.xml" />
<ReactScanLoader />
</head>
<body className="h-full bg-background-body" {...datasetMap}>
-1
View File
@@ -129,7 +129,6 @@
"remark-directive": "catalog:",
"scheduler": "catalog:",
"server-only": "catalog:",
"sharp": "catalog:",
"shiki": "catalog:",
"socket.io-client": "catalog:",
"sortablejs": "catalog:",
-128
View File
@@ -1,128 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dify - Offline</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
color: white;
text-align: center;
padding: 20px;
}
.container {
max-width: 600px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 40px;
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}
.icon {
width: 100px;
height: 100px;
margin: 0 auto 30px;
background: rgba(255, 255, 255, 0.2);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 48px;
}
h1 {
font-size: 32px;
font-weight: 600;
margin-bottom: 15px;
}
p {
font-size: 18px;
line-height: 1.6;
opacity: 0.9;
margin-bottom: 30px;
}
button {
background: white;
color: #764ba2;
border: none;
padding: 15px 30px;
font-size: 16px;
font-weight: 600;
border-radius: 50px;
cursor: pointer;
transition:
transform 0.2s,
box-shadow 0.2s;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
button:active {
transform: translateY(0);
}
@media (max-width: 640px) {
.container {
padding: 30px;
}
h1 {
font-size: 24px;
}
p {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="icon"></div>
<h1>You're Offline</h1>
<p>
It looks like you've lost your internet connection. Some features may not be available until
you're back online.
</p>
<button onclick="window.location.reload()">Try Again</button>
</div>
<script>
// Check for connection status changes
window.addEventListener('online', function () {
window.location.reload()
})
// Periodically check if online
setInterval(function () {
fetch(window.location.origin, { method: 'HEAD' })
.then(function () {
window.location.reload()
})
.catch(function () {
// Still offline
})
}, 5000)
</script>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/icon-72x72.png"/>
<square150x150logo src="/icon-152x152.png"/>
<square310x310logo src="/icon-512x512.png"/>
<TileColor>#1C64F2</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

-58
View File
@@ -1,58 +0,0 @@
{
"name": "Dify",
"short_name": "Dify",
"description": "Build Production Ready Agentic AI Solutions",
"icons": [
{
"src": "/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#1C64F2",
"background_color": "#ffffff",
"display": "standalone",
"scope": "/",
"start_url": "/",
"orientation": "portrait-primary",
"categories": ["productivity", "utilities", "developer"],
"lang": "en-US",
"dir": "ltr",
"prefer_related_applications": false,
"shortcuts": [
{
"name": "Apps",
"short_name": "Apps",
"url": "/apps",
"icons": [{ "src": "/icon-96x96.png", "sizes": "96x96" }]
},
{
"name": "Datasets",
"short_name": "Datasets",
"url": "/datasets",
"icons": [{ "src": "/icon-96x96.png", "sizes": "96x96" }]
}
]
}
-51
View File
@@ -1,51 +0,0 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import sharp from 'sharp'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const sizes = [
{ size: 192, name: 'icon-192x192.png' },
{ size: 256, name: 'icon-256x256.png' },
{ size: 384, name: 'icon-384x384.png' },
{ size: 512, name: 'icon-512x512.png' },
{ size: 96, name: 'icon-96x96.png' },
{ size: 72, name: 'icon-72x72.png' },
{ size: 128, name: 'icon-128x128.png' },
{ size: 144, name: 'icon-144x144.png' },
{ size: 152, name: 'icon-152x152.png' },
]
const inputPath = path.join(__dirname, '../public/icon.svg')
const outputDir = path.join(__dirname, '../public')
// Generate icons
async function generateIcons() {
try {
console.log('Generating PWA icons...')
for (const { size, name } of sizes) {
const outputPath = path.join(outputDir, name)
await sharp(inputPath).resize(size, size).png().toFile(outputPath)
console.log(`✓ Generated ${name} (${size}x${size})`)
}
// Generate apple-touch-icon
await sharp(inputPath)
.resize(180, 180)
.png()
.toFile(path.join(outputDir, 'apple-touch-icon.png'))
console.log('✓ Generated apple-touch-icon.png (180x180)')
console.log('\n✅ All icons generated successfully!')
} catch (error) {
console.error('Error generating icons:', error)
process.exit(1)
}
}
generateIcons()