@shipstatic/drop 2.13.0 → 2.14.0-beta.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.
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -264,6 +264,7 @@ function applyStatus(files, status, statusMessage) {
|
|
|
264
264
|
...statusMessage === void 0 ? {} : { statusMessage }
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
|
+
var NEVER_SOURCE = /* @__PURE__ */ new Set(["node_modules", ".git", "__MACOSX"]);
|
|
267
268
|
function segments(file) {
|
|
268
269
|
return filePath(file).replace(/\\/g, "/").split("/").filter(Boolean);
|
|
269
270
|
}
|
|
@@ -281,7 +282,7 @@ function rebase(line, base) {
|
|
|
281
282
|
return `${negated ? "!" : ""}${rebased}${directoryOnly ? "/" : ""}`;
|
|
282
283
|
}
|
|
283
284
|
async function projectSource(files) {
|
|
284
|
-
const source = files.filter((file) => !segments(file).
|
|
285
|
+
const source = files.filter((file) => !segments(file).some((part) => NEVER_SOURCE.has(part)));
|
|
285
286
|
const rules = source.map((file) => ({ file, parts: segments(file) })).filter(({ parts }) => parts.at(-1) === ".gitignore").sort((a, b) => a.parts.length - b.parts.length);
|
|
286
287
|
if (rules.length === 0) return source;
|
|
287
288
|
const matcher = ignore({ allowRelativePaths: true });
|
|
@@ -1012,10 +1013,11 @@ async function processFiles(input, { limits, onStatus }) {
|
|
|
1012
1013
|
}
|
|
1013
1014
|
const needsBuild = files.some((f) => hasUnbuiltMarker(filePath(f)));
|
|
1014
1015
|
if (needsBuild) files = await projectSource(files);
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
files.filter((f) => kept.has(filePath(f)))
|
|
1018
|
-
|
|
1016
|
+
if (!needsBuild) {
|
|
1017
|
+
const kept = new Set(filterJunk(files.map(filePath)));
|
|
1018
|
+
files = files.filter((f) => kept.has(filePath(f)));
|
|
1019
|
+
}
|
|
1020
|
+
const finalFiles = stripCommonPrefix(files.map((f) => createProcessedFile(f)));
|
|
1019
1021
|
if (needsBuild) {
|
|
1020
1022
|
const ready = applyStatus(finalFiles, FileValidationStatus.READY);
|
|
1021
1023
|
return {
|