@shipstatic/drop 2.16.1-beta.5 → 2.16.1-beta.6
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 +14 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -186,19 +186,22 @@ import { FileValidationStatus } from '@shipstatic/ship';
|
|
|
186
186
|
const ready = drop.files.filter(f => f.status === FileValidationStatus.READY);
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
##
|
|
189
|
+
## A project that isn't built
|
|
190
190
|
|
|
191
191
|
Drop recognises an unbuilt project (source files with `package.json` / `node_modules`) and sets `needsBuild`. `node_modules` stays behind (it is skipped during traversal and stripped from folder-picker selections), and so does whatever the project's `.gitignore` lists, read the way git reads it, so an old `dist/` the project ignores never rides along. A project's source isn't the site, so the deploy rules, the `index.html` at the top among them, don't apply to it: Astro, Next.js, SvelteKit and Eleventy have no `index.html` until they are built, and the rules judge what the build makes. Every file goes straight to `ready`, and the build gives the verdict.
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
ShipStatic's API publishes the files you send and doesn't build them, so check the signal before you deploy, and ask for the built folder instead:
|
|
194
194
|
|
|
195
195
|
```tsx
|
|
196
|
-
|
|
197
|
-
build
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
if (drop.needsBuild) {
|
|
197
|
+
showMessage("This project isn't built yet. Build it, then drop the folder the build makes, like dist.");
|
|
198
|
+
} else {
|
|
199
|
+
await ship.deployments.upload(drop.getFilesForUpload());
|
|
200
|
+
}
|
|
200
201
|
```
|
|
201
202
|
|
|
203
|
+
ShipStatic's own apps send a project to be built. That isn't part of the public API.
|
|
204
|
+
|
|
202
205
|
## ZIP handling
|
|
203
206
|
|
|
204
207
|
A **single** dropped ZIP is extracted and its contents deployed. ZIPs among several files are treated as ordinary files. Archive paths are sanitized against directory traversal (`../../config.json` → `config.json`).
|
|
@@ -213,11 +216,13 @@ import { FileValidationStatus } from '@shipstatic/ship';
|
|
|
213
216
|
|
|
214
217
|
const outcome = await processFiles(files, { limits: await ship.getLimits() });
|
|
215
218
|
|
|
216
|
-
if (outcome.phase === '
|
|
219
|
+
if (outcome.phase === 'error') {
|
|
220
|
+
console.error(outcome.status.title, outcome.status.details);
|
|
221
|
+
} else if (outcome.needsBuild) {
|
|
222
|
+
console.error("This project isn't built yet. Build it, then drop the folder the build makes.");
|
|
223
|
+
} else {
|
|
217
224
|
const ready = outcome.files.filter(f => f.status === FileValidationStatus.READY);
|
|
218
225
|
await ship.deployments.upload(ready.map(f => f.file));
|
|
219
|
-
} else {
|
|
220
|
-
console.error(outcome.status.title, outcome.status.details);
|
|
221
226
|
}
|
|
222
227
|
```
|
|
223
228
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipstatic/drop",
|
|
3
|
-
"version": "2.16.1-beta.
|
|
3
|
+
"version": "2.16.1-beta.6",
|
|
4
4
|
"description": "Headless React hook that prepares files for ShipStatic deployments: drag and drop with folder support, ZIP extraction, path normalization, and validation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@shipstatic/ship": "3.12.0-beta.
|
|
93
|
+
"@shipstatic/ship": "3.12.0-beta.7",
|
|
94
94
|
"fflate": "^0.8.3",
|
|
95
95
|
"ignore": "7.0.12"
|
|
96
96
|
},
|