diff --git a/.prettierignore b/.prettierignore index 36837a12..b3bfee53 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,9 @@ test/drivers/tmp src/_drivers.ts +dist +node_modules +.output +.nuxt +CHANGELOG.md +pnpm-lock.yaml +docs/2.drivers/0.index.md diff --git a/docs/1.guide/1.index.md b/docs/1.guide/1.index.md index 010c7679..2ea79252 100644 --- a/docs/1.guide/1.index.md +++ b/docs/1.guide/1.index.md @@ -356,11 +356,11 @@ type StorageDefinition = { items: { foo: string; baz: number; - } -} + }; +}; const storage = createStorage(); -await storage.has("foo");// Ts will prompt you that there are two optional keys: "foo" or "baz" +await storage.has("foo"); // Ts will prompt you that there are two optional keys: "foo" or "baz" await storage.getItem("baz"); // => string await storage.setItem("foo", 12); // TS error: is not compatible with await storage.setItem("foo", "val"); // Check ok diff --git a/docs/2.drivers/netlify.md b/docs/2.drivers/netlify.md index f365230e..94bf25d5 100644 --- a/docs/2.drivers/netlify.md +++ b/docs/2.drivers/netlify.md @@ -51,6 +51,7 @@ To use, you will need to install `@netlify/blobs` as dependency or devDependency - `name` - The name of the store to use. It is created if needed. This is required except for deploy-scoped stores. - `deployScoped` - If set to `true`, the store is scoped to the deploy. This means that it is only available from that deploy, and will be deleted or rolled-back alongside it. +- `consistency` - The [consistency model](https://docs.netlify.com/blobs/overview/#consistency) to use for the store. This can be `eventual` or `strong`. Default is `eventual`. - `siteID` - Required during builds, where it is available as `constants.SITE_ID`. At runtime this is set automatically. - `token` - Required during builds, where it is available as `constants.NETLIFY_API_TOKEN`. At runtime this is set automatically. @@ -60,8 +61,9 @@ These are not normally needed, but are available for advanced use cases or for u - `apiURL` - `edgeURL` +- `uncachedEdgeURL` -## Using in netlify edge +## Using in Netlify edge functions When using Unstorage in a Netlify edge function you should use a URL import. This does not apply if you are compiling your code in a framework - just if you are creating your own edge functions. diff --git a/package.json b/package.json index 467312d0..39e99736 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "build": "pnpm gen-drivers && unbuild", "gen-drivers": "jiti scripts/gen-drivers.ts", "dev": "vitest", - "lint": "eslint . && prettier -c src test", - "lint:fix": "eslint . --fix && prettier -w src test", + "lint": "eslint . && prettier -c .", + "lint:fix": "eslint . --fix && prettier -w .", "prepack": "pnpm build", "release": "pnpm test && changelogen --release && git push --follow-tags && pnpm publish", "test": "pnpm lint && pnpm test:types && vitest run --coverage", @@ -144,6 +144,9 @@ "@capacitor/preferences": { "optional": true }, + "@deno/kv": { + "optional": true + }, "@netlify/blobs": { "optional": true }, @@ -167,9 +170,6 @@ }, "ioredis": { "optional": true - }, - "@deno/kv": { - "optional": true } }, "packageManager": "pnpm@9.15.0" diff --git a/renovate.json b/renovate.json index a9971c80..57fe916b 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,3 @@ { - "extends": [ - "github>unjs/renovate-config" - ] + "extends": ["github>unjs/renovate-config"] } diff --git a/tsconfig.json b/tsconfig.json index 23e04d28..8617c8f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,6 @@ "unstorage/drivers/*": [ "./src/drivers/*" ], - } + }, } }