{"id":16839543,"url":"https://github.com/sigmasd/pwait","last_synced_at":"2026-05-19T00:32:45.106Z","repository":{"id":113562226,"uuid":"547874840","full_name":"sigmaSd/PwaIt","owner":"sigmaSd","description":"Script to kick start pwa app","archived":false,"fork":false,"pushed_at":"2024-05-19T09:58:56.000Z","size":56,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T19:45:07.483Z","etag":null,"topics":["deno","pwa"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigmaSd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-08T13:21:02.000Z","updated_at":"2024-05-19T09:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cad748c-be48-4043-9058-cf2a96d8c61e","html_url":"https://github.com/sigmaSd/PwaIt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FPwaIt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FPwaIt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FPwaIt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FPwaIt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigmaSd","download_url":"https://codeload.github.com/sigmaSd/PwaIt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257280,"owners_count":20424129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","pwa"],"created_at":"2024-10-13T12:32:47.558Z","updated_at":"2026-05-19T00:32:45.100Z","avatar_url":"https://github.com/sigmaSd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PwaIt\n\nScript to kick start pwa app\n\n## Usage\n\nRun on the root of your project\n\n```\ndeno run -r https://github.com/sigmaSd/PwaIt/raw/master/main.ts\n```\n\nThis will create `sw.js` and `pwa` folder.\n\nThe rest depends on your project, see the next section for examples.\n\n## Examples\n\n**Simple web app:**\n\n- Run the script inside the project root directory\n- Create `index.html`\n\n```html\n\u003chead\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003clink rel=\"manifest\" href=\"/pwa/manifest.json\" /\u003e\n\u003c/head\u003e\n\u003cscript defer src=\"/pwa/app.js\"\u003e\u003c/script\u003e\n\u003ch1\u003ehello\u003c/h1\u003e\n```\n\n- Start a server for example\n  `deno run -A https://deno.land/std/http/file_server.ts -p 8000`\n- Open `localhost:8000`\n\n**deno fresh project:**\n\n- Run the script inside the project root directory\n- The `./static` folder is special in fresh, as in all of its contents is dumped\n  to the root of the web page, so move the created assets to it, for example:\n  `mv pwa sw.js ./static` (make sure `./static` exists)\n- Add the needed manifest link + script in one of your entry routes for example\n  `routs/index.tsx` or `routes/_app.tsx`\n\n```jsx\nimport { Head } from \"$fresh/runtime.ts\";\n\nexport default function Home() {\n  return (\n    \u003cdiv\u003e\n      \u003cHead\u003e\n        \u003clink rel=\"manifest\" href=\"/pwa/manifest.json\" /\u003e\n      \u003c/Head\u003e\n      \u003cscript defer src=\"/pwa/app.js\" /\u003e\n      \u003cbutton\u003eOk!\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n- Run `deno task start`\n- open `localhost:8000`\n\n**Svelte**\n\n- Move the created pwa and sw.js to `public` folder\n- Copy the relevent lines from `index.html` from the `Simple web app` to svelte\n  index.html\n\n## Offline usage\n\nThe app will cache all requests by default whenever there is network so it can\nwork offline. This behaviour is defined in `sw.js`. When a network connection is\navailable it will automaticly override the cache with the newer remote resources.\n\n## Tips\n\n- For developping, use chromium\n- For installing the application on mobile use chrome, it has the most advanced\n  implementation\n\n- Open `localhost:8000` not `0.0.0.0:8000` pwa are sensitive to insecure pages\n- If you hack on `sw.js` sometimes bug happens and you have to manually unregister the service\n  worker. To do that go to the site, open the console and unregister the service\n  worker in the Application tab, in android chrome go to settings, and click on\n  clear site date\n- Firefox doesn't prompt for installing PWAs like chrome, instead it shows on the right menu \"Add app to Home screen\" instead of the \"Add to home screen\" for non pwa sites.\n\n## Why\n\nTo have a nice loading screen on mobile, also support for\n[share-target](https://web.dev/web-share-target/) and other pwa APIs.\n\nhttps://github.com/sigmaSd/ytdlf\n![ytdown](https://user-images.githubusercontent.com/22427111/194713700-d9b7a592-4165-4b3b-b5eb-f370785c1f22.png)\n\n## More examples\n\n- https://github.com/sigmaSd/datediff https://datediff.deno.dev/\n- https://github.com/sigmaSd/magic-cam https://magic-cam.deno.dev/\n\n## More Info about PWA\n- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps\n- https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Offline_Service_workers\n- https://whatpwacando.today/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmasd%2Fpwait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigmasd%2Fpwait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmasd%2Fpwait/lists"}