ship-it-mcp 0.5.0 → 0.5.1
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/dist/lib/fs-scan.js +7 -7
- package/package.json +1 -1
package/dist/lib/fs-scan.js
CHANGED
|
@@ -173,7 +173,7 @@ export async function scanFolder(folderPath) {
|
|
|
173
173
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
174
174
|
for (const entry of entries) {
|
|
175
175
|
if (files.length >= MAX_FILES) {
|
|
176
|
-
throw new ScanError(`
|
|
176
|
+
throw new ScanError(`This folder has more than ${MAX_FILES.toLocaleString("en-US")} files, so it's probably your whole project, not just the website. Ship the folder that has your index.html in it.`);
|
|
177
177
|
}
|
|
178
178
|
const full = resolveInside(root, path.join(dir, entry.name));
|
|
179
179
|
const rel = path.relative(root, full);
|
|
@@ -195,7 +195,7 @@ export async function scanFolder(folderPath) {
|
|
|
195
195
|
continue;
|
|
196
196
|
}
|
|
197
197
|
if (entry.isSymbolicLink()) {
|
|
198
|
-
warnings.push(`Skipped
|
|
198
|
+
warnings.push(`Skipped "${relPosix}": it's a shortcut to a file somewhere else.`);
|
|
199
199
|
continue;
|
|
200
200
|
}
|
|
201
201
|
if (entry.isDirectory()) {
|
|
@@ -204,11 +204,11 @@ export async function scanFolder(folderPath) {
|
|
|
204
204
|
else if (entry.isFile()) {
|
|
205
205
|
const stat = await fs.stat(full);
|
|
206
206
|
if (stat.size > MAX_SINGLE_FILE_BYTES) {
|
|
207
|
-
throw new ScanError(`
|
|
207
|
+
throw new ScanError(`"${relPosix}" is ${(stat.size / 1024 / 1024).toFixed(1)} MB, and one file can be up to ${MAX_SINGLE_FILE_BYTES / 1024 / 1024} MB. Compress it, or put videos on YouTube or Vimeo and embed them.`);
|
|
208
208
|
}
|
|
209
209
|
totalBytes += stat.size;
|
|
210
210
|
if (totalBytes > HARD_MAX_BYTES) {
|
|
211
|
-
throw new ScanError(`
|
|
211
|
+
throw new ScanError(`This folder is over ${HARD_MAX_BYTES / 1024 / 1024} MB, the most one site can be. Compress big images, or embed videos from YouTube or Vimeo.`);
|
|
212
212
|
}
|
|
213
213
|
files.push({ absPath: full, relPath: rel, size: stat.size });
|
|
214
214
|
}
|
|
@@ -216,13 +216,13 @@ export async function scanFolder(folderPath) {
|
|
|
216
216
|
};
|
|
217
217
|
await walk(root);
|
|
218
218
|
if (files.length === 0) {
|
|
219
|
-
throw new ScanError(`
|
|
219
|
+
throw new ScanError(`There's nothing to ship in ${folderPath}. Is the folder empty?`);
|
|
220
220
|
}
|
|
221
221
|
if (totalBytes > WARN_BYTES) {
|
|
222
|
-
warnings.push(`
|
|
222
|
+
warnings.push(`This folder is ${(totalBytes / 1024 / 1024).toFixed(1)} MB, so the upload may take a minute.`);
|
|
223
223
|
}
|
|
224
224
|
if (!files.some((f) => /^index\.html?$/i.test(f.relPath))) {
|
|
225
|
-
warnings.push("
|
|
225
|
+
warnings.push("There's no index.html in this folder, so the link won't have a home page. Ship the folder that has your index.html in it.");
|
|
226
226
|
}
|
|
227
227
|
const keptPrivate = Array.from(keptPrivateSet).sort();
|
|
228
228
|
return { files, totalBytes, warnings, keptPrivate };
|