Skip to content

Commit 3006ca0

Browse files
authored
fix: add logs to detect forceignored files W-18715150 (#1596)
* fix: add logger to detect hidden dir * fix: add logger * fix: add log comment
1 parent be8aec6 commit 3006ca0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/convert/streams.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ export class StandardWriter extends ComponentWriter {
141141
if (chunk.writeInfos.length !== 0) {
142142
try {
143143
const toResolve = new Set<string>();
144+
144145
// it is a reasonable expectation that when a conversion call exits, the files of
145146
// every component has been written to the destination. This await ensures the microtask
146147
// queue is empty when that call exits and overall less memory is consumed.
147148
await Promise.all(
148149
chunk.writeInfos
149150
.map(makeWriteInfoAbsolute(this.rootDestination))
150-
.filter(existsOrDoesntMatchIgnored(this.forceignore))
151+
.filter(existsOrDoesntMatchIgnored(this.forceignore, this.logger)) // Skip files matched by default ignore
151152
.map((info) => {
152153
if (info.shouldDelete) {
153154
this.deleted.push({
@@ -304,6 +305,13 @@ const makeWriteInfoAbsolute =
304305
});
305306

306307
const existsOrDoesntMatchIgnored =
307-
(forceignore: ForceIgnore) =>
308-
(writeInfo: WriteInfo): boolean =>
309-
existsSync(writeInfo.output) || forceignore.accepts(writeInfo.output);
308+
(forceignore: ForceIgnore, logger: Logger) =>
309+
(writeInfo: WriteInfo): boolean => {
310+
const result = existsSync(writeInfo.output) || forceignore.accepts(writeInfo.output);
311+
312+
// Detect if file was ignored by .forceignore patterns
313+
if (!result) {
314+
logger.debug(`File ${writeInfo.output} was ignored or not exists`);
315+
}
316+
return result;
317+
};

0 commit comments

Comments
 (0)