Skip to content

Commit 7d9bd42

Browse files
committed
fix: ignore installed dependencies in source snapshot
1 parent 97dc431 commit 7d9bd42

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

tools/__tests__/pack-artifacts.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ describe("pack artifact source snapshot", () => {
112112
const path = yield* Path.Path;
113113
const fixture = yield* repositoryFixture;
114114
const relative = "plugins/ask-gina/ignored-wrapper";
115+
yield* fs.makeDirectory(
116+
path.join(fixture.root, "packages/contracts/node_modules/synthetic-dependency"),
117+
{ recursive: true },
118+
);
119+
yield* fs.writeFileString(
120+
path.join(
121+
fixture.root,
122+
"packages/contracts/node_modules/synthetic-dependency/index.js",
123+
),
124+
"export {};\n",
125+
);
115126
const executable = path.join(fixture.root, relative);
116127
yield* fs.writeFileString(executable, `#!/bin/sh\ntouch '${fixture.impact}'\n`);
117128
yield* fs.chmod(executable, 0o755);

tools/pack-artifacts.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ const assertLiveSourceBoundary = (root: string, snapshot: string) =>
397397
.readDirectory(live)
398398
.pipe(Effect.mapError((cause) => fail(`cannot list ${relative}`, cause)));
399399
yield* Effect.forEach(names.sort(), (name) =>
400-
visit(path.join(live, name), path.join(committed, name), `${relative}/${name}`),
400+
name === "node_modules"
401+
? Effect.void
402+
: visit(path.join(live, name), path.join(committed, name), `${relative}/${name}`),
401403
);
402404
});
403405
yield* Effect.forEach(PACKAGES, (definition) =>

0 commit comments

Comments
 (0)