Giszmo / nostroid

A fast cross platform nostr client that even works offline
https://chat.nostr.info
Other
44 stars 11 forks source link

feat: migrate to pnpm and add vite-pwa-plugin #2

Closed userquin closed 2 years ago

userquin commented 2 years ago

This PR also includes:

The project will require Node 16.14+, SvelteKit requires at leat this version.

Node version should be managed with NVM, once installed a LTS version (I use 16.17.0) and selected in NVM, you must enable corepack: you can read https://github.com/antfu/contribute

To install dependencies just run pnpm install, to run scripts pnpm <script-name> or pnpm run <script-name>.

Use always a private window in chrome (or chromium based browser) when using dev server, this way the sw will be removed once the windows is closed.

By default, the applciation is configured to allow use the sw in development, and so, you can just make changes to the sw and once saved the application will be reloaded with the new one containing the chages (I have configured prompt for update, you can just ignore it, the sw is updated and your assets also reloaded, since they are not intercepted by the sw).

This behavior can be disabled. I will try to provide some stuff to allow start the dev server with or without the dev options of pwa plugin enabled.

About local pwa plugin stuff: I just include the vite-plugin-pwa with the fix to allow change the Rollup build type and the new SvelteKit integration (Rollup sequential hook).

Once the pwa plugin and the kit integration publised, just remove both dependencies and install the kit integration:

I've also patched the vite-plugin-pwa since there is 2 separated PR for iife and for Vite 3.1 (and we need last one for kit integration).