@vite-hub/cli 0.6.1 → 0.8.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
@@ -37,8 +37,9 @@ pnpm vitehub --help
37
37
  ```
38
38
 
39
39
  Every project includes `inspect` and `provision`. Other namespaces appear when their Vite integrations are active.
40
+ The CLI can reuse root and namespace help in Vite projects after successful discovery. It does not cache Nuxt help because Nuxt does not report all config imports.
40
41
  When the config throws, `vitehub --help` and `vitehub env --help` print the error, show reduced help, and exit with code 1. Of the listed commands, only `deploy`, `provision run`, and `provision status` load the config.
41
- Each CLI invocation resolves every active plugin's CLI contributor once. Commands and Provision Steps use that contribution for the invocation; the next invocation resolves it again.
42
+ When the CLI loads the project, it resolves each active plugin's CLI contributor once. Commands and Provision Steps use that contribution for the invocation.
42
43
 
43
44
  The CLI owns the `inspect` namespace. Plugin command contributions with that name are ignored. Generated operations cannot use the built-in `inspect` or `provision` namespaces: registry creation rejects them. Set the operation's `cli.namespace` to another name.
44
45
 
@@ -97,6 +98,8 @@ pnpm vitehub deploy --host vercel
97
98
 
98
99
  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
100
 
101
+ `link` and successful non-temporary deploys add missing ignore rules for `.vitehub` and the host CLI folder to an existing `.gitignore`.
102
+
100
103
  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
104
 
102
105
  ## Check and push host env
@@ -111,7 +114,7 @@ pnpm vitehub env diff --host vercel --stage preview
111
114
 
112
115
  `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
116
 
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).
117
+ `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
118
 
116
119
  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
120
 
@@ -161,4 +164,4 @@ Status also marks an R2 or Queue entry when its key is still declared but its re
161
164
 
162
165
  Read the [CLI guide](https://vitehub.dev/docs/cli) for every public command, examples, and troubleshooting.
163
166
 
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.
167
+ 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.