Skip to content

Commit

Permalink
Fix .d.cts/.d.mts files breaking declaration generation (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Dec 7, 2023
1 parent f902547 commit d79abf2
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-coins-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@preconstruct/cli": patch
---

Fix `.d.cts`/`.d.mts` files breaking declaration generation
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16
20
20 changes: 16 additions & 4 deletions packages/cli/src/build/__tests__/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,10 @@ test("correct default export using mjs and dmts proxies", async () => {
`);
expect(tsc.stderr.toString("utf8")).toMatchInlineSnapshot(`""`);

let node = await spawn("node", ["runtime-blah.mjs"], { cwd: dir });
let node = await spawn("node", ["runtime-blah.mjs"], {
cwd: dir,
env: { ...process.env, FORCE_COLOR: undefined, NO_COLOR: "1" },
});

expect(node.code).toBe(0);
expect(node.stdout.toString("utf8")).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -1576,7 +1579,10 @@ test("no __esModule when reexporting namespace with mjs proxy", async () => {
`);

let node = await spawn("node", ["runtime-blah.mjs"], { cwd: dir });
let node = await spawn("node", ["runtime-blah.mjs"], {
cwd: dir,
env: { ...process.env, FORCE_COLOR: undefined, NO_COLOR: "1" },
});

expect(node.code).toBe(0);
expect(node.stdout.toString("utf8")).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -1735,7 +1741,10 @@ test("export * from external", async () => {
`);

let node = await spawn("node", ["runtime-blah.mjs"], { cwd: dir });
let node = await spawn("node", ["runtime-blah.mjs"], {
cwd: dir,
env: { ...process.env, FORCE_COLOR: undefined, NO_COLOR: "1" },
});

expect(node.code).toBe(0);
expect(node.stdout.toString("utf8")).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -2171,7 +2180,10 @@ test("correct default export using mjs and dmts proxies with moduleResolution: b
`);
expect(tsc.stderr.toString("utf8")).toMatchInlineSnapshot(`""`);

let node = await spawn("node", ["runtime-blah.mjs"], { cwd: dir });
let node = await spawn("node", ["runtime-blah.mjs"], {
cwd: dir,
env: { ...process.env, FORCE_COLOR: undefined, NO_COLOR: "1" },
});

expect(node.code).toBe(0);
expect(node.stdout.toString("utf8")).toMatchInlineSnapshot(`
Expand Down

0 comments on commit d79abf2

Please sign in to comment.