-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/codegen): Fix codegen of type-only export declarations (#8447)
**Description:** This fixes the emit for `export type { } from "..."` and `export { type A } from "..."`.
- Loading branch information
Showing
10 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_codegen/tests/fixture/typescript/exports/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type * as test from "./a.ts"; | ||
export type { a } from "./a.ts"; | ||
export { b, type b2 } from "./b.ts"; |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_codegen/tests/fixture/typescript/exports/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type * as test from "./a.ts"; | ||
export type { a } from "./a.ts"; | ||
export { b, type b2 } from "./b.ts"; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_codegen/tests/fixture/typescript/exports/output.min.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type*as test from"./a.ts";export type{a}from"./a.ts";export{b,type b2}from"./b.ts"; |
4 changes: 4 additions & 0 deletions
4
crates/swc_ecma_codegen/tests/fixture/typescript/imports/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type test from "./a.ts"; | ||
import type { a } from "./a.ts"; | ||
import type * as name from "./a.ts"; | ||
import { b, type c } from "./a.ts"; |
4 changes: 4 additions & 0 deletions
4
crates/swc_ecma_codegen/tests/fixture/typescript/imports/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type test from "./a.ts"; | ||
import type { a } from "./a.ts"; | ||
import type * as name from "./a.ts"; | ||
import { b, type c } from "./a.ts"; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_codegen/tests/fixture/typescript/imports/output.min.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import type test from"./a.ts";import type{a}from"./a.ts";import type*as name from"./a.ts";import{b,type c}from"./a.ts"; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_codegen/tests/fixture/typescript/ts_import_equals/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import Test1 = MyNamespace.Test1; | ||
import Test2 = Test1; | ||
export import Test3 = Test1; |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_codegen/tests/fixture/typescript/ts_import_equals/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import Test1 = MyNamespace.Test1; | ||
import Test2 = Test1; | ||
export import Test3 = Test1; |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_codegen/tests/fixture/typescript/ts_import_equals/output.min.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import Test1=MyNamespace.Test1;import Test2=Test1; | ||
import Test1=MyNamespace.Test1;import Test2=Test1;export import Test3=Test1; |