Socket
Socket
Sign inDemoInstall

@angular/tsc-wrapped

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/tsc-wrapped - npm Package Compare versions

Comparing version 5.0.0-beta.5 to 5.0.0-beta.6

index_no_tsickle.d.ts

10

index.d.ts

@@ -8,9 +8,3 @@ /**

*/
export { MetadataWriterHost } from './src/compiler_host';
export { CodegenExtension, UserError, createBundleIndexHost, main } from './src/main';
export { default as AngularCompilerOptions } from './src/options';
export * from './src/bundler';
export * from './src/cli_options';
export * from './src/collector';
export * from './src/index_writer';
export * from './src/schema';
export { main } from './src/main';
export * from './index_no_tsickle';

10

index.js

@@ -13,13 +13,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var compiler_host_1 = require("./src/compiler_host");
exports.MetadataWriterHost = compiler_host_1.MetadataWriterHost;
var main_1 = require("./src/main");
exports.UserError = main_1.UserError;
exports.createBundleIndexHost = main_1.createBundleIndexHost;
exports.main = main_1.main;
__export(require("./src/bundler"));
__export(require("./src/cli_options"));
__export(require("./src/collector"));
__export(require("./src/index_writer"));
__export(require("./src/schema"));
__export(require("./index_no_tsickle"));
//# sourceMappingURL=index.js.map
{
"name": "@angular/tsc-wrapped",
"version": "5.0.0-beta.5",
"version": "5.0.0-beta.6",
"description": "Wraps the tsc CLI, allowing extensions.",

@@ -14,3 +14,3 @@ "homepage": "https://github.com/angular/angular/blob/master/packages/tsc-wrapped",

"dependencies": {
"tsickle": "^0.21.0"
"tsickle": "^0.23.5"
},

@@ -17,0 +17,0 @@ "peerDependencies": {

@@ -255,3 +255,5 @@ "use strict";

else {
obj_1[propertyName] = propertyValue;
obj_1[propertyName] = isPropertyAssignment(assignment) ?
recordEntry(propertyValue, assignment.initializer) :
propertyValue;
}

@@ -258,0 +260,0 @@ }

import * as ts from 'typescript';
import { CliOptions } from './cli_options';
import NgOptions from './options';
import { CodegenExtension } from './main_no_tsickle';
import { VinylFile } from './vinyl_file';
export { UserError } from './tsc';
export interface CodegenExtension {
/**
* Returns the generated file names.
*/
(ngOptions: NgOptions, cliOptions: CliOptions, program: ts.Program, host: ts.CompilerHost): Promise<string[]>;
}
export declare function createBundleIndexHost<H extends ts.CompilerHost>(ngOptions: NgOptions, rootFiles: string[], host: H): {
host: H;
indexName?: string;
errors?: ts.Diagnostic[];
};
export declare function main(project: string | VinylFile, cliOptions: CliOptions, codegen?: CodegenExtension, options?: ts.CompilerOptions): Promise<any>;

@@ -14,40 +14,8 @@ "use strict";

var ts = require("typescript");
var bundler_1 = require("./bundler");
var cli_options_1 = require("./cli_options");
var compiler_host_1 = require("./compiler_host");
var index_writer_1 = require("./index_writer");
var main_no_tsickle_1 = require("./main_no_tsickle");
var tsc_1 = require("./tsc");
var vinyl_file_1 = require("./vinyl_file");
var tsc_2 = require("./tsc");
exports.UserError = tsc_2.UserError;
var DTS = /\.d\.ts$/;
var JS_EXT = /(\.js|)$/;
var TS_EXT = /\.ts$/;
function createBundleIndexHost(ngOptions, rootFiles, host) {
var files = rootFiles.filter(function (f) { return !DTS.test(f); });
if (files.length != 1) {
return {
host: host,
errors: [{
file: null,
start: null,
length: null,
messageText: 'Angular compiler option "flatModuleIndex" requires one and only one .ts file in the "files" field.',
category: ts.DiagnosticCategory.Error,
code: 0
}]
};
}
var file = files[0];
var indexModule = file.replace(/\.ts$/, '');
var bundler = new bundler_1.MetadataBundler(indexModule, ngOptions.flatModuleId, new bundler_1.CompilerHostAdapter(host));
var metadataBundle = bundler.getMetadataBundle();
var metadata = JSON.stringify(metadataBundle.metadata);
var name = path.join(path.dirname(indexModule), ngOptions.flatModuleOutFile.replace(JS_EXT, '.ts'));
var libraryIndex = "./" + path.basename(indexModule);
var content = index_writer_1.privateEntriesToIndex(libraryIndex, metadataBundle.privates);
host = compiler_host_1.createSyntheticIndexHost(host, { name: name, content: content, metadata: metadata });
return { host: host, indexName: name };
}
exports.createBundleIndexHost = createBundleIndexHost;
function main(project, cliOptions, codegen, options) {

@@ -84,3 +52,3 @@ try {

if (ngOptions_1.flatModuleOutFile && !ngOptions_1.skipMetadataEmit) {
var _b = createBundleIndexHost(ngOptions_1, rootFileNames_1, host_1), bundleHost = _b.host, indexName = _b.indexName, errors_1 = _b.errors;
var _b = main_no_tsickle_1.createBundleIndexHost(ngOptions_1, rootFileNames_1, host_1), bundleHost = _b.host, indexName = _b.indexName, errors_1 = _b.errors;
if (errors_1)

@@ -92,3 +60,3 @@ tsc_1.check(errors_1);

}
var tsickleCompilerHostOptions = { googmodule: false, untyped: true, convertIndexImportShorthand: true };
var tsickleCompilerHostOptions = { googmodule: false, untyped: true, convertIndexImportShorthand: false };
var tsickleHost = {

@@ -95,0 +63,0 @@ shouldSkipTsickleProcessing: function (fileName) { return /\.d\.ts$/.test(fileName); },

@@ -659,3 +659,3 @@ "use strict";

it('should treat exported class expressions as a class', function () {
var source = ts.createSourceFile('', "\n export const InjectionToken: {new<T>(desc: string): InjectionToken<T>;} = class extends OpaqueToken {\n constructor(desc: string) {\n super(desc);\n }\n\n toString(): string { return `InjectionToken " + _this._desc + "`; }\n } as any;", ts.ScriptTarget.Latest, true);
var source = ts.createSourceFile('', "\n export const InjectionToken: {new<T>(desc: string): InjectionToken<T>;} = class {\n constructor(protected _desc: string) {}\n\n toString(): string { return `InjectionToken " + _this._desc + "`; }\n } as any;", ts.ScriptTarget.Latest, true);
var metadata = collector.getMetadata(source);

@@ -662,0 +662,0 @@ expect(metadata.metadata).toEqual({ InjectionToken: { __symbolic: 'class' } });

@@ -43,3 +43,3 @@ "use strict";

// Expand `export *` and fix index import
expect(out).toContain("export { A, B } from './dep/index'");
expect(out).toContain("export { A, B } from './dep'");
// Annotated for Closure compiler

@@ -79,3 +79,3 @@ expect(out).toContain('* @param {?} x');

// Expand `export *` and fix index import
expect(out).toContain("export { A, B } from './dep/index'");
expect(out).toContain("export { A, B } from './dep'");
// Annotated for Closure compiler

@@ -195,3 +195,3 @@ expect(out).toContain('* @param {?} x');

var fileOutput = readOut('js');
expect(fileOutput).toContain("export { A, B } from './dep/index'");
expect(fileOutput).toContain("export { A, B } from './dep'");
done();

@@ -201,3 +201,3 @@ })

});
it('should expand shorthand imports for ES5 CommonJS modules', function (done) {
it('should not expand shorthand imports for ES5 CommonJS modules', function (done) {
write('tsconfig.json', "{\n \"compilerOptions\": {\n \"experimentalDecorators\": true,\n \"types\": [],\n \"outDir\": \"built\",\n \"declaration\": true,\n \"moduleResolution\": \"node\",\n \"target\": \"es5\",\n \"module\": \"commonjs\"\n },\n \"angularCompilerOptions\": {\n \"annotateForClosureCompiler\": true\n },\n \"files\": [\"test.ts\"]\n }");

@@ -207,3 +207,3 @@ main_1.main(basePath, { basePath: basePath })

var fileOutput = readOut('js');
expect(fileOutput).toContain("var index_1 = require(\"./dep/index\");");
expect(fileOutput).toContain("var dep_1 = require(\"./dep\");");
done();

@@ -210,0 +210,0 @@ })

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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