From 40de15548f889a9dedae992f0062319b1940d813 Mon Sep 17 00:00:00 2001 From: Dallas Hoffman Date: Sat, 20 Jan 2024 15:24:54 -0500 Subject: [PATCH] Change Vite config used for COI; update Vitest packages --- README.md | 18 ++-- docs/guide/setup.md | 20 ++-- package-lock.json | 244 ++++++++++++++++++++++---------------------- package.json | 8 +- vite.config.ts | 19 ++-- 5 files changed, 145 insertions(+), 164 deletions(-) diff --git a/README.md b/README.md index 2b84081..190da64 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ pnpm install sqlocal ### Cross-Origin Isolation -Since this package depends on the origin private file system API, the page you use it on must be served with the following HTTP headers. Otherwise, the browser will block access to the origin private file system. +In order to persist data to the origin private file system, this package relies on APIs that require cross-origin isolation, so the page you use this package on must be served with the following HTTP headers. Otherwise, the browser will block access to the origin private file system. ```http Cross-Origin-Embedder-Policy: require-corp @@ -133,18 +133,12 @@ Cross-Origin-Opener-Policy: same-origin If your development server uses Vite, you can do this by adding the following to your Vite configuration. ```javascript -plugins: [ - { - name: 'configure-response-headers', - configureServer: (server) => { - server.middlewares.use((_req, res, next) => { - res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); - res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); - next(); - }); - }, +server: { + headers: { + 'Cross-Origin-Embedder-Policy': 'require-corp', + 'Cross-Origin-Opener-Policy': 'same-origin', }, -], +}, ``` ### Vite Configuration diff --git a/docs/guide/setup.md b/docs/guide/setup.md index f114939..04aaa8a 100644 --- a/docs/guide/setup.md +++ b/docs/guide/setup.md @@ -24,7 +24,7 @@ pnpm install sqlocal ## Cross-Origin Isolation -Since this package depends on the origin private file system API, the page you use it on must be served with the following HTTP headers. Otherwise, the browser will block access to the origin private file system. +In order to persist data to the origin private file system, this package relies on APIs that require cross-origin isolation, so the page you use this package on must be served with the following HTTP headers. Otherwise, the browser will block access to the origin private file system. ```http Cross-Origin-Embedder-Policy: require-corp @@ -65,19 +65,13 @@ optimizeDeps: { }, ``` -To enable cross-origin isolation for the Vite development server, you can add this plug-in to your Vite configuration. Just don't forget to also configure your _production_ web server to use the same headers. +To enable cross-origin isolation (required for origin private file system persistence) for the Vite development server, you can add this to your Vite configuration. Just don't forget to also configure your _production_ web server to use the same HTTP headers. ```javascript -plugins: [ - { - name: 'configure-response-headers', - configureServer: (server) => { - server.middlewares.use((_req, res, next) => { - res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); - res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); - next(); - }); - }, +server: { + headers: { + 'Cross-Origin-Embedder-Policy': 'require-corp', + 'Cross-Origin-Opener-Policy': 'same-origin', }, -], +}, ``` diff --git a/package-lock.json b/package-lock.json index 0decf1a..ea0222d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,14 +14,14 @@ "nanoid": "^4.0.2" }, "devDependencies": { - "@vitest/browser": "^1.0.4", + "@vitest/browser": "^1.2.1", "drizzle-orm": "^0.29.1", "prettier": "^2.8.8", "typescript": "^5.3.3", - "vite": "^5.0.7", + "vite": "^5.0.12", "vitepress": "^1.0.0-beta.5", - "vitest": "^1.0.4", - "webdriverio": "^8.26.0" + "vitest": "^1.2.1", + "webdriverio": "^8.28.8" } }, "node_modules/@algolia/autocomplete-core": { @@ -652,15 +652,15 @@ } }, "node_modules/@polka/url": { - "version": "1.0.0-next.21", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", - "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", + "version": "1.0.0-next.24", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.24.tgz", + "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==", "dev": true }, "node_modules/@puppeteer/browsers": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.0.tgz", - "integrity": "sha512-QwguOLy44YBGC8vuPP2nmpX4MUN2FzWbsnvZJtiCzecU3lHmVZkaC1tq6rToi9a200m8RzlVtDyxCS0UIDrxUg==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.1.tgz", + "integrity": "sha512-PuvK6xZzGhKPvlx3fpfdM2kYY3P/hB1URtK8wA7XUJ6prn6pp22zvJHu48th0SGcHL9SutbPHrFuQgfXTFobWA==", "dev": true, "dependencies": { "debug": "4.3.4", @@ -954,21 +954,20 @@ } }, "node_modules/@vitest/browser": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-1.0.4.tgz", - "integrity": "sha512-qMT1NhClex73eA2sOwnlwLcSIVCW8B7NFVzIKuXLKxSJD3LsNq8PCKhwOkBxklbSAcZdkOgL/d3/gzQT7k9eng==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-1.2.1.tgz", + "integrity": "sha512-jhaQ15zWYAwz8anXgmLW0yAVLCXdT8RFv7LeW9bg7sMlvGJaTCTIHaHWFvCdADF/i62+22tnrzgiiqSnApjXtA==", "dev": true, "dependencies": { - "estree-walker": "^3.0.3", + "@vitest/utils": "1.2.1", "magic-string": "^0.30.5", - "sirv": "^2.0.3" + "sirv": "^2.0.4" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "playwright": "*", - "safaridriver": "*", "vitest": "^1.0.0", "webdriverio": "*" }, @@ -985,13 +984,13 @@ } }, "node_modules/@vitest/expect": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.0.4.tgz", - "integrity": "sha512-/NRN9N88qjg3dkhmFcCBwhn/Ie4h064pY3iv7WLRsDJW7dXnEgeoa8W9zy7gIPluhz6CkgqiB3HmpIXgmEY5dQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.2.1.tgz", + "integrity": "sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.0.4", - "@vitest/utils": "1.0.4", + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", "chai": "^4.3.10" }, "funding": { @@ -999,12 +998,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.0.4.tgz", - "integrity": "sha512-rhOQ9FZTEkV41JWXozFM8YgOqaG9zA7QXbhg5gy6mFOVqh4PcupirIJ+wN7QjeJt8S8nJRYuZH1OjJjsbxAXTQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.2.1.tgz", + "integrity": "sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.0.4", + "@vitest/utils": "1.2.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1013,9 +1012,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.0.4.tgz", - "integrity": "sha512-vkfXUrNyNRA/Gzsp2lpyJxh94vU2OHT1amoD6WuvUAA12n32xeVZQ0KjjQIf8F6u7bcq2A2k969fMVxEsxeKYA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.2.1.tgz", + "integrity": "sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1027,9 +1026,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.0.4.tgz", - "integrity": "sha512-9ojTFRL1AJVh0hvfzAQpm0QS6xIS+1HFIw94kl/1ucTfGCaj1LV/iuJU4Y6cdR03EzPDygxTHwE1JOm+5RCcvA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.2.1.tgz", + "integrity": "sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1039,12 +1038,13 @@ } }, "node_modules/@vitest/utils": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.0.4.tgz", - "integrity": "sha512-gsswWDXxtt0QvtK/y/LWukN7sGMYmnCcv1qv05CsY6cU/Y1zpGX1QuvLs+GO1inczpE6Owixeel3ShkjhYtGfA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", "loupe": "^2.3.7", "pretty-format": "^29.7.0" }, @@ -1369,14 +1369,14 @@ } }, "node_modules/@wdio/config": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-8.24.12.tgz", - "integrity": "sha512-3HW7qG1rIHzOIybV6oHR1CqLghsN0G3Xzs90ZciGL8dYhtcLtYCHwuWmBw4mkaB5xViU4AmZDuj7ChiG8Cr6Qw==", + "version": "8.28.8", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-8.28.8.tgz", + "integrity": "sha512-+aoSuNNXZyARlx3W+lM2bykHwJ46C/W3emZLQrmweacWmOPz98mpRzUfUbk8lAdbsXFAk2rSBp8oTGwg9rjaKg==", "dev": true, "dependencies": { - "@wdio/logger": "8.24.12", - "@wdio/types": "8.24.12", - "@wdio/utils": "8.24.12", + "@wdio/logger": "8.28.0", + "@wdio/types": "8.28.6", + "@wdio/utils": "8.28.8", "decamelize": "^6.0.0", "deepmerge-ts": "^5.0.0", "glob": "^10.2.2", @@ -1387,9 +1387,9 @@ } }, "node_modules/@wdio/logger": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-8.24.12.tgz", - "integrity": "sha512-QisOiVIWKTUCf1H7S+DOtC+gruhlpimQrUXfWMTeeh672PvAJYnTpOJDWA+BtXfsikkUYFAzAaq8SeMJk8rqKg==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-8.28.0.tgz", + "integrity": "sha512-/s6zNCqwy1hoc+K4SJypis0Ud0dlJ+urOelJFO1x0G0rwDRWyFiUP6ijTaCcFxAm29jYEcEPWijl2xkVIHwOyA==", "dev": true, "dependencies": { "chalk": "^5.1.2", @@ -1420,9 +1420,9 @@ } }, "node_modules/@wdio/types": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/@wdio/types/-/types-8.24.12.tgz", - "integrity": "sha512-SaD3OacDiW06DvSgAQ7sDBbpiI9qZRg7eoVYeBg3uSGVtUq84vTETRhhV7D6xTC00IqZu+mmN2TY5/q+7Gqy7w==", + "version": "8.28.6", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-8.28.6.tgz", + "integrity": "sha512-FU3mMRqULpc2XYh6DrSo/KgNoaS6EO9GFJQX5q7+EiOAqVeo1TCLggvAWIPayKyjfD1/ctd9q+uW9vmNicaOjw==", "dev": true, "dependencies": { "@types/node": "^20.1.0" @@ -1432,14 +1432,14 @@ } }, "node_modules/@wdio/utils": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-8.24.12.tgz", - "integrity": "sha512-uzwZyBVgqz0Wz1KL3aOUaQsxT8TNkzxti4NNTSMrU256qAPqc/n75rB7V73QASapCMpy70mZZTsuPgQYYj4ytQ==", + "version": "8.28.8", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-8.28.8.tgz", + "integrity": "sha512-z+8vdqIdXRA2j4O9EPHcVGffA9EzgQjN6RYPGhEZbQvpnNEDbYVlFdwX7pYocNb2G3+6RnNLnfLvepAPkoW7uw==", "dev": true, "dependencies": { "@puppeteer/browsers": "^1.6.0", - "@wdio/logger": "8.24.12", - "@wdio/types": "8.24.12", + "@wdio/logger": "8.28.0", + "@wdio/types": "8.28.6", "decamelize": "^6.0.0", "deepmerge-ts": "^5.1.0", "edgedriver": "^5.3.5", @@ -1468,9 +1468,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz", - "integrity": "sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" @@ -1826,9 +1826,9 @@ } }, "node_modules/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -2258,9 +2258,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1233178", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1233178.tgz", - "integrity": "sha512-jmMfyaqlzddwmDaSR1AQ+5ek+f7rupZdxKuPdkRcoxrZoF70Idg/4dTgXA08TLPmwAwB54gh49Wm2l/gRM0eUg==", + "version": "0.0.1245094", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1245094.tgz", + "integrity": "sha512-c7Tk8wCk2bw+wuQbl8vDh/7rDboWY8TEtcuHj5Q8S9E4F0AJMGJBnp+OqBCTI+xuVeGitQHt04/Rp3tzUStJxg==", "dev": true }, "node_modules/diff-sequences": { @@ -2441,9 +2441,9 @@ } }, "node_modules/edgedriver": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-5.3.8.tgz", - "integrity": "sha512-FWLPDuwJDeGGgtmlqTXb4lQi/HV9yylLo1F9O1g9TLqSemA5T6xH28seUIfyleVirLFtDQyKNUxKsMhMT4IfnA==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-5.3.9.tgz", + "integrity": "sha512-G0wNgFMFRDnFfKaXG2R6HiyVHqhKwdQ3EgoxW3wPlns2wKqem7F+HgkWBcevN7Vz0nN4AXtskID7/6jsYDXcKw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2775,17 +2775,17 @@ } }, "node_modules/geckodriver": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-4.2.1.tgz", - "integrity": "sha512-4m/CRk0OI8MaANRuFIahvOxYTSjlNAO2p9JmE14zxueknq6cdtB5M9UGRQ8R9aMV0bLGNVHHDnDXmoXdOwJfWg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-4.3.0.tgz", + "integrity": "sha512-QfpvxFsMORwKpvnLslkHCr3NTCczHAvkte6+pQGsiUZXKBe6mO4TTb727b+9KMVSK6XZqhR6ZwImKdP+F5vS6A==", "dev": true, "hasInstallScript": true, "dependencies": { - "@wdio/logger": "^8.11.0", + "@wdio/logger": "^8.24.12", "decamelize": "^6.0.0", "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.1", - "node-fetch": "^3.3.1", + "https-proxy-agent": "^7.0.2", + "node-fetch": "^3.3.2", "tar-fs": "^3.0.4", "unzipper": "^0.10.14", "which": "^4.0.0" @@ -3233,12 +3233,12 @@ } }, "node_modules/locate-app": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.1.0.tgz", - "integrity": "sha512-rcVo/iLUxrd9d0lrmregK/Z5Y5NCpSwf9KlMbPpOHmKmdxdQY1Fj8NDQ5QymJTryCsBLqwmniFv2f3JKbk9Bvg==", + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.2.8.tgz", + "integrity": "sha512-L5ajqYbJZl8lJC56CFoYNIe225R3ZRZeSmDzR1TWpWROoJse0KGMPWVWArH6SQmNRMOTAF60hDiBvXbFvQGfkg==", "dev": true, "dependencies": { - "n12": "0.4.0", + "n12": "1.8.11", "type-fest": "2.13.0", "userhome": "1.0.0" } @@ -3434,9 +3434,9 @@ } }, "node_modules/mrmime": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz", - "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", "dev": true, "engines": { "node": ">=10" @@ -3449,9 +3449,9 @@ "dev": true }, "node_modules/n12": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/n12/-/n12-0.4.0.tgz", - "integrity": "sha512-p/hj4zQ8d3pbbFLQuN1K9honUxiDDhueOWyFLw/XgBv+wZCE44bcLH4CIcsolOceJQduh4Jf7m/LfaTxyGmGtQ==", + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/n12/-/n12-1.8.11.tgz", + "integrity": "sha512-hygXQNqLnQKyLfaTDPI3YdwQy8m1z65Q94MiizaLlh36hyV+AgSOtvrzYYFLup52gDbRnipQhqJE38uLo28Niw==", "dev": true }, "node_modules/nanoid": { @@ -4190,9 +4190,9 @@ } }, "node_modules/safaridriver": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/safaridriver/-/safaridriver-0.1.0.tgz", - "integrity": "sha512-azzzIP3gR1TB9bVPv7QO4Zjw0rR1BWEU/s2aFdUMN48gxDjxEB13grAEuXDmkKPgE74cObymDxmAmZnL3clj4w==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/safaridriver/-/safaridriver-0.1.2.tgz", + "integrity": "sha512-4R309+gWflJktzPXBQCobbWEHlzC4aK3a+Ov3tz2Ib2aBxiwd11phkdIBH1l0EO22x24CJMUQkpKFumRriCSRg==", "dev": true }, "node_modules/safe-buffer": { @@ -4298,13 +4298,13 @@ } }, "node_modules/sirv": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.3.tgz", - "integrity": "sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", "dev": true, "dependencies": { - "@polka/url": "^1.0.0-next.20", - "mrmime": "^1.0.0", + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", "totalist": "^3.0.0" }, "engines": { @@ -4757,9 +4757,9 @@ "dev": true }, "node_modules/vite": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.7.tgz", - "integrity": "sha512-B4T4rJCDPihrQo2B+h1MbeGL/k/GMAHzhQ8S0LjQ142s6/+l3hHTT095ORvsshj4QCkoWu3Xtmob5mazvakaOw==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", "dev": true, "dependencies": { "esbuild": "^0.19.3", @@ -4812,9 +4812,9 @@ } }, "node_modules/vite-node": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.0.4.tgz", - "integrity": "sha512-9xQQtHdsz5Qn8hqbV7UKqkm8YkJhzT/zr41Dmt5N7AlD8hJXw/Z7y0QiD5I8lnTthV9Rvcvi0QW7PI0Fq83ZPg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.2.1.tgz", + "integrity": "sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -5331,17 +5331,17 @@ } }, "node_modules/vitest": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.0.4.tgz", - "integrity": "sha512-s1GQHp/UOeWEo4+aXDOeFBJwFzL6mjycbQwwKWX2QcYfh/7tIerS59hWQ20mxzupTJluA2SdwiBuWwQHH67ckg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.2.1.tgz", + "integrity": "sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA==", "dev": true, "dependencies": { - "@vitest/expect": "1.0.4", - "@vitest/runner": "1.0.4", - "@vitest/snapshot": "1.0.4", - "@vitest/spy": "1.0.4", - "@vitest/utils": "1.0.4", - "acorn-walk": "^8.3.0", + "@vitest/expect": "1.2.1", + "@vitest/runner": "1.2.1", + "@vitest/snapshot": "1.2.1", + "@vitest/spy": "1.2.1", + "@vitest/utils": "1.2.1", + "acorn-walk": "^8.3.2", "cac": "^6.7.14", "chai": "^4.3.10", "debug": "^4.3.4", @@ -5355,7 +5355,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.1", "vite": "^5.0.0", - "vite-node": "1.0.4", + "vite-node": "1.2.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -5470,27 +5470,27 @@ } }, "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz", + "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==", "dev": true, "engines": { "node": ">= 8" } }, "node_modules/webdriver": { - "version": "8.24.12", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-8.24.12.tgz", - "integrity": "sha512-03DQIClHoaAqTsmDkxGwo4HwHfkn9LzJ1wfNyUerzKg8DnyXeiT6ILqj6EXLfsvh5zddU2vhYGLFXSerPgkuOQ==", + "version": "8.28.8", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-8.28.8.tgz", + "integrity": "sha512-cEJX/CCu91QIM4el0b3o1Yk/DI8TP79xGVVtT30zqhKUfGlvHlRr6XafFanuJkf0dPAs5DMQgN7CPtiAegCMJg==", "dev": true, "dependencies": { "@types/node": "^20.1.0", "@types/ws": "^8.5.3", - "@wdio/config": "8.24.12", - "@wdio/logger": "8.24.12", + "@wdio/config": "8.28.8", + "@wdio/logger": "8.28.0", "@wdio/protocols": "8.24.12", - "@wdio/types": "8.24.12", - "@wdio/utils": "8.24.12", + "@wdio/types": "8.28.6", + "@wdio/utils": "8.28.8", "deepmerge-ts": "^5.1.0", "got": "^12.6.1", "ky": "^0.33.0", @@ -5501,23 +5501,23 @@ } }, "node_modules/webdriverio": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-8.26.0.tgz", - "integrity": "sha512-4HfYTB1khiNaCtJGWnFmm/T5O1KAEL9srpWvIjw2XOkTd53rJ8pKTEU0lr/YtAunOELqcTZeTxb7Y0zfLsEEww==", + "version": "8.28.8", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-8.28.8.tgz", + "integrity": "sha512-QFHv5FRvEcNznggxQrI256AwdClrnhL7C9Vwx5KxljEK2qw01UgW2vkCcrRYyfof3t9/N0dcybvpV09zc0XklQ==", "dev": true, "dependencies": { "@types/node": "^20.1.0", - "@wdio/config": "8.24.12", - "@wdio/logger": "8.24.12", + "@wdio/config": "8.28.8", + "@wdio/logger": "8.28.0", "@wdio/protocols": "8.24.12", "@wdio/repl": "8.24.12", - "@wdio/types": "8.24.12", - "@wdio/utils": "8.24.12", + "@wdio/types": "8.28.6", + "@wdio/utils": "8.28.8", "archiver": "^6.0.0", "aria-query": "^5.0.0", "css-shorthand-properties": "^1.1.1", "css-value": "^0.0.1", - "devtools-protocol": "^0.0.1233178", + "devtools-protocol": "^0.0.1245094", "grapheme-splitter": "^1.0.2", "import-meta-resolve": "^4.0.0", "is-plain-obj": "^4.1.0", @@ -5529,7 +5529,7 @@ "resq": "^1.9.1", "rgb2hex": "0.2.5", "serialize-error": "^11.0.1", - "webdriver": "8.24.12" + "webdriver": "8.28.8" }, "engines": { "node": "^16.13 || >=18" diff --git a/package.json b/package.json index e2bd894..c057c15 100644 --- a/package.json +++ b/package.json @@ -40,14 +40,14 @@ "nanoid": "^4.0.2" }, "devDependencies": { - "@vitest/browser": "^1.0.4", + "@vitest/browser": "^1.2.1", "drizzle-orm": "^0.29.1", "prettier": "^2.8.8", "typescript": "^5.3.3", - "vite": "^5.0.7", + "vite": "^5.0.12", "vitepress": "^1.0.0-beta.5", - "vitest": "^1.0.4", - "webdriverio": "^8.26.0" + "vitest": "^1.2.1", + "webdriverio": "^8.28.8" }, "author": "Dallas Hoffman", "license": "MIT", diff --git a/vite.config.ts b/vite.config.ts index a877625..da96870 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,20 +9,13 @@ export default defineConfig({ name: 'chrome', }, }, + server: { + headers: { + 'Cross-Origin-Embedder-Policy': 'require-corp', + 'Cross-Origin-Opener-Policy': 'same-origin', + }, + }, optimizeDeps: { exclude: ['@sqlite.org/sqlite-wasm'], }, - plugins: [ - { - enforce: 'pre', - name: 'configure-response-headers', - configureServer: (server) => { - server.middlewares.use((_req, res, next) => { - res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); - res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); - next(); - }); - }, - }, - ], });