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

@nguniversal/common

Package Overview
Dependencies
Maintainers
2
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nguniversal/common - npm Package Compare versions

Comparing version 9.0.0-next.9 to 9.0.0-next.13

38

bundles/common-engine.umd.js

@@ -89,21 +89,23 @@ (function (global, factory) {

CommonEngine.prototype.getFactory = function (moduleOrFactory) {
var _this = this;
// If module has been compiled AoT
if (moduleOrFactory instanceof core.NgModuleFactory) {
return Promise.resolve(moduleOrFactory);
}
else {
// we're in JIT mode
var moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return Promise.resolve(moduleFactory);
}
// Compile the module and cache it
return this.getCompiler().compileModuleAsync(moduleOrFactory)
.then(function (factory) {
_this.factoryCacheMap.set(moduleOrFactory, factory);
return factory;
return tslib.__awaiter(this, void 0, void 0, function () {
var moduleFactory, factory;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(moduleOrFactory instanceof core.NgModuleFactory)) return [3 /*break*/, 1];
return [2 /*return*/, moduleOrFactory];
case 1:
moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return [2 /*return*/, moduleFactory];
}
return [4 /*yield*/, this.getCompiler().compileModuleAsync(moduleOrFactory)];
case 2:
factory = _a.sent();
this.factoryCacheMap.set(moduleOrFactory, factory);
return [2 /*return*/, factory];
}
});
}
});
};

@@ -110,0 +112,0 @@ /** Retrieve the document from the cache or the filesystem */

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("fs"),require("tslib"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server")):"function"==typeof define&&define.amd?define("@nguniversal/common/engine",["exports","fs","tslib","@angular/compiler","@angular/core","@angular/platform-server"],r):r(((e=e||self).nguniversal=e.nguniversal||{},e.nguniversal.common=e.nguniversal.common||{},e.nguniversal.common.engine={}),e.fs,e.tslib,e.ng.compiler,e.ng.core,e.ng.platformServer)}(this,(function(e,r,t,o,n,i){"use strict";
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("fs"),require("tslib"),require("@angular/compiler"),require("@angular/core"),require("@angular/platform-server")):"function"==typeof define&&define.amd?define("@nguniversal/common/engine",["exports","fs","tslib","@angular/compiler","@angular/core","@angular/platform-server"],r):r(((e=e||self).nguniversal=e.nguniversal||{},e.nguniversal.common=e.nguniversal.common||{},e.nguniversal.common.engine={}),e.fs,e.tslib,e.ng.compiler,e.ng.core,e.ng.platformServer)}(this,(function(e,r,t,n,o,i){"use strict";
/**

@@ -8,3 +8,3 @@ * @license

* found in the LICENSE file at https://angular.io/license
*/var a=function(){function e(){}return e.prototype.get=function(e){return new Promise((function(t,o){r.readFile(e,(function(e,r){if(e)return o(e);t(r.toString())}))}))},e}(),u=function(){function e(e,r){void 0===r&&(r=[]),this.moduleOrFactory=e,this.providers=r,this.factoryCacheMap=new Map,this.templateCache={}}return e.prototype.getCompiler=function(){return i.platformDynamicServer().injector.get(n.CompilerFactory).createCompiler([{providers:[{provide:o.ResourceLoader,useClass:a,deps:[]}]}])},e.prototype.render=function(e){return t.__awaiter(this,void 0,void 0,(function(){var r,o,n;return t.__generator(this,(function(a){switch(a.label){case 0:return(r=e.document)?[3,2]:[4,this.getDocument(e.documentFilePath)];case 1:r=a.sent(),a.label=2;case 2:return o=t.__spread(e.providers||[],this.providers||[],[{provide:i.INITIAL_CONFIG,useValue:{document:r,url:e.url}}]),[4,this.getFactory(this.moduleOrFactory||e.bootstrap)];case 3:return n=a.sent(),[2,i.renderModuleFactory(n,{extraProviders:o})]}}))}))},e.prototype.getFactory=function(e){var r=this;if(e instanceof n.NgModuleFactory)return Promise.resolve(e);var t=this.factoryCacheMap.get(e);return t?Promise.resolve(t):this.getCompiler().compileModuleAsync(e).then((function(t){return r.factoryCacheMap.set(e,t),t}))},e.prototype.getDocument=function(e){var t=this.templateCache[e]=this.templateCache[e]||r.readFileSync(e).toString();return Promise.resolve(t)},e}();
*/var a=function(){function e(){}return e.prototype.get=function(e){return new Promise((function(t,n){r.readFile(e,(function(e,r){if(e)return n(e);t(r.toString())}))}))},e}(),u=function(){function e(e,r){void 0===r&&(r=[]),this.moduleOrFactory=e,this.providers=r,this.factoryCacheMap=new Map,this.templateCache={}}return e.prototype.getCompiler=function(){return i.platformDynamicServer().injector.get(o.CompilerFactory).createCompiler([{providers:[{provide:n.ResourceLoader,useClass:a,deps:[]}]}])},e.prototype.render=function(e){return t.__awaiter(this,void 0,void 0,(function(){var r,n,o;return t.__generator(this,(function(a){switch(a.label){case 0:return(r=e.document)?[3,2]:[4,this.getDocument(e.documentFilePath)];case 1:r=a.sent(),a.label=2;case 2:return n=t.__spread(e.providers||[],this.providers||[],[{provide:i.INITIAL_CONFIG,useValue:{document:r,url:e.url}}]),[4,this.getFactory(this.moduleOrFactory||e.bootstrap)];case 3:return o=a.sent(),[2,i.renderModuleFactory(o,{extraProviders:n})]}}))}))},e.prototype.getFactory=function(e){return t.__awaiter(this,void 0,void 0,(function(){var r,n;return t.__generator(this,(function(t){switch(t.label){case 0:return e instanceof o.NgModuleFactory?[2,e]:[3,1];case 1:return(r=this.factoryCacheMap.get(e))?[2,r]:[4,this.getCompiler().compileModuleAsync(e)];case 2:return n=t.sent(),this.factoryCacheMap.set(e,n),[2,n]}}))}))},e.prototype.getDocument=function(e){var t=this.templateCache[e]=this.templateCache[e]||r.readFileSync(e).toString();return Promise.resolve(t)},e}();
/**

@@ -11,0 +11,0 @@ * @license

@@ -82,25 +82,22 @@ /**

getFactory(moduleOrFactory) {
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return Promise.resolve(moduleOrFactory);
}
else {
// we're in JIT mode
/** @type {?} */
let moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return Promise.resolve(moduleFactory);
return __awaiter(this, void 0, void 0, function* () {
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return moduleOrFactory;
}
// Compile the module and cache it
return this.getCompiler().compileModuleAsync(moduleOrFactory)
.then((/**
* @param {?} factory
* @return {?}
*/
(factory) => {
else {
// we're in JIT mode
/** @type {?} */
let moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return moduleFactory;
}
// Compile the module and cache it
/** @type {?} */
const factory = yield this.getCompiler().compileModuleAsync(moduleOrFactory);
this.factoryCacheMap.set(moduleOrFactory, factory);
return factory;
}));
}
}
});
}

@@ -143,2 +140,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5naW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9jb21tb24vZW5naW5lL3NyYy9lbmdpbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQU9BLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQWlCLGVBQWUsRUFBRSxlQUFlLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBQy9GLE9BQU8sRUFBQyxjQUFjLEVBQUUsbUJBQW1CLEVBQUUscUJBQXFCLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRyxPQUFPLEtBQUssRUFBRSxNQUFNLElBQUksQ0FBQztBQUV6QixPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDOzs7Ozs7QUFRekMsTUFBTSxPQUFPLFlBQVk7Ozs7O0lBYXZCLFlBQW9CLGVBQWdELEVBQ2hELFlBQThCLEVBQUU7UUFEaEMsb0JBQWUsR0FBZixlQUFlLENBQWlDO1FBQ2hELGNBQVMsR0FBVCxTQUFTLEN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ter, __generator, __read, __spread } from "tslib";

CommonEngine.prototype.getFactory = function (moduleOrFactory) {
var _this = this;
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return Promise.resolve(moduleOrFactory);
}
else {
// we're in JIT mode
var moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return Promise.resolve(moduleFactory);
}
// Compile the module and cache it
return this.getCompiler().compileModuleAsync(moduleOrFactory)
.then(function (factory) {
_this.factoryCacheMap.set(moduleOrFactory, factory);
return factory;
return __awaiter(this, void 0, void 0, function () {
var moduleFactory, factory;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(moduleOrFactory instanceof NgModuleFactory)) return [3 /*break*/, 1];
return [2 /*return*/, moduleOrFactory];
case 1:
moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return [2 /*return*/, moduleFactory];
}
return [4 /*yield*/, this.getCompiler().compileModuleAsync(moduleOrFactory)];
case 2:
factory = _a.sent();
this.factoryCacheMap.set(moduleOrFactory, factory);
return [2 /*return*/, factory];
}
});
}
});
};

@@ -103,2 +105,2 @@ /** Retrieve the document from the cache or the filesystem */

export { CommonEngine };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5naW5lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9jb21tb24vZW5naW5lL3NyYy9lbmdpbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRztBQUNILE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQWlCLGVBQWUsRUFBRSxlQUFlLEVBQWlCLE1BQU0sZUFBZSxDQUFDO0FBQy9GLE9BQU8sRUFBQyxjQUFjLEVBQUUsb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gIH1cbiAgfVxuXG4gIC8qKiBSZXRyaWV2ZSB0aGUgZG9jdW1lbnQgZnJvbSB0aGUgY2FjaGUgb3IgdGhlIGZpbGVzeXN0ZW0gKi9cbiAgcHJpdmF0ZSBnZXREb2N1bWVudChmaWxlUGF0aDogc3RyaW5nKTogUHJvbWlzZTxzdHJpbmc+IHtcbiAgICBjb25zdCBkb2MgPSB0aGlzLnRlbXBsYXRlQ2FjaGVbZmlsZVBhdGhdID0gdGhpcy50ZW1wbGF0ZUNhY2hlW2ZpbGVQYXRoXSB8fFxuICAgIGZzLnJlYWRGaWxlU3luYyhmaWxlUGF0aCkudG9TdHJpbmcoKTtcblxuICAgIC8vIEFzICBwcm9taXNlIHNvIHdlIGNhbiBjaGFuZ2UgdGhlIEFQSSBsYXRlciB3aXRob3V0IGJyZWFraW5nXG4gICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShkb2MpO1xuICB9XG59XG4iXX0=

@@ -133,25 +133,22 @@ import { readFile, readFileSync } from 'fs';

getFactory(moduleOrFactory) {
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return Promise.resolve(moduleOrFactory);
}
else {
// we're in JIT mode
/** @type {?} */
let moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return Promise.resolve(moduleFactory);
return __awaiter(this, void 0, void 0, function* () {
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return moduleOrFactory;
}
// Compile the module and cache it
return this.getCompiler().compileModuleAsync(moduleOrFactory)
.then((/**
* @param {?} factory
* @return {?}
*/
(factory) => {
else {
// we're in JIT mode
/** @type {?} */
let moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return moduleFactory;
}
// Compile the module and cache it
/** @type {?} */
const factory = yield this.getCompiler().compileModuleAsync(moduleOrFactory);
this.factoryCacheMap.set(moduleOrFactory, factory);
return factory;
}));
}
}
});
}

@@ -158,0 +155,0 @@ /**

@@ -89,21 +89,23 @@ import { readFile, readFileSync } from 'fs';

CommonEngine.prototype.getFactory = function (moduleOrFactory) {
var _this = this;
// If module has been compiled AoT
if (moduleOrFactory instanceof NgModuleFactory) {
return Promise.resolve(moduleOrFactory);
}
else {
// we're in JIT mode
var moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return Promise.resolve(moduleFactory);
}
// Compile the module and cache it
return this.getCompiler().compileModuleAsync(moduleOrFactory)
.then(function (factory) {
_this.factoryCacheMap.set(moduleOrFactory, factory);
return factory;
return __awaiter(this, void 0, void 0, function () {
var moduleFactory, factory;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(moduleOrFactory instanceof NgModuleFactory)) return [3 /*break*/, 1];
return [2 /*return*/, moduleOrFactory];
case 1:
moduleFactory = this.factoryCacheMap.get(moduleOrFactory);
// If module factory is cached
if (moduleFactory) {
return [2 /*return*/, moduleFactory];
}
return [4 /*yield*/, this.getCompiler().compileModuleAsync(moduleOrFactory)];
case 2:
factory = _a.sent();
this.factoryCacheMap.set(moduleOrFactory, factory);
return [2 /*return*/, factory];
}
});
}
});
};

@@ -110,0 +112,0 @@ /** Retrieve the document from the cache or the filesystem */

{
"name": "@nguniversal/common",
"version": "9.0.0-next.9",
"version": "9.0.0-next.13",
"description": "Angular Universal common utilities",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -16,3 +16,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

else if (typeof define === "function" && define.amd) {
define("@nguniversal/common/schematics/add/index", ["require", "exports", "@angular-devkit/schematics", "@angular-devkit/core", "@schematics/angular/utility/json-utils", "@schematics/angular/utility/workspace", "@schematics/angular/utility/dependencies", "@nguniversal/common/schematics/utils/index"], factory);
define("@nguniversal/common/schematics/add/index", ["require", "exports", "@angular-devkit/schematics", "@angular-devkit/core", "@schematics/angular/utility/json-utils", "@schematics/angular/utility/workspace", "@schematics/angular/utility/dependencies", "typescript", "@nguniversal/common/schematics/utils/index"], factory);
}

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

const dependencies_1 = require("@schematics/angular/utility/dependencies");
const ts = require("typescript");
const utils_1 = require("@nguniversal/common/schematics/utils/index");

@@ -48,2 +49,3 @@ const SERVE_SSR_TARGET_NAME = 'serve-ssr';

updateWorkspaceConfigRule(options),
routingInitialNavigationRule(options),
addDependencies(),

@@ -106,3 +108,7 @@ ]);

routes: []
}
},
// Add a dummy production config to be consistent with other targets.
configurations: {
production: {},
},
});

@@ -144,2 +150,75 @@ });

}
function routingInitialNavigationRule(options) {
return (host) => __awaiter(this, void 0, void 0, function* () {
const clientProject = yield utils_1.getProject(host, options.clientProject);
const serverTarget = clientProject.targets.get('server');
if (!serverTarget || !serverTarget.options) {
return;
}
const tsConfigPath = serverTarget.options.tsConfig;
if (!tsConfigPath || typeof tsConfigPath !== 'string' || !host.exists(tsConfigPath)) {
// No tsconfig path
return;
}
const parseConfigHost = {
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
readDirectory: ts.sys.readDirectory,
fileExists: function (fileName) {
return host.exists(fileName);
},
readFile: function (fileName) {
return host.read(fileName).toString();
},
};
const { config } = ts.readConfigFile(tsConfigPath, parseConfigHost.readFile);
const parsed = ts.parseJsonConfigFileContent(config, parseConfigHost, core_1.dirname(core_1.normalize(tsConfigPath)));
const tsHost = ts.createCompilerHost(parsed.options, true);
// Strip BOM as otherwise TSC methods (Ex: getWidth) will return an offset,
// which breaks the CLI UpdateRecorder.
// See: https://github.com/angular/angular/pull/30719
tsHost.readFile = function (fileName) {
return host.read(fileName).toString().replace(/^\uFEFF/, '');
};
tsHost.directoryExists = function (directoryName) {
const dir = host.getDir(directoryName);
return !!(dir.subdirs.length || dir.subfiles.length);
};
tsHost.fileExists = function (fileName) {
return host.exists(fileName);
};
tsHost.getCurrentDirectory = function () {
return host.root.path;
};
const program = ts.createProgram(parsed.fileNames, parsed.options, tsHost);
const typeChecker = program.getTypeChecker();
const sourceFiles = program.getSourceFiles().filter(f => !f.isDeclarationFile && !program.isSourceFileFromExternalLibrary(f));
const printer = ts.createPrinter();
const routerModule = 'RouterModule';
const routerSource = '@angular/router';
sourceFiles.forEach(sourceFile => {
const routerImport = utils_1.findImport(sourceFile, routerSource, routerModule);
if (!routerImport) {
return;
}
let routerModuleNode;
ts.forEachChild(sourceFile, function visitNode(node) {
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) &&
ts.isIdentifier(node.expression.expression) && node.expression.name.text === 'forRoot') {
const imp = utils_1.getImportOfIdentifier(typeChecker, node.expression.expression);
if (imp && imp.name === routerModule && imp.importModule === routerSource) {
routerModuleNode = node;
}
}
ts.forEachChild(node, visitNode);
});
if (routerModuleNode) {
const print = printer.printNode(ts.EmitHint.Unspecified, utils_1.addInitialNavigation(routerModuleNode), sourceFile);
const recorder = host.beginUpdate(sourceFile.fileName);
recorder.remove(routerModuleNode.getStart(), routerModuleNode.getWidth());
recorder.insertRight(routerModuleNode.getStart(), print);
host.commitUpdate(recorder);
}
});
});
}
function addDependencies() {

@@ -150,3 +229,3 @@ return host => {

type: dependencies_1.NodeDependencyType.Dev,
version: '^9.0.0-next.9',
version: '^9.0.0-next.13',
});

@@ -157,2 +236,2 @@ return host;

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

@@ -11,4 +11,14 @@ /**

import { workspaces } from '@angular-devkit/core';
import * as ts from 'typescript';
export declare function getProject(host: Tree, projectName: string): Promise<workspaces.ProjectDefinition>;
export declare function stripTsExtension(file: string): string;
export declare function getOutputPath(host: Tree, projectName: string, target: 'server' | 'build'): Promise<string>;
export declare function findImport(sourceFile: ts.SourceFile, moduleName: string, symbolName: string): ts.NamedImports | null;
export declare type Import = {
name: string;
importModule: string;
node: ts.ImportDeclaration;
};
/** Gets import information about the specified identifier by using the Type checker. */
export declare function getImportOfIdentifier(typeChecker: ts.TypeChecker, node: ts.Identifier): Import | null;
export declare function addInitialNavigation(node: ts.CallExpression): ts.CallExpression;

@@ -23,3 +23,3 @@ /**

else if (typeof define === "function" && define.amd) {
define("@nguniversal/common/schematics/utils/utils", ["require", "exports", "@schematics/angular/utility/workspace", "@angular-devkit/schematics"], factory);
define("@nguniversal/common/schematics/utils/utils", ["require", "exports", "@schematics/angular/utility/workspace", "@angular-devkit/schematics", "typescript"], factory);
}

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

const schematics_1 = require("@angular-devkit/schematics");
const ts = require("typescript");
function getProject(host, projectName) {

@@ -63,3 +64,66 @@ return __awaiter(this, void 0, void 0, function* () {

exports.getOutputPath = getOutputPath;
function findImport(sourceFile, moduleName, symbolName) {
// Only look through the top-level imports.
for (const node of sourceFile.statements) {
if (!ts.isImportDeclaration(node) || !ts.isStringLiteral(node.moduleSpecifier) ||
node.moduleSpecifier.text !== moduleName) {
continue;
}
const namedBindings = node.importClause && node.importClause.namedBindings;
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
continue;
}
if (namedBindings.elements.some(element => element.name.text === symbolName)) {
return namedBindings;
}
}
return null;
}
exports.findImport = findImport;
/** Gets import information about the specified identifier by using the Type checker. */
function getImportOfIdentifier(typeChecker, node) {
const symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol || !symbol.declarations.length) {
return null;
}
const decl = symbol.declarations[0];
if (!ts.isImportSpecifier(decl)) {
return null;
}
const importDecl = decl.parent.parent.parent;
if (!ts.isStringLiteral(importDecl.moduleSpecifier)) {
return null;
}
return {
// Handles aliased imports: e.g. "import {Component as myComp} from ...";
name: decl.propertyName ? decl.propertyName.text : decl.name.text,
importModule: importDecl.moduleSpecifier.text,
node: importDecl
};
}
exports.getImportOfIdentifier = getImportOfIdentifier;
function addInitialNavigation(node) {
const existingOptions = node.arguments[1];
// If the user has explicitly set initialNavigation, we respect that
if (existingOptions && existingOptions.properties.some(exp => ts.isPropertyAssignment(exp) && ts.isIdentifier(exp.name) &&
exp.name.text === 'initialNavigation')) {
return node;
}
const enabledLiteral = ts.createStringLiteral('enabled');
// TypeScript will emit the Node with double quotes.
// In schematics we usually write code with a single quotes
// tslint:disable-next-line: no-any
enabledLiteral.singleQuote = true;
const initialNavigationProperty = ts.createPropertyAssignment('initialNavigation', enabledLiteral);
const routerOptions = existingOptions
? ts.updateObjectLiteral(existingOptions, ts.createNodeArray([
...existingOptions.properties,
initialNavigationProperty
]))
: ts.createObjectLiteral([initialNavigationProperty], true);
const args = [node.arguments[0], routerOptions];
return ts.createCall(node.expression, node.typeArguments, args);
}
exports.addInitialNavigation = addInitialNavigation;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL2NvbW1vbi9zY2hlbWF0aWNzL3V0aWxzL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBSUgscUVBQW1FO0lBQ25FLDJEQUErRDtJQUUvRCxTQUFzQixVQUFVLENBQzlCLElBQVUsRUFDVixXQUFtQjs7WUFFbkIsTUFBTSxTQUFTLEdBQUcsTUFBTSx3QkFBWSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQzNDLE1BQU0sT0FBTyxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1lBRXBELElBQUksQ0FBQyxPQUFPLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxXQUFXLEtBQUssYUFBYSxFQUFFO2dCQUNoRSxNQUFNLElBQUksZ0NBQW1CLENBQUMscURBQXFELENBQUMsQ0FBQzthQUN0RjtZQUVELE9BQU8sT0FBTyxDQUFDO1FBQ2pCLENBQUM7S0FBQTtJQVpELGdDQVlDO0lBRUQsU0FBZ0IsZ0JBQWdCLENBQUMsSUFBWTtRQUMzQyxPQUFPLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQyxDQUFDO0lBQ25DLENBQUM7SUFGRCw0Q0FFQztJQUVELFNBQXNCLGFBQWEsQ0FDakMsSUFBVSxFQUNWLFdBQW1CLEVBQ25CLE1BQTBCOztZQUUxQiw0QkFBNEI7WUFDNUIsTUFBTSxPQUFPLEdBQU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gdHNsaW50OmRpc2FibGUtbmV4dC1saW5lOiBuby1hbnlcbiAgKGVuYWJsZWRMaXRlcmFsIGFzIGFueSkuc2luZ2xlUXVvdGUgPSB0cnVlO1xuXG4gIGNvbnN0IGluaXRpYWxOYXZpZ2F0aW9uUHJvcGVydHlcbiAgICA9IHRzLmNyZWF0ZVByb3BlcnR5QXNzaWdubWVudCgnaW5pdGlhbE5hdmlnYXRpb24nLCBlbmFibGVkTGl0ZXJhbCk7XG4gIGNvbnN0IHJvdXRlck9wdGlvbnMgPSBleGlzdGluZ09wdGlvbnNcbiAgICA/IHRzLnVwZGF0ZU9iamVjdExpdGVyYWwoZXhpc3RpbmdPcHRpb25zLCB0cy5jcmVhdGVOb2RlQXJyYXkoW1xuICAgICAgLi4uZXhpc3RpbmdPcHRpb25zLnByb3BlcnRpZXMsXG4gICAgICBpbml0aWFsTmF2aWdhdGlvblByb3BlcnR5XG4gICAgXSkpXG4gICAgOiB0cy5jcmVhdGVPYmplY3RMaXRlcmFsKFtpbml0aWFsTmF2aWdhdGlvblByb3BlcnR5XSwgdHJ1ZSk7XG4gIGNvbnN0IGFyZ3MgPSBbbm9kZS5hcmd1bWVudHNbMF0sIHJvdXRlck9wdGlvbnNdO1xuICByZXR1cm4gdHMuY3JlYXRlQ2FsbChub2RlLmV4cHJlc3Npb24sIG5vZGUudHlwZUFyZ3VtZW50cywgYXJncyk7XG59XG4iXX0=

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