typings-core
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -13,3 +13,3 @@ "use strict"; | ||
if (out == null) { | ||
return Promise.reject(new TypeError('Out directory is required for bundle')); | ||
return Promise.reject(new TypeError('Out file path is required for bundle')); | ||
} | ||
@@ -16,0 +16,0 @@ return dependencies_1.resolveAllDependencies({ cwd: cwd, dev: false, global: false, emitter: emitter }) |
@@ -280,13 +280,17 @@ "use strict"; | ||
var hasExports = false; | ||
var hasDefaultExport = false; | ||
var hasExportEquals = false; | ||
var hasLocalImports = false; | ||
var wasDeclared = false; | ||
function replacer(node) { | ||
if (node.kind === ts.SyntaxKind.ExportAssignment || | ||
node.kind === ts.SyntaxKind.ExportDeclaration) { | ||
if (node.kind === ts.SyntaxKind.ExportAssignment) { | ||
hasDefaultExport = !node.isExportEquals; | ||
hasExportEquals = !hasDefaultExport; | ||
} | ||
else if (node.kind === ts.SyntaxKind.ExportDeclaration) { | ||
hasExports = true; | ||
} | ||
else { | ||
hasExports = hasExports || | ||
!!(node.flags & ts.NodeFlags.Export) || | ||
!!(node.flags & ts.NodeFlags.Default); | ||
hasExports = hasExports || !!(node.flags & ts.NodeFlags.Export); | ||
hasDefaultExport = hasDefaultExport || !!(node.flags & ts.NodeFlags.Default); | ||
} | ||
@@ -324,4 +328,19 @@ if (node.kind === ts.SyntaxKind.StringLiteral && | ||
function alias(name) { | ||
var reexport = "import alias = require('" + modulePath + "');" + path_2.EOL + "export = alias;"; | ||
return hasExports ? declareText(name, reexport) : ''; | ||
var imports = []; | ||
if (hasExportEquals) { | ||
imports.push("import main = require('" + modulePath + "');"); | ||
imports.push("export = main;"); | ||
} | ||
else { | ||
if (hasExports) { | ||
imports.push("export * from '" + modulePath + "';"); | ||
} | ||
if (hasDefaultExport) { | ||
imports.push("export { default } from '" + modulePath + "';"); | ||
} | ||
} | ||
if (imports.length === 0) { | ||
return ''; | ||
} | ||
return declareText(name, imports.join(path_2.EOL)); | ||
} | ||
@@ -328,0 +347,0 @@ var isEntry = rawPath === entry; |
@@ -70,2 +70,9 @@ "use strict"; | ||
var raw = "registry:" + meta.source + "/" + meta.name + "#" + entry.tag; | ||
if (entry.deprecated) { | ||
options.emitter.emit('deprecated', { | ||
parent: options.parent, | ||
raw: dependency.raw, | ||
date: new Date(entry.deprecated) | ||
}); | ||
} | ||
return resolveDependencyInternally(type, location, raw, options); | ||
@@ -72,0 +79,0 @@ }, function (error) { |
{ | ||
"name": "typings-core", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "The logic of Typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/typings.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
198444
2640