@ic-reactor/vite-plugin 0.13.0 → 0.13.1

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.
Files changed (3) hide show
  1. package/README.md +8 -2
  2. package/llms.txt +8 -1
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -40,8 +40,14 @@ export const clientManager = new ClientManager({
40
40
  })
41
41
  ```
42
42
 
43
- No opt-in flag is needed to pick up the plugin's environment: the plugin sets
44
- the `ic_env` cookie and `ClientManager` reads it automatically in the browser.
43
+ No opt-in flag is needed to pick up the plugin's environment in development:
44
+ the plugin sets the `ic_env` cookie and `ClientManager` reads it automatically
45
+ in the browser. That trust stops at the local replica — cookies are not
46
+ origin-isolated, so on a custom domain or mainnet the cookie is ignored and a
47
+ reactor with no `canisterId` throws. Set the per-canister `canisterId` in the
48
+ plugin config to bake it into the generated output for those builds, or pass
49
+ `allowEnvConfig: true` to `ClientManager` if you trust every subdomain of the
50
+ domain you serve from.
45
51
 
46
52
  The plugin generates files under `src/declarations/<canister>/` by default —
47
53
  `declarations/<did-basename>.{js,d.ts,did}` plus a managed `index.generated.ts`
package/llms.txt CHANGED
@@ -34,7 +34,14 @@ icReactor({
34
34
  `injectEnvironment`, `failOnError`
35
35
  - Per canister (inside `canisters[]`): `name`, `didFile`, `outDir`,
36
36
  `clientManagerPath`, `target`, `mode`, `canisterId`
37
- - `injectEnvironment` for local `ic_env` cookie + `/api` proxy behavior
37
+ - `injectEnvironment` for local `ic_env` cookie + `/api` proxy behavior. The
38
+ consumer side is a positive allowlist: `ClientManager` trusts the cookie — its
39
+ root key, its Internet Identity provider, and the canister IDs a reactor
40
+ resolves by name — only for loopback, `localhost`, and dev-container hosts.
41
+ Serving a dev build over a tunnel or custom domain needs
42
+ `allowEnvConfig: true` (formerly `allowEnvRootKey`); without it a generated
43
+ reactor that carries no `canisterId` throws instead of reading one from the
44
+ cookie — see `packages/core/llms.txt`
38
45
  - `failOnError` overrides the default (`true` for build, `false` for dev)
39
46
 
40
47
  ## Best Practices
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/vite-plugin",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Vite plugin for zero-config IC reactor generation from Candid files",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,16 +50,16 @@
50
50
  },
51
51
  "homepage": "https://ic-reactor.b3pay.net/v3/packages/vite-plugin",
52
52
  "dependencies": {
53
- "@ic-reactor/codegen": "0.13.0"
53
+ "@ic-reactor/codegen": "0.13.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/node": "^26.2.0",
59
+ "@types/node": "^26.4.0",
60
60
  "tsup": "^8.5.1",
61
61
  "typescript": "^6.0.3",
62
- "vitest": "^4.1.10"
62
+ "vitest": "^4.1.11"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "tsup src/index.ts --format esm,cjs --dts --clean --tsconfig tsconfig.json",