-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsii): selective exports declarations are ignored
When specific symbols are exported from a module using the *ExportDeclaration* syntax: ```ts export { Foo } from './foo'; ``` Those declarations would not be processed at all, because they lack the `ts.ModifierFlags.Export` modifier (which is to be expected from a declaration that **is** an export statement). Added the necessary code (and a test) to ensure these statements are correctly detected, and the exported symbols are correctly processed into the output assembly. Fixes #1818
- Loading branch information
1 parent
7a74bdb
commit 5e6452e
Showing
3 changed files
with
47 additions
and
4 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
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
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,16 @@ | ||
import { sourceToAssemblyHelper } from '../lib'; | ||
|
||
test('export { Foo } from "./foo"', async () => { | ||
const assembly = await sourceToAssemblyHelper({ | ||
'index.ts': 'export { Foo } from "./foo";', | ||
'foo.ts': 'export class Foo { private constructor() {} }', | ||
}); | ||
|
||
expect(assembly.types?.['testpkg.Foo']).toEqual({ | ||
assembly: 'testpkg', | ||
fqn: 'testpkg.Foo', | ||
kind: 'class', | ||
locationInModule: { filename: 'foo.ts', line: 1 }, | ||
name: 'Foo', | ||
}); | ||
}); |