@shipstatic/ship 0.8.0 → 0.8.2
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 +45 -31
- package/SKILL.md +17 -10
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +20 -16
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,14 +15,29 @@ npm install @shipstatic/ship
|
|
|
15
15
|
## CLI Usage
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
# Deploy a directory
|
|
18
|
+
# Deploy a directory
|
|
19
19
|
ship ./dist
|
|
20
20
|
|
|
21
21
|
# Deploy with labels
|
|
22
22
|
ship ./dist --label production --label v1.0.0
|
|
23
23
|
|
|
24
|
-
#
|
|
25
|
-
ship ./dist
|
|
24
|
+
# Deploy and link to a domain in one pipe
|
|
25
|
+
ship ./dist -q | ship domains set www.example.com
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Composability
|
|
29
|
+
|
|
30
|
+
The `-q` flag outputs only the resource identifier — perfect for piping and scripting:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Deploy and link domain
|
|
34
|
+
ship ./dist -q | ship domains set www.example.com
|
|
35
|
+
|
|
36
|
+
# Deploy and open in browser
|
|
37
|
+
open https://$(ship ./dist -q)
|
|
38
|
+
|
|
39
|
+
# Batch operations
|
|
40
|
+
ship deployments list -q | xargs -I{} ship deployments remove {} -q
|
|
26
41
|
```
|
|
27
42
|
|
|
28
43
|
### Deployments
|
|
@@ -31,22 +46,22 @@ ship ./dist --no-path-detect --no-spa-detect
|
|
|
31
46
|
ship deployments list
|
|
32
47
|
ship deployments upload <path> # Upload from file or directory
|
|
33
48
|
ship deployments upload <path> --label production # Upload with labels
|
|
34
|
-
ship deployments get <
|
|
35
|
-
ship deployments set <
|
|
36
|
-
ship deployments remove <
|
|
49
|
+
ship deployments get <deployment>
|
|
50
|
+
ship deployments set <deployment> --label production
|
|
51
|
+
ship deployments remove <deployment>
|
|
37
52
|
```
|
|
38
53
|
|
|
39
54
|
### Domains
|
|
40
55
|
|
|
41
56
|
```bash
|
|
42
57
|
ship domains list
|
|
43
|
-
ship domains set
|
|
44
|
-
ship domains set
|
|
45
|
-
ship domains set
|
|
46
|
-
ship domains get
|
|
58
|
+
ship domains set www.example.com # Reserve domain (no deployment yet)
|
|
59
|
+
ship domains set www.example.com <deployment> # Link domain to deployment
|
|
60
|
+
ship domains set www.example.com --label prod # Update labels only
|
|
61
|
+
ship domains get www.example.com
|
|
47
62
|
ship domains validate www.example.com # Check if domain is valid and available
|
|
48
63
|
ship domains verify www.example.com # Trigger DNS verification
|
|
49
|
-
ship domains remove
|
|
64
|
+
ship domains remove www.example.com
|
|
50
65
|
```
|
|
51
66
|
|
|
52
67
|
### Tokens
|
|
@@ -60,8 +75,7 @@ ship tokens remove <token>
|
|
|
60
75
|
### Account & Setup
|
|
61
76
|
|
|
62
77
|
```bash
|
|
63
|
-
ship whoami
|
|
64
|
-
ship account get
|
|
78
|
+
ship whoami
|
|
65
79
|
ship config # Create or update ~/.shiprc
|
|
66
80
|
ship ping # Check API connectivity
|
|
67
81
|
```
|
|
@@ -80,10 +94,11 @@ ship completion uninstall
|
|
|
80
94
|
--deploy-token <token> Deploy token for single-use deployments
|
|
81
95
|
--config <file> Custom config file path
|
|
82
96
|
--label <label> Add label (repeatable)
|
|
83
|
-
--no-path-detect Disable automatic path optimization
|
|
84
|
-
--no-spa-detect Disable automatic SPA detection
|
|
97
|
+
--no-path-detect Disable automatic path optimization
|
|
98
|
+
--no-spa-detect Disable automatic SPA detection
|
|
85
99
|
--no-color Disable colored output
|
|
86
100
|
--json Output results in JSON format
|
|
101
|
+
-q, --quiet Output only the resource identifier
|
|
87
102
|
--version Show version information
|
|
88
103
|
```
|
|
89
104
|
|
|
@@ -107,12 +122,12 @@ const deployment = await ship.deployments.upload('./dist', {
|
|
|
107
122
|
});
|
|
108
123
|
|
|
109
124
|
// Manage domains
|
|
110
|
-
await ship.domains.set('
|
|
125
|
+
await ship.domains.set('www.example.com', { deployment: deployment.deployment });
|
|
111
126
|
await ship.domains.list();
|
|
112
127
|
|
|
113
128
|
// Update labels
|
|
114
|
-
await ship.deployments.set(deployment.
|
|
115
|
-
await ship.domains.set('
|
|
129
|
+
await ship.deployments.set(deployment.deployment, { labels: ['production', 'v1.0'] });
|
|
130
|
+
await ship.domains.set('www.example.com', { labels: ['live'] });
|
|
116
131
|
```
|
|
117
132
|
|
|
118
133
|
## Browser Usage
|
|
@@ -187,11 +202,11 @@ ship.setDeployToken(token) // Set deploy token after construction
|
|
|
187
202
|
### Deployments
|
|
188
203
|
|
|
189
204
|
```typescript
|
|
190
|
-
ship.deployments.upload(input, options?)
|
|
191
|
-
ship.deployments.list()
|
|
192
|
-
ship.deployments.get(
|
|
193
|
-
ship.deployments.set(
|
|
194
|
-
ship.deployments.remove(
|
|
205
|
+
ship.deployments.upload(input, options?) // Upload new deployment
|
|
206
|
+
ship.deployments.list() // List all deployments
|
|
207
|
+
ship.deployments.get(deployment) // Get deployment details
|
|
208
|
+
ship.deployments.set(deployment, { labels }) // Update deployment labels
|
|
209
|
+
ship.deployments.remove(deployment) // Delete deployment
|
|
195
210
|
```
|
|
196
211
|
|
|
197
212
|
### Domains
|
|
@@ -228,19 +243,19 @@ ship.account.get() // Get current account
|
|
|
228
243
|
|
|
229
244
|
```typescript
|
|
230
245
|
// Reserve domain (no deployment yet)
|
|
231
|
-
ship.domains.set('
|
|
246
|
+
ship.domains.set('www.example.com');
|
|
232
247
|
|
|
233
248
|
// Link domain to deployment
|
|
234
|
-
ship.domains.set('
|
|
249
|
+
ship.domains.set('www.example.com', { deployment: 'happy-cat-abc1234.shipstatic.com' });
|
|
235
250
|
|
|
236
251
|
// Switch to a different deployment (atomic)
|
|
237
|
-
ship.domains.set('
|
|
252
|
+
ship.domains.set('www.example.com', { deployment: 'other-deploy-xyz7890.shipstatic.com' });
|
|
238
253
|
|
|
239
254
|
// Update labels only (deployment preserved)
|
|
240
|
-
ship.domains.set('
|
|
255
|
+
ship.domains.set('www.example.com', { labels: ['prod', 'v2'] });
|
|
241
256
|
|
|
242
257
|
// Update both
|
|
243
|
-
ship.domains.set('
|
|
258
|
+
ship.domains.set('www.example.com', { deployment: 'happy-cat-abc1234.shipstatic.com', labels: ['prod'] });
|
|
244
259
|
```
|
|
245
260
|
|
|
246
261
|
**No unlinking:** Once a domain is linked, `{ deployment: null }` returns a 400 error. To take a site offline, deploy a maintenance page. To clean up, delete the domain.
|
|
@@ -248,8 +263,8 @@ ship.domains.set('staging', { deployment: 'abc123', labels: ['prod'] });
|
|
|
248
263
|
**Domain format:** Domain names are FQDNs. The SDK accepts any format (case-insensitive, Unicode) — the API normalizes:
|
|
249
264
|
|
|
250
265
|
```typescript
|
|
251
|
-
ship.domains.set('Example.COM'
|
|
252
|
-
ship.domains.set('münchen.de'
|
|
266
|
+
ship.domains.set('WWW.Example.COM'); // → normalized to 'www.example.com'
|
|
267
|
+
ship.domains.set('www.münchen.de'); // → Unicode supported
|
|
253
268
|
```
|
|
254
269
|
|
|
255
270
|
### Deploy Options
|
|
@@ -263,7 +278,6 @@ ship.deploy('./dist', {
|
|
|
263
278
|
spaDetect?: boolean, // Auto-detect SPA (default: true)
|
|
264
279
|
maxConcurrency?: number, // Concurrent uploads (default: 4)
|
|
265
280
|
timeout?: number, // Request timeout (ms)
|
|
266
|
-
subdomain?: string, // Suggested subdomain
|
|
267
281
|
via?: string, // Client identifier (e.g. 'sdk', 'cli')
|
|
268
282
|
apiKey?: string, // Per-request API key override
|
|
269
283
|
deployToken?: string, // Per-request deploy token override
|
package/SKILL.md
CHANGED
|
@@ -40,10 +40,17 @@ Alternative: set the `SHIP_API_KEY` environment variable or pass `--api-key` per
|
|
|
40
40
|
```bash
|
|
41
41
|
ship ./dist
|
|
42
42
|
ship ./dist --label production --label v1.0
|
|
43
|
-
ship ./dist --json # Returns {"deployment": "
|
|
43
|
+
ship ./dist --json # Returns {"deployment": "happy-cat-abc1234.shipstatic.com", ...}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
## Workflow 2 —
|
|
46
|
+
## Workflow 2 — Deploy and Link Domain
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Deploy and link in one pipe
|
|
50
|
+
ship ./dist -q | ship domains set www.example.com
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Workflow 3 — Reserve a Domain
|
|
47
54
|
|
|
48
55
|
```bash
|
|
49
56
|
# Pre-flight check
|
|
@@ -53,21 +60,21 @@ ship domains validate www.example.com
|
|
|
53
60
|
ship domains set www.example.com
|
|
54
61
|
|
|
55
62
|
# Or reserve an internal subdomain (instant, no DNS)
|
|
56
|
-
ship domains set my-site
|
|
63
|
+
ship domains set my-site.shipstatic.com
|
|
57
64
|
```
|
|
58
65
|
|
|
59
66
|
Internal domains (`my-site.shipstatic.com`) are free and instant. Custom domains require DNS configuration — the CLI prints the required records.
|
|
60
67
|
|
|
61
68
|
**Apex domains are not supported.** Always use a subdomain: `www.example.com`, not `example.com`.
|
|
62
69
|
|
|
63
|
-
## Workflow
|
|
70
|
+
## Workflow 4 — Link Domain to Deployment
|
|
64
71
|
|
|
65
72
|
```bash
|
|
66
73
|
# Link domain to a deployment
|
|
67
|
-
ship domains set www.example.com <deployment
|
|
74
|
+
ship domains set www.example.com <deployment>
|
|
68
75
|
|
|
69
76
|
# Switch to a different deployment (instant rollback)
|
|
70
|
-
ship domains set www.example.com <other-deployment
|
|
77
|
+
ship domains set www.example.com <other-deployment>
|
|
71
78
|
|
|
72
79
|
# For custom domains: verify DNS after configuring records
|
|
73
80
|
ship domains verify www.example.com
|
|
@@ -78,9 +85,9 @@ ship domains verify www.example.com
|
|
|
78
85
|
```bash
|
|
79
86
|
# Deployments
|
|
80
87
|
ship deployments list
|
|
81
|
-
ship deployments get <
|
|
82
|
-
ship deployments set <
|
|
83
|
-
ship deployments remove <
|
|
88
|
+
ship deployments get <deployment>
|
|
89
|
+
ship deployments set <deployment> --label production
|
|
90
|
+
ship deployments remove <deployment>
|
|
84
91
|
|
|
85
92
|
# Domains
|
|
86
93
|
ship domains list
|
|
@@ -94,4 +101,4 @@ ship whoami
|
|
|
94
101
|
ship ping
|
|
95
102
|
```
|
|
96
103
|
|
|
97
|
-
Use `--json` on any command for machine-readable output.
|
|
104
|
+
Use `--json` on any command for machine-readable output. Use `-q` for the key identifier only.
|