Skip to content

Commit

Permalink
Merge branch 'main' into build/driver-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 18, 2024
2 parents 151c8c5 + 1e28a25 commit 0571bf6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions docs/1.guide/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ type StorageDefinition = {
items: {
foo: string;
baz: number;
}
}
};
};

const storage = createStorage<StorageDefinition>();
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: <number> is not compatible with <string>
await storage.setItem("foo", "val"); // Check ok
Expand Down
4 changes: 3 additions & 1 deletion docs/2.drivers/netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -144,6 +144,9 @@
"@capacitor/preferences": {
"optional": true
},
"@deno/kv": {
"optional": true
},
"@netlify/blobs": {
"optional": true
},
Expand All @@ -167,9 +170,6 @@
},
"ioredis": {
"optional": true
},
"@deno/kv": {
"optional": true
}
},
"packageManager": "[email protected]"
Expand Down
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"extends": [
"github>unjs/renovate-config"
]
"extends": ["github>unjs/renovate-config"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"unstorage/drivers/*": [
"./src/drivers/*"
],
}
},
}
}

0 comments on commit 0571bf6

Please sign in to comment.