@vite-hub/cli 0.6.1 → 0.7.0

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/README.md CHANGED
@@ -97,6 +97,8 @@ pnpm vitehub deploy --host vercel
97
97
 
98
98
  The first linked host is the default. `vitehub link --host <host> --default` changes it. `vitehub deploy --host <host>` builds with `VITEHUB_HOST=<host>`, and that host wins over `host` in `vitehub()`. With several targets and no default, deploy needs `--host`. Resources such as D1, KV, R2, and libSQL are separate on each host. See [Link a project to its host](https://vitehub.dev/docs/cli/project#link-a-project-to-its-host).
99
99
 
100
+ `link` and successful non-temporary deploys add missing ignore rules for `.vitehub` and the host CLI folder to an existing `.gitignore`.
101
+
100
102
  On Cloudflare and Vercel, `vitehub deploy` first runs the provision plan of the host with the same credentials, including a `wrangler login`. It lists the resources it creates, asks first unless you pass `--yes`, and records their ids in `.vitehub/provision.json` before the build, so a second deploy creates nothing. `--no-provision` skips it. See [Create the host resources](https://vitehub.dev/docs/cli/project#create-the-host-resources).
101
103
 
102
104
  ## Check and push host env
@@ -111,7 +113,7 @@ pnpm vitehub env diff --host vercel --stage preview
111
113
 
112
114
  `env diff` compares names only, because hosts do not return values. It exits with 1 when a required name is missing. `env push` reads each value from the shell, then from `.env`, `.env.local`, `.env.<stage>`, and `.env.<stage>.local`, as Vite does. It decrypts dotenvx `encrypted:` values with `DOTENV_PRIVATE_KEY_<STAGE>`. It reads the files in the build's Vite `envDir`, refuses a plaintext secret from a file that git tracks or does not ignore (also through `$NAME` expansion and symlinks), sends each value on stdin or in an API body, prints names only, and never deletes a host variable. See [Check and push host env](https://vitehub.dev/docs/cli/primitives#check-and-push-host-env).
113
115
 
114
- `vitehub deploy` runs the same check after provisioning and the build, before migrations, env writes, or publishing code. `vitehub deploy` reads stage `production`, and `vitehub deploy --preview` reads stage `preview`. A required name that is on neither the host nor a local value stops the deploy. Deploy sets the names that the host lacks from their local values, and `--push-env` also replaces the names that the host has. Cloudflare gets the values with the new version through `wrangler deploy --secrets-file`. With `--yes`, deploy generates a missing `VITEHUB_SECRET`. See [Check Env before a deploy](https://vitehub.dev/docs/cli/project#check-env-before-a-deploy).
116
+ `vitehub deploy` runs the same check after provisioning and the build, before migrations, env writes, or publishing code. `vitehub deploy` reads stage `production`, and `vitehub deploy --preview` reads stage `preview`. A required name that is on neither the host nor a local value stops the deploy. Deploy sets the names that the host lacks from their local values, and `--push-env` also replaces the names that the host has. Cloudflare gets the values with the new version through `wrangler deploy --secrets-file`. With `--yes`, deploy generates a missing `VITEHUB_SECRET` and saves it in the git-ignored `.env.<stage>.local`. See [Check Env before a deploy](https://vitehub.dev/docs/cli/project#check-env-before-a-deploy).
115
117
 
116
118
  After the upload, `vitehub deploy` requests the paths of `deploy.check` in `vitehub()`, and the health route with `health`, on the deployed URL. When one does not answer with a `2xx` status, it exits with `SETUP_DEPLOY_CHECK_FAILED` and prints the command that rolls production back to the deployment it replaced, such as `npx wrangler rollback <version-id> --name my-app --yes`. With `deploy: { indexNow: true }` and a string `publicUrl`, a production deploy that passed its checks sends the URLs of `/sitemap.xml` to IndexNow. `--no-check` and `--no-index-now` skip them. See [Check the deployed app](https://vitehub.dev/docs/cli/project#check-the-deployed-app).
117
119
 
@@ -161,4 +163,4 @@ Status also marks an R2 or Queue entry when its key is still declared but its re
161
163
 
162
164
  Read the [CLI guide](https://vitehub.dev/docs/cli) for every public command, examples, and troubleshooting.
163
165
 
164
- Cloudflare deploys always re-supply the stage’s local values, including existing Worker secrets, to prevent inheritance from a preview upload. Every existing secret needs a local stage value; otherwise deploy stops with `SETUP_DEPLOY_ENV_STAGE_UNSAFE`. This includes a previously generated `VITEHUB_SECRET`; supply a locally managed value for subsequent deploys.
166
+ Cloudflare deploys always re-supply the stage’s local values, including existing Worker secrets, to prevent inheritance from a preview upload. Every existing secret needs a local stage value; otherwise deploy stops with `SETUP_DEPLOY_ENV_STAGE_UNSAFE`. Deploy keeps a generated `VITEHUB_SECRET` in the stage’s local env file for the next deploy. The file cannot be a symlink or hard link, and deploy saves it with mode 600 on Unix.