From 63768e8e1f9e6e0e961639b8d9eae27dfcb1962d Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sat, 17 Feb 2024 12:44:44 +0100 Subject: [PATCH 1/5] remove --force from npm install in CI --- .github/workflows/gh-pages.yml | 2 -- .pre-commit-config.yaml | 4 ++-- tests/MultiSelect.test.ts | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 5ede3b9..0cfba03 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -10,5 +10,3 @@ on: jobs: build: uses: janosh/workflows/.github/workflows/nodejs-gh-pages.yml@main - with: - install-cmd: npm install -f diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a55a09a..7149c2e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier args: [--write] # edit files in-place @@ -37,7 +37,7 @@ repos: exclude: changelog\.md - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.53.0 + rev: v9.0.0-beta.0 hooks: - id: eslint types: [file] diff --git a/tests/MultiSelect.test.ts b/tests/MultiSelect.test.ts index d8f220b..097e3e5 100644 --- a/tests/MultiSelect.test.ts +++ b/tests/MultiSelect.test.ts @@ -46,10 +46,9 @@ test.describe(`input`, async () => { await page.fill(`#foods input[autocomplete]`, `Pineapple`) - expect( - await page.$$(`div.multiselect.open > ul.options > li`), - ).toHaveLength(1) - const text = await page.textContent(`div.multiselect.open > ul.options`) + const ul_selector = `div.multiselect.open > ul.options` + expect(await page.$$(`${ul_selector} > li`)).toHaveLength(1) + const text = await page.textContent(ul_selector) expect(text?.trim()).toBe(`🍍 Pineapple`) }) }) From 7239d602b2368a6f575c80b90b57637ed085e0ab Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sat, 17 Feb 2024 12:46:17 +0100 Subject: [PATCH 2/5] use from 'svelte-multiselect' imports in examples instead of flashing onMount $lib -> svelte-multiselect replace --- package.json | 1 + src/routes/(demos)/allow-user-options/+page.svx | 8 ++++---- src/routes/(demos)/css-classes/+page.svx | 2 +- src/routes/(demos)/disabled/+page.svx | 2 +- src/routes/(demos)/duplicates/+page.md | 2 +- src/routes/(demos)/form/+page.svx | 2 +- src/routes/(demos)/kit-form-actions/+page.svx | 2 +- src/routes/(demos)/min-max-select/+page.svx | 8 ++++---- src/routes/(demos)/parse-labels-as-html/+page.svx | 2 +- src/routes/(demos)/persistent/+page.svx | 2 +- src/routes/(demos)/slots/+page.svx | 6 +++--- src/routes/(demos)/sort-selected/+page.svx | 2 +- src/routes/(demos)/ui/+page.svx | 2 +- src/site/Examples.svx | 10 +++++----- svelte.config.js | 2 +- 15 files changed, 27 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 5752c7a..c496b36 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", "svelte-check": "^3.6.3", + "svelte-multiselect": "^10.2.0", "svelte-preprocess": "^5.1.3", "svelte-toc": "^0.5.6", "svelte-zoo": "^0.4.9", diff --git a/src/routes/(demos)/allow-user-options/+page.svx b/src/routes/(demos)/allow-user-options/+page.svx index 6e9e181..bdf7561 100644 --- a/src/routes/(demos)/allow-user-options/+page.svx +++ b/src/routes/(demos)/allow-user-options/+page.svx @@ -1,5 +1,5 @@ diff --git a/src/routes/(demos)/css-classes/+page.svx b/src/routes/(demos)/css-classes/+page.svx index 91c76b4..b5930d7 100644 --- a/src/routes/(demos)/css-classes/+page.svx +++ b/src/routes/(demos)/css-classes/+page.svx @@ -2,7 +2,7 @@ ```svelte example stackblitz id="foods" diff --git a/src/routes/(demos)/disabled/+page.svx b/src/routes/(demos)/disabled/+page.svx index fd62376..9cc93eb 100644 --- a/src/routes/(demos)/disabled/+page.svx +++ b/src/routes/(demos)/disabled/+page.svx @@ -5,7 +5,7 @@ ```svelte example stackblitz id="disabled-input-title" - import MultiSelect from '$lib' + import MultiSelect from 'svelte-multiselect' import { Toggle } from 'svelte-zoo' let duplicates = true diff --git a/src/routes/(demos)/form/+page.svx b/src/routes/(demos)/form/+page.svx index fcea675..c65a1d2 100644 --- a/src/routes/(demos)/form/+page.svx +++ b/src/routes/(demos)/form/+page.svx @@ -6,7 +6,7 @@ This example shows the JavaScript way of handling MultiSelect fields in form sub ```svelte example stackblitz @@ -41,7 +41,7 @@ When setting an integer value for `maxSelect` Multiselect will ```svelte example stackblitz diff --git a/src/routes/(demos)/ui/+page.svx b/src/routes/(demos)/ui/+page.svx index 540dcfd..10e7bec 100644 --- a/src/routes/(demos)/ui/+page.svx +++ b/src/routes/(demos)/ui/+page.svx @@ -5,7 +5,7 @@ ```svelte example stackblitz id="foods"