@psg2/env-sync 1.0.1 → 1.1.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.
Files changed (3) hide show
  1. package/README.md +9 -3
  2. package/dist/cli.js +271 -269
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -78,7 +78,11 @@ targets:
78
78
 
79
79
  #### Vercel
80
80
 
81
- Pushes vars to Vercel environment(s) via the Vercel CLI. Backs up current env vars before overwriting.
81
+ Pushes vars to Vercel environment(s) via the Vercel REST API. Before overwriting, the current variables of each environment are backed up to `.env-sync-backups/vercel-<env>.<timestamp>.env`, in `KEY="value"` format. Sensitive variables can't be read back through the API (nor by `vercel env pull`), so the backup records only their key and type as a comment.
82
+
83
+ Values resolved from `op://` references are stored as **Sensitive** variables (write-only on Vercel; the value can never be read back). Literal values stay as regular readable variables. Re-running the sync converts existing variables to the right type.
84
+
85
+ With `redeploy: true`, the latest READY deployment of the environment is redeployed through the API — the same effect as `vercel redeploy`. Skipped for `development`, which has no deployments.
82
86
 
83
87
  ```yaml
84
88
  targets:
@@ -90,6 +94,8 @@ targets:
90
94
  redeploy: true # Optional (default: false)
91
95
  ```
92
96
 
97
+ **Authentication:** the token is read from `VERCEL_TOKEN` first, then from the Vercel CLI auth store written by `vercel login` (e.g. `~/Library/Application Support/com.vercel.cli/auth.json` on macOS, `~/.local/share/com.vercel.cli/auth.json` on Linux, `%APPDATA%/com.vercel.cli/auth.json` on Windows). The project and team ids come from `.vercel/project.json`, created by `vercel link` (or written by hand with `projectId` and `orgId`). The `vercel` CLI itself is optional at runtime — it's only needed once, to produce the token and the linked project file.
98
+
93
99
  #### GitHub
94
100
 
95
101
  Pushes vars as GitHub repository secrets via the GitHub CLI.
@@ -123,10 +129,10 @@ Options:
123
129
  | Feature | Requires |
124
130
  |---------|----------|
125
131
  | 1Password secrets | [`op` CLI](https://developer.1password.com/docs/cli) + `op signin` |
126
- | Vercel targets | [`vercel` CLI](https://vercel.com/docs/cli) |
132
+ | Vercel targets | `VERCEL_TOKEN` env var, or `vercel login` (CLI optional) |
127
133
  | GitHub targets | [`gh` CLI](https://cli.github.com) |
128
134
 
129
- The CLI checks for required tools before syncing and gives clear error messages.
135
+ The CLI checks for `op` and `gh` before syncing and gives clear error messages; Vercel credentials are validated when the target runs.
130
136
 
131
137
  ## Examples
132
138