dts-bundle-generator
Advanced tools
Comparing version 9.2.3 to 9.2.4
@@ -1,2 +0,2 @@ | ||
// Generated by dts-bundle-generator v9.2.3 | ||
// Generated by dts-bundle-generator v9.2.4 | ||
@@ -3,0 +3,0 @@ export interface CompilationOptions { |
@@ -1,2 +0,2 @@ | ||
// Generated by dts-bundle-generator v9.2.3 | ||
// Generated by dts-bundle-generator v9.2.4 | ||
@@ -3,0 +3,0 @@ export interface CompilationOptions { |
@@ -778,3 +778,4 @@ "use strict"; | ||
} | ||
return (0, generate_output_1.generateOutput)({ | ||
const renamedAndNotExplicitlyExportedTypes = []; | ||
const output = (0, generate_output_1.generateOutput)({ | ||
...collectionResult, | ||
@@ -799,3 +800,3 @@ resolveIdentifierName: (identifier) => { | ||
// to put export keyword for this statement because we'll re-export it in the way | ||
let result = statementExports.length === 0 || statementExports.find((exp) => { | ||
const isExplicitlyExported = statementExports.find((exp) => { | ||
if (ts.isVariableStatement(statement)) { | ||
@@ -821,3 +822,3 @@ for (const variableDeclaration of statement.declarationList.declarations) { | ||
// but if `exportReferencedTypes` option is disabled we have to check direct export for them either | ||
const onlyDirectlyExportedShouldBeExported = !exportReferencedTypes | ||
const onlyExplicitlyExportedShouldBeExported = !exportReferencedTypes | ||
|| ts.isClassDeclaration(statement) | ||
@@ -828,11 +829,14 @@ || (ts.isEnumDeclaration(statement) && !(0, typescript_1.hasNodeModifier)(statement, ts.SyntaxKind.ConstKeyword)) | ||
|| ts.isModuleDeclaration(statement); | ||
if (onlyDirectlyExportedShouldBeExported) { | ||
if (onlyExplicitlyExportedShouldBeExported) { | ||
// "valuable" statements must be re-exported from root source file | ||
// to having export keyword in declaration file | ||
result = result && statementExports.length !== 0; | ||
return isExplicitlyExported; | ||
} | ||
else if ((0, typescript_1.isNodeNamedDeclaration)(statement) && !isExportedWithLocalName(statement, (0, typescript_1.getNodeName)(statement).getText())) { // eslint-disable-line @typescript-eslint/no-non-null-assertion | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if ((0, typescript_1.isNodeNamedDeclaration)(statement) && !isExportedWithLocalName(statement, (0, typescript_1.getNodeName)(statement).getText())) { | ||
// if a type node was renamed because of name collisions it shouldn't be exported with its new name | ||
renamedAndNotExplicitlyExportedTypes.push(statement); | ||
return false; | ||
} | ||
return result; | ||
return isExplicitlyExported || statementExports.length === 0; | ||
}, | ||
@@ -863,4 +867,10 @@ needStripConstFromConstEnum: (constEnum) => { | ||
}); | ||
if (renamedAndNotExplicitlyExportedTypes.length !== 0) { | ||
(0, logger_1.warnLog)(`The following type nodes were renamed because of the name collisions and will not be exported from the generated bundle:\n- ${ | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
renamedAndNotExplicitlyExportedTypes.map(node => `${(0, typescript_1.getNodeName)(node).getText()} (from ${node.getSourceFile().fileName})`).join('\n- ')}${'\n'}This might lead to unpredictable and unexpected output, and possible breaking changes to your API.${'\n'}Consider either (re-)exporting them explicitly from the entry point, or disable --export-referenced-types option ('output.exportReferencedTypes' in the config).`); | ||
} | ||
return output; | ||
}); | ||
} | ||
exports.generateDtsBundle = generateDtsBundle; |
{ | ||
"name": "dts-bundle-generator", | ||
"version": "9.2.3", | ||
"version": "9.2.4", | ||
"description": "DTS Bundle Generator", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle-generator.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161614
2937