@picked/vite-plugin-picked 0.0.1-dev.1788925875333 → 0.0.1-dev.1793753513002

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) Picked. All rights reserved. Contact Picked for a usage licence.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @picked/vite-plugin-picked
2
+
3
+ Embeds your Picked project's configuration and content in the bundle at build time, so the
4
+ SDK makes no configuration request at runtime. It also generates types and serves a preview
5
+ launcher during development.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -D @picked/vite-plugin-picked
11
+ ```
12
+
13
+ Supports Vite 7 and 8.
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ // vite.config.ts
19
+ import { defineConfig } from 'vite'
20
+ import { picked } from '@picked/vite-plugin-picked'
21
+
22
+ export default defineConfig({
23
+ plugins: [picked()],
24
+ })
25
+ ```
26
+
27
+ The plugin reads the project from `picked.config.ts`. The `data` field there sets where the
28
+ build gets its data:
29
+
30
+ | `data` | Build and dev server |
31
+ | ------------ | ---------------------------------------------------------------------------------------- |
32
+ | `'bundle'` | Default. Fetch the configuration and content from the API and embed them. |
33
+ | `'api'` | Embed nothing. The SDK reads everything from the API at runtime. |
34
+ | `'snapshot'` | Embed the committed `picked.snapshot.json`. No request. Write it with `npx picked pull`. |
35
+
36
+ The `mode` plugin option is deprecated; set `data` in `picked.config.ts` instead.
37
+
38
+ To type `virtual:picked/data`, add `"@picked/vite-plugin-picked/client"` to
39
+ `compilerOptions.types` in `tsconfig.json`.
40
+
41
+ | Option | Default | Description |
42
+ | ----------------- | -------------------- | ---------------------------------------------------------- |
43
+ | `generateTypes` | `true` | Generate types from the workspace schema on dev and build. |
44
+ | `disableLauncher` | `false` | Leave out the launcher page. |
45
+ | `telemetry` | from `picked.config` | Send anonymous build-time telemetry. |
46
+
47
+ ## Docs
48
+
49
+ - **Web:** [Vite Plugin](https://docs.picked.app/reference/tools/vite-plugin)
50
+ - **Local:** `node_modules/picked/docs/reference/tools/vite-plugin.md`. The `picked` package carries every page under `node_modules/picked/docs/`.
51
+ - **CLI:** `npx picked docs read /reference/tools/vite-plugin`. `npx picked docs list [words]` lists the pages.
52
+ - **MCP:** call `read_picked_doc` with `{ "path": "/reference/tools/vite-plugin" }`; `list_picked_docs` lists the pages. Add the server with `claude mcp add --transport http picked https://api.picked.app/mcp`, or see [How to connect the MCP server](https://docs.picked.app/how-to/connect-the-mcp-server) for other tools.