From a5314e59238b3e47519f8a5476a703be81288ed0 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Mon, 27 Mar 2023 20:26:49 +0200 Subject: [PATCH] Use nanostores for saving instances --- package.json | 4 +++- pnpm-lock.yaml | 18 ++++++++++++++ src/components/instance-select.astro | 35 +++++++--------------------- src/stores/saved-instances.ts | 21 +++++++++++++++++ svelte.config.js | 5 ++++ tsconfig.json | 1 + 6 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 src/stores/saved-instances.ts create mode 100644 svelte.config.js diff --git a/package.json b/package.json index e0d5285..b8c475c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "@astrojs/netlify": "^2.2.0", "@astrojs/node": "^5.1.0", "@astrojs/vercel": "^3.2.1", - "astro": "^2.1.7" + "@nanostores/persistent": "^0.7.0", + "astro": "^2.1.7", + "nanostores": "^0.7.4" }, "devDependencies": { "@types/node": "^18.15.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 469de1c..1fddf83 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,7 @@ specifiers: '@astrojs/netlify': ^2.2.0 '@astrojs/node': ^5.1.0 '@astrojs/vercel': ^3.2.1 + '@nanostores/persistent': ^0.7.0 '@types/node': ^18.15.10 '@typescript-eslint/eslint-plugin': ^5.57.0 '@typescript-eslint/parser': ^5.57.0 @@ -15,6 +16,7 @@ specifiers: eslint-config-prettier: ^8.8.0 eslint-plugin-astro: ^0.26.1 eslint-plugin-unicorn: ^46.0.0 + nanostores: ^0.7.4 postcss: ^8.4.21 postcss-csso: ^6.0.1 prettier: ^2.8.7 @@ -31,7 +33,9 @@ dependencies: '@astrojs/netlify': 2.2.0_astro@2.1.7 '@astrojs/node': 5.1.0_astro@2.1.7 '@astrojs/vercel': 3.2.1_astro@2.1.7 + '@nanostores/persistent': 0.7.0_nanostores@0.7.4 astro: 2.1.7_zfwagalafqqey6uoinf67yy4wu + nanostores: 0.7.4 devDependencies: '@types/node': 18.15.10 @@ -803,6 +807,15 @@ packages: - supports-color dev: false + /@nanostores/persistent/0.7.0_nanostores@0.7.4: + resolution: {integrity: sha512-4PAInL/T1hbftZUJ0cmgdFHBMalUoq7BUXFBy7QfyMv/8X3LPTYNh/yxspL7+J+XM3UNvVI7IFRMMs6FBasjhQ==} + engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} + peerDependencies: + nanostores: ^0.7.0 + dependencies: + nanostores: 0.7.4 + dev: false + /@netlify/functions/1.4.0: resolution: {integrity: sha512-gy7ULTIRroc2/jyFVGx1djCmmBMVisIwrvkqggq5B6iDcInRSy2Tpkm+V5C63hKJVkNRskKWtLQKm9ecCaQTjA==} engines: {node: '>=8.3.0'} @@ -3668,6 +3681,11 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /nanostores/0.7.4: + resolution: {integrity: sha512-MBeUVt7NBcXqh7AGT+KSr3O0X/995CZsvcP2QEMP+PXFwb07qv3Vjyq+EX0yS8f12Vv3Tn2g/BvK/OZoMhJlOQ==} + engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} + dev: false + /napi-build-utils/1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} diff --git a/src/components/instance-select.astro b/src/components/instance-select.astro index 6c0221a..a4dc63f 100644 --- a/src/components/instance-select.astro +++ b/src/components/instance-select.astro @@ -66,9 +66,10 @@ const { prefilledInstance } = Astro.props;