Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-extractor] add basic support for import * as module from './local-module' #1796

Merged
merged 39 commits into from
Jun 30, 2021
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
efdde26
added support for 'import * as module from ./local-module'
mckn Mar 25, 2020
1a94da5
added change description.
mckn Mar 25, 2020
79b397e
fixed so we return a proper error messae.
mckn Mar 25, 2020
6e8b0e2
fixed build errors.
mckn Mar 26, 2020
9c3d85a
added missing annotation.
mckn Mar 26, 2020
ec5757a
fixed feedback on pr.
mckn Mar 27, 2020
a4ea1c1
added tests.
mckn Mar 30, 2020
90032e9
merged master into branch.
mckn Apr 2, 2020
64e2c66
fixed version missmatch.
mckn Apr 2, 2020
c88df79
Convert "api-extractor-test-no-report" to be a scenario test
octogonz Apr 7, 2020
dc9bb83
Convert test functions to be stereotypical functions instead of lambd…
octogonz Apr 7, 2020
24ddf89
Merge remote-tracking branch 'remotes/origin/master' into octogonz/ex…
octogonz Apr 16, 2020
0b81dfb
Adjust changelog
octogonz Apr 16, 2020
3651886
Improve test to show how top-level name conflicts are handled
octogonz Apr 17, 2020
de80229
Show how aliases are handled
octogonz Apr 17, 2020
dd449f4
Refactor AstEntity into a proper base class
octogonz May 16, 2020
04a5563
Merge remote-tracking branch 'remotes/origin/release/master-before-pr…
octogonz Aug 28, 2020
11db642
Reapply Prettier following the steps in this comment:
octogonz Aug 28, 2020
872bccb
Merge remote-tracking branch 'remotes/origin/master' into export-star…
octogonz Aug 28, 2020
9481016
Fix lint warnings from merge
octogonz Aug 28, 2020
828baad
Some minor cleanups (no semantic changes)
octogonz Aug 28, 2020
4fbadd8
Add class documentation, rename "exportName" to "namespaceName"
octogonz Aug 28, 2020
cfc693c
Rename AstImportAsModule --> AstNamespaceImport because that's what t…
octogonz Aug 28, 2020
2e75e83
Rename AstImportAsModule --> AstNamespaceImport because that's what t…
octogonz Aug 28, 2020
b2fa123
Tune up the code for generating the .d.ts rollup and add a location f…
octogonz Aug 28, 2020
857a27a
Start work on generating an API report for namespace imports
octogonz Aug 28, 2020
cdc1678
Merge branch 'master' into export-star-as-support
mckn Oct 1, 2020
88ce9ca
fixed issue in change log.
mckn Oct 1, 2020
7ff319d
Merge remote-tracking branch 'remotes/origin/master' into export-star…
octogonz Jun 25, 2021
615a387
rush build
octogonz Jun 25, 2021
2e100e6
Update lockfile
octogonz Jun 25, 2021
8cac97b
Include /// directives in API report, since they are relevant to API …
octogonz Jun 26, 2021
66636f4
Introduce CollectorEntity.consumable distinction to ensure that AstNa…
octogonz Jun 27, 2021
ec267b3
Fix an issue where DocCommentEnhancer was skipping AstNamespaceImport…
octogonz Jun 27, 2021
0ba9748
Eliminate trailing comma
octogonz Jun 27, 2021
51acb54
Add a second test case
octogonz Jun 30, 2021
12799aa
Implement the missing ae-forgotten-export analysis for AstNamespaceIm…
octogonz Jun 30, 2021
fcc005a
Update change log
octogonz Jun 30, 2021
73a3498
Improve the error message for not yet supported "export * as ___ from…
octogonz Jun 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed so we return a proper error messae.
  • Loading branch information
mckn committed Mar 25, 2020
commit 79b397e86066c94651f0a3047218d171289ea228
8 changes: 6 additions & 2 deletions apps/api-extractor/src/generators/ApiReportGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ export class ApiReportGenerator {
}

if (entity.astEntity instanceof AstImportAsModule) {
// TODO [MA]: add file path to error message.
throw new Error('"import * as ___ from ___;" is not supported for local files when generating report.'
+ '\nFailure in: ' + 'entity.astEntity.getSourceFile().fileName');
+ '\nFailure in: ' + ApiReportGenerator._getSourceFilePath(entity.astEntity));
}

// Now emit the export statements for this entity.
Expand Down Expand Up @@ -167,6 +166,11 @@ export class ApiReportGenerator {
return stringWriter.toString().replace(ApiReportGenerator._TrimSpacesRegExp, '');
}

private static _getSourceFilePath(importAsModule: AstImportAsModule): string {
const sourceFile: ts.SourceFile = importAsModule.astModule?.sourceFile?.getSourceFile();
return sourceFile ? sourceFile.fileName : 'unkown source file';
}

/**
* Before writing out a declaration, _modifySpan() applies various fixups to make it nice.
*/
Expand Down