Comparing version 0.34.3 to 0.35.0
{ | ||
"name": "tsickle", | ||
"version": "0.34.3", | ||
"version": "0.35.0", | ||
"description": "Transpile TypeScript code to JavaScript with Closure annotations.", | ||
@@ -20,5 +20,6 @@ "main": "src/tsickle.js", | ||
"peerDependencies": { | ||
"typescript": "~3.3.1" | ||
"typescript": "~3.4.1" | ||
}, | ||
"devDependencies": { | ||
"@bazel/typescript": "^0.24.1", | ||
"@types/diff-match-patch": "^1.0.32", | ||
@@ -38,3 +39,3 @@ "@types/glob": "5.0.35", | ||
"tslint": "5.11.0", | ||
"typescript": "3.3.1" | ||
"typescript": "~3.4.1" | ||
}, | ||
@@ -41,0 +42,0 @@ "scripts": { |
@@ -52,2 +52,18 @@ # Tsickle - TypeScript to Closure Translator [![Build Status](https://circleci.com/gh/angular/tsickle.svg?style=svg)](https://circleci.com/gh/angular/tsickle) [![Windows build](https://ci.appveyor.com/api/projects/status/puxdblmlqbofqqt1/branch/master?svg=true)](https://ci.appveyor.com/project/alexeagle/tsickle/branch/master) | ||
### Output format | ||
Tsickle is designed to do whatever is necessary to make the code acceptable by | ||
Closure compiler. We view its output as a necessary intermediate form for | ||
communicating to the Closure compiler, and not something for humans. This means | ||
the tsickle output may be kind of ugly to read. Its only real use is to pass it | ||
on to the compiler. | ||
For one example, the syntax of types tsickle produces are specific to Closure. | ||
The type `{!Foo}` means "Foo, excluding null" and a type alias becomes a `var` | ||
statement that is tagged with `@typedef`. | ||
Tsickle emits modules using Closure's `goog.module` module system. This system | ||
is similar to but different from ES modules, and was supported by Closure before | ||
the ES module system was finalized. | ||
### Differences from TypeScript | ||
@@ -54,0 +70,0 @@ |
@@ -19,4 +19,4 @@ /** | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var assert = require("assert"); | ||
var path = require("path"); | ||
const assert = require("assert"); | ||
const path = require("path"); | ||
/** | ||
@@ -29,3 +29,3 @@ * asserts that the given fileName is an absolute path. | ||
function assertAbsolute(fileName) { | ||
assert(path.isAbsolute(fileName), "expected " + JSON.stringify(fileName) + " to be absolute"); | ||
assert(path.isAbsolute(fileName), `expected ${JSON.stringify(fileName)} to be absolute`); | ||
} | ||
@@ -57,3 +57,3 @@ exports.assertAbsolute = assertAbsolute; | ||
// Replace characters not supported by goog.module. | ||
var moduleName = fileName.replace(/\/|\\/g, '.').replace(/^[^a-zA-Z_$]/, '_').replace(/[^a-zA-Z0-9._$]/g, '_'); | ||
const moduleName = fileName.replace(/\/|\\/g, '.').replace(/^[^a-zA-Z_$]/, '_').replace(/[^a-zA-Z0-9._$]/g, '_'); | ||
return moduleName; | ||
@@ -63,2 +63,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpX3N1cHBvcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpX3N1cHBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7SUFFSCwrQkFBaUM7SUFDakMsMkJBQTZCO0lBRTdCOzs7OztPQUtHO0lBQ0gsU0FBZ0IsY0FBYyxDQUFDLFFBQWdCO1FBQzdDLE1BQU0sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxFQUFFLGNBQVksSUFBSSxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsb0JBQWlCLENBQUMsQ0FBQztJQUMzRixDQUFDO0lBRkQsd0NBRUM7SUFFRDs7O09BR0c7SUFDSCxTQUFnQixnQkFBZ0IsQ0FDNUIsY0FBc0IsRUFBRSxPQUFlLEVBQUUsUUFBZ0I7UUFDM0QsUUFBUSxHQUFHLFFBQVEsQ0FBQyxPQUFPLENBQUMsZ0JBQWdCLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFbEQsSUFBSSxRQUFRLENBQUMsQ0FBQyxDQUFDLEtBQUssR0FBRyxFQUFFO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bGF0aXZlKHJvb3RNb2R1bGVQYXRoLCBmaWxlTmFtZSk7XG4gIH1cblxuICAvLyBSZXBsYWNlIGNoYXJhY3RlcnMgbm90IHN1cHBvcnRlZCBieSBnb29nLm1vZHVsZS5cbiAgY29uc3QgbW9kdWxlTmFtZSA9XG4gICAgICBmaWxlTmFtZS5yZXBsYWNlKC9cXC98XFxcXC9nLCAnLicpLnJlcGxhY2UoL15bXmEtekEtWl8kXS8sICdfJykucmVwbGFjZSgvW15hLXpBLVowLTkuXyRdL2csICdfJyk7XG5cbiAgcmV0dXJuIG1vZHVsZU5hbWU7XG59XG4iXX0= |
@@ -83,1 +83,17 @@ /** | ||
var SymbolConstructor; | ||
/** | ||
* This is a placeholder for a Closure type to be determined. | ||
* @constructor | ||
*/ | ||
function bigintPlaceholder() {} | ||
/** @typedef {!Object} */ | ||
var GlobalFetch; | ||
/** | ||
* @interface | ||
* @extends{WorkerGlobalScope} | ||
* @extends{Window} | ||
*/ | ||
var WindowOrWorkerGlobalScope; |
@@ -8,12 +8,2 @@ /** | ||
*/ | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
(function (factory) { | ||
@@ -30,4 +20,4 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
var transformer_util_1 = require("tsickle/src/transformer_util"); | ||
const ts = require("typescript"); | ||
const transformer_util_1 = require("tsickle/src/transformer_util"); | ||
/** | ||
@@ -38,3 +28,3 @@ * Returns the declarations for the given decorator. | ||
// Walk down the expression to find the identifier of the decorator function. | ||
var node = decorator; | ||
let node = decorator; | ||
while (node.kind !== ts.SyntaxKind.Identifier) { | ||
@@ -49,3 +39,3 @@ if (node.kind === ts.SyntaxKind.Decorator || node.kind === ts.SyntaxKind.CallExpression) { | ||
} | ||
var decSym = typeChecker.getSymbolAtLocation(node); | ||
let decSym = typeChecker.getSymbolAtLocation(node); | ||
if (!decSym) | ||
@@ -65,3 +55,3 @@ return []; | ||
return node.decorators && | ||
node.decorators.some(function (decorator) { return isExportingDecorator(decorator, typeChecker); }); | ||
node.decorators.some(decorator => isExportingDecorator(decorator, typeChecker)); | ||
} | ||
@@ -73,23 +63,12 @@ exports.hasExportingDecorator = hasExportingDecorator; | ||
function isExportingDecorator(decorator, typeChecker) { | ||
return getDecoratorDeclarations(decorator, typeChecker).some(function (declaration) { | ||
var e_1, _a; | ||
var range = transformer_util_1.getAllLeadingComments(declaration); | ||
return getDecoratorDeclarations(decorator, typeChecker).some(declaration => { | ||
const range = transformer_util_1.getAllLeadingComments(declaration); | ||
if (!range) { | ||
return false; | ||
} | ||
try { | ||
for (var range_1 = __values(range), range_1_1 = range_1.next(); !range_1_1.done; range_1_1 = range_1.next()) { | ||
var text = range_1_1.value.text; | ||
if (/@ExportDecoratedItems\b/.test(text)) { | ||
return true; | ||
} | ||
for (const { text } of range) { | ||
if (/@ExportDecoratedItems\b/.test(text)) { | ||
return true; | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (range_1_1 && !range_1_1.done && (_a = range_1.return)) _a.call(range_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return false; | ||
@@ -99,2 +78,2 @@ }); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVILCtCQUFpQztJQ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hcyBhbiBARXhwb3J0RGVjb3JhdGVkSXRlbXMgZGlyZWN0aXZlIGluIGl0cyBKU0RvYy5cbiAqL1xuZnVuY3Rpb24gaXNFeHBvcnRpbmdEZWNvcmF0b3IoZGVjb3JhdG9yOiB0cy5EZWNvcmF0b3IsIHR5cGVDaGVja2VyOiB0cy5UeXBlQ2hlY2tlcikge1xuICByZXR1cm4gZ2V0RGVjb3JhdG9yRGVjbGFyYXRpb25zKGRlY29yYXRvciwgdHlwZUNoZWNrZXIpLnNvbWUoZGVjbGFyYXRpb24gPT4ge1xuICAgIGNvbnN0IHJhbmdlID0gZ2V0QWxsTGVhZGluZ0NvbW1lbnRzKGRlY2xhcmF0aW9uKTtcbiAgICBpZiAoIXJhbmdlKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIGZvciAoY29uc3Qge3RleHR9IG9mIHJhbmdlKSB7XG4gICAgICBpZiAoL0BFeHBvcnREZWNvcmF0ZWRJdGVtc1xcYi8udGVzdCh0ZXh0KSkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9KTtcbn1cbiJdfQ== |
@@ -8,12 +8,2 @@ /** | ||
*/ | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
(function (factory) { | ||
@@ -42,4 +32,4 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
*/ | ||
var ts = require("typescript"); | ||
var transformer_util_1 = require("tsickle/src/transformer_util"); | ||
const ts = require("typescript"); | ||
const transformer_util_1 = require("tsickle/src/transformer_util"); | ||
/** isInNamespace returns true if any of node's ancestors is a namespace (ModuleDeclaration). */ | ||
@@ -49,3 +39,3 @@ function isInNamespace(node) { | ||
// no longer being set. | ||
var parent = ts.getOriginalNode(node).parent; | ||
let parent = ts.getOriginalNode(node).parent; | ||
while (parent) { | ||
@@ -67,3 +57,3 @@ if (parent.kind === ts.SyntaxKind.ModuleDeclaration) { | ||
} | ||
var type = typeChecker.getTypeAtLocation(member.initializer); | ||
const type = typeChecker.getTypeAtLocation(member.initializer); | ||
// Note: checking against 'NumberLike' instead of just 'Number' means this code | ||
@@ -86,23 +76,12 @@ // handles both | ||
function getEnumType(typeChecker, enumDecl) { | ||
var e_1, _a; | ||
var hasNumber = false; | ||
var hasString = false; | ||
try { | ||
for (var _b = __values(enumDecl.members), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var member = _c.value; | ||
var type = getEnumMemberType(typeChecker, member); | ||
if (type === 'string') { | ||
hasString = true; | ||
} | ||
else if (type === 'number') { | ||
hasNumber = true; | ||
} | ||
let hasNumber = false; | ||
let hasString = false; | ||
for (const member of enumDecl.members) { | ||
const type = getEnumMemberType(typeChecker, member); | ||
if (type === 'string') { | ||
hasString = true; | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
else if (type === 'number') { | ||
hasNumber = true; | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
@@ -128,5 +107,4 @@ if (hasNumber && hasString) { | ||
function enumTransformer(typeChecker, diagnostics) { | ||
return function (context) { | ||
return (context) => { | ||
function visitor(node) { | ||
var e_2, _a, e_3, _b; | ||
if (!ts.isEnumDeclaration(node)) | ||
@@ -144,58 +122,48 @@ return ts.visitEachChild(node, visitor, context); | ||
return ts.visitEachChild(node, visitor, context); | ||
var name = node.name.getText(); | ||
var isExported = transformer_util_1.hasModifierFlag(node, ts.ModifierFlags.Export); | ||
var enumType = getEnumType(typeChecker, node); | ||
var values = []; | ||
var enumIndex = 0; | ||
try { | ||
for (var _c = __values(node.members), _d = _c.next(); !_d.done; _d = _c.next()) { | ||
var member = _d.value; | ||
var enumValue = void 0; | ||
if (member.initializer) { | ||
var enumConstValue = typeChecker.getConstantValue(member); | ||
if (typeof enumConstValue === 'number') { | ||
enumIndex = enumConstValue + 1; | ||
enumValue = ts.createLiteral(enumConstValue); | ||
} | ||
else { | ||
// Non-numeric enum value (string or an expression). | ||
// Emit this initializer expression as-is. | ||
// Note: if the member's initializer expression refers to another | ||
// value within the enum (e.g. something like | ||
// enum Foo { | ||
// Field1, | ||
// Field2 = Field1 + something(), | ||
// } | ||
// Then when we emit the initializer we produce invalid code because | ||
// on the Closure side the reference to Field1 has to be namespaced, | ||
// e.g. written "Foo.Field1 + something()". | ||
// Hopefully this doesn't come up often -- if the enum instead has | ||
// something like | ||
// Field2 = Field1 + 3, | ||
// then it's still a constant expression and we inline the constant | ||
// value in the above branch of this "if" statement. | ||
enumValue = visitor(member.initializer); | ||
} | ||
const name = node.name.getText(); | ||
const isExported = transformer_util_1.hasModifierFlag(node, ts.ModifierFlags.Export); | ||
const enumType = getEnumType(typeChecker, node); | ||
const values = []; | ||
let enumIndex = 0; | ||
for (const member of node.members) { | ||
let enumValue; | ||
if (member.initializer) { | ||
const enumConstValue = typeChecker.getConstantValue(member); | ||
if (typeof enumConstValue === 'number') { | ||
enumIndex = enumConstValue + 1; | ||
enumValue = ts.createLiteral(enumConstValue); | ||
} | ||
else { | ||
enumValue = ts.createLiteral(enumIndex); | ||
enumIndex++; | ||
// Non-numeric enum value (string or an expression). | ||
// Emit this initializer expression as-is. | ||
// Note: if the member's initializer expression refers to another | ||
// value within the enum (e.g. something like | ||
// enum Foo { | ||
// Field1, | ||
// Field2 = Field1 + something(), | ||
// } | ||
// Then when we emit the initializer we produce invalid code because | ||
// on the Closure side the reference to Field1 has to be namespaced, | ||
// e.g. written "Foo.Field1 + something()". | ||
// Hopefully this doesn't come up often -- if the enum instead has | ||
// something like | ||
// Field2 = Field1 + 3, | ||
// then it's still a constant expression and we inline the constant | ||
// value in the above branch of this "if" statement. | ||
enumValue = visitor(member.initializer); | ||
} | ||
var memberName = member.name.getText(); | ||
values.push(ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(memberName, enumValue), member), member)); | ||
} | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c); | ||
else { | ||
enumValue = ts.createLiteral(enumIndex); | ||
enumIndex++; | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
const memberName = member.name.getText(); | ||
values.push(ts.setOriginalNode(ts.setTextRange(ts.createPropertyAssignment(memberName, enumValue), member), member)); | ||
} | ||
var varDecl = ts.createVariableStatement( | ||
const varDecl = ts.createVariableStatement( | ||
/* modifiers */ undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, undefined, ts.createObjectLiteral(ts.setTextRange(ts.createNodeArray(values, true), node.members), true))], | ||
/* create a const var */ ts.NodeFlags.Const)); | ||
var comment = { | ||
const comment = { | ||
kind: ts.SyntaxKind.MultiLineCommentTrivia, | ||
text: "* @enum {" + enumType + "} ", | ||
text: `* @enum {${enumType}} `, | ||
hasTrailingNewLine: true, | ||
@@ -206,3 +174,3 @@ pos: -1, | ||
ts.setSyntheticLeadingComments(varDecl, [comment]); | ||
var resultNodes = [varDecl]; | ||
const resultNodes = [varDecl]; | ||
if (isExported) { | ||
@@ -220,39 +188,29 @@ // Create a separate export {...} statement, so that the enum name can be used in local | ||
} | ||
try { | ||
// Emit the reverse mapping of foo[foo.BAR] = 'BAR'; lines for number enum members | ||
for (var _e = __values(node.members), _f = _e.next(); !_f.done; _f = _e.next()) { | ||
var member = _f.value; | ||
var memberName = member.name; | ||
var memberType = getEnumMemberType(typeChecker, member); | ||
if (memberType !== 'number') | ||
continue; | ||
// TypeScript enum members can have Identifier names or String names. | ||
// We need to emit slightly different code to support these two syntaxes: | ||
var nameExpr = void 0; | ||
var memberAccess = void 0; | ||
if (ts.isIdentifier(memberName)) { | ||
// Foo[Foo.ABC] = "ABC"; | ||
nameExpr = transformer_util_1.createSingleQuoteStringLiteral(memberName.text); | ||
// Make sure to create a clean, new identifier, so comments do not get emitted twice. | ||
var ident = ts.createIdentifier(transformer_util_1.getIdentifierText(memberName)); | ||
memberAccess = ts.createPropertyAccess(ts.createIdentifier(name), ident); | ||
} | ||
else { | ||
// Foo[Foo["A B C"]] = "A B C"; or Foo[Foo[expression]] = expression; | ||
nameExpr = ts.isComputedPropertyName(memberName) ? memberName.expression : memberName; | ||
memberAccess = ts.createElementAccess(ts.createIdentifier(name), nameExpr); | ||
} | ||
resultNodes.push(ts.createStatement(ts.createAssignment(ts.createElementAccess(ts.createIdentifier(name), memberAccess), nameExpr))); | ||
// Emit the reverse mapping of foo[foo.BAR] = 'BAR'; lines for number enum members | ||
for (const member of node.members) { | ||
const memberName = member.name; | ||
const memberType = getEnumMemberType(typeChecker, member); | ||
if (memberType !== 'number') | ||
continue; | ||
// TypeScript enum members can have Identifier names or String names. | ||
// We need to emit slightly different code to support these two syntaxes: | ||
let nameExpr; | ||
let memberAccess; | ||
if (ts.isIdentifier(memberName)) { | ||
// Foo[Foo.ABC] = "ABC"; | ||
nameExpr = transformer_util_1.createSingleQuoteStringLiteral(memberName.text); | ||
// Make sure to create a clean, new identifier, so comments do not get emitted twice. | ||
const ident = ts.createIdentifier(transformer_util_1.getIdentifierText(memberName)); | ||
memberAccess = ts.createPropertyAccess(ts.createIdentifier(name), ident); | ||
} | ||
} | ||
catch (e_3_1) { e_3 = { error: e_3_1 }; } | ||
finally { | ||
try { | ||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e); | ||
else { | ||
// Foo[Foo["A B C"]] = "A B C"; or Foo[Foo[expression]] = expression; | ||
nameExpr = ts.isComputedPropertyName(memberName) ? memberName.expression : memberName; | ||
memberAccess = ts.createElementAccess(ts.createIdentifier(name), nameExpr); | ||
} | ||
finally { if (e_3) throw e_3.error; } | ||
resultNodes.push(ts.createStatement(ts.createAssignment(ts.createElementAccess(ts.createIdentifier(name), memberAccess), nameExpr))); | ||
} | ||
return resultNodes; | ||
} | ||
return function (sf) { return visitor(sf); }; | ||
return (sf) => visitor(sf); | ||
}; | ||
@@ -262,2 +220,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW51bV90cmFuc2Zvcm1lci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnVtX3RyYW5zZm9ybWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVIOzs7Ozs7Ozs7OztPQVdHO0lBRUgsK0JBQWlDO0lBRWpDLGlFQUFpSDtJQUVqSCxnR0FBZ0c7SUFDaEcsU0FBUyxhQUFhLENBQUMsSUFBYTtRQUNsQyxnR0FBZ0c7UUFDaEcsdUJBQXVCO1FBQ3ZCLElBQUksTUFBTSxHQUFHLEVBQUUsQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLENBQUMsTUFBTSxDQUFDO1FBQzdDLE9BQU8sTUFBTSxFQUFFO1lBQ2IsSUFBSSxNQUFNLENBQUMsSUFBSSxLQUFLLEVBQUUsQ0FBQyxVQUFVLENBQUMsaUJBQWlCLEVBQUU7Z0JBQ25ELE9BQU8sSUFBSSxDQUFDO2FBQ2I7WUFDRCxNQUFNLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztTQUN4QjtRQUNELE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQztJQUVEOztPQUVHO0lBQ0gsU0FBUyxpQkFBaUIsQ0FBQyxXQUEyQixFQUFFLE1BQXFCO1FBQzNFLHlEQUF5RDtRQUN6RCxJQUFJLENBQUMsTUFBTSxDQUFDLFdBQVcsRUFBRTtZQUN2QixPQUFPLFFBQVEsQ0FBQztTQUNqQjtRQUNELElBQU0sSUFBSSxHQUFHLFdBQVcs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KSBhcyB0cy5Tb3VyY2VGaWxlO1xuICB9O1xufVxuIl19 |
@@ -8,32 +8,2 @@ /** | ||
*/ | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (this && this.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
(function (factory) { | ||
@@ -50,5 +20,5 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
var jsdoc = require("tsickle/src/jsdoc"); | ||
var transformer_util_1 = require("tsickle/src/transformer_util"); | ||
const ts = require("typescript"); | ||
const jsdoc = require("tsickle/src/jsdoc"); | ||
const transformer_util_1 = require("tsickle/src/transformer_util"); | ||
/** | ||
@@ -58,3 +28,3 @@ * A set of JSDoc tags that mark a comment as a fileoverview comment. These are recognized by other | ||
*/ | ||
var FILEOVERVIEW_COMMENT_MARKERS = new Set(['fileoverview', 'externs', 'modName', 'mods', 'pintomodule']); | ||
const FILEOVERVIEW_COMMENT_MARKERS = new Set(['fileoverview', 'externs', 'modName', 'mods', 'pintomodule']); | ||
/** | ||
@@ -68,3 +38,3 @@ * Given a parsed \@fileoverview comment, ensures it has all the attributes we need. | ||
// Ensure we start with a @fileoverview. | ||
if (!tags.find(function (t) { return t.tagName === 'fileoverview'; })) { | ||
if (!tags.find(t => t.tagName === 'fileoverview')) { | ||
tags.splice(0, 0, { tagName: 'fileoverview', text: 'added by tsickle' }); | ||
@@ -75,6 +45,6 @@ } | ||
// only appear once and be merged. | ||
var suppressTag = tags.find(function (t) { return t.tagName === 'suppress'; }); | ||
var suppressions; | ||
let suppressTag = tags.find(t => t.tagName === 'suppress'); | ||
let suppressions; | ||
if (suppressTag) { | ||
suppressions = new Set((suppressTag.type || '').split(',').map(function (s) { return s.trim(); })); | ||
suppressions = new Set((suppressTag.type || '').split(',').map(s => s.trim())); | ||
} | ||
@@ -109,28 +79,17 @@ else { | ||
function transformFileoverviewCommentFactory(diagnostics) { | ||
return function () { | ||
return () => { | ||
function checkNoFileoverviewComments(context, comments, message) { | ||
var e_1, _a; | ||
try { | ||
for (var comments_1 = __values(comments), comments_1_1 = comments_1.next(); !comments_1_1.done; comments_1_1 = comments_1.next()) { | ||
var comment = comments_1_1.value; | ||
var parse = jsdoc.parse(comment); | ||
if (parse !== null && parse.tags.some(function (t) { return FILEOVERVIEW_COMMENT_MARKERS.has(t.tagName); })) { | ||
// Report a warning; this should not break compilation in third party code. | ||
transformer_util_1.reportDiagnostic(diagnostics, context, message, comment.originalRange, ts.DiagnosticCategory.Warning); | ||
} | ||
for (const comment of comments) { | ||
const parse = jsdoc.parse(comment); | ||
if (parse !== null && parse.tags.some(t => FILEOVERVIEW_COMMENT_MARKERS.has(t.tagName))) { | ||
// Report a warning; this should not break compilation in third party code. | ||
transformer_util_1.reportDiagnostic(diagnostics, context, message, comment.originalRange, ts.DiagnosticCategory.Warning); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (comments_1_1 && !comments_1_1.done && (_a = comments_1.return)) _a.call(comments_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
} | ||
return function (sourceFile) { | ||
var text = sourceFile.getFullText(); | ||
var fileComments = []; | ||
var firstStatement = sourceFile.statements.length && sourceFile.statements[0] || null; | ||
var originalComments = ts.getLeadingCommentRanges(text, 0) || []; | ||
return (sourceFile) => { | ||
const text = sourceFile.getFullText(); | ||
let fileComments = []; | ||
const firstStatement = sourceFile.statements.length && sourceFile.statements[0] || null; | ||
const originalComments = ts.getLeadingCommentRanges(text, 0) || []; | ||
if (!firstStatement) { | ||
@@ -145,4 +104,4 @@ // In an empty source file, all comments are file-level comments. | ||
// fileoverview comment. | ||
for (var i = originalComments.length - 1; i >= 0; i--) { | ||
var end = originalComments[i].end; | ||
for (let i = originalComments.length - 1; i >= 0; i--) { | ||
const end = originalComments[i].end; | ||
if (!text.substring(end).startsWith('\n\n') && | ||
@@ -155,4 +114,4 @@ !text.substring(end).startsWith('\r\n\r\n')) { | ||
// NotEmittedStatement, so that they do not get lost later on. | ||
var synthesizedComments = jsdoc.synthesizeLeadingComments(firstStatement); | ||
var notEmitted = ts.createNotEmittedStatement(sourceFile); | ||
const synthesizedComments = jsdoc.synthesizeLeadingComments(firstStatement); | ||
const notEmitted = ts.createNotEmittedStatement(sourceFile); | ||
// Modify the comments on the firstStatement in place by removing the file-level comments. | ||
@@ -162,3 +121,3 @@ fileComments = synthesizedComments.splice(0, i + 1); | ||
ts.setSyntheticLeadingComments(notEmitted, fileComments); | ||
sourceFile = transformer_util_1.updateSourceFileNode(sourceFile, ts.createNodeArray(__spread([notEmitted, firstStatement], sourceFile.statements.slice(1)))); | ||
sourceFile = transformer_util_1.updateSourceFileNode(sourceFile, ts.createNodeArray([notEmitted, firstStatement, ...sourceFile.statements.slice(1)])); | ||
break; | ||
@@ -169,10 +128,10 @@ } | ||
// emit duplicated ones. | ||
for (var i = 0; i < sourceFile.statements.length; i++) { | ||
var stmt = sourceFile.statements[i]; | ||
for (let i = 0; i < sourceFile.statements.length; i++) { | ||
const stmt = sourceFile.statements[i]; | ||
// Accept the NotEmittedStatement inserted above. | ||
if (i === 0 && stmt.kind === ts.SyntaxKind.NotEmittedStatement) | ||
continue; | ||
var comments = jsdoc.synthesizeLeadingComments(stmt); | ||
checkNoFileoverviewComments(stmt, comments, "file comments must be at the top of the file, " + | ||
"separated from the file body by an empty line."); | ||
const comments = jsdoc.synthesizeLeadingComments(stmt); | ||
checkNoFileoverviewComments(stmt, comments, `file comments must be at the top of the file, ` + | ||
`separated from the file body by an empty line.`); | ||
} | ||
@@ -184,7 +143,7 @@ } | ||
// comment mentioning @fileoverview. | ||
var fileoverviewIdx = -1; | ||
var tags = []; | ||
for (var i = fileComments.length - 1; i >= 0; i--) { | ||
var parse = jsdoc.parseContents(fileComments[i].text); | ||
if (parse !== null && parse.tags.some(function (t) { return FILEOVERVIEW_COMMENT_MARKERS.has(t.tagName); })) { | ||
let fileoverviewIdx = -1; | ||
let tags = []; | ||
for (let i = fileComments.length - 1; i >= 0; i--) { | ||
const parse = jsdoc.parseContents(fileComments[i].text); | ||
if (parse !== null && parse.tags.some(t => FILEOVERVIEW_COMMENT_MARKERS.has(t.tagName))) { | ||
fileoverviewIdx = i; | ||
@@ -196,6 +155,6 @@ tags = parse.tags; | ||
if (fileoverviewIdx !== -1) { | ||
checkNoFileoverviewComments(firstStatement || sourceFile, fileComments.slice(0, fileoverviewIdx), "duplicate file level comment"); | ||
checkNoFileoverviewComments(firstStatement || sourceFile, fileComments.slice(0, fileoverviewIdx), `duplicate file level comment`); | ||
} | ||
augmentFileoverviewComments(tags); | ||
var commentText = jsdoc.toStringWithoutStartEnd(tags); | ||
const commentText = jsdoc.toStringWithoutStartEnd(tags); | ||
if (fileoverviewIdx < 0) { | ||
@@ -213,7 +172,7 @@ // No existing comment to merge with, just emit a new one. | ||
function addNewFileoverviewComment(sf, commentText) { | ||
var syntheticFirstStatement = transformer_util_1.createNotEmittedStatement(sf); | ||
let syntheticFirstStatement = transformer_util_1.createNotEmittedStatement(sf); | ||
syntheticFirstStatement = ts.addSyntheticTrailingComment(syntheticFirstStatement, ts.SyntaxKind.MultiLineCommentTrivia, commentText, true); | ||
return transformer_util_1.updateSourceFileNode(sf, ts.createNodeArray(__spread([syntheticFirstStatement], sf.statements))); | ||
return transformer_util_1.updateSourceFileNode(sf, ts.createNodeArray([syntheticFirstStatement, ...sf.statements])); | ||
} | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZW92ZXJ2aWV3X2NvbW1lbnRfdHJhbnNmb3JtZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvZmlsZW92ZXJ2aWV3X2NvbW1lbnRfdHJhbnNmb3JtZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFFSCwrQkFBaUM7SUFFakMseUNBQWlDO0lBQ2pDLGlFQUE4SDtJQUU5SDs7O09BR0c7SUFDSCxJQUFNLDRCQUE0QixHQUM5QixJQUFJLEdBQUcsQ0FBQyxDQUFDLGNBQWMsRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxhQUFhLENBQUMsQ0FBQyxDQUFDO0lBRTNFOzs7OztPQUtHO0lBQ0gsU0FBUywyQkFBMkIsQ0FBQyxJQUFpQjtRQUNwRCx3Q0FBd0M7UUFDeEMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBQSxDQUFDLElBQUksT0FBQSxDQUFDLENBQUMsT0FBTyxLQUFLLGNBQWMsRUFBNUIsQ0FBNEIsQ0FBQyxFQUFFO1lBQ2pELElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFDLE9BQU8sRUFBRSxjQUFjLEVBQUUsSUFBSSxFQUFFLGtCQUFrQixFQUFDLENBQUMsQ0FBQztTQUN4RTtRQUVELGtD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N0aW5nIGNvbW1lbnQgdG8gbWVyZ2Ugd2l0aCwganVzdCBlbWl0IGEgbmV3IG9uZS5cbiAgICAgICAgcmV0dXJuIGFkZE5ld0ZpbGVvdmVydmlld0NvbW1lbnQoc291cmNlRmlsZSwgY29tbWVudFRleHQpO1xuICAgICAgfVxuXG4gICAgICBmaWxlQ29tbWVudHNbZmlsZW92ZXJ2aWV3SWR4XS50ZXh0ID0gY29tbWVudFRleHQ7XG4gICAgICAvLyBzZiBkb2VzIG5vdCBuZWVkIHRvIGJlIHVwZGF0ZWQsIHN5bnRoZXNpemVkIGNvbW1lbnRzIGFyZSBtdXRhYmxlLlxuICAgICAgcmV0dXJuIHNvdXJjZUZpbGU7XG4gICAgfTtcbiAgfTtcbn1cblxuZnVuY3Rpb24gYWRkTmV3RmlsZW92ZXJ2aWV3Q29tbWVudChzZjogdHMuU291cmNlRmlsZSwgY29tbWVudFRleHQ6IHN0cmluZyk6IHRzLlNvdXJjZUZpbGUge1xuICBsZXQgc3ludGhldGljRmlyc3RTdGF0ZW1lbnQgPSBjcmVhdGVOb3RFbWl0dGVkU3RhdGVtZW50KHNmKTtcbiAgc3ludGhldGljRmlyc3RTdGF0ZW1lbnQgPSB0cy5hZGRTeW50aGV0aWNUcmFpbGluZ0NvbW1lbnQoXG4gICAgICBzeW50aGV0aWNGaXJzdFN0YXRlbWVudCwgdHMuU3ludGF4S2luZC5NdWx0aUxpbmVDb21tZW50VHJpdmlhLCBjb21tZW50VGV4dCwgdHJ1ZSk7XG4gIHJldHVybiB1cGRhdGVTb3VyY2VGaWxlTm9kZShzZiwgdHMuY3JlYXRlTm9kZUFycmF5KFtzeW50aGV0aWNGaXJzdFN0YXRlbWVudCwgLi4uc2Yuc3RhdGVtZW50c10pKTtcbn1cbiJdfQ== |
330
src/jsdoc.js
@@ -8,39 +8,2 @@ /** | ||
*/ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
(function (factory) { | ||
@@ -57,5 +20,11 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
const ts = require("typescript"); | ||
/** | ||
* A list of all JSDoc tags allowed by the Closure compiler. | ||
* All tags other than these are escaped before emitting. | ||
* | ||
* Note that some of these tags are also rejected by tsickle when seen in | ||
* the user-provided source, but also that tsickle itself may generate some of these. | ||
* This whitelist is just used for controlling the output. | ||
* | ||
* The public Closure docs don't list all the tags it allows; this list comes | ||
@@ -66,3 +35,3 @@ * from the compiler source itself. | ||
*/ | ||
var JSDOC_TAGS_WHITELIST = new Set([ | ||
const JSDOC_TAGS_OUTPUT_WHITELIST = new Set([ | ||
'abstract', | ||
@@ -151,4 +120,5 @@ 'argument', | ||
* these will cause Closure Compiler issues and should not be used. | ||
* Note: 'template' is special-cased below; see where this set is queried. | ||
*/ | ||
var JSDOC_TAGS_BLACKLIST = new Set([ | ||
const JSDOC_TAGS_INPUT_BLACKLIST = new Set([ | ||
'augments', 'class', 'constructs', 'constructor', 'enum', 'extends', 'field', | ||
@@ -159,7 +129,9 @@ 'function', 'implements', 'interface', 'lends', 'namespace', 'private', 'public', | ||
/** | ||
* A list of JSDoc @tags that might include a {type} after them. Only banned when a type is passed. | ||
* Note that this does not include tags that carry a non-type system type, e.g. \@suppress. | ||
* JSDoc \@tags that might include a {type} after them. Specifying a type is forbidden, since it | ||
* would collide with TypeScript's type information. If a type *is* given, the entire tag will be | ||
* ignored. | ||
*/ | ||
var JSDOC_TAGS_WITH_TYPES = new Set([ | ||
const JSDOC_TAGS_WITH_TYPES = new Set([ | ||
'const', | ||
'define', | ||
'export', | ||
@@ -186,3 +158,3 @@ 'param', | ||
return null; | ||
var text = comment.text.substring(1).trim(); | ||
const text = comment.text.substring(1).trim(); | ||
return parseContents(text); | ||
@@ -205,3 +177,2 @@ } | ||
function parseContents(commentText) { | ||
var e_1, _a, _b, _c; | ||
// Make sure we have proper line endings before parsing on Windows. | ||
@@ -211,78 +182,82 @@ commentText = normalizeLineEndings(commentText); | ||
commentText = commentText.replace(/^\s*\*? ?/gm, ''); | ||
var lines = commentText.split('\n'); | ||
var tags = []; | ||
var warnings = []; | ||
try { | ||
for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) { | ||
var line = lines_1_1.value; | ||
var match = line.match(/^\s*@(\S+) *(.*)/); | ||
if (match) { | ||
var _d = __read(match, 3), _ = _d[0], tagName = _d[1], text = _d[2]; | ||
if (tagName === 'returns') { | ||
// A synonym for 'return'. | ||
tagName = 'return'; | ||
} | ||
var type = void 0; | ||
if (JSDOC_TAGS_BLACKLIST.has(tagName)) { | ||
warnings.push("@" + tagName + " annotations are redundant with TypeScript equivalents"); | ||
const lines = commentText.split('\n'); | ||
const tags = []; | ||
const warnings = []; | ||
for (const line of lines) { | ||
let match = line.match(/^\s*@(\S+) *(.*)/); | ||
if (match) { | ||
let [_, tagName, text] = match; | ||
if (tagName === 'returns') { | ||
// A synonym for 'return'. | ||
tagName = 'return'; | ||
} | ||
let type; | ||
if (JSDOC_TAGS_INPUT_BLACKLIST.has(tagName)) { | ||
if (tagName !== 'template') { | ||
// Tell the user to not write blacklisted tags, because there is TS | ||
// syntax available for them. | ||
warnings.push(`@${tagName} annotations are redundant with TypeScript equivalents`); | ||
continue; // Drop the tag so Closure won't process it. | ||
} | ||
else if (JSDOC_TAGS_WITH_TYPES.has(tagName) && text[0] === '{') { | ||
warnings.push("the type annotation on @" + tagName + " is redundant with its TypeScript type, " + | ||
"remove the {...} part"); | ||
else { | ||
// But @template in particular is special: it's ok for the user to | ||
// write it for documentation purposes, but we don't want the | ||
// user-written one making it into the output because Closure interprets | ||
// it as well. | ||
// Drop it without any warning. (We also don't ensure its correctness.) | ||
continue; | ||
} | ||
else if (tagName === 'suppress') { | ||
var suppressMatch = text.match(/^\{(.*)\}(.*)$/); | ||
if (!suppressMatch) { | ||
warnings.push("malformed @suppress tag: \"" + text + "\""); | ||
} | ||
else { | ||
_b = __read(suppressMatch, 3), type = _b[1], text = _b[2]; | ||
} | ||
} | ||
else if (tagName === 'dict') { | ||
warnings.push('use index signatures (`[k: string]: type`) instead of @dict'); | ||
} | ||
else if (JSDOC_TAGS_WITH_TYPES.has(tagName)) { | ||
if (text[0] === '{') { | ||
warnings.push(`the type annotation on @${tagName} is redundant with its TypeScript type, ` + | ||
`remove the {...} part`); | ||
continue; | ||
} | ||
// Grab the parameter name from @param tags. | ||
var parameterName = void 0; | ||
if (tagName === 'param') { | ||
match = text.match(/^(\S+) ?(.*)/); | ||
if (match) | ||
_c = __read(match, 3), _ = _c[0], parameterName = _c[1], text = _c[2]; | ||
} | ||
var tag = { tagName: tagName }; | ||
if (parameterName) | ||
tag.parameterName = parameterName; | ||
if (text) | ||
tag.text = text; | ||
if (type) | ||
tag.type = type; | ||
tags.push(tag); | ||
} | ||
else { | ||
// Text without a preceding @tag on it is either the plain text | ||
// documentation or a continuation of a previous tag. | ||
if (tags.length === 0) { | ||
tags.push({ tagName: '', text: line }); | ||
else if (tagName === 'suppress') { | ||
const typeMatch = text.match(/^\{(.*)\}(.*)$/); | ||
if (typeMatch) { | ||
[, type, text] = typeMatch; | ||
} | ||
else { | ||
var lastTag = tags[tags.length - 1]; | ||
lastTag.text = (lastTag.text || '') + '\n' + line; | ||
warnings.push(`malformed @${tagName} tag: "${text}"`); | ||
} | ||
} | ||
else if (tagName === 'dict') { | ||
warnings.push('use index signatures (`[k: string]: type`) instead of @dict'); | ||
continue; | ||
} | ||
// Grab the parameter name from @param tags. | ||
let parameterName; | ||
if (tagName === 'param') { | ||
match = text.match(/^(\S+) ?(.*)/); | ||
if (match) | ||
[_, parameterName, text] = match; | ||
} | ||
const tag = { tagName }; | ||
if (parameterName) | ||
tag.parameterName = parameterName; | ||
if (text) | ||
tag.text = text; | ||
if (type) | ||
tag.type = type; | ||
tags.push(tag); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1); | ||
else { | ||
// Text without a preceding @tag on it is either the plain text | ||
// documentation or a continuation of a previous tag. | ||
if (tags.length === 0) { | ||
tags.push({ tagName: '', text: line }); | ||
} | ||
else { | ||
const lastTag = tags[tags.length - 1]; | ||
lastTag.text = (lastTag.text || '') + '\n' + line; | ||
} | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
if (warnings.length > 0) { | ||
return { tags: tags, warnings: warnings }; | ||
return { tags, warnings }; | ||
} | ||
return { tags: tags }; | ||
return { tags }; | ||
} | ||
@@ -294,7 +269,6 @@ exports.parseContents = parseContents; | ||
*/ | ||
function tagToString(tag, escapeExtraTags) { | ||
if (escapeExtraTags === void 0) { escapeExtraTags = new Set(); } | ||
var out = ''; | ||
function tagToString(tag, escapeExtraTags = new Set()) { | ||
let out = ''; | ||
if (tag.tagName) { | ||
if (!JSDOC_TAGS_WHITELIST.has(tag.tagName) || escapeExtraTags.has(tag.tagName)) { | ||
if (!JSDOC_TAGS_OUTPUT_WHITELIST.has(tag.tagName) || escapeExtraTags.has(tag.tagName)) { | ||
// Escape tags we don't understand. This is a subtle | ||
@@ -311,6 +285,6 @@ // compromise between multiple issues. | ||
// responsibility of a linter. | ||
out += " \\@" + tag.tagName; | ||
out += ` \\@${tag.tagName}`; | ||
} | ||
else { | ||
out += " @" + tag.tagName; | ||
out += ` @${tag.tagName}`; | ||
} | ||
@@ -338,3 +312,3 @@ } | ||
/** Tags that must only occur onces in a comment (filtered below). */ | ||
var SINGLETON_TAGS = new Set(['deprecated']); | ||
const SINGLETON_TAGS = new Set(['deprecated']); | ||
/** Tags that conflict with \@type in Closure Compiler (e.g. \@param). */ | ||
@@ -348,7 +322,7 @@ exports.TAGS_CONFLICTING_WITH_TYPE = new Set(['param', 'return']); | ||
function synthesizeLeadingComments(node) { | ||
var existing = ts.getSyntheticLeadingComments(node); | ||
const existing = ts.getSyntheticLeadingComments(node); | ||
if (existing) | ||
return existing; | ||
var text = node.getFullText(); | ||
var synthComments = getLeadingCommentRangesSynthesized(text, node.getFullStart()); | ||
const text = node.getFullText(); | ||
const synthComments = getLeadingCommentRangesSynthesized(text, node.getFullStart()); | ||
if (synthComments.length) { | ||
@@ -367,12 +341,11 @@ ts.setSyntheticLeadingComments(node, synthComments); | ||
// VisibleForTesting | ||
function getLeadingCommentRangesSynthesized(text, offset) { | ||
if (offset === void 0) { offset = 0; } | ||
var comments = ts.getLeadingCommentRanges(text, 0) || []; | ||
return comments.map(function (cr) { | ||
function getLeadingCommentRangesSynthesized(text, offset = 0) { | ||
const comments = ts.getLeadingCommentRanges(text, 0) || []; | ||
return comments.map((cr) => { | ||
// Confusingly, CommentRange in TypeScript includes start and end markers, but | ||
// SynthesizedComments do not. | ||
var commentText = cr.kind === ts.SyntaxKind.SingleLineCommentTrivia ? | ||
const commentText = cr.kind === ts.SyntaxKind.SingleLineCommentTrivia ? | ||
text.substring(cr.pos + 2, cr.end) : | ||
text.substring(cr.pos + 2, cr.end - 2); | ||
return __assign({}, cr, { text: commentText, pos: -1, end: -1, originalRange: { pos: cr.pos + offset, end: cr.end + offset } }); | ||
return Object.assign({}, cr, { text: commentText, pos: -1, end: -1, originalRange: { pos: cr.pos + offset, end: cr.end + offset } }); | ||
}); | ||
@@ -392,7 +365,7 @@ } | ||
// the copied node to have comments emitted. | ||
var originalStart = node.getFullStart(); | ||
var actualStart = node.getStart(); | ||
const originalStart = node.getFullStart(); | ||
const actualStart = node.getStart(); | ||
function suppressCommentsInternal(node) { | ||
ts.setEmitFlags(node, ts.EmitFlags.NoLeadingComments); | ||
return !!ts.forEachChild(node, function (child) { | ||
return !!ts.forEachChild(node, (child) => { | ||
if (child.pos !== originalStart) | ||
@@ -417,4 +390,3 @@ return true; | ||
/** Serializes a Comment out to a string, but does not include the start and end comment tokens. */ | ||
function toStringWithoutStartEnd(tags, escapeExtraTags) { | ||
if (escapeExtraTags === void 0) { escapeExtraTags = new Set(); } | ||
function toStringWithoutStartEnd(tags, escapeExtraTags = new Set()) { | ||
return serialize(tags, false, escapeExtraTags); | ||
@@ -424,14 +396,11 @@ } | ||
/** Serializes a Comment out to a string usable in source code. */ | ||
function toString(tags, escapeExtraTags) { | ||
if (escapeExtraTags === void 0) { escapeExtraTags = new Set(); } | ||
function toString(tags, escapeExtraTags = new Set()) { | ||
return serialize(tags, true, escapeExtraTags); | ||
} | ||
exports.toString = toString; | ||
function serialize(tags, includeStartEnd, escapeExtraTags) { | ||
if (escapeExtraTags === void 0) { escapeExtraTags = new Set(); } | ||
var e_2, _a; | ||
function serialize(tags, includeStartEnd, escapeExtraTags = new Set()) { | ||
if (tags.length === 0) | ||
return ''; | ||
if (tags.length === 1) { | ||
var tag = tags[0]; | ||
const tag = tags[0]; | ||
if ((tag.tagName === 'type' || tag.tagName === 'typedef' || tag.tagName === 'nocollapse') && | ||
@@ -441,29 +410,19 @@ (!tag.text || !tag.text.match('\n'))) { | ||
// /** @type {foo} */ | ||
var text = tagToString(tag, escapeExtraTags); | ||
return includeStartEnd ? "/**" + text + " */" : "*" + text + " "; | ||
const text = tagToString(tag, escapeExtraTags); | ||
return includeStartEnd ? `/**${text} */` : `*${text} `; | ||
} | ||
// Otherwise, fall through to the multi-line output. | ||
} | ||
var out = includeStartEnd ? '/**\n' : '*\n'; | ||
var emitted = new Set(); | ||
try { | ||
for (var tags_1 = __values(tags), tags_1_1 = tags_1.next(); !tags_1_1.done; tags_1_1 = tags_1.next()) { | ||
var tag = tags_1_1.value; | ||
if (emitted.has(tag.tagName) && SINGLETON_TAGS.has(tag.tagName)) { | ||
continue; | ||
} | ||
emitted.add(tag.tagName); | ||
out += ' *'; | ||
// If the tagToString is multi-line, insert " * " prefixes on subsequent lines. | ||
out += tagToString(tag, escapeExtraTags).split('\n').join('\n * '); | ||
out += '\n'; | ||
let out = includeStartEnd ? '/**\n' : '*\n'; | ||
const emitted = new Set(); | ||
for (const tag of tags) { | ||
if (emitted.has(tag.tagName) && SINGLETON_TAGS.has(tag.tagName)) { | ||
continue; | ||
} | ||
emitted.add(tag.tagName); | ||
out += ' *'; | ||
// If the tagToString is multi-line, insert " * " prefixes on subsequent lines. | ||
out += tagToString(tag, escapeExtraTags).split('\n').join('\n * '); | ||
out += '\n'; | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (tags_1_1 && !tags_1_1.done && (_a = tags_1.return)) _a.call(tags_1); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
out += includeStartEnd ? ' */\n' : ' '; | ||
@@ -474,43 +433,32 @@ return out; | ||
function merge(tags) { | ||
var e_3, _a; | ||
var tagNames = new Set(); | ||
var parameterNames = new Set(); | ||
var types = new Set(); | ||
var texts = new Set(); | ||
const tagNames = new Set(); | ||
const parameterNames = new Set(); | ||
const types = new Set(); | ||
const texts = new Set(); | ||
// If any of the tags are optional/rest, then the merged output is optional/rest. | ||
var optional = false; | ||
var restParam = false; | ||
try { | ||
for (var tags_2 = __values(tags), tags_2_1 = tags_2.next(); !tags_2_1.done; tags_2_1 = tags_2.next()) { | ||
var tag_1 = tags_2_1.value; | ||
tagNames.add(tag_1.tagName); | ||
if (tag_1.parameterName !== undefined) | ||
parameterNames.add(tag_1.parameterName); | ||
if (tag_1.type !== undefined) | ||
types.add(tag_1.type); | ||
if (tag_1.text !== undefined) | ||
texts.add(tag_1.text); | ||
if (tag_1.optional) | ||
optional = true; | ||
if (tag_1.restParam) | ||
restParam = true; | ||
} | ||
let optional = false; | ||
let restParam = false; | ||
for (const tag of tags) { | ||
tagNames.add(tag.tagName); | ||
if (tag.parameterName !== undefined) | ||
parameterNames.add(tag.parameterName); | ||
if (tag.type !== undefined) | ||
types.add(tag.type); | ||
if (tag.text !== undefined) | ||
texts.add(tag.text); | ||
if (tag.optional) | ||
optional = true; | ||
if (tag.restParam) | ||
restParam = true; | ||
} | ||
catch (e_3_1) { e_3 = { error: e_3_1 }; } | ||
finally { | ||
try { | ||
if (tags_2_1 && !tags_2_1.done && (_a = tags_2.return)) _a.call(tags_2); | ||
} | ||
finally { if (e_3) throw e_3.error; } | ||
} | ||
if (tagNames.size !== 1) { | ||
throw new Error("cannot merge differing tags: " + JSON.stringify(tags)); | ||
throw new Error(`cannot merge differing tags: ${JSON.stringify(tags)}`); | ||
} | ||
var tagName = tagNames.values().next().value; | ||
var parameterName = parameterNames.size > 0 ? Array.from(parameterNames).join('_or_') : undefined; | ||
var type = types.size > 0 ? Array.from(types).join('|') : undefined; | ||
const tagName = tagNames.values().next().value; | ||
const parameterName = parameterNames.size > 0 ? Array.from(parameterNames).join('_or_') : undefined; | ||
const type = types.size > 0 ? Array.from(types).join('|') : undefined; | ||
// @template uses text (not type!) to declare its type parameters, with ','-separated text. | ||
var isTemplateTag = tagName === 'template'; | ||
var text = texts.size > 0 ? Array.from(texts).join(isTemplateTag ? ',' : ' / ') : undefined; | ||
var tag = { tagName: tagName, parameterName: parameterName, type: type, text: text }; | ||
const isTemplateTag = tagName === 'template'; | ||
const text = texts.size > 0 ? Array.from(texts).join(isTemplateTag ? ',' : ' / ') : undefined; | ||
const tag = { tagName, parameterName, type, text }; | ||
// Note: a param can either be optional or a rest param; if we merged an | ||
@@ -528,2 +476,2 @@ // optional and rest param together, prefer marking it as a rest param. | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNkb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvanNkb2MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBRUgsK0JBQWlDO0lBc0NqQzs7Ozs7O09BTUc7SUFDSCxJQUFNLG9CQUFvQixHQUFHLElBQUksR0FBRyxDQUFDO1FBQ25DLFVBQVU7UUFDVixVQUFVO1FBQ1YsUUFBUTtRQUNSLHVCQUF1QjtRQUN2QixPQUFPO1FBQ1AsVUFBVTtRQUNWLGFBQWE7UUFDYixXQUFXO1FBQ1gsUUFBUTtRQUNSLFlBQVk7UUFDWixNQUFNO1FBQ04sTUFBTTtRQUNOLFVBQVU7UUFDVixTQUFTO1FBQ1QsYUFBYTtRQUNiLE1BQU07UUFDTixRQUFRO1FBQ1IsUUFBUTtRQUNSLFNBQVM7UUFDVCxTQUFTO1FBQ1QsY0FBYztRQUNkLE9BQU87UUFDUCxlQUFlO1FBQ2YsbUJBQW1CO1FBQ25CLFFBQVE7UUFDUixJQUFJO1FBQ0osYUFBYTtRQUNiLFFBQVE7UUFDUixZQUFZO1FBQ1osY0FBYztRQUNkLFlBQVk7UUFDWixXQUFXO1FBQ1gsY0FBYztRQUNkLGNBQWM7UUFDZCxlQUFlO1FBQ2Ysc0JBQXNCO1FBQ3RCLE9BQU87UUFDUCxTQUFTO1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b2luKCdfb3JfJykgOiB1bmRlZmluZWQ7XG4gIGNvbnN0IHR5cGUgPSB0eXBlcy5zaXplID4gMCA/IEFycmF5LmZyb20odHlwZXMpLmpvaW4oJ3wnKSA6IHVuZGVmaW5lZDtcbiAgLy8gQHRlbXBsYXRlIHVzZXMgdGV4dCAobm90IHR5cGUhKSB0byBkZWNsYXJlIGl0cyB0eXBlIHBhcmFtZXRlcnMsIHdpdGggJywnLXNlcGFyYXRlZCB0ZXh0LlxuICBjb25zdCBpc1RlbXBsYXRlVGFnID0gdGFnTmFtZSA9PT0gJ3RlbXBsYXRlJztcbiAgY29uc3QgdGV4dCA9IHRleHRzLnNpemUgPiAwID8gQXJyYXkuZnJvbSh0ZXh0cykuam9pbihpc1RlbXBsYXRlVGFnID8gJywnIDogJyAvICcpIDogdW5kZWZpbmVkO1xuICBjb25zdCB0YWc6IFRhZyA9IHt0YWdOYW1lLCBwYXJhbWV0ZXJOYW1lLCB0eXBlLCB0ZXh0fTtcbiAgLy8gTm90ZTogYSBwYXJhbSBjYW4gZWl0aGVyIGJlIG9wdGlvbmFsIG9yIGEgcmVzdCBwYXJhbTsgaWYgd2UgbWVyZ2VkIGFuXG4gIC8vIG9wdGlvbmFsIGFuZCByZXN0IHBhcmFtIHRvZ2V0aGVyLCBwcmVmZXIgbWFya2luZyBpdCBhcyBhIHJlc3QgcGFyYW0uXG4gIGlmIChyZXN0UGFyYW0pIHtcbiAgICB0YWcucmVzdFBhcmFtID0gdHJ1ZTtcbiAgfSBlbHNlIGlmIChvcHRpb25hbCkge1xuICAgIHRhZy5vcHRpb25hbCA9IHRydWU7XG4gIH1cbiAgcmV0dXJuIHRhZztcbn1cbiJdfQ== |
#!/usr/bin/env node | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
/// <amd-module name="tsickle/src/main" /> | ||
@@ -7,4 +14,2 @@ import * as ts from 'typescript'; | ||
export interface Settings { | ||
/** If provided, modify quoting of property accesses to match the type declaration. */ | ||
enableAutoQuoting?: boolean; | ||
/** If provided, path to save externs to. */ | ||
@@ -11,0 +16,0 @@ externsPath?: string; |
187
src/main.js
#!/usr/bin/env node | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
(function (factory) { | ||
@@ -23,12 +20,21 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fs = require("fs"); | ||
var minimist = require("minimist"); | ||
var mkdirp = require("mkdirp"); | ||
var path = require("path"); | ||
var ts = require("typescript"); | ||
var cliSupport = require("tsickle/src/cli_support"); | ||
var tsickle = require("tsickle/src/tsickle"); | ||
var tsickle_1 = require("tsickle/src/tsickle"); | ||
const fs = require("fs"); | ||
const minimist = require("minimist"); | ||
const mkdirp = require("mkdirp"); | ||
const path = require("path"); | ||
const ts = require("typescript"); | ||
const cliSupport = require("tsickle/src/cli_support"); | ||
const tsickle = require("tsickle/src/tsickle"); | ||
const tsickle_1 = require("tsickle/src/tsickle"); | ||
function usage() { | ||
console.error("usage: tsickle [tsickle options] -- [tsc options]\n\nexample:\n tsickle --externs=foo/externs.js -- -p src --noImplicitAny\n\ntsickle flags are:\n --externs=PATH save generated Closure externs.js to PATH\n --typed [experimental] attempt to provide Closure types instead of {?}\n --enableAutoQuoting automatically apply quotes to property accesses\n --fatalWarnings whether warnings should be fatal, and cause tsickle to return a non-zero exit code\n"); | ||
console.error(`usage: tsickle [tsickle options] -- [tsc options] | ||
example: | ||
tsickle --externs=foo/externs.js -- -p src --noImplicitAny | ||
tsickle flags are: | ||
--externs=PATH save generated Closure externs.js to PATH | ||
--typed [experimental] attempt to provide Closure types instead of {?} | ||
--fatalWarnings whether warnings should be fatal, and cause tsickle to return a non-zero exit code | ||
`); | ||
} | ||
@@ -40,49 +46,35 @@ /** | ||
function loadSettingsFromArgs(args) { | ||
var e_1, _a; | ||
var settings = {}; | ||
var parsedArgs = minimist(args); | ||
try { | ||
for (var _b = __values(Object.keys(parsedArgs)), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var flag = _c.value; | ||
switch (flag) { | ||
case 'h': | ||
case 'help': | ||
usage(); | ||
process.exit(0); | ||
break; | ||
case 'externs': | ||
settings.externsPath = parsedArgs[flag]; | ||
break; | ||
case 'typed': | ||
settings.isTyped = true; | ||
break; | ||
case 'verbose': | ||
settings.verbose = true; | ||
break; | ||
case 'enableAutoQuoting': | ||
settings.enableAutoQuoting = true; | ||
break; | ||
case 'fatalWarnings': | ||
settings.fatalWarnings = true; | ||
break; | ||
case '_': | ||
// This is part of the minimist API, and holds args after the '--'. | ||
break; | ||
default: | ||
console.error("unknown flag '--" + flag + "'"); | ||
usage(); | ||
process.exit(1); | ||
} | ||
const settings = {}; | ||
const parsedArgs = minimist(args); | ||
for (const flag of Object.keys(parsedArgs)) { | ||
switch (flag) { | ||
case 'h': | ||
case 'help': | ||
usage(); | ||
process.exit(0); | ||
break; | ||
case 'externs': | ||
settings.externsPath = parsedArgs[flag]; | ||
break; | ||
case 'typed': | ||
settings.isTyped = true; | ||
break; | ||
case 'verbose': | ||
settings.verbose = true; | ||
break; | ||
case 'fatalWarnings': | ||
settings.fatalWarnings = true; | ||
break; | ||
case '_': | ||
// This is part of the minimist API, and holds args after the '--'. | ||
break; | ||
default: | ||
console.error(`unknown flag '--${flag}'`); | ||
usage(); | ||
process.exit(1); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
// Arguments after the '--' arg are arguments to tsc. | ||
var tscArgs = parsedArgs['_']; | ||
return { settings: settings, tscArgs: tscArgs }; | ||
const tscArgs = parsedArgs['_']; | ||
return { settings, tscArgs }; | ||
} | ||
@@ -93,7 +85,7 @@ /** | ||
function getCommonParentDirectory(fileNames) { | ||
var pathSplitter = /[\/\\]+/; | ||
var commonParent = fileNames[0].split(pathSplitter); | ||
for (var i = 1; i < fileNames.length; i++) { | ||
var thisPath = fileNames[i].split(pathSplitter); | ||
var j = 0; | ||
const pathSplitter = /[\/\\]+/; | ||
const commonParent = fileNames[0].split(pathSplitter); | ||
for (let i = 1; i < fileNames.length; i++) { | ||
const thisPath = fileNames[i].split(pathSplitter); | ||
let j = 0; | ||
while (thisPath[j] === commonParent[j]) { | ||
@@ -120,24 +112,24 @@ j++; | ||
function loadTscConfig(args) { | ||
var _a; | ||
// Gather tsc options/input files from command line. | ||
var _b = ts.parseCommandLine(args), options = _b.options, fileNames = _b.fileNames, errors = _b.errors; | ||
let { options, fileNames, errors } = ts.parseCommandLine(args); | ||
if (errors.length > 0) { | ||
return { options: {}, fileNames: [], errors: errors }; | ||
return { options: {}, fileNames: [], errors }; | ||
} | ||
// Store file arguments | ||
var tsFileArguments = fileNames; | ||
const tsFileArguments = fileNames; | ||
// Read further settings from tsconfig.json. | ||
var projectDir = options.project || '.'; | ||
var configFileName = path.join(projectDir, 'tsconfig.json'); | ||
var _c = ts.readConfigFile(configFileName, function (path) { return fs.readFileSync(path, 'utf-8'); }), json = _c.config, error = _c.error; | ||
const projectDir = options.project || '.'; | ||
const configFileName = path.join(projectDir, 'tsconfig.json'); | ||
const { config: json, error } = ts.readConfigFile(configFileName, path => fs.readFileSync(path, 'utf-8')); | ||
if (error) { | ||
return { options: {}, fileNames: [], errors: [error] }; | ||
} | ||
(_a = ts.parseJsonConfigFileContent(json, ts.sys, projectDir, options, configFileName), options = _a.options, fileNames = _a.fileNames, errors = _a.errors); | ||
({ options, fileNames, errors } = | ||
ts.parseJsonConfigFileContent(json, ts.sys, projectDir, options, configFileName)); | ||
if (errors.length > 0) { | ||
return { options: {}, fileNames: [], errors: errors }; | ||
return { options: {}, fileNames: [], errors }; | ||
} | ||
// if file arguments were given to the typescript transpiler then transpile only those files | ||
fileNames = tsFileArguments.length > 0 ? tsFileArguments : fileNames; | ||
return { options: options, fileNames: fileNames, errors: [] }; | ||
return { options, fileNames, errors: [] }; | ||
} | ||
@@ -150,16 +142,14 @@ /** | ||
// relative or absolute paths | ||
var absoluteFileNames = fileNames.map(function (i) { return path.resolve(i); }); | ||
var compilerHost = ts.createCompilerHost(options); | ||
var program = ts.createProgram(absoluteFileNames, options, compilerHost); | ||
var filesToProcess = new Set(absoluteFileNames); | ||
var rootModulePath = options.rootDir || getCommonParentDirectory(absoluteFileNames); | ||
var transformerHost = { | ||
shouldSkipTsickleProcessing: function (fileName) { | ||
const absoluteFileNames = fileNames.map(i => path.resolve(i)); | ||
const compilerHost = ts.createCompilerHost(options); | ||
const program = ts.createProgram(absoluteFileNames, options, compilerHost); | ||
const filesToProcess = new Set(absoluteFileNames); | ||
const rootModulePath = options.rootDir || getCommonParentDirectory(absoluteFileNames); | ||
const transformerHost = { | ||
shouldSkipTsickleProcessing: (fileName) => { | ||
return !filesToProcess.has(path.resolve(fileName)); | ||
}, | ||
shouldIgnoreWarningsForPath: function (fileName) { return !settings.fatalWarnings; }, | ||
pathToModuleName: function (context, fileName) { | ||
return cliSupport.pathToModuleName(rootModulePath, context, fileName); | ||
}, | ||
fileNameToModuleId: function (fileName) { return path.relative(rootModulePath, fileName); }, | ||
shouldIgnoreWarningsForPath: (fileName) => !settings.fatalWarnings, | ||
pathToModuleName: (context, fileName) => cliSupport.pathToModuleName(rootModulePath, context, fileName), | ||
fileNameToModuleId: (fileName) => path.relative(rootModulePath, fileName), | ||
es5Mode: true, | ||
@@ -170,12 +160,11 @@ googmodule: true, | ||
typeBlackListPaths: new Set(), | ||
enableAutoQuoting: settings.enableAutoQuoting, | ||
untyped: false, | ||
logWarning: function (warning) { return console.error(ts.formatDiagnostics([warning], compilerHost)); }, | ||
options: options, | ||
logWarning: (warning) => console.error(ts.formatDiagnostics([warning], compilerHost)), | ||
options, | ||
moduleResolutionHost: compilerHost, | ||
}; | ||
var diagnostics = ts.getPreEmitDiagnostics(program); | ||
const diagnostics = ts.getPreEmitDiagnostics(program); | ||
if (diagnostics.length > 0) { | ||
return { | ||
diagnostics: diagnostics, | ||
diagnostics, | ||
modulesManifest: new tsickle_1.ModulesManifest(), | ||
@@ -191,4 +180,4 @@ externs: {}, | ||
function main(args) { | ||
var _a = loadSettingsFromArgs(args), settings = _a.settings, tscArgs = _a.tscArgs; | ||
var config = loadTscConfig(tscArgs); | ||
const { settings, tscArgs } = loadSettingsFromArgs(args); | ||
const config = loadTscConfig(tscArgs); | ||
if (config.errors.length) { | ||
@@ -206,3 +195,3 @@ console.error(ts.formatDiagnostics(config.errors, ts.createCompilerHost(config.options))); | ||
// Run tsickle+TSC to convert inputs to Closure JS files. | ||
var result = toClosureJS(config.options, config.fileNames, settings, function (filePath, contents) { | ||
const result = toClosureJS(config.options, config.fileNames, settings, (filePath, contents) => { | ||
mkdirp.sync(path.dirname(filePath)); | ||
@@ -226,2 +215,2 @@ fs.writeFileSync(filePath, contents, { encoding: 'utf-8' }); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFVQSx1QkFBeUI7SUFDekIsbUNBQXFDO0lBQ3JDLCtCQUFpQztJQUNqQywyQkFBNkI7SUFDN0IsK0JBQWlDO0lBRWpDLG9EQUE0QztJQ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mMoZmlsZVBhdGgsIGNvbnRlbnRzLCB7ZW5jb2Rpbmc6ICd1dGYtOCd9KTtcbiAgICAgIH0pO1xuICBpZiAocmVzdWx0LmRpYWdub3N0aWNzLmxlbmd0aCkge1xuICAgIGNvbnNvbGUuZXJyb3IodHMuZm9ybWF0RGlhZ25vc3RpY3MocmVzdWx0LmRpYWdub3N0aWNzLCB0cy5jcmVhdGVDb21waWxlckhvc3QoY29uZmlnLm9wdGlvbnMpKSk7XG4gICAgcmV0dXJuIDE7XG4gIH1cblxuICBpZiAoc2V0dGluZ3MuZXh0ZXJuc1BhdGgpIHtcbiAgICBta2RpcnAuc3luYyhwYXRoLmRpcm5hbWUoc2V0dGluZ3MuZXh0ZXJuc1BhdGgpKTtcbiAgICBmcy53cml0ZUZpbGVTeW5jKFxuICAgICAgICBzZXR0aW5ncy5leHRlcm5zUGF0aCxcbiAgICAgICAgdHNpY2tsZS5nZXRHZW5lcmF0ZWRFeHRlcm5zKHJlc3VsdC5leHRlcm5zLCBjb25maWcub3B0aW9ucy5yb290RGlyIHx8ICcnKSk7XG4gIH1cbiAgcmV0dXJuIDA7XG59XG5cbi8vIENMSSBlbnRyeSBwb2ludFxuaWYgKHJlcXVpcmUubWFpbiA9PT0gbW9kdWxlKSB7XG4gIHByb2Nlc3MuZXhpdChtYWluKHByb2Nlc3MuYXJndi5zcGxpY2UoMikpKTtcbn1cbiJdfQ== |
@@ -82,2 +82,7 @@ /** | ||
/** | ||
* Generates a somewhat human-readable module prefix for the given import context, to make | ||
* debugging the emitted Closure types a bit easier. | ||
*/ | ||
private generateModulePrefix; | ||
/** | ||
* Records that we we want a `const x = goog.requireType...` import of the given `importPath`, | ||
@@ -87,8 +92,6 @@ * which will be inserted when we emit. | ||
* | ||
* @param isExplicitImport True if this comes from an underlying 'import' statement, false | ||
* if this reference is needed just because a symbol's type relies on it. | ||
* @param isDefaultImport True if the import statement is a default import, e.g. | ||
* `import Foo from ...;`, which matters for adjusting whether we emit a `.default`. | ||
*/ | ||
requireType(importPath: string, moduleSymbol: ts.Symbol, isExplicitImport: boolean, isDefaultImport?: boolean): void; | ||
requireType(importPath: string, moduleSymbol: ts.Symbol, isDefaultImport?: boolean): void; | ||
protected ensureSymbolDeclared(sym: ts.Symbol): void; | ||
@@ -95,0 +98,0 @@ insertAdditionalImports(sourceFile: ts.SourceFile): ts.SourceFile; |
@@ -20,4 +20,4 @@ /** | ||
/** A class that maintains the module dependency graph of output JS files. */ | ||
var ModulesManifest = /** @class */ (function () { | ||
function ModulesManifest() { | ||
class ModulesManifest { | ||
constructor() { | ||
/** Map of googmodule module name to file name */ | ||
@@ -28,37 +28,28 @@ this.moduleToFileName = {}; | ||
} | ||
ModulesManifest.prototype.addManifest = function (other) { | ||
addManifest(other) { | ||
Object.assign(this.moduleToFileName, other.moduleToFileName); | ||
Object.assign(this.referencedModules, other.referencedModules); | ||
}; | ||
ModulesManifest.prototype.addModule = function (fileName, module) { | ||
} | ||
addModule(fileName, module) { | ||
this.moduleToFileName[module] = fileName; | ||
this.referencedModules[fileName] = []; | ||
}; | ||
ModulesManifest.prototype.addReferencedModule = function (fileName, resolvedModule) { | ||
} | ||
addReferencedModule(fileName, resolvedModule) { | ||
this.referencedModules[fileName].push(resolvedModule); | ||
}; | ||
Object.defineProperty(ModulesManifest.prototype, "modules", { | ||
get: function () { | ||
return Object.keys(this.moduleToFileName); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
ModulesManifest.prototype.getFileNameFromModule = function (module) { | ||
} | ||
get modules() { | ||
return Object.keys(this.moduleToFileName); | ||
} | ||
getFileNameFromModule(module) { | ||
return this.moduleToFileName[module]; | ||
}; | ||
Object.defineProperty(ModulesManifest.prototype, "fileNames", { | ||
get: function () { | ||
return Object.keys(this.referencedModules); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
ModulesManifest.prototype.getReferencedModules = function (fileName) { | ||
} | ||
get fileNames() { | ||
return Object.keys(this.referencedModules); | ||
} | ||
getReferencedModules(fileName) { | ||
return this.referencedModules[fileName]; | ||
}; | ||
return ModulesManifest; | ||
}()); | ||
} | ||
} | ||
exports.ModulesManifest = ModulesManifest; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlc19tYW5pZmVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tb2R1bGVzX21hbmlmZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBTUgsNkVBQTZFO0lBQzdFO1FBQUE7WUFDRSxpREFBaUQ7WUFDekMscUJBQWdCLEdBQW9CLEVBQUUsQ0FBQztZQUMvQyxxRUFBcUU7WUFDN0Qsc0JBQWlCLEdBQXNCLEVBQUUsQ0FBQztRQStCcEQsQ0FBQztRQTdCQyxxQ0FBVyxHQUFYLFVBQVksS0FBc0I7WUFDaEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLEVBQUUsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7WUFDN0QsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsaUJBQWlCLEVBQUUsS0FBSyxDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDakUsQ0FBQztRQUVELG1DQUFTLEdBQVQsVUFBVSxRQUFnQixFQUFFLE1BQWM7WUFDeEMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLE1BQU0sQ0FBQyxHQUFHLFFBQVEsQ0FBQztZQUN6QyxJQUFJLENBQUMsaUJBQWlCLENBQUMsUUFBUSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBQ3hDLENBQUM7UUFFRCw2Q0FBbUIsR0FBbkIsVUFBb0IsUUFBZ0IsRUFBRSxjQUFzQjtZQUMxRCxJQUFJLENBQUMsaUJBQWlCLENBQUMsUUFBU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ICB0aGlzLm1vZHVsZVRvRmlsZU5hbWVbbW9kdWxlXSA9IGZpbGVOYW1lO1xuICAgIHRoaXMucmVmZXJlbmNlZE1vZHVsZXNbZmlsZU5hbWVdID0gW107XG4gIH1cblxuICBhZGRSZWZlcmVuY2VkTW9kdWxlKGZpbGVOYW1lOiBzdHJpbmcsIHJlc29sdmVkTW9kdWxlOiBzdHJpbmcpOiB2b2lkIHtcbiAgICB0aGlzLnJlZmVyZW5jZWRNb2R1bGVzW2ZpbGVOYW1lXS5wdXNoKHJlc29sdmVkTW9kdWxlKTtcbiAgfVxuXG4gIGdldCBtb2R1bGVzKCk6IHN0cmluZ1tdIHtcbiAgICByZXR1cm4gT2JqZWN0LmtleXModGhpcy5tb2R1bGVUb0ZpbGVOYW1lKTtcbiAgfVxuXG4gIGdldEZpbGVOYW1lRnJvbU1vZHVsZShtb2R1bGU6IHN0cmluZyk6IHN0cmluZyB7XG4gICAgcmV0dXJuIHRoaXMubW9kdWxlVG9GaWxlTmFtZVttb2R1bGVdO1xuICB9XG5cbiAgZ2V0IGZpbGVOYW1lcygpOiBzdHJpbmdbXSB7XG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKHRoaXMucmVmZXJlbmNlZE1vZHVsZXMpO1xuICB9XG5cbiAgZ2V0UmVmZXJlbmNlZE1vZHVsZXMoZmlsZU5hbWU6IHN0cmluZyk6IHN0cmluZ1tdIHtcbiAgICByZXR1cm4gdGhpcy5yZWZlcmVuY2VkTW9kdWxlc1tmaWxlTmFtZV07XG4gIH1cbn1cbiJdfQ== |
@@ -8,33 +8,2 @@ /** | ||
*/ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (this && this.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
(function (factory) { | ||
@@ -51,3 +20,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
const ts = require("typescript"); | ||
/** @return true if node has the specified modifier flag set. */ | ||
@@ -60,3 +29,3 @@ function hasModifierFlag(declaration, flag) { | ||
function isAmbient(node) { | ||
var current = node; | ||
let current = node; | ||
while (current) { | ||
@@ -96,3 +65,3 @@ if (hasModifierFlag(current, ts.ModifierFlags.Ambient)) { | ||
// See the private function unescapeIdentifier in TypeScript's utilities.ts. | ||
var str = name; | ||
const str = name; | ||
if (str.startsWith('___')) | ||
@@ -111,6 +80,6 @@ return str.substring(1); | ||
function createNotEmittedStatementWithComments(sourceFile, original) { | ||
var replacement = ts.createNotEmittedStatement(original); | ||
let replacement = ts.createNotEmittedStatement(original); | ||
// NB: synthetic nodes can have pos/end == -1. This is handled by the underlying implementation. | ||
var leading = ts.getLeadingCommentRanges(sourceFile.text, original.pos) || []; | ||
var trailing = ts.getTrailingCommentRanges(sourceFile.text, original.end) || []; | ||
const leading = ts.getLeadingCommentRanges(sourceFile.text, original.pos) || []; | ||
const trailing = ts.getTrailingCommentRanges(sourceFile.text, original.end) || []; | ||
replacement = | ||
@@ -127,6 +96,5 @@ ts.setSyntheticLeadingComments(replacement, synthesizeCommentRanges(sourceFile, leading)); | ||
function synthesizeCommentRanges(sourceFile, parsedComments) { | ||
var synthesizedComments = []; | ||
parsedComments.forEach(function (_a, commentIdx) { | ||
var kind = _a.kind, pos = _a.pos, end = _a.end, hasTrailingNewLine = _a.hasTrailingNewLine; | ||
var commentText = sourceFile.text.substring(pos, end).trim(); | ||
const synthesizedComments = []; | ||
parsedComments.forEach(({ kind, pos, end, hasTrailingNewLine }, commentIdx) => { | ||
let commentText = sourceFile.text.substring(pos, end).trim(); | ||
if (kind === ts.SyntaxKind.MultiLineCommentTrivia) { | ||
@@ -142,3 +110,3 @@ commentText = commentText.replace(/(^\/\*)|(\*\/$)/g, ''); | ||
} | ||
synthesizedComments.push({ kind: kind, text: commentText, hasTrailingNewLine: hasTrailingNewLine, pos: -1, end: -1 }); | ||
synthesizedComments.push({ kind, text: commentText, hasTrailingNewLine, pos: -1, end: -1 }); | ||
}); | ||
@@ -152,3 +120,3 @@ return synthesizedComments; | ||
function createNotEmittedStatement(sourceFile) { | ||
var stmt = ts.createNotEmittedStatement(sourceFile); | ||
const stmt = ts.createNotEmittedStatement(sourceFile); | ||
ts.setOriginalNode(stmt, undefined); | ||
@@ -171,3 +139,3 @@ ts.setTextRange(stmt, { pos: 0, end: 0 }); | ||
if (node.kind === ts.SyntaxKind.SourceFile) { | ||
var sf = node; | ||
const sf = node; | ||
return updateSourceFileNode(sf, ts.visitLexicalEnvironment(sf.statements, visitor, context)); | ||
@@ -214,3 +182,3 @@ } | ||
function createSingleQuoteStringLiteral(text) { | ||
var stringLiteral = ts.createLiteral(text); | ||
const stringLiteral = ts.createLiteral(text); | ||
// tslint:disable-next-line:no-any accessing TS internal API. | ||
@@ -223,3 +191,3 @@ stringLiteral.singleQuote = true; | ||
function createSingleLineComment(original, text) { | ||
var comment = { | ||
const comment = { | ||
kind: ts.SyntaxKind.SingleLineCommentTrivia, | ||
@@ -236,3 +204,3 @@ text: ' ' + text, | ||
function createMultiLineComment(original, text) { | ||
var comment = { | ||
const comment = { | ||
kind: ts.SyntaxKind.MultiLineCommentTrivia, | ||
@@ -273,4 +241,3 @@ text: ' ' + text, | ||
*/ | ||
function reportDiagnostic(diagnostics, node, messageText, textRange, category) { | ||
if (category === void 0) { category = ts.DiagnosticCategory.Error; } | ||
function reportDiagnostic(diagnostics, node, messageText, textRange, category = ts.DiagnosticCategory.Error) { | ||
diagnostics.push(createDiagnostic(node, messageText, textRange, category)); | ||
@@ -280,3 +247,3 @@ } | ||
function createDiagnostic(node, messageText, textRange, category) { | ||
var start, length; | ||
let start, length; | ||
if (textRange) { | ||
@@ -293,6 +260,6 @@ start = textRange.pos; | ||
file: node.getSourceFile(), | ||
start: start, | ||
length: length, | ||
messageText: messageText, | ||
category: category, | ||
start, | ||
length, | ||
messageText, | ||
category, | ||
code: 0, | ||
@@ -307,10 +274,10 @@ }; | ||
function getAllLeadingComments(node) { | ||
var allRanges = []; | ||
var nodeText = node.getFullText(); | ||
var cr = ts.getLeadingCommentRanges(nodeText, 0); | ||
const allRanges = []; | ||
const nodeText = node.getFullText(); | ||
const cr = ts.getLeadingCommentRanges(nodeText, 0); | ||
if (cr) | ||
allRanges.push.apply(allRanges, __spread(cr.map(function (c) { return (__assign({}, c, { text: nodeText.substring(c.pos, c.end) })); }))); | ||
var synthetic = ts.getSyntheticLeadingComments(node); | ||
allRanges.push(...cr.map(c => (Object.assign({}, c, { text: nodeText.substring(c.pos, c.end) })))); | ||
const synthetic = ts.getSyntheticLeadingComments(node); | ||
if (synthetic) | ||
allRanges.push.apply(allRanges, __spread(synthetic)); | ||
allRanges.push(...synthetic); | ||
return allRanges; | ||
@@ -320,2 +287,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZXJfdXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90cmFuc2Zvcm1lcl91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs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dpdGggdGhlaXIgdGV4dCBpbmNsdWRlZC4gVGhlIHJldHVybmVkIGNvbW1lbnRzIG11c3RcbiAqIG5vdCBiZSBtdXRhdGVkLCBhcyB0aGVpciBjb250ZW50IG1pZ2h0IG9yIG1pZ2h0IG5vdCBiZSByZWZsZWN0ZWQgYmFjayBpbnRvIHRoZSBBU1QuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRBbGxMZWFkaW5nQ29tbWVudHMobm9kZTogdHMuTm9kZSk6XG4gICAgUmVhZG9ubHlBcnJheTxSZWFkb25seTx0cy5Db21tZW50UmFuZ2Ume3RleHQ6IHN0cmluZ30+PiB7XG4gIGNvbnN0IGFsbFJhbmdlczogQXJyYXk8UmVhZG9ubHk8dHMuQ29tbWVudFJhbmdlJnt0ZXh0OiBzdHJpbmd9Pj4gPSBbXTtcbiAgY29uc3Qgbm9kZVRleHQgPSBub2RlLmdldEZ1bGxUZXh0KCk7XG4gIGNvbnN0IGNyID0gdHMuZ2V0TGVhZGluZ0NvbW1lbnRSYW5nZXMobm9kZVRleHQsIDApO1xuICBpZiAoY3IpIGFsbFJhbmdlcy5wdXNoKC4uLmNyLm1hcChjID0+ICh7Li4uYywgdGV4dDogbm9kZVRleHQuc3Vic3RyaW5nKGMucG9zLCBjLmVuZCl9KSkpO1xuICBjb25zdCBzeW50aGV0aWMgPSB0cy5nZXRTeW50aGV0aWNMZWFkaW5nQ29tbWVudHMobm9kZSk7XG4gIGlmIChzeW50aGV0aWMpIGFsbFJhbmdlcy5wdXNoKC4uLnN5bnRoZXRpYyk7XG4gIHJldHVybiBhbGxSYW5nZXM7XG59XG4iXX0= |
@@ -8,32 +8,2 @@ /** | ||
*/ | ||
var __values = (this && this.__values) || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __spread = (this && this.__spread) || function () { | ||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | ||
return ar; | ||
}; | ||
(function (factory) { | ||
@@ -45,3 +15,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
else if (typeof define === "function" && define.amd) { | ||
define("tsickle/src/tsickle", ["require", "exports", "typescript", "tsickle/src/cli_support", "tsickle/src/decorator_downlevel_transformer", "tsickle/src/enum_transformer", "tsickle/src/externs", "tsickle/src/fileoverview_comment_transformer", "tsickle/src/googmodule", "tsickle/src/jsdoc_transformer", "tsickle/src/modules_manifest", "tsickle/src/quoting_transformer", "tsickle/src/transformer_util", "tsickle/src/externs", "tsickle/src/modules_manifest"], factory); | ||
define("tsickle/src/tsickle", ["require", "exports", "typescript", "tsickle/src/cli_support", "tsickle/src/decorator_downlevel_transformer", "tsickle/src/enum_transformer", "tsickle/src/externs", "tsickle/src/fileoverview_comment_transformer", "tsickle/src/googmodule", "tsickle/src/jsdoc_transformer", "tsickle/src/modules_manifest", "tsickle/src/transformer_util", "tsickle/src/externs", "tsickle/src/modules_manifest"], factory); | ||
} | ||
@@ -51,13 +21,12 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ts = require("typescript"); | ||
var cli_support_1 = require("tsickle/src/cli_support"); | ||
var decorator_downlevel_transformer_1 = require("tsickle/src/decorator_downlevel_transformer"); | ||
var enum_transformer_1 = require("tsickle/src/enum_transformer"); | ||
var externs_1 = require("tsickle/src/externs"); | ||
var fileoverview_comment_transformer_1 = require("tsickle/src/fileoverview_comment_transformer"); | ||
var googmodule = require("tsickle/src/googmodule"); | ||
var jsdoc_transformer_1 = require("tsickle/src/jsdoc_transformer"); | ||
var modules_manifest_1 = require("tsickle/src/modules_manifest"); | ||
var quoting_transformer_1 = require("tsickle/src/quoting_transformer"); | ||
var transformer_util_1 = require("tsickle/src/transformer_util"); | ||
const ts = require("typescript"); | ||
const cli_support_1 = require("tsickle/src/cli_support"); | ||
const decorator_downlevel_transformer_1 = require("tsickle/src/decorator_downlevel_transformer"); | ||
const enum_transformer_1 = require("tsickle/src/enum_transformer"); | ||
const externs_1 = require("tsickle/src/externs"); | ||
const fileoverview_comment_transformer_1 = require("tsickle/src/fileoverview_comment_transformer"); | ||
const googmodule = require("tsickle/src/googmodule"); | ||
const jsdoc_transformer_1 = require("tsickle/src/jsdoc_transformer"); | ||
const modules_manifest_1 = require("tsickle/src/modules_manifest"); | ||
const transformer_util_1 = require("tsickle/src/transformer_util"); | ||
// Retained here for API compatibility. | ||
@@ -69,47 +38,26 @@ var externs_2 = require("tsickle/src/externs"); | ||
function mergeEmitResults(emitResults) { | ||
var e_1, _a; | ||
var diagnostics = []; | ||
var emitSkipped = true; | ||
var emittedFiles = []; | ||
var externs = {}; | ||
var modulesManifest = new modules_manifest_1.ModulesManifest(); | ||
try { | ||
for (var emitResults_1 = __values(emitResults), emitResults_1_1 = emitResults_1.next(); !emitResults_1_1.done; emitResults_1_1 = emitResults_1.next()) { | ||
var er = emitResults_1_1.value; | ||
diagnostics.push.apply(diagnostics, __spread(er.diagnostics)); | ||
emitSkipped = emitSkipped || er.emitSkipped; | ||
emittedFiles.push.apply(emittedFiles, __spread(er.emittedFiles)); | ||
Object.assign(externs, er.externs); | ||
modulesManifest.addManifest(er.modulesManifest); | ||
const diagnostics = []; | ||
let emitSkipped = true; | ||
const emittedFiles = []; | ||
const externs = {}; | ||
const modulesManifest = new modules_manifest_1.ModulesManifest(); | ||
for (const er of emitResults) { | ||
diagnostics.push(...er.diagnostics); | ||
emitSkipped = emitSkipped || er.emitSkipped; | ||
if (er.emittedFiles) { | ||
emittedFiles.push(...er.emittedFiles); | ||
} | ||
Object.assign(externs, er.externs); | ||
modulesManifest.addManifest(er.modulesManifest); | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (emitResults_1_1 && !emitResults_1_1.done && (_a = emitResults_1.return)) _a.call(emitResults_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
return { diagnostics: diagnostics, emitSkipped: emitSkipped, emittedFiles: emittedFiles, externs: externs, modulesManifest: modulesManifest }; | ||
return { diagnostics, emitSkipped, emittedFiles, externs, modulesManifest }; | ||
} | ||
exports.mergeEmitResults = mergeEmitResults; | ||
function emitWithTsickle(program, host, tsHost, tsOptions, targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { | ||
if (customTransformers === void 0) { customTransformers = {}; } | ||
var e_2, _a, e_3, _b; | ||
try { | ||
for (var _c = __values(program.getSourceFiles()), _d = _c.next(); !_d.done; _d = _c.next()) { | ||
var sf = _d.value; | ||
cli_support_1.assertAbsolute(sf.fileName); | ||
} | ||
function emitWithTsickle(program, host, tsHost, tsOptions, targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers = {}) { | ||
for (const sf of program.getSourceFiles()) { | ||
cli_support_1.assertAbsolute(sf.fileName); | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
var tsickleDiagnostics = []; | ||
var typeChecker = program.getTypeChecker(); | ||
var tsickleSourceTransformers = []; | ||
let tsickleDiagnostics = []; | ||
const typeChecker = program.getTypeChecker(); | ||
const tsickleSourceTransformers = []; | ||
if (host.transformTypesToClosure) { | ||
@@ -119,5 +67,2 @@ // Only add @suppress {checkTypes} comments when also adding type annotations. | ||
tsickleSourceTransformers.push(jsdoc_transformer_1.jsdocTransformer(host, tsOptions, tsHost, typeChecker, tsickleDiagnostics)); | ||
if (host.enableAutoQuoting) { | ||
tsickleSourceTransformers.push(quoting_transformer_1.quotingTransformer(host, typeChecker, tsickleDiagnostics)); | ||
} | ||
tsickleSourceTransformers.push(enum_transformer_1.enumTransformer(typeChecker, tsickleDiagnostics)); | ||
@@ -129,7 +74,14 @@ tsickleSourceTransformers.push(decorator_downlevel_transformer_1.decoratorDownlevelTransformer(typeChecker, tsickleDiagnostics)); | ||
} | ||
var modulesManifest = new modules_manifest_1.ModulesManifest(); | ||
var tsickleTransformers = { before: tsickleSourceTransformers }; | ||
var tsTransformers = { | ||
before: __spread((customTransformers.beforeTsickle || []), (tsickleTransformers.before || []).map(function (tf) { return skipTransformForSourceFileIfNeeded(host, tf); }), (customTransformers.beforeTs || [])), | ||
after: __spread((customTransformers.afterTs || []), (tsickleTransformers.after || []).map(function (tf) { return skipTransformForSourceFileIfNeeded(host, tf); })), | ||
const modulesManifest = new modules_manifest_1.ModulesManifest(); | ||
const tsickleTransformers = { before: tsickleSourceTransformers }; | ||
const tsTransformers = { | ||
before: [ | ||
...(customTransformers.beforeTsickle || []), | ||
...(tsickleTransformers.before || []).map(tf => skipTransformForSourceFileIfNeeded(host, tf)), | ||
...(customTransformers.beforeTs || []), | ||
], | ||
after: [ | ||
...(customTransformers.afterTs || []), | ||
...(tsickleTransformers.after || []).map(tf => skipTransformForSourceFileIfNeeded(host, tf)), | ||
], | ||
afterDeclarations: customTransformers.afterDeclarations, | ||
@@ -144,4 +96,4 @@ }; | ||
} | ||
var writeFileDelegate = writeFile || tsHost.writeFile.bind(tsHost); | ||
var writeFileImpl = function (fileName, content, writeByteOrderMark, onError, sourceFiles) { | ||
const writeFileDelegate = writeFile || tsHost.writeFile.bind(tsHost); | ||
const writeFileImpl = (fileName, content, writeByteOrderMark, onError, sourceFiles) => { | ||
cli_support_1.assertAbsolute(fileName); | ||
@@ -153,35 +105,25 @@ if (host.addDtsClutzAliases && transformer_util_1.isDtsFileName(fileName) && sourceFiles) { | ||
if (!sourceFiles || sourceFiles.length > 1) { | ||
throw new Error("expected exactly one source file for .d.ts emit, got " + sourceFiles.map(function (sf) { return sf.fileName; })); | ||
throw new Error(`expected exactly one source file for .d.ts emit, got ${sourceFiles.map(sf => sf.fileName)}`); | ||
} | ||
var originalSource = sourceFiles[0]; | ||
content = addClutzAliases(fileName, content, originalSource, typeChecker, host); | ||
const originalSource = sourceFiles[0]; | ||
content = addClutzAliases(content, originalSource, typeChecker, host); | ||
} | ||
writeFileDelegate(fileName, content, writeByteOrderMark, onError, sourceFiles); | ||
}; | ||
var _e = program.emit(targetSourceFile, writeFileImpl, cancellationToken, emitOnlyDtsFiles, tsTransformers), tsDiagnostics = _e.diagnostics, emitSkipped = _e.emitSkipped, emittedFiles = _e.emittedFiles; | ||
var externs = {}; | ||
const { diagnostics: tsDiagnostics, emitSkipped, emittedFiles } = program.emit(targetSourceFile, writeFileImpl, cancellationToken, emitOnlyDtsFiles, tsTransformers); | ||
const externs = {}; | ||
if (host.transformTypesToClosure) { | ||
var sourceFiles = targetSourceFile ? [targetSourceFile] : program.getSourceFiles(); | ||
try { | ||
for (var sourceFiles_1 = __values(sourceFiles), sourceFiles_1_1 = sourceFiles_1.next(); !sourceFiles_1_1.done; sourceFiles_1_1 = sourceFiles_1.next()) { | ||
var sourceFile = sourceFiles_1_1.value; | ||
var isDts = transformer_util_1.isDtsFileName(sourceFile.fileName); | ||
if (isDts && host.shouldSkipTsickleProcessing(sourceFile.fileName)) { | ||
continue; | ||
} | ||
var _f = externs_1.generateExterns(typeChecker, sourceFile, host, host.moduleResolutionHost, tsOptions), output = _f.output, diagnostics = _f.diagnostics; | ||
if (output) { | ||
externs[sourceFile.fileName] = output; | ||
} | ||
if (diagnostics) { | ||
tsickleDiagnostics.push.apply(tsickleDiagnostics, __spread(diagnostics)); | ||
} | ||
const sourceFiles = targetSourceFile ? [targetSourceFile] : program.getSourceFiles(); | ||
for (const sourceFile of sourceFiles) { | ||
const isDts = transformer_util_1.isDtsFileName(sourceFile.fileName); | ||
if (isDts && host.shouldSkipTsickleProcessing(sourceFile.fileName)) { | ||
continue; | ||
} | ||
} | ||
catch (e_3_1) { e_3 = { error: e_3_1 }; } | ||
finally { | ||
try { | ||
if (sourceFiles_1_1 && !sourceFiles_1_1.done && (_b = sourceFiles_1.return)) _b.call(sourceFiles_1); | ||
const { output, diagnostics } = externs_1.generateExterns(typeChecker, sourceFile, host, host.moduleResolutionHost, tsOptions); | ||
if (output) { | ||
externs[sourceFile.fileName] = output; | ||
} | ||
finally { if (e_3) throw e_3.error; } | ||
if (diagnostics) { | ||
tsickleDiagnostics.push(...diagnostics); | ||
} | ||
} | ||
@@ -193,10 +135,10 @@ } | ||
// warns and then fixes up the code to be Closure-compatible anyway. | ||
tsickleDiagnostics = tsickleDiagnostics.filter(function (d) { return d.category === ts.DiagnosticCategory.Error || | ||
!host.shouldIgnoreWarningsForPath(d.file.fileName); }); | ||
tsickleDiagnostics = tsickleDiagnostics.filter(d => d.category === ts.DiagnosticCategory.Error || | ||
!host.shouldIgnoreWarningsForPath(d.file.fileName)); | ||
return { | ||
modulesManifest: modulesManifest, | ||
emitSkipped: emitSkipped, | ||
modulesManifest, | ||
emitSkipped, | ||
emittedFiles: emittedFiles || [], | ||
diagnostics: __spread(tsDiagnostics, tsickleDiagnostics), | ||
externs: externs | ||
diagnostics: [...tsDiagnostics, ...tsickleDiagnostics], | ||
externs | ||
}; | ||
@@ -219,24 +161,73 @@ } | ||
*/ | ||
function addClutzAliases(fileName, dtsFileContent, sourceFile, typeChecker, host) { | ||
var e_4, _a; | ||
var moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile); | ||
var moduleExports = moduleSymbol && typeChecker.getExportsOfModule(moduleSymbol); | ||
function addClutzAliases(dtsFileContent, sourceFile, typeChecker, host) { | ||
const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile); | ||
const moduleExports = moduleSymbol && typeChecker.getExportsOfModule(moduleSymbol); | ||
if (!moduleExports) | ||
return dtsFileContent; | ||
// .d.ts files can be transformed, too, so we need to compare the original node below. | ||
var origSourceFile = ts.getOriginalNode(sourceFile); | ||
// The module exports might be re-exports, and in the case of "export *" might not even be | ||
// available in the module scope, which makes them difficult to export. Avoid the problem by | ||
// filtering out symbols who do not have a declaration in the local module. | ||
var localExports = moduleExports.filter(function (e) { | ||
// If there are no declarations, be conservative and emit the aliases. | ||
const origSourceFile = ts.getOriginalNode(sourceFile); | ||
// In order to write aliases, the exported symbols need to be available in the | ||
// the module scope. That is not always the case: | ||
// | ||
// export | ||
// 1) export const X; // works | ||
// | ||
// reexport | ||
// 2) export {X} from './foo'; // doesn't | ||
// | ||
// imported reexport | ||
// 3) import {X} from './foo'; // works | ||
// export {X} from './foo'; | ||
// | ||
// getExportsOfModule returns all three types, but we need to separate 2). | ||
// For now we 'fix' 2) by simply not emitting a clutz alias, since clutz | ||
// interop is used in minority of scenarios. | ||
// | ||
// TODO(radokirov): attempt to add appropriate imports for 2) so that | ||
// currently finding out local appears even harder than fixing exports. | ||
const localExports = moduleExports.filter(e => { | ||
// If there are no declarations, be conservative and don't emit the aliases. | ||
// I don't know how can this happen, we have no tests that excercise it. | ||
if (!e.declarations) | ||
return true; | ||
return false; | ||
// Skip default exports, they are not currently supported. | ||
// default is a keyword in typescript, so the name of the export being default means that it's a | ||
// default export. | ||
// default is a keyword in typescript, so the name of the export being | ||
// default means that it's a default export. | ||
if (e.name === 'default') | ||
return false; | ||
// Otherwise check that some declaration is from the local module. | ||
return e.declarations.some(function (d) { return d.getSourceFile() === origSourceFile; }); | ||
// Use the declaration location to determine separate cases above. | ||
for (const d of e.declarations) { | ||
// This is a special case for export *. Technically, it is outside the | ||
// three cases outlined, but at this point we have rewritten it to a | ||
// reexport or an imported reexport. However, it appears that the | ||
// rewriting also has made it behave different from explicit named export | ||
// in the sense that the declaration appears to point at the original | ||
// location not the reexport location. Since we can't figure out whether | ||
// there is a local import here, we err on the side of less emit. | ||
if (d.getSourceFile() !== origSourceFile) { | ||
return false; | ||
} | ||
if (!ts.isExportSpecifier(d)) { | ||
// we have a pure export (case 1) thus safe to emit clutz alias. | ||
return true; | ||
} | ||
// The declaration d is useless to separate reexport and import-reexport | ||
// because they both point to the reexporting file and not to the original | ||
// one. However, there is another ts API that can do a deeper resolution. | ||
const localSymbol = typeChecker.getExportSpecifierLocalTargetSymbol(d); | ||
// I don't know how can this happen, but err on the side of less emit. | ||
if (!localSymbol) | ||
return false; | ||
// `declarations` is undefined for builtin symbols, such as `unknown`. | ||
if (!localSymbol.declarations) | ||
return false; | ||
// In case of no import we ended up in a declaration in foo.ts, while in | ||
// case of having an import localD is still in the reexporing file. | ||
for (const localD of localSymbol.declarations) { | ||
if (localD.getSourceFile() !== origSourceFile) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
}); | ||
@@ -247,5 +238,5 @@ if (!localExports.length) | ||
// module symbols come out, so sort here to make the tests stable. | ||
localExports.sort(function (a, b) { return stringCompare(a.name, b.name); }); | ||
var moduleName = host.pathToModuleName('', sourceFile.fileName); | ||
var clutzModuleName = moduleName.replace(/\./g, '$'); | ||
localExports.sort((a, b) => stringCompare(a.name, b.name)); | ||
const moduleName = host.pathToModuleName('', sourceFile.fileName); | ||
const clutzModuleName = moduleName.replace(/\./g, '$'); | ||
// Clutz might refer to the name in two different forms (stemming from goog.provide and | ||
@@ -258,28 +249,27 @@ // goog.module respectively). | ||
// Case (1) from above. | ||
var globalSymbols = ''; | ||
let globalSymbols = ''; | ||
// Case (2) from above. | ||
var nestedSymbols = ''; | ||
try { | ||
for (var localExports_1 = __values(localExports), localExports_1_1 = localExports_1.next(); !localExports_1_1.done; localExports_1_1 = localExports_1.next()) { | ||
var symbol = localExports_1_1.value; | ||
globalSymbols += | ||
"\t\texport {" + symbol.name + " as module$contents$" + clutzModuleName + "_" + symbol.name + "}\n"; | ||
nestedSymbols += | ||
"\t\texport {module$contents$" + clutzModuleName + "_" + symbol.name + " as " + symbol.name + "}\n"; | ||
let nestedSymbols = ''; | ||
for (const symbol of localExports) { | ||
let localName = symbol.name; | ||
const declaration = symbol.declarations.find(d => d.getSourceFile() === origSourceFile); | ||
if (declaration && ts.isExportSpecifier(declaration) && declaration.propertyName) { | ||
// If declared in an "export {X as Y};" export specifier, then X (stored in propertyName) is | ||
// the local name that resolves within the module, whereas Y is only available on the exports, | ||
// i.e. the name used to address the symbol from outside the module. | ||
// Use the localName for the export then, but publish under the external name. | ||
localName = declaration.propertyName.text; | ||
} | ||
globalSymbols += | ||
`\t\texport {${localName} as module$contents$${clutzModuleName}_${symbol.name}}\n`; | ||
nestedSymbols += | ||
`\t\texport {module$contents$${clutzModuleName}_${symbol.name} as ${symbol.name}}\n`; | ||
} | ||
catch (e_4_1) { e_4 = { error: e_4_1 }; } | ||
finally { | ||
try { | ||
if (localExports_1_1 && !localExports_1_1.done && (_a = localExports_1.return)) _a.call(localExports_1); | ||
} | ||
finally { if (e_4) throw e_4.error; } | ||
} | ||
dtsFileContent += 'declare global {\n'; | ||
dtsFileContent += "\tnamespace \u0CA0_\u0CA0.clutz {\n"; | ||
dtsFileContent += `\tnamespace ಠ_ಠ.clutz {\n`; | ||
dtsFileContent += globalSymbols; | ||
dtsFileContent += "\t}\n"; | ||
dtsFileContent += "\tnamespace \u0CA0_\u0CA0.clutz.module$exports$" + clutzModuleName + " {\n"; | ||
dtsFileContent += `\t}\n`; | ||
dtsFileContent += `\tnamespace ಠ_ಠ.clutz.module$exports$${clutzModuleName} {\n`; | ||
dtsFileContent += nestedSymbols; | ||
dtsFileContent += "\t}\n"; | ||
dtsFileContent += `\t}\n`; | ||
dtsFileContent += '}\n'; | ||
@@ -289,5 +279,5 @@ return dtsFileContent; | ||
function skipTransformForSourceFileIfNeeded(host, delegateFactory) { | ||
return function (context) { | ||
var delegate = delegateFactory(context); | ||
return function (sourceFile) { | ||
return (context) => { | ||
const delegate = delegateFactory(context); |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ICAgICAgIHJldHVybiBzb3VyY2VGaWxlO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGRlbGVnYXRlKHNvdXJjZUZpbGUpO1xuICAgIH07XG4gIH07XG59XG4iXX0= |
@@ -57,4 +57,4 @@ /** | ||
* @param symbolsToAliasedNames a mapping from symbols (`Foo`) to a name in scope they should be | ||
* emitted as (e.g. `tsickle_forward_declare_1.Foo`). Can be augmented during type | ||
* translation, e.g. to blacklist a symbol. | ||
* emitted as (e.g. `tsickle_reqType_1.Foo`). Can be augmented during type translation, e.g. | ||
* to blacklist a symbol. | ||
*/ | ||
@@ -61,0 +61,0 @@ constructor(host: AnnotatorHost, typeChecker: ts.TypeChecker, node: ts.Node, pathBlackList?: Set<string> | undefined, symbolsToAliasedNames?: Map<ts.Symbol, string>, ensureSymbolDeclared?: (sym: ts.Symbol) => void); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
197
938869
16
36
6815