Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsickle

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsickle - npm Package Compare versions

Comparing version 0.25.5 to 0.25.6

4

package.json
{
"name": "tsickle",
"version": "0.25.5",
"version": "0.25.6",
"description": "Transpile TypeScript code to JavaScript with Closure annotations.",

@@ -24,3 +24,2 @@ "main": "src/tsickle.js",

"devDependencies": {
"@bazel/typescript": "^0.3.1",
"@types/chai": "^3.4.32",

@@ -54,3 +53,2 @@ "@types/diff": "^3.2.0",

"scripts": {
"build": "bazel build //src/... && mkdir built && cp -R bazel-bin/src built/src && cp package.json README.md built",

@@ -57,0 +55,0 @@ "clean": "rm -rf built",

@@ -121,2 +121,20 @@ # Tsickle - TypeScript to Closure Translator [![Linux build](https://travis-ci.org/angular/tsickle.svg?branch=master)](https://travis-ci.org/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)

### Debugging
You can debug tests by using `bazel run` and passing `--node_options=--inspect`. For example, to
debug a specific golden test:
```shell
TEST_FILTER=my_golden_test ibazel run //test:golden_test -- --node_options=--inspect
```
Then open [about:inspect] in Chrome and choose "about:inspect". Chrome will launch a debugging
session on any node process that starts with a debugger listening on one of the listed ports. The
tsickle tests and Chrome both default to `localhost:9229`, so things should work out of the box.
VS Code can also connect using the inspect protocol. It doesn't support automatically reconnecting
or any way to re-run the test suite though, so it is a less convenient. You can start the node
process passing an extra `--node_options=--debug-brk` (in addition to the parameters above) to have
Node wait before program execution, so you have time to attach VS Code.
### Updating Goldens

@@ -123,0 +141,0 @@

@@ -158,2 +158,3 @@ /**

var decoratorList = [];
var decoratorsToKeep = [];
try {

@@ -165,2 +166,5 @@ for (var decorators_1 = __values(decorators), decorators_1_1 = decorators_1.next(); !decorators_1_1.done; decorators_1_1 = decorators_1.next()) {

}
else {
decoratorsToKeep.push(decorator);
}
}

@@ -179,3 +183,4 @@ }

newClassDeclaration.members = insertBeforeDecoratorProperties(newClassDeclaration.members, createDecoratorClassProperty(decoratorList));
newClassDeclaration.decorators = undefined;
newClassDeclaration.decorators =
decoratorsToKeep.length ? ts.createNodeArray(decoratorsToKeep) : undefined;
return newClassDeclaration;

@@ -192,2 +197,2 @@ default:

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NfZGVjb3JhdG9yX2Rvd25sZXZlbF90cmFuc2Zvcm1lci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jbGFzc19kZWNvcmF0b3JfZG93bmxldmVsX3RyYW5zZm9ybWVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBRUgsdUVBQWtEO0lBQ2xELGlFQUFrRDtJQUNsRCwyQ0FBbUM7SUFFbkM7OztPQUdHO0lBQ0g7UUFDRSxJQUFNLFlBQVksR0FBcUIsRUFBRSxDQUFDO1FBQzFDLFlBQVksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLHVCQUF1QixDQUN4QyxTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFDNUIsRUFBRSxDQUFDLHVCQUF1QixDQUFDLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FBQyxVQUFVLENBQUMsRUFBRSxTQUFTLENBQUMsRUFBRSxTQUFTLENBQUMsQ0FBQyxDQUFDO1FBQ3hGLFlBQVksQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLHVCQUF1QixDQUN4QyxTQUFTLEVBQUUsTUFBTSxFQUFFLEVBQUUsQ0FBQyxXQUFX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uZ2V0TXV0YWJsZUNsb25lKGNkKTtcblxuICAgICAgICAgIG5ld0NsYXNzRGVjbGFyYXRpb24ubWVtYmVycyA9IGluc2VydEJlZm9yZURlY29yYXRvclByb3BlcnRpZXMoXG4gICAgICAgICAgICAgIG5ld0NsYXNzRGVjbGFyYXRpb24ubWVtYmVycywgY3JlYXRlRGVjb3JhdG9yQ2xhc3NQcm9wZXJ0eShkZWNvcmF0b3JMaXN0KSk7XG5cbiAgICAgICAgICBuZXdDbGFzc0RlY2xhcmF0aW9uLmRlY29yYXRvcnMgPVxuICAgICAgICAgICAgICBkZWNvcmF0b3JzVG9LZWVwLmxlbmd0aCA/IHRzLmNyZWF0ZU5vZGVBcnJheShkZWNvcmF0b3JzVG9LZWVwKSA6IHVuZGVmaW5lZDtcblxuICAgICAgICAgIHJldHVybiBuZXdDbGFzc0RlY2xhcmF0aW9uO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHJldHVybiB2aXNpdEVhY2hDaGlsZChub2RlLCB2aXNpdG9yLCBjb250ZXh0KTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgcmV0dXJuIChzZjogdHMuU291cmNlRmlsZSkgPT4gdmlzaXRvcihzZikgYXMgdHMuU291cmNlRmlsZTtcbiAgfTtcbn0iXX0=

@@ -76,5 +76,5 @@ /// <amd-module name="tsickle/src/decorator-annotator" />

export declare function visitClassContentIncludingDecorators(classDecl: ts.ClassDeclaration, rewriter: Rewriter, decoratorVisitor?: DecoratorClassVisitor): void;
export declare function convertDecorators(typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile, sourceMapper?: SourceMapper): {
export declare function convertDecorators(typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile, sourceMapper: SourceMapper): {
output: string;
diagnostics: ts.Diagnostic[];
};
/// <amd-module name="tsickle/src/es5processor" />
/**
* @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
*/
import { ModulesManifest } from './modules_manifest';

@@ -10,0 +3,0 @@ export interface Es5ProcessorHost {

@@ -34,3 +34,3 @@ /**

else if (typeof define === "function" && define.amd) {
define("tsickle/src/es5processor", ["require", "exports", "tsickle/src/rewriter", "tsickle/src/typescript", "tsickle/src/util"], factory);
define("tsickle/src/es5processor", ["require", "exports", "tsickle/src/fileoverview_comment_transformer", "tsickle/src/rewriter", "tsickle/src/typescript", "tsickle/src/util"], factory);
}

@@ -40,2 +40,3 @@ })(function (require, exports) {

Object.defineProperty(exports, "__esModule", { value: true });
var fileoverview_comment_transformer_1 = require("tsickle/src/fileoverview_comment_transformer");
var rewriter_1 = require("tsickle/src/rewriter");

@@ -88,5 +89,4 @@ var ts = require("tsickle/src/typescript");

ES5Processor.prototype.process = function () {
this.emitFileComment();
var moduleId = this.host.fileNameToModuleId(this.file.fileName);
// TODO(evanm): only emit the goog.module *after* the first comment,
// so that @suppress statements work.
var moduleName = this.host.pathToModuleName('', this.file.fileName);

@@ -138,2 +138,21 @@ // NB: No linebreak after module call so sourcemaps are not offset.

/**
* Emits file comments for the current source file, if any.
*/
ES5Processor.prototype.emitFileComment = function () {
var _this = this;
var leadingComments = ts.getLeadingCommentRanges(this.file.getFullText(), 0) || [];
var fileComment = leadingComments.find(function (c) {
if (c.kind !== ts.SyntaxKind.MultiLineCommentTrivia)
return false;
var commentText = _this.file.getFullText().substring(c.pos, c.end);
return fileoverview_comment_transformer_1.isClosureFileoverviewComment(commentText);
});
if (!fileComment)
return;
var end = fileComment.end;
if (fileComment.hasTrailingNewLine)
end++;
this.writeLeadingTrivia(this.file, end);
};
/**
* visitTopLevel processes a top-level ts.Node and emits its contents.

@@ -456,2 +475,2 @@ *

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXM1cHJvY2Vzc29yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2VzNXByb2Nlc3Nvci50cyJdLCJuYW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uICAgIGNvbnRlbnQ6IHN0cmluZyk6IHN0cmluZyB7XG4gIGlmICghaG9zdC5nb29nbW9kdWxlIHx8IGlzRHRzRmlsZU5hbWUoZmlsZU5hbWUpKSB7XG4gICAgcmV0dXJuIGNvbnRlbnQ7XG4gIH1cbiAgY29uc3Qge291dHB1dCwgcmVmZXJlbmNlZE1vZHVsZXN9ID0gcHJvY2Vzc0VTNShob3N0LCBmaWxlTmFtZSwgY29udGVudCk7XG5cbiAgY29uc3QgbW9kdWxlTmFtZSA9IGhvc3QucGF0aFRvTW9kdWxlTmFtZSgnJywgZmlsZU5hbWUpO1xuICBtb2R1bGVzTWFuaWZlc3QuYWRkTW9kdWxlKGZpbGVOYW1lLCBtb2R1bGVOYW1lKTtcbiAgZm9yIChjb25zdCByZWZlcmVuY2VkIG9mIHJlZmVyZW5jZWRNb2R1bGVzKSB7XG4gICAgbW9kdWxlc01hbmlmZXN0LmFkZFJlZmVyZW5jZWRNb2R1bGUoZmlsZU5hbWUsIHJlZmVyZW5jZWQpO1xuICB9XG5cbiAgcmV0dXJuIG91dHB1dDtcbn1cbiJdfQ==
/// <amd-module name="tsickle/src/fileoverview_comment_transformer" />
import * as ts from './typescript';
/**
* Returns true if the given comment is a \@fileoverview style comment in the Closure sense, i.e. a
* comment that has JSDoc tags marking it as a fileoverview comment.
* Note that this is different from TypeScript's understanding of the concept, where a file comment
* is a comment separated from the rest of the file by a double newline.
*/
export declare function isClosureFileoverviewComment(text: string): boolean;
/**
* A transformer that ensures the emitted JS file has an \@fileoverview comment that contains an

@@ -5,0 +12,0 @@ * \@suppress {checkTypes} annotation by either adding or updating an existing comment.

@@ -48,2 +48,13 @@ /**

/**
* Returns true if the given comment is a \@fileoverview style comment in the Closure sense, i.e. a
* comment that has JSDoc tags marking it as a fileoverview comment.
* Note that this is different from TypeScript's understanding of the concept, where a file comment
* is a comment separated from the rest of the file by a double newline.
*/
function isClosureFileoverviewComment(text) {
var current = jsdoc.parseContents(text);
return current !== null && current.tags.some(function (t) { return FILEOVERVIEW_COMMENT_MARKERS.has(t.tagName); });
}
exports.isClosureFileoverviewComment = isClosureFileoverviewComment;
/**
* A transformer that ensures the emitted JS file has an \@fileoverview comment that contains an

@@ -116,2 +127,2 @@ * \@suppress {checkTypes} annotation by either adding or updating an existing comment.

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZW92ZXJ2aWV3X2NvbW1lbnRfdHJhbnNmb3JtZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvZmlsZW92ZXJ2aWV3X2NvbW1lbnRfdHJhbnNmb3JtZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVILHlDQUFpQztJQUNqQyxpRUFBbUY7SUFDbkYsMkNBQW1DO0lBRW5DOzs7T0FHRztJQUNILElBQU0sNEJBQTRCLEdBQzlCLElBQUksR0FBRyxDQUFDLENBQUMsY0FBYyxFQUFFLFNBQVMsRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLGFBQWEsQ0FBQyxDQUFDLENBQUM7SUFFM0U7OztPQUdHO0lBQ0gsc0NBQTZDLE9BQWlDO1FBRTVFLE1BQU0sQ0FBQyxVQUFDLEVBQWlCO1lBQ3ZCLElBQUksUUFBUSxHQUE0QixFQUFFLENBQUM7WUFDM0MsOEZBQThGO1lBQzlGLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsTUFBTSxJQUFJLEVBQUUsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxLQUFLLEVBQUUsQ0FBQyxVQUFVLENBQUMsbUJBQW1CLENBQUMsQ0FBQyxDQUFDO2dCQUN4RixRQUFRLEdBQUcsRUFBRSxDQUFDLDRCQUE0QixDQUFDL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5bnRoZXRpY1RyYWlsaW5nQ29tbWVudChcbiAgICAgIHN5bnRoZXRpY0ZpcnN0U3RhdGVtZW50LCB0cy5TeW50YXhLaW5kLk11bHRpTGluZUNvbW1lbnRUcml2aWEsIGNvbW1lbnRUZXh0LCB0cnVlKTtcbiAgcmV0dXJuIHVwZGF0ZVNvdXJjZUZpbGVOb2RlKHNmLCB0cy5jcmVhdGVOb2RlQXJyYXkoW3N5bnRoZXRpY0ZpcnN0U3RhdGVtZW50LCAuLi5zZi5zdGF0ZW1lbnRzXSkpO1xufVxuIl19

@@ -35,3 +35,3 @@ /// <amd-module name="tsickle/src/rewriter" />

constructor(file: ts.SourceFile, sourceMapper?: SourceMapper);
getOutput(): {
getOutput(prefix?: string): {
output: string;

@@ -54,3 +54,7 @@ diagnostics: ts.Diagnostic[];

writeNodeFrom(node: ts.Node, pos: number, end?: number): void;
writeLeadingTrivia(node: ts.Node): void;
/**
* Writes all leading trivia (whitespace or comments) on node, or all trivia up to the given
* position. Also marks those trivia as "already emitted" by shifting the skipCommentsUpTo marker.
*/
writeLeadingTrivia(node: ts.Node, upTo?: number): void;
addSourceMapping(node: ts.Node): void;

@@ -57,0 +61,0 @@ /**

@@ -57,8 +57,15 @@ /**

}
Rewriter.prototype.getOutput = function () {
Rewriter.prototype.getOutput = function (prefix) {
if (this.indent !== 0) {
throw new Error('visit() failed to track nesting');
}
var out = this.output.join('');
if (prefix) {
// Insert prefix after any leading trivia so that @fileoverview comments do not get broken.
var firstCode = this.file.getStart();
out = out.substring(0, firstCode) + prefix + out.substring(firstCode);
this.sourceMapper.shiftByOffset(prefix.length);
}
return {
output: this.output.join(''),
output: out,
diagnostics: this.diagnostics,

@@ -131,4 +138,11 @@ };

};
Rewriter.prototype.writeLeadingTrivia = function (node) {
this.writeRange(node, node.getFullStart(), node.getStart());
/**
* Writes all leading trivia (whitespace or comments) on node, or all trivia up to the given
* position. Also marks those trivia as "already emitted" by shifting the skipCommentsUpTo marker.
*/
Rewriter.prototype.writeLeadingTrivia = function (node, upTo) {
if (upTo === void 0) { upTo = 0; }
var upToOffset = upTo || node.getStart();
this.writeRange(node, node.getFullStart(), upTo || node.getStart());
this.skipCommentsUpToOffset = upToOffset;
};

@@ -208,3 +222,3 @@ Rewriter.prototype.addSourceMapping = function (node) {

this.diagnostics.push({
file: this.file,
file: node.getSourceFile(),
start: node.getStart(),

@@ -247,2 +261,2 @@ length: node.getEnd() - node.getStart(),

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV3cml0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvcmV3cml0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBRUgsaUVBQW9GO0lBQ3BGLDJDQUFtQztJQUVuQzs7OztPQUlHO0lBQ0g7UUFpQkUsa0JBQW1CLElBQW1CLEVBQVUsWUFBK0M7WUFBL0MsNkJBQUEsRUFBQSxlQUE2QixxQ0FBa0I7WUFBNUUsU0FBSSxHQUFKLElBQUksQ0FBZTtZQUFVLGlCQUFZLEdBQVosWUFBWSxDQUFtQztZQWhCdkYsV0FBTSxHQUFhLEVBQUUsQ0FBQztZQUM5Qiw2Q0FBNkM7WUFDbkMsZ0JBQVcsR0FBb0IsRUFBRSxDQUFDO1lBQzVDLHNDQUFzQztZQUM5QixhQUFRLEdBQW1CLEVBQUMsSUFBSSxFQUFFLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQyxFQUFFLFFBQVEsRUFBRSxDQUFDLEVBQUMsQ0FBQztZQUNyRTs7O2VBR0c7WUFDSyxXQUFNLEdBQUcsQ0FBQyxDQUFDO1lBQ25COzs7ZUFHRztZQUNLLDJCQUFzQixHQUFHLENBQUMsQ0FBQyxDQUFDO1FBR3BDLENBQUM7UUFFRCw0QkFBUyxHQUFUO1l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aXR5TmFtZSk6IHN0cmluZyB7XG4gIGlmICh0cy5pc0lkZW50aWZpZXIobmFtZSkpIHtcbiAgICByZXR1cm4gZ2V0SWRlbnRpZmllclRleHQobmFtZSk7XG4gIH1cbiAgcmV0dXJuIGdldEVudGl0eU5hbWVUZXh0KG5hbWUubGVmdCkgKyAnLicgKyBnZXRJZGVudGlmaWVyVGV4dChuYW1lLnJpZ2h0KTtcbn1cblxuLyoqXG4gKiBDb252ZXJ0cyBhbiBlc2NhcGVkIFR5cGVTY3JpcHQgbmFtZSBpbnRvIHRoZSBvcmlnaW5hbCBzb3VyY2UgbmFtZS5cbiAqIFByZWZlciBnZXRJZGVudGlmaWVyVGV4dCgpIGluc3RlYWQgaWYgcG9zc2libGUuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB1bmVzY2FwZU5hbWUobmFtZTogc3RyaW5nKTogc3RyaW5nIHtcbiAgLy8gU2VlIHRoZSBwcml2YXRlIGZ1bmN0aW9uIHVuZXNjYXBlSWRlbnRpZmllciBpbiBUeXBlU2NyaXB0J3MgdXRpbGl0aWVzLnRzLlxuICBpZiAobmFtZS5tYXRjaCgvXl9fXy8pKSByZXR1cm4gbmFtZS5zdWJzdHIoMSk7XG4gIHJldHVybiBuYW1lO1xufVxuIl19

@@ -31,17 +31,28 @@ /// <amd-module name="tsickle/src/source_map_utils" />

export declare function sourceMapTextToGenerator(sourceMapText: string): SourceMapGenerator;
/**
* A position in a source map. All offsets are zero-based.
*/
export interface SourcePosition {
/** 0 based */
column: number;
/** 0 based */
line: number;
/** 0 based full offset in the file. */
position: number;
}
export interface SourceMapper {
/**
* Logically shift all source positions by `offset`.
*
* This method is useful if code has to prepend additional text to the generated output after
* source mappings have already been generated. The source maps are then transparently adjusted
* during TypeScript output generation.
*/
shiftByOffset(offset: number): void;
/**
* Adds a mapping from `originalNode` in `original` position to its new location in the output,
* spanning from `generated` (an offset in the file) for `length` characters.
*/
addMapping(originalNode: ts.Node, original: SourcePosition, generated: SourcePosition, length: number): void;
}
export declare const NOOP_SOURCE_MAPPER: SourceMapper;
export declare class DefaultSourceMapper implements SourceMapper {
private fileName;
/** The source map that's generated while rewriting this file. */
sourceMap: SourceMapGenerator;
constructor(fileName: string);
addMapping(node: ts.Node, original: SourcePosition, generated: SourcePosition, length: number): void;
}

@@ -116,31 +116,6 @@ /**

exports.NOOP_SOURCE_MAPPER = {
// tslint:disable-next-line:no-empty
addMapping: function () { }
shiftByOffset: function () { },
addMapping: function () { },
};
var DefaultSourceMapper = /** @class */ (function () {
function DefaultSourceMapper(fileName) {
this.fileName = fileName;
/** The source map that's generated while rewriting this file. */
this.sourceMap = new source_map_1.SourceMapGenerator();
this.sourceMap.addMapping({
// tsc's source maps use 1-indexed lines, 0-indexed columns
original: { line: 1, column: 0 },
generated: { line: 1, column: 0 },
source: this.fileName,
});
}
DefaultSourceMapper.prototype.addMapping = function (node, original, generated, length) {
if (length > 0) {
this.sourceMap.addMapping({
// tsc's source maps use 1-indexed lines, 0-indexed columns
original: { line: original.line + 1, column: original.column },
generated: { line: generated.line + 1, column: generated.column },
source: this.fileName,
});
}
};
return DefaultSourceMapper;
}());
exports.DefaultSourceMapper = DefaultSourceMapper;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlX21hcF91dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9zb3VyY2VfbWFwX3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBRUgseUNBQXVHO0lBR3ZHOzs7O09BSUc7SUFDSDtRQUNFLE1BQU0sQ0FBQyxJQUFJLE1BQU0sQ0FBQywwREFBMEQsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUN0RixDQUFDO0lBRUQsaUNBQXdDLE1BQWM7UUFDcEQsTUFBTSxDQUFDLHVCQUF1QixD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iBudW1iZXIpOiB2b2lkO1xuICAvKipcbiAgICogQWRkcyBhIG1hcHBpbmcgZnJvbSBgb3JpZ2luYWxOb2RlYCBpbiBgb3JpZ2luYWxgIHBvc2l0aW9uIHRvIGl0cyBuZXcgbG9jYXRpb24gaW4gdGhlIG91dHB1dCxcbiAgICogc3Bhbm5pbmcgZnJvbSBgZ2VuZXJhdGVkYCAoYW4gb2Zmc2V0IGluIHRoZSBmaWxlKSBmb3IgYGxlbmd0aGAgY2hhcmFjdGVycy5cbiAgICovXG4gIGFkZE1hcHBpbmcoXG4gICAgICBvcmlnaW5hbE5vZGU6IHRzLk5vZGUsIG9yaWdpbmFsOiBTb3VyY2VQb3NpdGlvbiwgZ2VuZXJhdGVkOiBTb3VyY2VQb3NpdGlvbixcbiAgICAgIGxlbmd0aDogbnVtYmVyKTogdm9pZDtcbn1cblxuZXhwb3J0IGNvbnN0IE5PT1BfU09VUkNFX01BUFBFUjogU291cmNlTWFwcGVyID0ge1xuICBzaGlmdEJ5T2Zmc2V0KCkgey8qIG5vLW9wICovfSxcbiAgYWRkTWFwcGluZygpIHsvKiBuby1vcCAqL30sXG59O1xuIl19

@@ -1,1 +0,1 @@

{"compilerOptions": {"target": "es5", "downlevelIteration": true, "skipDefaultLibCheck": true, "moduleResolution": "node", "outDir": "../../../../bazel-out/local-fastbuild/bin", "rootDir": "../../../..", "rootDirs": ["../../../..", "../../../../bazel-out/local-fastbuild/genfiles", "../../../../bazel-out/local-fastbuild/bin"], "baseUrl": "../../../..", "paths": {"*": ["./*", "bazel-out/local-fastbuild/genfiles/*", "bazel-out/local-fastbuild/bin/*"]}, "preserveConstEnums": false, "experimentalDecorators": true, "emitDecoratorMetadata": true, "jsx": "react", "jsxFactory": "React.createElement", "noEmitOnError": false, "declaration": true, "declarationDir": "../../../../bazel-out/local-fastbuild/bin", "stripInternal": true, "inlineSourceMap": true, "inlineSources": true, "sourceMap": false, "module": "umd"}, "bazelOptions": {"workspaceName": "tsickle", "target": "//src:src", "tsickle": false, "tsickleGenerateExterns": true, "tsickleExternsPath": "", "untyped": true, "typeBlackListPaths": [], "es5Mode": true, "manifest": "bazel-out/local-fastbuild/bin/src/src.es5.MF", "compilationTargetSrc": ["src/class_decorator_downlevel_transformer.ts", "src/cli_support.ts", "src/decorator-annotator.ts", "src/decorators.ts", "src/es5processor.ts", "src/fileoverview_comment_transformer.ts", "src/jsdoc.ts", "src/main.ts", "src/modules_manifest.ts", "src/rewriter.ts", "src/source_map_utils.ts", "src/transformer_sourcemap.ts", "src/transformer_util.ts", "src/tsickle.ts", "src/type-translator.ts", "src/typescript.ts", "src/util.ts", "bazel-out/local-fastbuild/genfiles/src/typescript-2.4.d.ts"], "disableStrictDeps": false, "allowedStrictDeps": ["src/class_decorator_downlevel_transformer.ts", "src/cli_support.ts", "src/decorator-annotator.ts", "src/decorators.ts", "src/es5processor.ts", "src/fileoverview_comment_transformer.ts", "src/jsdoc.ts", "src/main.ts", "src/modules_manifest.ts", "src/rewriter.ts", "src/source_map_utils.ts", "src/transformer_sourcemap.ts", "src/transformer_util.ts", "src/tsickle.ts", "src/type-translator.ts", "src/typescript.ts", "src/util.ts", "bazel-out/local-fastbuild/genfiles/src/typescript-2.4.d.ts"], "addDtsClutzAliases": false, "nodeModulesPrefix": "node_modules"}, "files": ["../../../../bazel-out/local-fastbuild/genfiles/src/typescript-2.4.d.ts", "../../../../src/class_decorator_downlevel_transformer.ts", "../../../../src/cli_support.ts", "../../../../src/decorator-annotator.ts", "../../../../src/decorators.ts", "../../../../src/es5processor.ts", "../../../../src/fileoverview_comment_transformer.ts", "../../../../src/jsdoc.ts", "../../../../src/main.ts", "../../../../src/modules_manifest.ts", "../../../../src/rewriter.ts", "../../../../src/source_map_utils.ts", "../../../../src/transformer_sourcemap.ts", "../../../../src/transformer_util.ts", "../../../../src/tsickle.ts", "../../../../src/type-translator.ts", "../../../../src/typescript.ts", "../../../../src/util.ts"], "compileOnSave": false, "extends": "../../../../tsconfig"}
{"compilerOptions": {"target": "es5", "downlevelIteration": true, "skipDefaultLibCheck": true, "moduleResolution": "node", "outDir": "../../../../bazel-out/darwin-fastbuild/bin", "rootDir": "../../../..", "rootDirs": ["../../../..", "../../../../bazel-out/darwin-fastbuild/genfiles", "../../../../bazel-out/darwin-fastbuild/bin"], "baseUrl": "../../../..", "paths": {"*": ["./*", "bazel-out/darwin-fastbuild/genfiles/*", "bazel-out/darwin-fastbuild/bin/*", "node_modules/*"], "tsickle/*": ["./*", "bazel-out/darwin-fastbuild/genfiles/*", "bazel-out/darwin-fastbuild/bin/*"]}, "preserveConstEnums": false, "experimentalDecorators": true, "emitDecoratorMetadata": true, "jsx": "react", "jsxFactory": "React.createElement", "noEmitOnError": false, "declaration": true, "declarationDir": "../../../../bazel-out/darwin-fastbuild/bin", "stripInternal": true, "inlineSourceMap": true, "inlineSources": true, "sourceMap": false, "typeRoots": ["../../../../node_modules/@types"], "module": "umd"}, "bazelOptions": {"workspaceName": "tsickle", "target": "//src:src", "tsickle": false, "tsickleGenerateExterns": true, "tsickleExternsPath": "", "untyped": true, "typeBlackListPaths": [], "es5Mode": true, "manifest": "bazel-out/darwin-fastbuild/bin/src/src.es5.MF", "compilationTargetSrc": ["src/class_decorator_downlevel_transformer.ts", "src/cli_support.ts", "src/decorator-annotator.ts", "src/decorators.ts", "src/es5processor.ts", "src/fileoverview_comment_transformer.ts", "src/jsdoc.ts", "src/main.ts", "src/modules_manifest.ts", "src/rewriter.ts", "src/source_map_utils.ts", "src/transformer_sourcemap.ts", "src/transformer_util.ts", "src/tsickle.ts", "src/type-translator.ts", "src/typescript.ts", "src/util.ts", "bazel-out/darwin-fastbuild/genfiles/src/typescript-2.4.d.ts"], "addDtsClutzAliases": false, "expectedDiagnostics": [], "allowedStrictDeps": ["src/class_decorator_downlevel_transformer.ts", "src/cli_support.ts", "src/decorator-annotator.ts", "src/decorators.ts", "src/es5processor.ts", "src/fileoverview_comment_transformer.ts", "src/jsdoc.ts", "src/main.ts", "src/modules_manifest.ts", "src/rewriter.ts", "src/source_map_utils.ts", "src/transformer_sourcemap.ts", "src/transformer_util.ts", "src/tsickle.ts", "src/type-translator.ts", "src/typescript.ts", "src/util.ts", "bazel-out/darwin-fastbuild/genfiles/src/typescript-2.4.d.ts"], "nodeModulesPrefix": "node_modules"}, "files": ["../../../../bazel-out/darwin-fastbuild/genfiles/src/typescript-2.4.d.ts", "../../../../src/class_decorator_downlevel_transformer.ts", "../../../../src/cli_support.ts", "../../../../src/decorator-annotator.ts", "../../../../src/decorators.ts", "../../../../src/es5processor.ts", "../../../../src/fileoverview_comment_transformer.ts", "../../../../src/jsdoc.ts", "../../../../src/main.ts", "../../../../src/modules_manifest.ts", "../../../../src/rewriter.ts", "../../../../src/source_map_utils.ts", "../../../../src/transformer_sourcemap.ts", "../../../../src/transformer_util.ts", "../../../../src/tsickle.ts", "../../../../src/type-translator.ts", "../../../../src/typescript.ts", "../../../../src/util.ts"], "compileOnSave": false, "extends": "../../../../tsconfig"}

@@ -12,6 +12,13 @@ /// <amd-module name="tsickle/src/transformer_sourcemap" />

/**
* @fileoverview Creates a TypeScript transformer that parses code into a new `ts.SourceFile`,
* marks the nodes as synthetic and where possible maps the new nodes back to the original nodes
* via sourcemap information.
* Creates a TypeScript transformer based on a source->text transformation.
*
* TypeScript transformers operate on AST nodes. Newly created nodes must be marked as replacing an
* older AST node. This shim allows running a transformation step that's based on emitting new text
* as a node based transformer. It achieves that by running the transformation, collecting a source
* mapping in the process, and then afterwards parsing the source text into a new AST and marking
* the new nodes as representations of the old nodes based on their source map positions.
*
* The process marks all nodes as synthesized except for a handful of special cases (identifiers
* etc).
*/
export declare function createTransformerFromSourceMap(operator: (sourceFile: ts.SourceFile, sourceMapper: SourceMapper) => string): ts.TransformerFactory<ts.SourceFile>;
export declare function createTransformerFromSourceMap(sourceBasedTransformer: (sourceFile: ts.SourceFile, sourceMapper: SourceMapper) => string): ts.TransformerFactory<ts.SourceFile>;

@@ -22,10 +22,18 @@ /**

/**
* @fileoverview Creates a TypeScript transformer that parses code into a new `ts.SourceFile`,
* marks the nodes as synthetic and where possible maps the new nodes back to the original nodes
* via sourcemap information.
* Creates a TypeScript transformer based on a source->text transformation.
*
* TypeScript transformers operate on AST nodes. Newly created nodes must be marked as replacing an
* older AST node. This shim allows running a transformation step that's based on emitting new text
* as a node based transformer. It achieves that by running the transformation, collecting a source
* mapping in the process, and then afterwards parsing the source text into a new AST and marking
* the new nodes as representations of the old nodes based on their source map positions.
*
* The process marks all nodes as synthesized except for a handful of special cases (identifiers
* etc).
*/
function createTransformerFromSourceMap(operator) {
function createTransformerFromSourceMap(sourceBasedTransformer) {
return function (context) { return function (sourceFile) {
var sourceMapper = new NodeSourceMapper();
var newFile = ts.createSourceFile(sourceFile.fileName, operator(sourceFile, sourceMapper), ts.ScriptTarget.Latest, true);
var transformedSourceText = sourceBasedTransformer(sourceFile, sourceMapper);
var newFile = ts.createSourceFile(sourceFile.fileName, transformedSourceText, ts.ScriptTarget.Latest, true);
var mappedFile = visitNode(newFile);

@@ -96,2 +104,4 @@ return transformer_util_1.updateSourceFileNode(sourceFile, mappedFile.statements);

this.genStartPositions = new Map();
/** Conceptual offset for all nodes in this mapping. */
this.offset = 0;
}

@@ -103,2 +113,5 @@ NodeSourceMapper.prototype.addFullNodeRange = function (node, genStartPos) {

};
NodeSourceMapper.prototype.shiftByOffset = function (offset) {
this.offset += offset;
};
NodeSourceMapper.prototype.addMapping = function (originalNode, original, generated, length) {

@@ -127,4 +140,20 @@ var _this = this;

};
/** For the newly parsed `node`, find what node corresponded to it in the original source text. */
NodeSourceMapper.prototype.getOriginalNode = function (node) {
return this.originalNodeByGeneratedRange.get(this.nodeCacheKey(node.kind, node.getStart(), node.getEnd()));
// Apply the offset: if there is an offset > 0, all nodes are conceptually shifted by so many
// characters from the start of the file.
var start = node.getStart() - this.offset;
if (start < 0) {
// Special case: the source file conceptually spans all of the file, including any added
// prefix added that causes offset to be set.
if (node.kind !== ts.SyntaxKind.SourceFile) {
// Nodes within [0, offset] of the new file (start < 0) is the additional prefix that has no
// corresponding nodes in the original source, so return undefined.
return undefined;
}
start = 0;
}
var end = node.getEnd() - this.offset;
var key = this.nodeCacheKey(node.kind, start, end);
return this.originalNodeByGeneratedRange.get(key);
};

@@ -151,2 +180,2 @@ NodeSourceMapper.prototype.nodeCacheKey = function (kind, start, end) {

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtZXJfc291cmNlbWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RyYW5zZm9ybWVyX3NvdXJjZW1hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7OztJQUdILGlFQUEwRztJQUMxRywyQ0FBbUM7SUFFbkM7Ozs7T0FJRztJQUNILHdDQUNJLFFBQ1U7UUFDWixNQUFNLENBQUMsVUFBQyxPQUFPLElBQUssT0FBQSxVQUFDLFVBQVU7WUFDN0IsSUFBTSxZQUFZLEdBQUcsSUFBSSxnQkFBZ0IsRUFBRSxDQUFDO1lBQzVDLElBQU0sT0FBTyxHQUFHLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FDL0IsVUFBVSxDQUFDLFFBQVEsRUFBRSxRQUFRLENBQUMsVUFBVSxFQUFFLFlBQVksQ0FBQyxFQUFFLEVBQUUsQ0FBQyxZQUFZLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO1lBQzNGLElBQU0sVUFBVSxHQUFHLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQztZQUN0QyxNQUFNLENBQUMsdUNBQW9CLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxVQUFVLENBQUMsQ0FBQztZQUUvRCxtQkFBc0MsSUFBTztnQkFDM0MsTUFBTSxDQUFDLG1EQUFnQyxDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsSUF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0gdHMuU3ludGF4S2luZC5MYXN0TGl0ZXJhbFRva2VuO1xufVxuIl19

@@ -40,2 +40,4 @@ /// <amd-module name="tsickle/src/tsickle" />

export declare function formatDiagnostics(diags: ts.Diagnostic[]): string;
/** Returns a fileName:line:column string for the given position in the file. */
export declare function formatLocation(sf: ts.SourceFile, start: number | undefined): string;
export declare function annotate(typeChecker: ts.TypeChecker, file: ts.SourceFile, host: AnnotatorHost, tsHost?: ts.ModuleResolutionHost, tsOpts?: ts.CompilerOptions, sourceMapper?: SourceMapper): {

@@ -42,0 +44,0 @@ output: string;

@@ -16,7 +16,8 @@ /// <amd-module name="tsickle/src/type-translator" />

private readonly symbolsToAliasedNames;
private readonly ensureSymbolDeclared;
/**
* A list of types we've encountered while emitting; used to avoid getting stuck in recursive
* types.
* A list of type literals we've encountered while emitting; used to avoid getting stuck in
* recursive types.
*/
private readonly seenTypes;
private readonly seenTypeLiterals;
/**

@@ -34,5 +35,6 @@ * Whether to write types suitable for an \@externs file. Externs types must not refer to

* @param symbolsToAliasedNames a mapping from symbols (`Foo`) to a name in scope they should be
* emitted as (e.g. `tsickle_forward_declare_1.Foo`).
* emitted as (e.g. `tsickle_forward_declare_1.Foo`). Can be augmented during type
* translation, e.g. to blacklist a symbol.
*/
constructor(typeChecker: ts.TypeChecker, node: ts.Node, pathBlackList?: Set<string> | undefined, symbolsToAliasedNames?: Map<ts.Symbol, string>);
constructor(typeChecker: ts.TypeChecker, node: ts.Node, pathBlackList?: Set<string> | undefined, symbolsToAliasedNames?: Map<ts.Symbol, string>, ensureSymbolDeclared?: (sym: ts.Symbol) => void);
/**

@@ -50,3 +52,3 @@ * Converts a ts.Symbol to a string.

private stripClutzNamespace(name);
translate(type: ts.Type): string;
translate(type: ts.Type, resolveAlias?: boolean): string;
private translateUnion(type);

@@ -63,6 +65,25 @@ private translateEnumLiteral(type);

private signatureToClosure(sig);
private convertParams(sig);
/**
* Converts parameters for the given signature. Takes parameter declarations as those might not
* match the signature parameters (e.g. there might be an additional this parameter). This
* difference is handled by the caller, as is converting the "this" parameter.
*/
private convertParams(sig, paramDecls);
warn(msg: string): void;
/** @return true if sym should always have type {?}. */
isBlackListed(symbol: ts.Symbol): boolean;
/**
* Closure doesn not support type parameters for function types, i.e. generic function types.
* Blacklist the symbols declared by them and emit a ? for the types.
*
* This mutates the given blacklist map. The map's scope is one file, and symbols are
* unique objects, so this should neither lead to excessive memory consumption nor introduce
* errors.
*
* @param blacklist a map to store the blacklisted symbols in, with a value of '?'. In practice,
* this is always === this.symbolsToAliasedNames, but we're passing it explicitly to make it
* clear that the map is mutated (in particular when used from outside the class).
* @param decls the declarations whose symbols should be blacklisted.
*/
blacklistTypeParameters(blacklist: Map<ts.Symbol, string>, decls: ts.NodeArray<ts.TypeParameterDeclaration> | undefined): 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc