@shipstatic/ship 2.0.0-beta.2 → 2.0.0-beta.20

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
@@ -49,18 +49,20 @@ const ship = new Ship({ token: 'ship-...' });
49
49
  ship ./dist # Deploy (shortcut)
50
50
  ship ./dist --label production --label v1.0.0 # Deploy with labels
51
51
  ship deployments list
52
+ ship deployments list --limit 20 # Page size; a hint shows the next cursor
53
+ ship deployments list --cursor <cursor> # Continue from a previous page
52
54
  ship deployments get <deployment>
53
55
  ship deployments set <deployment> --label production
54
- ship deployments remove <deployment>
56
+ ship deployments delete <deployment>
55
57
  ```
56
58
 
57
59
  ```typescript
58
60
  ship.deploy(input, options?) // Shortcut for deployments.upload()
59
61
  ship.deployments.upload(input, options?)
60
- ship.deployments.list()
62
+ ship.deployments.list(options?) // { limit?, cursor? } — response carries the next cursor
61
63
  ship.deployments.get(deployment)
62
64
  ship.deployments.set(deployment, { labels })
63
- ship.deployments.remove(deployment)
65
+ ship.deployments.delete(deployment)
64
66
  ```
65
67
 
66
68
  ### Domains
@@ -70,25 +72,25 @@ ship domains set www.example.com # Reserve domain (no deployme
70
72
  ship domains set www.example.com <deployment> # Link domain to deployment
71
73
  ship domains set www.example.com --label prod # Update labels only
72
74
  ship domains get www.example.com
73
- ship domains list
75
+ ship domains list # --limit / --cursor paginate here too
74
76
  ship domains validate www.example.com
75
77
  ship domains verify www.example.com
76
78
  ship domains records www.example.com
77
79
  ship domains dns www.example.com
78
80
  ship domains share www.example.com
79
- ship domains remove www.example.com
81
+ ship domains delete www.example.com
80
82
  ```
81
83
 
82
84
  ```typescript
83
85
  ship.domains.set(name, { deployment?, labels? }) // Upsert — create, repoint, or label
84
86
  ship.domains.get(name)
85
- ship.domains.list()
87
+ ship.domains.list(options?) // { limit?, cursor? }
86
88
  ship.domains.validate(name)
87
89
  ship.domains.verify(name)
88
90
  ship.domains.records(name)
89
91
  ship.domains.dns(name)
90
92
  ship.domains.share(name)
91
- ship.domains.remove(name)
93
+ ship.domains.delete(name)
92
94
  ```
93
95
 
94
96
  `domains.set()` is a merge-upsert — omitted fields are preserved on update, defaulted on create. Once linked, a domain cannot be unlinked (`{ deployment: null }` → 400). Switch deployments or delete the domain instead.
@@ -105,26 +107,29 @@ ship.domains.set('www.münchen.de'); // → Unicode supported
105
107
  ```bash
106
108
  ship tokens create --ttl 3600 --label ci
107
109
  ship tokens list
108
- ship tokens remove <token>
110
+ ship tokens get <token>
111
+ ship tokens delete <token>
109
112
  ```
110
113
 
111
114
  ```typescript
112
115
  ship.tokens.create({ ttl?, labels? })
113
116
  ship.tokens.list()
114
- ship.tokens.remove(token)
117
+ ship.tokens.get(token)
118
+ ship.tokens.delete(token)
115
119
  ```
116
120
 
117
121
  ### Account
118
122
 
119
123
  ```bash
120
124
  ship whoami
125
+ ship account get
121
126
  ship config
122
127
  ship ping
123
128
  ```
124
129
 
125
130
  ```typescript
126
131
  ship.account.get() // → whoami
127
- ship.ping() // → boolean
132
+ ship.ping() // → { timestamp } (server clock; reachability is the absence of a throw)
128
133
  ship.getLimits() // → platform plan limits (cached)
129
134
  ```
130
135
 
@@ -134,6 +139,8 @@ ship.getLimits() // → platform plan limits (cached)
134
139
 
135
140
  The `-q` flag outputs only the resource identifier — perfect for piping and scripting:
136
141
 
142
+ `ship tokens create -q` is the one exception: it prints the token **secret**, which is shown once and never again.
143
+
137
144
  ```bash
138
145
  # Deploy and link domain in one pipe
139
146
  ship ./dist -q | ship domains set www.example.com
@@ -141,8 +148,8 @@ ship ./dist -q | ship domains set www.example.com
141
148
  # Deploy and open in browser
142
149
  open https://$(ship ./dist -q)
143
150
 
144
- # Batch remove all deployments
145
- ship deployments list -q | xargs -I{} ship deployments remove {} -q
151
+ # Batch delete all deployments
152
+ ship deployments list -q | xargs -I{} ship deployments delete {} -q
146
153
  ```
147
154
 
148
155
  ### Shell Completion
@@ -164,8 +171,8 @@ Available on every command:
164
171
  | `--json` | Output results in JSON format |
165
172
  | `-q, --quiet` | Output only the resource identifier |
166
173
  | `--no-color` | Disable colored output |
167
- | `--help` | Display help for command |
168
- | `--version` | Show version information |
174
+ | `-h, --help` | Display help for command |
175
+ | `-V, --version` | Show version information |
169
176
 
170
177
  ### Deploy Flags
171
178
 
@@ -219,13 +226,9 @@ ship.setToken('ship-...');
219
226
  ship.deploy(input, {
220
227
  labels?: string[],
221
228
  password?: string, // Password-protect the deployment (6–128 chars)
222
- onProgress?: ({ percent }) => void,
223
- signal?: AbortSignal,
224
- onCancel?: () => void, // Called if signal aborts
229
+ signal?: AbortSignal, // Abort to cancel the deploy
225
230
  pathDetect?: boolean, // Auto-optimize paths (default: true)
226
231
  spaDetect?: boolean, // Auto-detect SPA (default: true)
227
- maxConcurrency?: number, // Concurrent uploads (default: 4)
228
- timeout?: number, // Request timeout in ms
229
232
  via?: string, // Client identifier
230
233
  });
231
234
  ```
@@ -273,6 +276,8 @@ ship.off('request', handler);
273
276
 
274
277
  Pass `fetch` to override the transport function used for every API call. Defaults to `globalThis.fetch`. Useful for wrapping requests with tracing, retries, or request signing, and for injecting a Cloudflare service-binding `Fetcher` from a Worker so calls reach a sibling Worker in-process instead of through the public hostname.
275
278
 
279
+ This is also the seam for corporate proxies: Node's built-in `fetch` ignores `HTTP(S)_PROXY` environment variables, so behind a proxy inject a proxy-aware transport (e.g. [undici](https://github.com/nodejs/undici)'s `EnvHttpProxyAgent` as the dispatcher, or Node 24+'s `NODE_USE_ENV_PROXY=1`).
280
+
276
281
  ```typescript
277
282
  import type { Fetch } from '@shipstatic/ship';
278
283
 
@@ -315,7 +320,15 @@ The **CLI** (`ship`) resolves its token in this order:
315
320
 
316
321
  1. CLI flag: `--token`
317
322
  2. Environment variable: `SHIP_TOKEN`
318
- 3. Config files: `.shiprc` or `package.json` `"ship"` key (run `ship config` to create one)
323
+ 3. Config file: `~/.shiprc` (run `ship config` to create one)
324
+
325
+ `--config <file>` reads any path you name instead of `~/.shiprc`, which is how per-environment
326
+ configs work (`ship --config dev.shiprc ...`). The file is strict JSON; an empty one means "no
327
+ config".
328
+
329
+ **No repository file is ever read.** A `.shiprc` or `package.json` `"ship"` key in your working
330
+ directory is ignored — cloning a repo can never change which account you deploy to, or which
331
+ host your token is sent to.
319
332
 
320
333
  The **SDK** (`new Ship(...)`) resolves its token in this order:
321
334
 
package/SKILL.md CHANGED
@@ -223,9 +223,11 @@ Every command supports three modes:
223
223
  | `--json` | JSON on stdout | Parsing programmatically |
224
224
  | `-q` | Identifier only | Piping between commands |
225
225
 
226
+ `-q` prints the resource identifier — except `tokens create -q`, which prints the token **secret** (shown once, never again).
227
+
226
228
  Errors go to stderr in all modes. Exit 0 = success, 1 = error.
227
229
 
228
- List commands return `{"<resource>s": [...], "cursor": null, "total": N}`. `domains list` text mode omits status — use `--json` to see `pending` vs `success`.
230
+ List commands return `{"<resource>s": [...], "cursor": null}`. A non-null `cursor` means more pages remain — pass it back with `--cursor` to continue, and size pages with `--limit`. There is no total; a count is an aggregate over a collection, not a property of one page. `domains list` text mode omits status — use `--json` to see `pending` vs `success`.
229
231
 
230
232
  ## Commands
231
233
 
@@ -237,7 +239,7 @@ ship deployments upload <path> # Deploy (explicit)
237
239
  ship deployments list # List all
238
240
  ship deployments get <deployment> # Details
239
241
  ship deployments set <deployment> # Update labels (--label)
240
- ship deployments remove <deployment> # Delete (async)
242
+ ship deployments delete <deployment> # Delete (async)
241
243
  ```
242
244
 
243
245
  ### Domains
@@ -251,7 +253,7 @@ ship domains records <name> # Required DNS records
251
253
  ship domains dns <name> # DNS provider lookup
252
254
  ship domains share <name> # Shareable setup link
253
255
  ship domains verify <name> # Trigger DNS verification
254
- ship domains remove <name> # Delete
256
+ ship domains delete <name> # Delete
255
257
  ```
256
258
 
257
259
  ### Account & Tokens
@@ -262,7 +264,8 @@ ship ping # Connectivity check
262
264
  ship tokens create # New deploy token (shown once)
263
265
  ship tokens create --ttl 3600 # With expiry (seconds)
264
266
  ship tokens list # List tokens
265
- ship tokens remove <token> # Revoke
267
+ ship tokens get <token> # Details for one token
268
+ ship tokens delete <token> # Delete (revokes immediately)
266
269
  ```
267
270
 
268
271
  ## Flags