GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - haoliangwu/dsh-pwa: practical example about how to change dsh into PWA.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
docs
docs
 
 
lib
lib
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
cordis.patch.yml
cordis.patch.yml
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 
tsdown.config.ts
tsdown.config.ts
 
 

Repository files navigation

dsh-pwa

Makes a running `dsh web` instance installable as a PWA — manifest + service worker + icons, with `basePath` support for reverse-proxy deployments.

DeepSeek Harness PWA running as a standalone macOS app window

A pure host-side plugin for DeepSeek Harness. The web frontend already ships a manifest and favicon in its dist, but no service worker or SW registration script — so Chrome's installability check fails. This plugin fills that gap and lets the app be mounted under a reverse-proxy sub-path.

  • One-line install, no build step. lib/ and assets/ are committed — the git install just works.
  • Fills exactly one gap. The stock dist already ships a manifest and favicon; this plugin adds the missing service worker + registration script, so Chrome's installability check passes.
  • Reverse-proxy ready. Every route and URL is basePath-rooted, with normalization (''/'/' → /, /dsh → /dsh/, …) and ?/# rejected.
  • Five routes, zero per-request reads. manifest.webmanifest, sw.js, icon-192.png/icon-512.png, favicon.svg — static assets cached in the handler closure at apply time.

Install

dsh plugin --profile web add github:haoliangwu/dsh-pwa

Built lib/ and assets/ are committed, so the git install is one line — no prepare script, no build step. Restart dsh --profile web after install (bundle layer stacks compose at boot).

Configure

basePath defaults to / (install at the origin root). For a reverse-proxy deployment mounted at /dsh/, add the plugin to your profile's cordis.patch.yml (~/.dsh/profiles/web/cordis.patch.yml) via the insert form (the config-overlay form only tunes plugins already listed in dsh.profile.bundles):

- insert:
    - id: dsh-pwa
      name: dsh-pwa
      config:
        basePath: /dsh/

After a dsh plugin add install, the bare - id: dsh-pwa row is already in place; only append the config: block to tune basePath.

Normalization applies automatically: ''/'/' → '/', '/dsh' → '/dsh/', 'dsh/' → '/dsh/', '/dsh/' unchanged. Values containing ? or # are rejected.

How it works

On apply(ctx, config), the plugin registers five WebServer routes under ${basePath}pwa/*:

  • manifest.webmanifest → the web manifest, built in JS with basePath-rooted URLs, served as application/manifest+json
  • sw.js → assets/sw.js, served as text/javascript
  • icon-192.png / icon-512.png → assets/icon-192.png / assets/icon-512.png, served as image/png
  • favicon.svg → assets/favicon.svg, served as image/svg+xml

Each static asset is read once at apply time and cached in the handler closure (no per-request disk reads), and the returned disposers are released through ctx.effect so HMR/unload cleans up.

It also taps ctx.webServer.tapIndex(transform) to rewrite index.html:

  • repoints <link rel="manifest"> to ${basePath}pwa/manifest.webmanifest
  • repoints <link rel="icon" ...> to ${basePath}pwa/favicon.svg
  • injects before </body> a serviceWorker.register('${basePath}pwa/sw.js', { scope: '${basePath}' }) script

Verify

  1. Start dsh --profile web.
  2. Open Chrome DevTools → Application panel → Manifest. Confirm the name, icons (192/512/svg), and start_url/scope rooted at basePath.
  3. Application → Service Workers should list one active worker from ${basePath}pwa/sw.js.
  4. Open Lighthouse (or check Application → the installability banner) — the site should now pass the install checklist and show beforeinstallprompt on first visit.

Build from source

pnpm install
pnpm gen-icons   # regenerates assets/icon-192.png + assets/icon-512.png from assets/favicon.svg
pnpm build       # emits lib/index.js, lib/invariant.js
pnpm test        # config normalization + manifest/tapIndex unit tests

lib/ and assets/ are committed so git installs work without a build step. After changing source, run pnpm build (and pnpm gen-icons when the icon source changes) and commit both trees.

License

MIT

About

practical example about how to change dsh into PWA.

Topics

deepseek-harnessdeepseek-harness-plugin

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.