From 40215b9e228d808b8e9fae72418778d1f905f427 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Wed, 15 Aug 2018 15:30:35 -0500 Subject: [PATCH 01/13] feat(express-engine): add schematics --- modules/express-engine/package.json | 1 + modules/express-engine/schematics/README.md | 14 + .../express-engine/schematics/collection.json | 11 + .../__serverFileName@stripTsExtension__.ts | 50 ++ .../files/root/__tsconfigFileName__.json | 11 + .../files/root/webpack.server.config.js | 47 ++ .../files/src/__main@stripTsExtension__.ts | 9 + .../files/src/app/__rootModuleFileName__ | 14 + .../schematics/install/index.spec.ts | 179 ++++++ .../schematics/install/index.ts | 270 ++++++++ .../schematics/install/schema.json | 81 +++ .../schematics/install/schema.ts | 62 ++ .../express-engine/schematics/tsconfig.json | 21 + package.json | 3 + yarn.lock | 584 +++++++++++++++++- 15 files changed, 1346 insertions(+), 11 deletions(-) create mode 100644 modules/express-engine/schematics/README.md create mode 100644 modules/express-engine/schematics/collection.json create mode 100644 modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts create mode 100644 modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json create mode 100644 modules/express-engine/schematics/install/files/root/webpack.server.config.js create mode 100644 modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts create mode 100644 modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ create mode 100644 modules/express-engine/schematics/install/index.spec.ts create mode 100644 modules/express-engine/schematics/install/index.ts create mode 100644 modules/express-engine/schematics/install/schema.json create mode 100644 modules/express-engine/schematics/install/schema.ts create mode 100644 modules/express-engine/schematics/tsconfig.json diff --git a/modules/express-engine/package.json b/modules/express-engine/package.json index 62d076f4f..6623940bb 100644 --- a/modules/express-engine/package.json +++ b/modules/express-engine/package.json @@ -14,6 +14,7 @@ "@angular/platform-server": "NG_VERSION", "express": "EXPRESS_VERSION" }, + "schematics": "./schematics/collection.json", "ng-update": { "packageGroup": "NG_UPDATE_PACKAGE_GROUP" }, diff --git a/modules/express-engine/schematics/README.md b/modules/express-engine/schematics/README.md new file mode 100644 index 000000000..d1c348cc2 --- /dev/null +++ b/modules/express-engine/schematics/README.md @@ -0,0 +1,14 @@ +# Angular Universal Express-Engine Schematics +A collection of Schematics for Angular Universal Express-Engine. + +## Collection + +### Install +Adds Angular Universal Express Engine and its depedencies and pre-configures the application. + +- Adds Express-Engine, NgModule-Factory-Loader, ts-loader, and webpack to `package.json` +- Adds a sample Express server file +- Ensure `BrowserAnimationsModule` is installed and included in root module +- Adds pre-configured theme to `.angular.json` file OR adds custom theme scaffolding to `styles.scss` + +Command: `ng add @nguniversal/express-engine` \ No newline at end of file diff --git a/modules/express-engine/schematics/collection.json b/modules/express-engine/schematics/collection.json new file mode 100644 index 000000000..d8ac23b66 --- /dev/null +++ b/modules/express-engine/schematics/collection.json @@ -0,0 +1,11 @@ +{ + "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json", + "schematics": { + "ng-add": { + "description": "Adds Angular Universal Express Engine to the application without affecting any templates", + "factory": "./install", + "schema": "./install/schema.json", + "aliases": ["express-engine-shell"] + }, + } +} diff --git a/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts new file mode 100644 index 000000000..f13571512 --- /dev/null +++ b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts @@ -0,0 +1,50 @@ +import 'zone.js/dist/zone-node'; +import 'reflect-metadata'; +import {enableProdMode} from '@angular/core'; +// Express Engine +import {ngExpressEngine} from '@nguniversal/express-engine'; +// Import module map for lazy loading +import {provideModuleMap} from '@nguniversal/module-map-ngfactory-loader'; + +import * as express from 'express'; +import {join} from 'path'; + +// Faster server renders w/ Prod mode (dev mode never needed) +enableProdMode(); + +// Express server +const app = express(); + +const PORT = process.env.PORT || <%= serverPort %>; +const DIST_FOLDER = join(process.cwd(), 'dist'); + +// * NOTE :: leave this as require() since this file is built Dynamically from webpack +const {AppServerModuleNgFactory, LAZY_MODULE_MAP} = require('./dist/server/main'); + +// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine) +app.engine('html', ngExpressEngine({ + bootstrap: AppServerModuleNgFactory, + providers: [ + provideModuleMap(LAZY_MODULE_MAP) + ] +})); + +app.set('view engine', 'html'); +app.set('views', join(DIST_FOLDER, 'browser')); + +// Example Express Rest API endpoints +// app.get('/api/**', (req, res) => { }); +// Server static files from /browser +app.get('*.*', express.static(join(DIST_FOLDER, 'browser'), { + maxAge: '1y' +})); + +// All regular routes use the Universal engine +app.get('*', (req, res) => { + res.render('index', { req }); +}); + +// Start up the Node server +app.listen(PORT, () => { + console.log(`Node Express server listening on http://localhost:${PORT}`); +}); diff --git a/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json b/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json new file mode 100644 index 000000000..c85442731 --- /dev/null +++ b/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json @@ -0,0 +1,11 @@ +{ + "extends": "./<%= tsConfigExtends %>", + "compilerOptions": { + "outDir": "<%= outDir %>-server", + "baseUrl": ".", + "module": "commonjs" + }, + "angularCompilerOptions": { + "entryModule": "<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>" + } +} \ No newline at end of file diff --git a/modules/express-engine/schematics/install/files/root/webpack.server.config.js b/modules/express-engine/schematics/install/files/root/webpack.server.config.js new file mode 100644 index 000000000..a62a2c95c --- /dev/null +++ b/modules/express-engine/schematics/install/files/root/webpack.server.config.js @@ -0,0 +1,47 @@ +// Work around for https://github.com/angular/angular-cli/issues/7200 + +const path = require('path'); +const webpack = require('webpack'); + +module.exports = { + mode: 'none', + entry: { + // This is our Express server for Dynamic universal + server: './<%= serverFileName %>.ts' + }, + target: 'node', + resolve: {extensions: ['.ts', '.js']}, + optimization: { + minimize: false + }, + output: { + // Puts the output at the root of the dist folder + path: path.join(__dirname, 'dist'), + filename: '[name].js' + }, + module: { + rules: [ + {test: /\.ts$/, loader: 'ts-loader'}, + { + // Mark files inside `@angular/core` as using SystemJS style dynamic imports. + // Removing this will cause deprecation warnings to appear. + test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/, + parser: {system: true}, + }, + ] + }, + plugins: [ + new webpack.ContextReplacementPlugin( + // fixes WARNING Critical dependency: the request of a dependency is an expression + /(.+)?angular(\\|\/)core(.+)?/, + path.join(__dirname, 'src'), // location of your src + {} // a map of your routes + ), + new webpack.ContextReplacementPlugin( + // fixes WARNING Critical dependency: the request of a dependency is an expression + /(.+)?express(\\|\/)(.+)?/, + path.join(__dirname, 'src'), + {} + ) + ] +} diff --git a/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts b/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts new file mode 100644 index 000000000..5f82b3e53 --- /dev/null +++ b/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts @@ -0,0 +1,9 @@ +import { enableProdMode } from '@angular/core'; + +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +export { <%= rootModuleClassName %> } from './app/<%= stripTsExtension(rootModuleFileName) %>'; diff --git a/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ b/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ new file mode 100644 index 000000000..af9a56e17 --- /dev/null +++ b/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { ServerModule } from '@angular/platform-server'; + +import { AppModule } from './app.module'; +import { AppComponent } from './app.component'; + +@NgModule({ + imports: [ + AppModule, + ServerModule, + ], + bootstrap: [AppComponent], +}) +export class <%= rootModuleClassName %> {} diff --git a/modules/express-engine/schematics/install/index.spec.ts b/modules/express-engine/schematics/install/index.spec.ts new file mode 100644 index 000000000..1825a5384 --- /dev/null +++ b/modules/express-engine/schematics/install/index.spec.ts @@ -0,0 +1,179 @@ +/** + * @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 {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing'; +import * as path from 'path'; +import {Schema as ApplicationOptions} from '@schematics/angular/application/schema'; +import {Schema as WorkspaceOptions} from '@schematics/angular/workspace/schema'; +import {Schema as UniversalOptions} from './schema'; + +describe('Universal Schematic', () => { + const schematicRunner = new SchematicTestRunner( + '@schematics/angular', + path.join(__dirname, '../collection.json'), + ); + const defaultOptions: UniversalOptions = { + clientProject: 'bar', + }; + const workspaceUniversalOptions: UniversalOptions = { + clientProject: 'workspace', + }; + + const workspaceOptions: WorkspaceOptions = { + name: 'workspace', + newProjectRoot: 'projects', + version: '6.0.0', + }; + + const appOptions: ApplicationOptions = { + name: 'bar', + inlineStyle: false, + inlineTemplate: false, + routing: false, + style: 'css', + skipTests: false, + skipPackageJson: false, + }; + + const initialWorkspaceAppOptions: ApplicationOptions = { + name: 'workspace', + projectRoot: '', + inlineStyle: false, + inlineTemplate: false, + routing: false, + style: 'css', + skipTests: false, + skipPackageJson: false, + }; + + let appTree: UnitTestTree; + + beforeEach(() => { + appTree = schematicRunner.runSchematic('workspace', workspaceOptions); + appTree = schematicRunner.runSchematic('application', initialWorkspaceAppOptions, appTree); + appTree = schematicRunner.runSchematic('application', appOptions, appTree); + }); + + it('should create a root module file', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/projects/bar/src/app/app.server.module.ts'; + expect(tree.exists(filePath)).toEqual(true); + }); + + it('should create a main file', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/projects/bar/src/main.server.ts'; + expect(tree.exists(filePath)).toEqual(true); + const contents = tree.readContent(filePath); + expect(contents).toMatch(/export { AppServerModule } from '\.\/app\/app\.server\.module'/); + }); + + it('should create a tsconfig file for the workspace project', () => { + const tree = schematicRunner.runSchematic('universal', workspaceUniversalOptions, appTree); + const filePath = '/src/tsconfig.server.json'; + expect(tree.exists(filePath)).toEqual(true); + const contents = tree.readContent(filePath); + expect(JSON.parse(contents)).toEqual({ + extends: './tsconfig.app.json', + compilerOptions: { + outDir: '../out-tsc/app-server', + baseUrl: '.', + module: 'commonjs', + }, + angularCompilerOptions: { + entryModule: 'app/app.server.module#AppServerModule', + }, + }); + const angularConfig = JSON.parse(tree.readContent('angular.json')); + expect(angularConfig.projects.workspace.architect.server.options.tsConfig) + .toEqual('src/tsconfig.server.json'); + }); + + it('should create a tsconfig file for a generated application', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/projects/bar/tsconfig.server.json'; + expect(tree.exists(filePath)).toEqual(true); + const contents = tree.readContent(filePath); + expect(JSON.parse(contents)).toEqual({ + extends: './tsconfig.app.json', + compilerOptions: { + outDir: '../../out-tsc/app-server', + baseUrl: '.', + module: 'commonjs', + }, + angularCompilerOptions: { + entryModule: 'src/app/app.server.module#AppServerModule', + }, + }); + const angularConfig = JSON.parse(tree.readContent('angular.json')); + expect(angularConfig.projects.bar.architect.server.options.tsConfig) + .toEqual('projects/bar/tsconfig.server.json'); + }); + + it('should add dependency: @angular/platform-server', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/package.json'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/\"@angular\/platform-server\": \"/); + }); + + it('should add dependency: @nguniversal/module-map-ngfactory-loader', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/package.json'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/\"@nguniversal\/module-map-ngfactory-loader\": \"/); + }); + + it('should add dependency: @nguniversal/express-engine', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/package.json'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/\"@nguniversal\/express-engine\": \"/); + }); + + it('should add dependency: express', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/package.json'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/\"express\": \"/); + }); + + it('should update workspace with a server target', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/angular.json'; + const contents = tree.readContent(filePath); + const config = JSON.parse(contents.toString()); + const arch = config.projects.bar.architect; + expect(arch.server).toBeDefined(); + expect(arch.server.builder).toBeDefined(); + const opts = arch.server.options; + expect(opts.outputPath).toEqual('dist/bar-server'); + expect(opts.main).toEqual('projects/bar/src/main.server.ts'); + expect(opts.tsConfig).toEqual('projects/bar/tsconfig.server.json'); + }); + + it('should add a server transition to BrowerModule import', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/projects/bar/src/app/app.module.ts'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/BrowserModule\.withServerTransition\({ appId: 'serverApp' }\)/); + }); + + it('should wrap the bootstrap call in a DOMContentLoaded event handler', () => { + const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const filePath = '/projects/bar/src/main.ts'; + const contents = tree.readContent(filePath); + expect(contents).toMatch(/document.addEventListener\('DOMContentLoaded', \(\) => {/); + }); + + it('should install npm dependencies', () => { + schematicRunner.runSchematic('universal', defaultOptions, appTree); + expect(schematicRunner.tasks.length).toBe(1); + expect(schematicRunner.tasks[0].name).toBe('node-package'); + expect((schematicRunner.tasks[0].options as {command: string}).command).toBe('install'); + }); +}); diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts new file mode 100644 index 000000000..4cf6f0592 --- /dev/null +++ b/modules/express-engine/schematics/install/index.ts @@ -0,0 +1,270 @@ +/** + * @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 { + JsonObject, + Path, + basename, + experimental, + join, + normalize, + parseJson, + strings, +} from '@angular-devkit/core'; +import { + Rule, + SchematicContext, + SchematicsException, + Tree, + apply, + chain, + mergeWith, + move, + template, + url, noop, filter, +} from '@angular-devkit/schematics'; +import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; +import * as ts from 'typescript'; +import {findNode, getDecoratorMetadata} from '@schematics/angular/utility/ast-utils' +import {findBootstrapModuleCall, findBootstrapModulePath} from '@schematics/angular/utility/ng-ast-utils'; +import {InsertChange} from '@schematics/angular/utility/change'; +import {getWorkspace} from '@schematics/angular/utility/config'; +import {Schema as UniversalOptions} from './schema'; + + +function getWorkspacePath(host: Tree): string { + const possibleFiles = [ '/angular.json', '/.angular.json' ]; + + return possibleFiles.filter(path => host.exists(path))[0]; +} + +function getClientProject( + host: Tree, options: UniversalOptions, +): experimental.workspace.WorkspaceProject { + const workspace = getWorkspace(host); + const clientProject = workspace.projects[options.clientProject]; + if (!clientProject) { + throw new SchematicsException(`Client app ${options.clientProject} not found.`); + } + + return clientProject; +} + +function getClientArchitect( + host: Tree, + options: UniversalOptions, +): experimental.workspace.WorkspaceTool { + const clientArchitect = getClientProject(host, options).architect; + + if (!clientArchitect) { + throw new Error('Client project architect not found.'); + } + + return clientArchitect; +} + +function updateConfigFile(options: UniversalOptions, tsConfigDirectory: Path): Rule { + return (host: Tree) => { + const workspace = getWorkspace(host); + if (!workspace.projects[options.clientProject]) { + throw new SchematicsException(`Client app ${options.clientProject} not found.`); + } + + const clientProject = workspace.projects[options.clientProject]; + if (!clientProject.architect) { + throw new Error('Client project architect not found.'); + } + + const builderOptions: JsonObject = { + outputPath: `dist/${options.clientProject}-server`, + main: `${clientProject.root}src/main.server.ts`, + tsConfig: join(tsConfigDirectory, `${options.tsconfigFileName}.json`), + }; + const serverTarget: JsonObject = { + builder: '@angular-devkit/build-angular:server', + options: builderOptions, + }; + clientProject.architect.server = serverTarget; + + const workspacePath = getWorkspacePath(host); + + host.overwrite(workspacePath, JSON.stringify(workspace, null, 2)); + + return host; + }; +} + +function findBrowserModuleImport(host: Tree, modulePath: string): ts.Node { + const moduleBuffer = host.read(modulePath); + if (!moduleBuffer) { + throw new SchematicsException(`Module file (${modulePath}) not found`); + } + const moduleFileText = moduleBuffer.toString('utf-8'); + + const source = ts.createSourceFile(modulePath, moduleFileText, ts.ScriptTarget.Latest, true); + + const decoratorMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core')[0]; + const browserModuleNode = findNode(decoratorMetadata, ts.SyntaxKind.Identifier, 'BrowserModule'); + + if (browserModuleNode === null) { + throw new SchematicsException(`Cannot find BrowserModule import in ${modulePath}`); + } + + return browserModuleNode; +} + +function wrapBootstrapCall(options: UniversalOptions): Rule { + return (host: Tree) => { + const clientArchitect = getClientArchitect(host, options); + const mainPath = normalize('/' + clientArchitect.build.options.main); + let bootstrapCall: ts.Node | null = findBootstrapModuleCall(host, mainPath); + if (bootstrapCall === null) { + throw new SchematicsException('Bootstrap module not found.'); + } + + let bootstrapCallExpression: ts.Node | null = null; + let currentCall = bootstrapCall; + while (bootstrapCallExpression === null && currentCall.parent) { + currentCall = currentCall.parent; + if (currentCall.kind === ts.SyntaxKind.ExpressionStatement) { + bootstrapCallExpression = currentCall; + } + } + bootstrapCall = currentCall; + + const recorder = host.beginUpdate(mainPath); + const beforeText = `document.addEventListener('DOMContentLoaded', () => {\n `; + const afterText = `\n});`; + recorder.insertLeft(bootstrapCall.getStart(), beforeText); + recorder.insertRight(bootstrapCall.getEnd(), afterText); + host.commitUpdate(recorder); + }; +} + +function addServerTransition(options: UniversalOptions): Rule { + return (host: Tree) => { + const clientProject = getClientProject(host, options); + const clientArchitect = getClientArchitect(host, options); + const mainPath = normalize('/' + clientArchitect.build.options.main); + + const bootstrapModuleRelativePath = findBootstrapModulePath(host, mainPath); + const bootstrapModulePath = normalize( + `/${clientProject.root}/src/${bootstrapModuleRelativePath}.ts`); + + const browserModuleImport = findBrowserModuleImport(host, bootstrapModulePath); + const appId = options.appId; + const transitionCall = `.withServerTransition({ appId: '${appId}' })`; + const position = browserModuleImport.pos + browserModuleImport.getFullText().length; + const transitionCallChange = new InsertChange( + bootstrapModulePath, position, transitionCall); + + const transitionCallRecorder = host.beginUpdate(bootstrapModulePath); + transitionCallRecorder.insertLeft(transitionCallChange.pos, transitionCallChange.toAdd); + host.commitUpdate(transitionCallRecorder); + }; +} + +function addDependenciesAndScripts(options: UniversalOptions): Rule { + return (host: Tree) => { + + const workspace = getWorkspace(host); + if (!workspace.projects[options.clientProject]) { + throw new SchematicsException(`Client app ${options.clientProject} not found.`); + } + + const clientProject = workspace.projects[options.clientProject]; + const pkgPath = '/package.json'; + const buffer = host.read(pkgPath); + if (buffer === null) { + throw new SchematicsException('Could not find package.json'); + } + + const pkg = JSON.parse(buffer.toString()); + + const ngCoreVersion = pkg.dependencies['@angular/core']; + pkg.dependencies['@angular/platform-server'] = ngCoreVersion; + pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = ngCoreVersion; + pkg.dependencies['@nguniversal/express-engine'] = ngCoreVersion; + pkg.dependencies['express'] = ngCoreVersion; + + pkg.scripts['serve:ssr'] = 'node dist/server'; + pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run webpack:server'; + pkg.scripts['build:client-and-server-bundles'] = `ng build --prod && ng run ${clientProject}:server:production`; + pkg.scripts['webpack:server'] = 'webpack --config webpack.server.config.js --progress --colors'; + + host.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); + + return host; + }; +} + +function getTsConfigOutDir(host: Tree, architect: experimental.workspace.WorkspaceTool): string { + const tsConfigPath = architect.build.options.tsConfig; + const tsConfigBuffer = host.read(tsConfigPath); + if (!tsConfigBuffer) { + throw new SchematicsException(`Could not read ${tsConfigPath}`); + } + const tsConfigContent = tsConfigBuffer.toString(); + const tsConfig = parseJson(tsConfigContent); + if (tsConfig === null || typeof tsConfig !== 'object' || Array.isArray(tsConfig) || + tsConfig.compilerOptions === null || typeof tsConfig.compilerOptions !== 'object' || + Array.isArray(tsConfig.compilerOptions)) { + throw new SchematicsException(`Invalid tsconfig - ${tsConfigPath}`); + } + const outDir = tsConfig.compilerOptions.outDir; + + return outDir as string; +} + +export default function (options: UniversalOptions): Rule { + return (host: Tree, context: SchematicContext) => { + const clientProject = getClientProject(host, options); + if (clientProject.projectType !== 'application') { + throw new SchematicsException(`Universal requires a project type of "application".`); + } + const clientArchitect = getClientArchitect(host, options); + const outDir = getTsConfigOutDir(host, clientArchitect); + const tsConfigExtends = basename(clientArchitect.build.options.tsConfig); + const rootInSrc = clientProject.root === ''; + const tsConfigDirectory = join(normalize(clientProject.root), rootInSrc ? 'src' : ''); + + if (!options.skipInstall) { + context.addTask(new NodePackageInstallTask()); + } + + const templateSource = apply(url('./files/src'), [ + template({ + ...strings, + ...options as object, + stripTsExtension: (s: string) => { return s.replace(/\.ts$/, ''); }, + }), + move(join(normalize(clientProject.root), 'src')), + ]); + + const rootSource = apply(url('./files/root'), [ + options.skipServer ? filter(path => !path.startsWith('__serverFileName')) : noop(), + template({ + ...strings, + ...options as object, + stripTsExtension: (s: string) => { return s.replace(/\.ts$/, ''); }, + outDir, + tsConfigExtends, + rootInSrc, + }), + move(tsConfigDirectory), + ]); + + return chain([ + mergeWith(templateSource), + mergeWith(rootSource), + addDependenciesAndScripts(options), + updateConfigFile(options, tsConfigDirectory), + wrapBootstrapCall(options), + addServerTransition(options), + ]); + }; +} diff --git a/modules/express-engine/schematics/install/schema.json b/modules/express-engine/schematics/install/schema.json new file mode 100644 index 000000000..65804a475 --- /dev/null +++ b/modules/express-engine/schematics/install/schema.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/schema", + "id": "SchematicsExpressEngineInstall", + "title": "Express Engine Install Options Schema", + "type": "object", + "properties": { + "clientProject": { + "type": "string", + "description": "Name of related client app." + }, + "appId": { + "type": "string", + "format": "html-selector", + "description": "The appId to use withServerTransition.", + "default": "serverApp" + }, + "main": { + "type": "string", + "format": "path", + "description": "The name of the main entry-point file.", + "default": "main.server.ts" + }, + "test": { + "type": "string", + "format": "path", + "description": "The name of the test entry-point file." + }, + "serverFileName": { + "type": "string", + "default": "server.ts", + "description": "The name of the Express server file." + }, + "serverPort": { + "type": "number", + "default": 4000, + "description": "The port for the Express server." + } + "tsconfigFileName": { + "type": "string", + "default": "tsconfig.server", + "description": "The name of the TypeScript configuration file." + }, + "testTsconfigFileName": { + "type": "string", + "format": "path", + "description": "The name of the TypeScript configuration file for tests.", + "default": "tsconfig.spec" + }, + "appDir": { + "type": "string", + "format": "path", + "description": "The name of the application directory.", + "default": "app" + }, + "rootModuleFileName": { + "type": "string", + "format": "path", + "description": "The name of the root module file", + "default": "app.server.module.ts" + }, + "rootModuleClassName": { + "type": "string", + "description": "The name of the root module class.", + "default": "AppServerModule" + }, + "skipInstall": { + "description": "Skip installing dependency packages.", + "type": "boolean", + "default": false + }, + "skipServer": { + "description": "Skip adding Express server file.", + "type": "boolean", + "default": false + } + }, + "required": [ + "clientProject" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/modules/express-engine/schematics/install/schema.ts b/modules/express-engine/schematics/install/schema.ts new file mode 100644 index 000000000..63a85ae66 --- /dev/null +++ b/modules/express-engine/schematics/install/schema.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright Google LLC 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 + */ + +export interface Schema { + /** + * Name or index of related client app. + */ + clientProject: string; + /** + * The appId to use withServerTransition. + */ + appId?: string; + /** + * The name of the main entry-point file. + */ + main?: string; + /** + * The name of the test entry-point file. + */ + test?: string; + /** + * The name of the Express server file. + */ + serverFileName?: string; + /** + * The port for the Express server. + */ + serverPort?: number; + /** + * The name of the TypeScript configuration file. + */ + tsconfigFileName?: string; + /** + * The name of the TypeScript configuration file for tests. + */ + testTsconfigFileName?: string; + /** + * The name of the application directory. + */ + appDir?: string; + /** + * The name of the root module file + */ + rootModuleFileName?: string; + /** + * The name of the root module class. + */ + rootModuleClassName?: string; + /** + * Skip installing dependency packages. + */ + skipInstall?: boolean; + /** + * Skip adding Express server file. + */ + skipServer?: boolean; +} diff --git a/modules/express-engine/schematics/tsconfig.json b/modules/express-engine/schematics/tsconfig.json new file mode 100644 index 000000000..21c18cd9d --- /dev/null +++ b/modules/express-engine/schematics/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "lib": ["es2017", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../../../dist/schematics", + "noEmitOnError": false, + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "sourceMap": true, + "target": "es6", + "types": [ + "jasmine", + "node" + ] + }, + "exclude": [ + "**/*.spec.ts", + "*/files/**/*" + ] +} diff --git a/package.json b/package.json index 3d4c71c22..81f935465 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,8 @@ "test:watch": "ibazel test //..." }, "devDependencies": { + "@angular-devkit/core": "^0.7.3", + "@angular-devkit/schematics": "^0.7.3", "@angular/animations": "^6.0.4", "@angular/bazel": "^6.0.4", "@angular/common": "^6.0.4", @@ -85,6 +87,7 @@ "@angular/router": "^6.0.4", "@angular/upgrade": "^6.0.4", "@bazel/ibazel": "^0.3.1", + "@schematics/angular": "^0.7.3", "@types/express": "^4.0.39", "@types/fs-extra": "^4.0.5", "@types/hapi": "^17.0.12", diff --git a/yarn.lock b/yarn.lock index aea77ce90..abc893935 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,22 @@ # yarn lockfile v1 +"@angular-devkit/core@0.7.3", "@angular-devkit/core@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-0.7.3.tgz#a18f7b922390503b5226b3d64c4c54fb43ad15e2" + dependencies: + ajv "~6.4.0" + chokidar "^2.0.3" + rxjs "^6.0.0" + source-map "^0.5.6" + +"@angular-devkit/schematics@0.7.3", "@angular-devkit/schematics@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-0.7.3.tgz#49dc93d55246814924e19db37dae43867ed563ea" + dependencies: + "@angular-devkit/core" "0.7.3" + rxjs "^6.0.0" + "@angular/animations@^6.0.4": version "6.0.4" resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.4.tgz#4e22612e8fed3193983d985c748514a03404bd96" @@ -91,6 +107,14 @@ version "0.15.0" resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.0.tgz#bd588b8b9fcc5763c3f14787fdb29ba4e127258d" +"@schematics/angular@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-0.7.3.tgz#d4a33a78b152bded557efddba4616a8fafa9ae24" + dependencies: + "@angular-devkit/core" "0.7.3" + "@angular-devkit/schematics" "0.7.3" + typescript ">=2.6.2 <2.10" + "@types/body-parser@*": version "1.17.0" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.0.tgz#9f5c9d9bd04bb54be32d5eb9fc0d8c974e6cf58c" @@ -311,6 +335,15 @@ ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.4.0.tgz#d3aff78e9277549771daf0164cff48482b754fc6" + dependencies: + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + uri-js "^3.0.2" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -380,6 +413,13 @@ anymatch@^1.3.0: micromatch "^2.1.5" normalize-path "^2.0.0" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -410,7 +450,11 @@ arr-diff@^2.0.0: dependencies: arr-flatten "^1.0.1" -arr-flatten@^1.0.1: +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -418,6 +462,10 @@ arr-union@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-2.1.0.tgz#20f9eab5ec70f5c7d215b1077b1c39161d292c7d" +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -448,6 +496,10 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" @@ -489,6 +541,10 @@ assert@^1.4.1: dependencies: util "0.10.3" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + ast-types@0.x.x: version "0.11.4" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.4.tgz#76f930930e9571851ba282a9a0f6923f29f6be2f" @@ -569,6 +625,18 @@ base64id@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -689,6 +757,21 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +braces@^2.3.0, braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -808,6 +891,20 @@ bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + call@5.x.x: version "5.0.1" resolved "https://registry.yarnpkg.com/call/-/call-5.0.1.tgz#ac1b5c106d9edc2a17af2a4a4f74dd4f0c06e910" @@ -911,6 +1008,25 @@ chokidar@^1.4.1, chokidar@^1.4.2: optionalDependencies: fsevents "^1.0.0" +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.5" + optionalDependencies: + fsevents "^1.2.2" + chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" @@ -926,6 +1042,15 @@ circular-json@^0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.4.tgz#ff1ad2f2e392eeb8a5172d4d985fa846ed8ad656" +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -962,6 +1087,13 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + color-convert@^1.9.0: version "1.9.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" @@ -1016,7 +1148,7 @@ component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" -component-emitter@1.2.1: +component-emitter@1.2.1, component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" @@ -1230,6 +1362,10 @@ cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + core-js@^2.2.0: version "2.5.6" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.6.tgz#0fe6d45bf3cac3ac364a9d72de7576f4eb221b9d" @@ -1355,7 +1491,7 @@ dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@~2.6.4, debug@~2.6.6: +debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@~2.6.4, debug@~2.6.6: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1404,6 +1540,25 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + degenerator@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" @@ -1705,6 +1860,18 @@ expand-brackets@^0.1.4: dependencies: is-posix-bracket "^0.1.0" +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + expand-range@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" @@ -1759,6 +1926,19 @@ extend-shallow@^1.1.2: dependencies: kind-of "^1.1.0" +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -1769,6 +1949,19 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -1814,6 +2007,15 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + finalhandler@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" @@ -1863,7 +2065,7 @@ follow-redirects@^1.0.0: dependencies: debug "^3.1.0" -for-in@^1.0.1: +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1897,6 +2099,12 @@ forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -1925,7 +2133,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.0.0, fsevents@^1.2.2: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" dependencies: @@ -1995,6 +2203,10 @@ get-uri@^2.0.0: ftp "~0.3.10" readable-stream "2" +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -2044,6 +2256,13 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + glob@^5.0.10, glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -2160,6 +2379,33 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" @@ -2394,6 +2640,18 @@ iron@5.x.x: cryptiles "4.x.x" hoek "5.x.x" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -2414,6 +2672,34 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -2424,14 +2710,24 @@ is-equal-shallow@^0.1.3: dependencies: is-primitive "^2.0.0" -is-extendable@^0.1.1: +is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -2454,6 +2750,18 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + is-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" @@ -2482,6 +2790,12 @@ is-number@^2.1.0: dependencies: kind-of "^3.0.2" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" @@ -2510,6 +2824,12 @@ is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -2544,6 +2864,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -2576,6 +2900,10 @@ isobject@^2.0.0: dependencies: isarray "1.0.0" +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -2799,13 +3127,23 @@ kind-of@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" -kind-of@^3.0.2: +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" dependencies: is-buffer "^1.1.5" -kind-of@^6.0.0: +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" @@ -2887,6 +3225,10 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + lodash.memoize@~3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" @@ -3000,6 +3342,10 @@ make-error@^1.1.1: version "1.3.4" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" @@ -3008,6 +3354,12 @@ map-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" @@ -3084,6 +3436,24 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -3170,6 +3540,13 @@ minizlib@^1.1.0: dependencies: minipass "^2.2.1" +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -3188,6 +3565,22 @@ nan@^2.9.2: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + needle@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" @@ -3301,7 +3694,7 @@ normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -3353,6 +3746,20 @@ object-component@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -3360,6 +3767,12 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -3540,10 +3953,18 @@ parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -3659,6 +4080,10 @@ podium@3.x.x: hoek "5.x.x" joi "13.x.x" +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -3760,7 +4185,7 @@ punycode@1.4.1, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -punycode@2.x.x: +punycode@2.x.x, punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -3984,6 +4409,13 @@ regex-cache@^0.4.2: dependencies: is-equal-shallow "^0.1.3" +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + remap-istanbul@^0.10.1: version "0.10.1" resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.10.1.tgz#3aa58dd5021d499f336d3ba5bf3bbb91c1b88e37" @@ -4007,7 +4439,7 @@ repeat-string@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" -repeat-string@^1.5.2: +repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -4112,6 +4544,10 @@ resolve@^1.1.6, resolve@^1.3.2, resolve@^1.4.0: dependencies: path-parse "^1.0.5" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" @@ -4179,6 +4615,12 @@ rollup@^0.56.5: version "0.56.5" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.56.5.tgz#40fe3cf0cd1659d469baad11f4d5b6336c14ce84" +rxjs@^6.0.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" + dependencies: + tslib "^1.9.0" + rxjs@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.0.tgz#e024d0e180b72756a83c2aaea8f25423751ba978" @@ -4193,6 +4635,12 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -4278,6 +4726,24 @@ set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -4347,6 +4813,33 @@ smtp-connection@2.12.0: httpntlm "1.6.1" nodemailer-shared "1.1.0" +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -4497,6 +4990,12 @@ spdx-license-ids@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + split2@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" @@ -4552,6 +5051,13 @@ statehood@6.x.x: iron "5.x.x" joi "13.x.x" +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + "statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -4782,6 +5288,28 @@ to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + topo@3.x.x: version "3.0.0" resolved "https://registry.yarnpkg.com/topo/-/topo-3.0.0.tgz#37e48c330efeac784538e0acd3e62ca5e231fe7a" @@ -4911,6 +5439,10 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +"typescript@>=2.6.2 <2.10": + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" + typescript@~2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" @@ -4947,6 +5479,15 @@ underscore@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" @@ -4955,6 +5496,23 @@ unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + +uri-js@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-3.0.2.tgz#f90b858507f81dea4dcfbb3c4c3dbfa2b557faaa" + dependencies: + punycode "^2.1.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -4966,6 +5524,10 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + useragent@2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" From 8de43390aca362dcc1ced8926035942326c2894d Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Wed, 15 Aug 2018 15:40:49 -0500 Subject: [PATCH 02/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/install/index.ts | 12 ++++++++---- tslint.json | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts index 4cf6f0592..1fade2b56 100644 --- a/modules/express-engine/schematics/install/index.ts +++ b/modules/express-engine/schematics/install/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC 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 @@ -29,8 +29,11 @@ import { } from '@angular-devkit/schematics'; import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; import * as ts from 'typescript'; -import {findNode, getDecoratorMetadata} from '@schematics/angular/utility/ast-utils' -import {findBootstrapModuleCall, findBootstrapModulePath} from '@schematics/angular/utility/ng-ast-utils'; +import {findNode, getDecoratorMetadata} from '@schematics/angular/utility/ast-utils'; +import { + findBootstrapModuleCall, + findBootstrapModulePath +} from '@schematics/angular/utility/ng-ast-utils'; import {InsertChange} from '@schematics/angular/utility/change'; import {getWorkspace} from '@schematics/angular/utility/config'; import {Schema as UniversalOptions} from './schema'; @@ -193,7 +196,8 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { pkg.scripts['serve:ssr'] = 'node dist/server'; pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run webpack:server'; - pkg.scripts['build:client-and-server-bundles'] = `ng build --prod && ng run ${clientProject}:server:production`; + pkg.scripts['build:client-and-server-bundles'] = + `ng build --prod && ng run ${clientProject}:server:production`; pkg.scripts['webpack:server'] = 'webpack --config webpack.server.config.js --progress --colors'; host.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); diff --git a/tslint.json b/tslint.json index d5a61621f..5d6095dc1 100644 --- a/tslint.json +++ b/tslint.json @@ -96,5 +96,11 @@ "modules/**/*.ts" ], "deletion-target": true + }, + "linterOptions": { + "exclude": [ + // Exclude schematic template files that can't be linted. + "src/lib/schematics/**/files/**/*" + ] } } \ No newline at end of file From a00703ae4c8fa4037a83dc3b75af57c71f2efc07 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Wed, 15 Aug 2018 15:55:26 -0500 Subject: [PATCH 03/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/README.md | 5 +- .../files/root/__tsconfigFileName__.json | 11 -- .../files/src/__main@stripTsExtension__.ts | 9 -- .../files/src/app/__rootModuleFileName__ | 14 -- .../schematics/install/index.spec.ts | 97 +----------- .../schematics/install/index.ts | 143 +----------------- 6 files changed, 13 insertions(+), 266 deletions(-) delete mode 100644 modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json delete mode 100644 modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts delete mode 100644 modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ diff --git a/modules/express-engine/schematics/README.md b/modules/express-engine/schematics/README.md index d1c348cc2..02307ae41 100644 --- a/modules/express-engine/schematics/README.md +++ b/modules/express-engine/schematics/README.md @@ -4,11 +4,10 @@ A collection of Schematics for Angular Universal Express-Engine. ## Collection ### Install -Adds Angular Universal Express Engine and its depedencies and pre-configures the application. +Adds Angular Universal Express Engine and its dependencies and pre-configures the application. +- Runs the default Angular Universal schematic to add Universal capabilities to an application - Adds Express-Engine, NgModule-Factory-Loader, ts-loader, and webpack to `package.json` - Adds a sample Express server file -- Ensure `BrowserAnimationsModule` is installed and included in root module -- Adds pre-configured theme to `.angular.json` file OR adds custom theme scaffolding to `styles.scss` Command: `ng add @nguniversal/express-engine` \ No newline at end of file diff --git a/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json b/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json deleted file mode 100644 index c85442731..000000000 --- a/modules/express-engine/schematics/install/files/root/__tsconfigFileName__.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./<%= tsConfigExtends %>", - "compilerOptions": { - "outDir": "<%= outDir %>-server", - "baseUrl": ".", - "module": "commonjs" - }, - "angularCompilerOptions": { - "entryModule": "<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>" - } -} \ No newline at end of file diff --git a/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts b/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts deleted file mode 100644 index 5f82b3e53..000000000 --- a/modules/express-engine/schematics/install/files/src/__main@stripTsExtension__.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { enableProdMode } from '@angular/core'; - -import { environment } from './environments/environment'; - -if (environment.production) { - enableProdMode(); -} - -export { <%= rootModuleClassName %> } from './app/<%= stripTsExtension(rootModuleFileName) %>'; diff --git a/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ b/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ deleted file mode 100644 index af9a56e17..000000000 --- a/modules/express-engine/schematics/install/files/src/app/__rootModuleFileName__ +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { ServerModule } from '@angular/platform-server'; - -import { AppModule } from './app.module'; -import { AppComponent } from './app.component'; - -@NgModule({ - imports: [ - AppModule, - ServerModule, - ], - bootstrap: [AppComponent], -}) -export class <%= rootModuleClassName %> {} diff --git a/modules/express-engine/schematics/install/index.spec.ts b/modules/express-engine/schematics/install/index.spec.ts index 1825a5384..c2e0b8520 100644 --- a/modules/express-engine/schematics/install/index.spec.ts +++ b/modules/express-engine/schematics/install/index.spec.ts @@ -19,9 +19,9 @@ describe('Universal Schematic', () => { const defaultOptions: UniversalOptions = { clientProject: 'bar', }; - const workspaceUniversalOptions: UniversalOptions = { - clientProject: 'workspace', - }; + // const workspaceUniversalOptions: UniversalOptions = { + // clientProject: 'workspace', + // }; const workspaceOptions: WorkspaceOptions = { name: 'workspace', @@ -58,69 +58,6 @@ describe('Universal Schematic', () => { appTree = schematicRunner.runSchematic('application', appOptions, appTree); }); - it('should create a root module file', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/projects/bar/src/app/app.server.module.ts'; - expect(tree.exists(filePath)).toEqual(true); - }); - - it('should create a main file', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/projects/bar/src/main.server.ts'; - expect(tree.exists(filePath)).toEqual(true); - const contents = tree.readContent(filePath); - expect(contents).toMatch(/export { AppServerModule } from '\.\/app\/app\.server\.module'/); - }); - - it('should create a tsconfig file for the workspace project', () => { - const tree = schematicRunner.runSchematic('universal', workspaceUniversalOptions, appTree); - const filePath = '/src/tsconfig.server.json'; - expect(tree.exists(filePath)).toEqual(true); - const contents = tree.readContent(filePath); - expect(JSON.parse(contents)).toEqual({ - extends: './tsconfig.app.json', - compilerOptions: { - outDir: '../out-tsc/app-server', - baseUrl: '.', - module: 'commonjs', - }, - angularCompilerOptions: { - entryModule: 'app/app.server.module#AppServerModule', - }, - }); - const angularConfig = JSON.parse(tree.readContent('angular.json')); - expect(angularConfig.projects.workspace.architect.server.options.tsConfig) - .toEqual('src/tsconfig.server.json'); - }); - - it('should create a tsconfig file for a generated application', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/projects/bar/tsconfig.server.json'; - expect(tree.exists(filePath)).toEqual(true); - const contents = tree.readContent(filePath); - expect(JSON.parse(contents)).toEqual({ - extends: './tsconfig.app.json', - compilerOptions: { - outDir: '../../out-tsc/app-server', - baseUrl: '.', - module: 'commonjs', - }, - angularCompilerOptions: { - entryModule: 'src/app/app.server.module#AppServerModule', - }, - }); - const angularConfig = JSON.parse(tree.readContent('angular.json')); - expect(angularConfig.projects.bar.architect.server.options.tsConfig) - .toEqual('projects/bar/tsconfig.server.json'); - }); - - it('should add dependency: @angular/platform-server', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/package.json'; - const contents = tree.readContent(filePath); - expect(contents).toMatch(/\"@angular\/platform-server\": \"/); - }); - it('should add dependency: @nguniversal/module-map-ngfactory-loader', () => { const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); const filePath = '/package.json'; @@ -142,34 +79,6 @@ describe('Universal Schematic', () => { expect(contents).toMatch(/\"express\": \"/); }); - it('should update workspace with a server target', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/angular.json'; - const contents = tree.readContent(filePath); - const config = JSON.parse(contents.toString()); - const arch = config.projects.bar.architect; - expect(arch.server).toBeDefined(); - expect(arch.server.builder).toBeDefined(); - const opts = arch.server.options; - expect(opts.outputPath).toEqual('dist/bar-server'); - expect(opts.main).toEqual('projects/bar/src/main.server.ts'); - expect(opts.tsConfig).toEqual('projects/bar/tsconfig.server.json'); - }); - - it('should add a server transition to BrowerModule import', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/projects/bar/src/app/app.module.ts'; - const contents = tree.readContent(filePath); - expect(contents).toMatch(/BrowserModule\.withServerTransition\({ appId: 'serverApp' }\)/); - }); - - it('should wrap the bootstrap call in a DOMContentLoaded event handler', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); - const filePath = '/projects/bar/src/main.ts'; - const contents = tree.readContent(filePath); - expect(contents).toMatch(/document.addEventListener\('DOMContentLoaded', \(\) => {/); - }); - it('should install npm dependencies', () => { schematicRunner.runSchematic('universal', defaultOptions, appTree); expect(schematicRunner.tasks.length).toBe(1); diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts index 1fade2b56..569096518 100644 --- a/modules/express-engine/schematics/install/index.ts +++ b/modules/express-engine/schematics/install/index.ts @@ -6,8 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { - JsonObject, - Path, basename, experimental, join, @@ -25,26 +23,16 @@ import { mergeWith, move, template, - url, noop, filter, + url, + noop, + filter, + externalSchematic, } from '@angular-devkit/schematics'; import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; -import * as ts from 'typescript'; -import {findNode, getDecoratorMetadata} from '@schematics/angular/utility/ast-utils'; -import { - findBootstrapModuleCall, - findBootstrapModulePath -} from '@schematics/angular/utility/ng-ast-utils'; -import {InsertChange} from '@schematics/angular/utility/change'; import {getWorkspace} from '@schematics/angular/utility/config'; import {Schema as UniversalOptions} from './schema'; -function getWorkspacePath(host: Tree): string { - const possibleFiles = [ '/angular.json', '/.angular.json' ]; - - return possibleFiles.filter(path => host.exists(path))[0]; -} - function getClientProject( host: Tree, options: UniversalOptions, ): experimental.workspace.WorkspaceProject { @@ -70,107 +58,6 @@ function getClientArchitect( return clientArchitect; } -function updateConfigFile(options: UniversalOptions, tsConfigDirectory: Path): Rule { - return (host: Tree) => { - const workspace = getWorkspace(host); - if (!workspace.projects[options.clientProject]) { - throw new SchematicsException(`Client app ${options.clientProject} not found.`); - } - - const clientProject = workspace.projects[options.clientProject]; - if (!clientProject.architect) { - throw new Error('Client project architect not found.'); - } - - const builderOptions: JsonObject = { - outputPath: `dist/${options.clientProject}-server`, - main: `${clientProject.root}src/main.server.ts`, - tsConfig: join(tsConfigDirectory, `${options.tsconfigFileName}.json`), - }; - const serverTarget: JsonObject = { - builder: '@angular-devkit/build-angular:server', - options: builderOptions, - }; - clientProject.architect.server = serverTarget; - - const workspacePath = getWorkspacePath(host); - - host.overwrite(workspacePath, JSON.stringify(workspace, null, 2)); - - return host; - }; -} - -function findBrowserModuleImport(host: Tree, modulePath: string): ts.Node { - const moduleBuffer = host.read(modulePath); - if (!moduleBuffer) { - throw new SchematicsException(`Module file (${modulePath}) not found`); - } - const moduleFileText = moduleBuffer.toString('utf-8'); - - const source = ts.createSourceFile(modulePath, moduleFileText, ts.ScriptTarget.Latest, true); - - const decoratorMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core')[0]; - const browserModuleNode = findNode(decoratorMetadata, ts.SyntaxKind.Identifier, 'BrowserModule'); - - if (browserModuleNode === null) { - throw new SchematicsException(`Cannot find BrowserModule import in ${modulePath}`); - } - - return browserModuleNode; -} - -function wrapBootstrapCall(options: UniversalOptions): Rule { - return (host: Tree) => { - const clientArchitect = getClientArchitect(host, options); - const mainPath = normalize('/' + clientArchitect.build.options.main); - let bootstrapCall: ts.Node | null = findBootstrapModuleCall(host, mainPath); - if (bootstrapCall === null) { - throw new SchematicsException('Bootstrap module not found.'); - } - - let bootstrapCallExpression: ts.Node | null = null; - let currentCall = bootstrapCall; - while (bootstrapCallExpression === null && currentCall.parent) { - currentCall = currentCall.parent; - if (currentCall.kind === ts.SyntaxKind.ExpressionStatement) { - bootstrapCallExpression = currentCall; - } - } - bootstrapCall = currentCall; - - const recorder = host.beginUpdate(mainPath); - const beforeText = `document.addEventListener('DOMContentLoaded', () => {\n `; - const afterText = `\n});`; - recorder.insertLeft(bootstrapCall.getStart(), beforeText); - recorder.insertRight(bootstrapCall.getEnd(), afterText); - host.commitUpdate(recorder); - }; -} - -function addServerTransition(options: UniversalOptions): Rule { - return (host: Tree) => { - const clientProject = getClientProject(host, options); - const clientArchitect = getClientArchitect(host, options); - const mainPath = normalize('/' + clientArchitect.build.options.main); - - const bootstrapModuleRelativePath = findBootstrapModulePath(host, mainPath); - const bootstrapModulePath = normalize( - `/${clientProject.root}/src/${bootstrapModuleRelativePath}.ts`); - - const browserModuleImport = findBrowserModuleImport(host, bootstrapModulePath); - const appId = options.appId; - const transitionCall = `.withServerTransition({ appId: '${appId}' })`; - const position = browserModuleImport.pos + browserModuleImport.getFullText().length; - const transitionCallChange = new InsertChange( - bootstrapModulePath, position, transitionCall); - - const transitionCallRecorder = host.beginUpdate(bootstrapModulePath); - transitionCallRecorder.insertLeft(transitionCallChange.pos, transitionCallChange.toAdd); - host.commitUpdate(transitionCallRecorder); - }; -} - function addDependenciesAndScripts(options: UniversalOptions): Rule { return (host: Tree) => { @@ -188,11 +75,9 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { const pkg = JSON.parse(buffer.toString()); - const ngCoreVersion = pkg.dependencies['@angular/core']; - pkg.dependencies['@angular/platform-server'] = ngCoreVersion; - pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = ngCoreVersion; - pkg.dependencies['@nguniversal/express-engine'] = ngCoreVersion; - pkg.dependencies['express'] = ngCoreVersion; + pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = 'TEMP'; + pkg.dependencies['@nguniversal/express-engine'] = 'TEMP'; + pkg.dependencies['express'] = 'TEMP'; pkg.scripts['serve:ssr'] = 'node dist/server'; pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run webpack:server'; @@ -240,15 +125,6 @@ export default function (options: UniversalOptions): Rule { context.addTask(new NodePackageInstallTask()); } - const templateSource = apply(url('./files/src'), [ - template({ - ...strings, - ...options as object, - stripTsExtension: (s: string) => { return s.replace(/\.ts$/, ''); }, - }), - move(join(normalize(clientProject.root), 'src')), - ]); - const rootSource = apply(url('./files/root'), [ options.skipServer ? filter(path => !path.startsWith('__serverFileName')) : noop(), template({ @@ -263,12 +139,9 @@ export default function (options: UniversalOptions): Rule { ]); return chain([ - mergeWith(templateSource), + externalSchematic('@schematics/angular', 'universal', options), mergeWith(rootSource), addDependenciesAndScripts(options), - updateConfigFile(options, tsConfigDirectory), - wrapBootstrapCall(options), - addServerTransition(options), ]); }; } From dc6f9c78f002aca37c9ed12e0dbd75e9d35f20c3 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Wed, 15 Aug 2018 15:58:13 -0500 Subject: [PATCH 04/13] fixup! feat(express-engine): add schematics --- tslint.json | 2 +- yarn.lock | 681 +++++++++++++++++++++++++++------------------------- 2 files changed, 360 insertions(+), 323 deletions(-) diff --git a/tslint.json b/tslint.json index 5d6095dc1..4e97fb33c 100644 --- a/tslint.json +++ b/tslint.json @@ -100,7 +100,7 @@ "linterOptions": { "exclude": [ // Exclude schematic template files that can't be linted. - "src/lib/schematics/**/files/**/*" + "**/schematics/**/files/**/*" ] } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index abc893935..35d47190f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,83 +19,81 @@ rxjs "^6.0.0" "@angular/animations@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.4.tgz#4e22612e8fed3193983d985c748514a03404bd96" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.1.2.tgz#31070ac85bca47e3feab887fed8872c147fcf63e" dependencies: tslib "^1.9.0" "@angular/bazel@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.0.4.tgz#a87edd5b5c9b23cdb2b3f2188d95d18f87c1d1a4" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.1.2.tgz#ebfa8c1948f25ce95b288f5eebd3c0290852e616" dependencies: "@bazel/typescript" "^0.15.0" "@types/node" "6.0.84" - "@types/shelljs" "0.7.7" protobufjs "5.0.0" - shelljs "0.7.8" "@angular/common@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.4.tgz#e3d194a1bb1e143044774488d610437a982179fa" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.1.2.tgz#6e3bd4b16975dbb4ba67e2fc7589d0a036e5df12" dependencies: tslib "^1.9.0" "@angular/compiler-cli@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.4.tgz#03596a2365aaed418e09999493560ba82fd45190" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.1.2.tgz#00829df848210a8a06c3641428f36525fdf41e53" dependencies: chokidar "^1.4.2" minimist "^1.2.0" reflect-metadata "^0.1.2" - tsickle "^0.29.0" + tsickle "^0.32.1" "@angular/compiler@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.4.tgz#86d3adc2c915ee98aa8e00c542c2ef1c09f9c61f" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.1.2.tgz#56fada04cb7dc77a5d3f0b786be713130293d468" dependencies: tslib "^1.9.0" "@angular/core@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.4.tgz#80b19624493126b6c7e3a180a33dee92c84b4bd6" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.1.2.tgz#412dd32a91ec1d5d6db508babbb36e9799235d8d" dependencies: tslib "^1.9.0" "@angular/http@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.4.tgz#5598c6eec895014da9242c22236af2757ae9fef1" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.1.2.tgz#2e0e376686f4bf51ef043856b26679e88d7a92b9" dependencies: tslib "^1.9.0" "@angular/platform-browser-dynamic@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.4.tgz#3b86f6b826d45418520da583eb8ba0526f62a4bb" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.1.2.tgz#76d813e6ab577ce1ffdb31e88d37df9a5177f55c" dependencies: tslib "^1.9.0" "@angular/platform-browser@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.4.tgz#3a86890324fd9de37df8d7195fcedf4145eefb3b" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.1.2.tgz#9a2a498e27e2bcd0fc8d6c696340c258f8b3e322" dependencies: tslib "^1.9.0" "@angular/platform-server@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.0.4.tgz#38de69d98ca01a4e20d6eac7d19b85d9257f06aa" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.1.2.tgz#f8954c5720169c4a2433cb73678c8a8709b12271" dependencies: domino "^2.0.1" tslib "^1.9.0" xhr2 "^0.1.4" "@angular/router@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.4.tgz#81c96dfa42a8c4a218cbd450b1e8959a76ea9595" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.1.2.tgz#5e9e12225b41940fe346675caf1ed15033738abc" dependencies: tslib "^1.9.0" "@angular/upgrade@^6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.0.4.tgz#b12a016bab98db77bacbe9b1a83c4c2a47e5baf5" + version "6.1.2" + resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.1.2.tgz#0ad539347ae3028c39fd31a12c91b1feb7f11ae7" dependencies: tslib "^1.9.0" @@ -104,8 +102,12 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.3.1.tgz#5f02f208f138e581bbdb1534d5c013d7a0ac9799" "@bazel/typescript@^0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.0.tgz#bd588b8b9fcc5763c3f14787fdb29ba4e127258d" + version "0.15.3" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.3.tgz#5c32b3bf664b268f9ffb634b86f40004a50e7ef9" + dependencies: + protobufjs "5.0.0" + tsickle "0.25.x" + tsutils "2.20.0" "@schematics/angular@^0.7.3": version "0.7.3" @@ -127,8 +129,8 @@ resolved "https://registry.yarnpkg.com/@types/boom/-/boom-7.2.0.tgz#19c36cbb5811a7493f0f2e37f31d42b28df1abc1" "@types/catbox@*": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-10.0.0.tgz#1e01e5ad83e224f110cc59f6f57c56558f7eeb61" + version "10.0.1" + resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-10.0.1.tgz#266679017749041fe9873fee1131dd2aaa04a07e" "@types/connect@*": version "3.4.32" @@ -162,17 +164,9 @@ dependencies: "@types/node" "*" -"@types/glob@*": - version "5.0.35" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a" - dependencies: - "@types/events" "*" - "@types/minimatch" "*" - "@types/node" "*" - "@types/hapi@^17.0.12": - version "17.0.12" - resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.12.tgz#5751f4d8db4decb4eae6671a4efbeae671278ceb" + version "17.0.17" + resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.17.tgz#376b823c09d9f3537d3b4eb80f1fe30deffae8a0" dependencies: "@types/boom" "*" "@types/catbox" "*" @@ -194,8 +188,8 @@ resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.7.tgz#3fe583928ae0a22cdd34cedf930eeffeda2602fd" "@types/joi@*": - version "13.0.8" - resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.0.8.tgz#224d5da224036f0c15b35e6980ba9de63b8ea374" + version "13.4.2" + resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.4.2.tgz#d91b07bb52393bfdc38901f313f6bc96ce40f623" "@types/mime-db@*": version "1.27.0" @@ -211,10 +205,6 @@ dependencies: "@types/mime-db" "*" -"@types/minimatch@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" - "@types/node@*": version "10.1.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.2.tgz#1b928a0baa408fc8ae3ac012cc81375addc147c6" @@ -243,9 +233,9 @@ version "1.2.2" resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.2.tgz#fa8e1ad1d474688a757140c91de6dace6f4abc8d" -"@types/selenium-webdriver@^2.53.35", "@types/selenium-webdriver@~2.53.39": - version "2.53.43" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-2.53.43.tgz#2de3d718819bc20165754c4a59afb7e9833f6707" +"@types/selenium-webdriver@^3.0.0": + version "3.0.10" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-3.0.10.tgz#e98cc6f05b4b436277671c784ee2f9d05a634f9b" "@types/serve-static@*": version "1.13.2" @@ -254,13 +244,6 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" -"@types/shelljs@0.7.7": - version "0.7.7" - resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.7.tgz#1f7bfa28947661afea06365db9b1135bbc903ec4" - dependencies: - "@types/glob" "*" - "@types/node" "*" - "@types/shot@*": version "3.4.0" resolved "https://registry.yarnpkg.com/@types/shot/-/shot-3.4.0.tgz#459477c5187d3ebd303660ab099e7e9e0f3b656f" @@ -308,11 +291,7 @@ addressparser@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" -adm-zip@0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.4.tgz#a61ed5ae6905c3aea58b3a657d25033091052736" - -adm-zip@^0.4.7: +adm-zip@^0.4.9: version "0.4.11" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" @@ -320,13 +299,13 @@ after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" +agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" dependencies: es6-promisify "^5.0.0" -ajv@^5.1.0: +ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -524,8 +503,10 @@ asn1.js@^4.0.0: minimalistic-assert "^1.0.0" asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" @@ -583,9 +564,9 @@ aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" -aws4@^1.2.1, aws4@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" +aws4@^1.2.1, aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" axios@^0.15.3: version "0.15.3" @@ -638,8 +619,8 @@ base@^0.11.1: pascalcase "^0.1.1" bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" dependencies: tweetnacl "^0.14.3" @@ -777,8 +758,8 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" browser-resolve@^1.11.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" dependencies: resolve "1.1.7" @@ -802,12 +783,13 @@ browserify-cipher@^1.0.0: evp_bytestokey "^1.0.0" browserify-des@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.1.tgz#3343124db6d7ad53e26a8826318712bdc8450f9c" + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" dependencies: cipher-base "^1.0.1" des.js "^1.0.0" inherits "^2.0.1" + safe-buffer "^5.1.2" browserify-rsa@^4.0.0: version "4.0.1" @@ -834,13 +816,34 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" +browserstack@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.5.1.tgz#e2dfa66ffee940ebad0a07f7e00fd4687c455d66" + dependencies: + https-proxy-agent "^2.2.1" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + buffer-crc32@^0.2.5: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + buffer-from@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" buffer-more-ints@0.0.2: version "0.0.2" @@ -851,8 +854,8 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" buffer@^5.0.6: - version "5.1.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe" + version "5.2.0" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.0.tgz#53cf98241100099e9eeae20ee6d51d21b16e541e" dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -985,7 +988,7 @@ chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.3.0, chalk@^2.3.2: +chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -993,7 +996,7 @@ chalk@^2.0.0, chalk@^2.3.0, chalk@^2.3.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chokidar@^1.4.1, chokidar@^1.4.2: +chokidar@^1.4.2: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: @@ -1039,8 +1042,8 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: safe-buffer "^5.0.1" circular-json@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.4.tgz#ff1ad2f2e392eeb8a5172d4d985fa846ed8ad656" + version "0.5.5" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.5.tgz#64182ef359042d37cd8e767fc9de878b1e9447d3" class-utils@^0.3.5: version "0.3.6" @@ -1095,14 +1098,14 @@ collection-visit@^1.0.0: object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" dependencies: - color-name "^1.1.1" + color-name "1.1.1" -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" colors@^1.1.0: version "1.2.5" @@ -1127,15 +1130,19 @@ combine-source-map@^0.8.0: lodash.memoize "~3.0.3" source-map "~0.5.3" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: delayed-stream "~1.0.0" -commander@^2.12.1, commander@^2.9.0, commander@~2.15.0: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" +commander@^2.12.1, commander@^2.9.0: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + +commander@~2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" compare-func@^1.3.1: version "1.3.2" @@ -1421,8 +1428,8 @@ cryptiles@2.x.x: boom "2.x.x" cryptiles@4.x.x: - version "4.1.1" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.1.tgz#169256b9df9fe3c73f8085c99e30b32247d4ab46" + version "4.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.2.tgz#363c9ab5c859da9d2d6fb901b64d980966181184" dependencies: boom "7.x.x" @@ -1518,6 +1525,12 @@ decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +decamelize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" + dependencies: + xregexp "4.0.0" + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -1640,8 +1653,8 @@ domain-browser@^1.1.7: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" domino@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/domino/-/domino-2.0.2.tgz#fa2da6ace8381cf64089079470ee33c53901010f" + version "2.1.0" + resolved "https://registry.yarnpkg.com/domino/-/domino-2.1.0.tgz#653ba7d331441113b42e40ba05f24253ec86e02e" dot-prop@^3.0.0: version "3.0.0" @@ -1661,18 +1674,19 @@ double-ended-queue@^2.1.0-0: resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" dependencies: jsbn "~0.1.0" + safer-buffer "^2.1.0" ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + version "6.4.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -1730,8 +1744,8 @@ ent@~2.2.0: resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" dependencies: is-arrayish "^0.2.1" @@ -1773,8 +1787,8 @@ escodegen@1.8.x: source-map "~0.2.0" escodegen@1.x.x: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -1792,8 +1806,8 @@ esprima@3.x.x, esprima@^3.1.3: resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" estraverse@^1.9.1: version "1.9.3" @@ -1939,9 +1953,9 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" extglob@^0.3.1: version "0.3.2" @@ -2053,6 +2067,12 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + follow-redirects@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" @@ -2060,8 +2080,8 @@ follow-redirects@1.0.0: debug "^2.2.0" follow-redirects@^1.0.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.0.tgz#234f49cf770b7f35b40e790f636ceba0c3a0ab77" + version "1.5.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.5.tgz#3c143ca599a2e22e62876687d68b23d55bad788b" dependencies: debug "^3.1.0" @@ -2087,7 +2107,7 @@ form-data@~2.0.0: combined-stream "^1.0.5" mime-types "^2.1.11" -form-data@~2.3.0, form-data@~2.3.1: +form-data@~2.3.0, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -2171,8 +2191,8 @@ generate-object-property@^1.1.0: is-property "^1.0.0" get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" get-pkg-repo@^1.0.0: version "1.4.0" @@ -2273,7 +2293,7 @@ glob@^5.0.10, glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: +glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -2310,8 +2330,8 @@ handlebars@^4.0.1, handlebars@^4.0.2: uglify-js "^2.6" hapi@^17.5.1: - version "17.5.1" - resolved "https://registry.yarnpkg.com/hapi/-/hapi-17.5.1.tgz#0e6ca5d3d908c4c96203221c9c246e23fce4b49b" + version "17.5.3" + resolved "https://registry.yarnpkg.com/hapi/-/hapi-17.5.3.tgz#60266ca072d69620b5b135c0c98a17228c3bf34d" dependencies: accept "3.x.x" ammo "3.x.x" @@ -2344,11 +2364,11 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" +har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" dependencies: - ajv "^5.1.0" + ajv "^5.3.0" har-schema "^2.0.0" has-ansi@^2.0.0: @@ -2414,11 +2434,11 @@ hash-base@^3.0.0: safe-buffer "^5.0.1" hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + version "1.1.5" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.5.tgz#e38ab4b85dfb1e0c40fe9265c0e9b54854c23812" dependencies: inherits "^2.0.3" - minimalistic-assert "^1.0.0" + minimalistic-assert "^1.0.1" hawk@~3.1.3: version "3.1.3" @@ -2457,8 +2477,8 @@ hoek@2.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" hoek@5.x.x: - version "5.0.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac" + version "5.0.4" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.4.tgz#0f7fa270a1cafeb364a4b2ddfaa33f864e4157da" homedir-polyfill@^1.0.1: version "1.0.1" @@ -2467,8 +2487,8 @@ homedir-polyfill@^1.0.1: parse-passwd "^1.0.0" hosted-git-info@^2.1.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" http-errors@1.6.2: version "1.6.2" @@ -2556,8 +2576,8 @@ iconv-lite@0.4.23, iconv-lite@^0.4.4: safer-buffer ">= 2.1.2 < 3" ieee754@^1.1.4: - version "1.1.11" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455" + version "1.1.12" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" ignore-walk@^3.0.1: version "3.0.1" @@ -2616,10 +2636,6 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" @@ -2628,9 +2644,9 @@ ip@^1.1.2, ip@^1.1.4, ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" -ipaddr.js@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b" +ipaddr.js@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e" iron@5.x.x: version "5.0.4" @@ -2771,8 +2787,8 @@ is-my-ip-valid@^1.0.0: resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" is-my-json-valid@^2.12.4: - version "2.17.2" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c" + version "2.19.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz#8fd6e40363cd06b963fa877d444bfb5eddc62175" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -2881,12 +2897,14 @@ isarray@2.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" isbinaryfile@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621" + version "3.0.3" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" + dependencies: + buffer-alloc "^1.2.0" isemail@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.2.tgz#937cf919002077999a73ea8b1951d590e84e01dd" + version "3.1.3" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.3.tgz#64f37fc113579ea12523165c3ebe3a71a56ce571" dependencies: punycode "2.x.x" @@ -2935,6 +2953,12 @@ jasmine-core@~2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" +jasmine-diff@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8" + dependencies: + diff "^3.2.0" + jasmine@2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" @@ -2948,8 +2972,8 @@ jasminewd2@^2.1.0: resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e" joi@13.x.x: - version "13.4.0" - resolved "https://registry.yarnpkg.com/joi/-/joi-13.4.0.tgz#afc359ee3d8bc5f9b9ba6cdc31b46d44af14cecc" + version "13.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-13.6.0.tgz#877d820e3ad688a49c32421ffefc746bfbe2d0a0" dependencies: hoek "5.x.x" isemail "3.x.x" @@ -3047,8 +3071,8 @@ karma-sourcemap-loader@^0.3.7: graceful-fs "^4.1.2" karma-typescript@^3.0.12: - version "3.0.12" - resolved "https://registry.yarnpkg.com/karma-typescript/-/karma-typescript-3.0.12.tgz#aa2cbdd111442a09c6dbcbaaeaf48499654c6913" + version "3.0.13" + resolved "https://registry.yarnpkg.com/karma-typescript/-/karma-typescript-3.0.13.tgz#8948afbd103ac1987a5961a0f43a1ba2871067cd" dependencies: acorn "^4.0.4" assert "^1.4.1" @@ -3092,12 +3116,12 @@ karma-typescript@^3.0.12: vm-browserify "0.0.4" karma@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.2.tgz#4d2db9402850a66551fa784b0164fb0824ed8c4b" + version "2.0.5" + resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.5.tgz#3710c7a2e71b1c439313f283846d88e04e4f918c" dependencies: bluebird "^3.3.0" body-parser "^1.16.1" - chokidar "^1.4.1" + chokidar "^2.0.3" colors "^1.1.0" combine-lists "^1.0.0" connect "^3.6.0" @@ -3110,7 +3134,7 @@ karma@^2.0.0: http-proxy "^1.13.0" isbinaryfile "^3.0.0" lodash "^4.17.4" - log4js "^2.3.9" + log4js "^2.5.3" mime "^1.3.4" minimatch "^3.0.2" optimist "^0.6.1" @@ -3221,6 +3245,13 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -3325,8 +3356,8 @@ mailcomposer@4.0.1: libmime "3.0.0" mailgun-js@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.0.tgz#81fed0c66a411d3ff6c4354861ad21387afcfaaa" + version "0.18.1" + resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.1.tgz#ee39aa18d7bb598a5ce9ede84afb681defc8a6b0" dependencies: async "~2.6.0" debug "~3.1.0" @@ -3461,19 +3492,15 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.x.x: - version "1.34.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.34.0.tgz#452d0ecff5c30346a6dc1e64b1eaee0d3719ff9a" - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" +mime-db@1.x.x, mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" +mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" dependencies: - mime-db "~1.33.0" + mime-db "~1.35.0" mime@1.4.1: version "1.4.1" @@ -3494,7 +3521,7 @@ mimos@4.x.x: hoek "5.x.x" mime-db "1.x.x" -minimalistic-assert@^1.0.0: +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -3581,9 +3608,9 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -needle@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" +needle@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.2.tgz#1120ca4c41f2fcc6976fd28a8968afe239929418" dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -3605,16 +3632,16 @@ nigel@3.x.x: vise "3.x.x" node-pre-gyp@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" - needle "^2.2.0" + needle "^2.2.1" nopt "^4.0.1" npm-packlist "^1.1.6" npmlog "^4.0.2" - rc "^1.1.7" + rc "^1.2.7" rimraf "^2.6.1" semver "^5.3.0" tar "^4" @@ -3701,12 +3728,12 @@ normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: remove-trailing-separator "^1.0.1" npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" npm-packlist@^1.1.6: - version "1.1.10" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + version "1.1.11" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -3734,10 +3761,14 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1, oauth-sign@~0.8.2: +oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3803,10 +3834,6 @@ optionator@^0.8.1: type-check "~0.3.2" wordwrap "~1.0.0" -options@>=0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" - optjs@~3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" @@ -3854,16 +3881,32 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" +p-limit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + dependencies: + p-try "^2.0.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" dependencies: p-limit "^1.1.0" +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" +p-try@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + pac-proxy-agent@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-2.0.2.tgz#90d9f6730ab0f4d2607dcdcd4d3d641aa26c3896" @@ -3988,8 +4031,8 @@ path-key@^2.0.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" path-proxy@~1.0.0: version "1.0.0" @@ -4120,13 +4163,14 @@ protobufjs@5.0.0: yargs "^3.10.0" protractor@^5.2.0: - version "5.3.2" - resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.3.2.tgz#b8278f3131d9d52fa1172ed0f7fec03085fbe0ce" + version "5.4.0" + resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.0.tgz#e71c9c1f5cf6c5e9bdbcdb71e7f31b17ffd2878f" dependencies: "@types/node" "^6.0.46" "@types/q" "^0.0.32" - "@types/selenium-webdriver" "~2.53.39" + "@types/selenium-webdriver" "^3.0.0" blocking-proxy "^1.0.0" + browserstack "^1.5.1" chalk "^1.1.3" glob "^7.0.3" jasmine "2.8.0" @@ -4136,19 +4180,19 @@ protractor@^5.2.0: saucelabs "^1.5.0" selenium-webdriver "3.6.0" source-map-support "~0.4.0" - webdriver-js-extender "^1.0.0" + webdriver-js-extender "2.0.0" webdriver-manager "^12.0.6" proxy-addr@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" + version "2.0.4" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" dependencies: forwarded "~0.1.2" - ipaddr.js "1.6.0" + ipaddr.js "1.8.0" proxy-agent@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.0.tgz#f6768e202889b2285d39906d3a94768416f8f713" + version "3.0.1" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.1.tgz#4fb7b61b1476d0fe8e3a3384d90e2460bbded3f9" dependencies: agent-base "^4.2.0" debug "^3.1.0" @@ -4157,7 +4201,7 @@ proxy-agent@~3.0.0: lru-cache "^4.1.2" pac-proxy-agent "^2.0.1" proxy-from-env "^1.0.0" - socks-proxy-agent "^3.0.0" + socks-proxy-agent "^4.0.1" proxy-from-env@^1.0.0: version "1.0.0" @@ -4167,6 +4211,10 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + public-encrypt@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" @@ -4205,7 +4253,7 @@ qs@6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -qs@6.5.2, qs@~6.5.1: +qs@6.5.2, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -4226,8 +4274,8 @@ quick-lru@^1.0.0: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" randomatic@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + version "3.1.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -4363,12 +4411,6 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -4450,12 +4492,12 @@ repeating@^2.0.0: is-finite "^1.0.0" replace-in-file@^3.1.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-3.4.0.tgz#b48c94567bbf4f44a2bc6fabdf21ab443e806851" + version "3.4.2" + resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-3.4.2.tgz#6d40f076ac86948e28efeb6fab73fbad5c0bfa2a" dependencies: - chalk "^2.3.2" + chalk "^2.4.1" glob "^7.1.2" - yargs "^11.0.0" + yargs "^12.0.1" request@2.75.x: version "2.75.0" @@ -4488,10 +4530,10 @@ request@^2.0.0, request@^2.74.0, request@^2.78.0: resolved "https://registry.yarnpkg.com/request/-/request-2.86.0.tgz#2b9497f449b0a32654c081a5cf426bbfb5bf5b69" dependencies: aws-sign2 "~0.7.0" - aws4 "^1.6.0" + aws4 "^1.8.0" caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" + combined-stream "~1.0.6" + extend "~3.0.2" forever-agent "~0.6.1" form-data "~2.3.1" har-validator "~5.0.3" @@ -4500,14 +4542,14 @@ request@^2.0.0, request@^2.74.0, request@^2.78.0: is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" + mime-types "~2.1.19" + oauth-sign "~0.9.0" performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - tough-cookie "~2.3.3" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" tunnel-agent "^0.6.0" - uuid "^3.1.0" + uuid "^3.3.2" requestretry@^1.2.2: version "1.13.0" @@ -4539,8 +4581,8 @@ resolve@1.1.7, resolve@1.1.x: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" resolve@^1.1.6, resolve@^1.3.2, resolve@^1.4.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" dependencies: path-parse "^1.0.5" @@ -4615,18 +4657,12 @@ rollup@^0.56.5: version "0.56.5" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.56.5.tgz#40fe3cf0cd1659d469baad11f4d5b6336c14ce84" -rxjs@^6.0.0: +rxjs@^6.0.0, rxjs@^6.2.0: version "6.2.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" dependencies: tslib "^1.9.0" -rxjs@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.0.tgz#e024d0e180b72756a83c2aaea8f25423751ba978" - dependencies: - tslib "^1.9.0" - safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -4641,7 +4677,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -4660,15 +4696,11 @@ saucelabs@^1.5.0: dependencies: https-proxy-agent "^2.2.1" -sax@0.6.x: - version "0.6.1" - resolved "https://registry.yarnpkg.com/sax/-/sax-0.6.1.tgz#563b19c7c1de892e09bfc4f2fc30e3c27f0952b9" - sax@>=0.6.0, sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -selenium-webdriver@3.6.0: +selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: version "3.6.0" resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz#2ba87a1662c020b8988c981ae62cb2a01298eafc" dependencies: @@ -4677,16 +4709,6 @@ selenium-webdriver@3.6.0: tmp "0.0.30" xml2js "^0.4.17" -selenium-webdriver@^2.53.2: - version "2.53.3" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-2.53.3.tgz#d29ff5a957dff1a1b49dc457756e4e4bfbdce085" - dependencies: - adm-zip "0.4.4" - rimraf "^2.2.8" - tmp "0.0.24" - ws "^1.0.1" - xml2js "0.4.4" - "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -4773,14 +4795,6 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shelljs@0.7.8: - version "0.7.8" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - shot@4.x.x: version "4.0.5" resolved "https://registry.yarnpkg.com/shot/-/shot-4.0.5.tgz#c7e7455d11d60f6b6cd3c43e15a3b431c17e5566" @@ -4806,6 +4820,10 @@ smart-buffer@^1.0.13, smart-buffer@^1.0.4: version "1.1.15" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" +smart-buffer@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + smtp-connection@2.12.0: version "2.12.0" resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" @@ -4894,6 +4912,13 @@ socks-proxy-agent@^3.0.0: agent-base "^4.1.0" socks "^1.1.10" +socks-proxy-agent@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + dependencies: + agent-base "~4.2.0" + socks "~2.2.0" + socks@1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" @@ -4908,6 +4933,13 @@ socks@^1.1.10: ip "^1.1.4" smart-buffer "^1.0.13" +socks@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" + dependencies: + ip "^1.1.5" + smart-buffer "^4.0.1" + sorcery@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" @@ -4927,15 +4959,15 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.0, source-map-support@~0.4.0: +source-map-support@^0.4.0, source-map-support@^0.4.2, source-map-support@~0.4.0: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: source-map "^0.5.6" source-map-support@^0.5.0: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" + version "0.5.8" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.8.tgz#04f5581713a8a65612d0175fbf3a01f80a162613" dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -5258,10 +5290,6 @@ timespan@2.3.x: version "2.3.0" resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" -tmp@0.0.24: - version "0.0.24" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.24.tgz#d6a5e198d14a9835cc6f2d7c3d9e302428c8cf12" - tmp@0.0.29: version "0.0.29" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.29.tgz#f25125ff0dd9da3ccb0c2dd371ee1288bb9128c0" @@ -5316,12 +5344,19 @@ topo@3.x.x: dependencies: hoek "5.x.x" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: +tough-cookie@~2.3.0: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -5364,10 +5399,20 @@ tsconfig@^6.0.0: strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tsickle@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.29.0.tgz#812806554bb46c1aa16eb0fe2a051da95ca8f5a4" +tsickle@0.25.x: + version "0.25.6" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.25.6.tgz#b595db16b236721824eeeda8bb262365b47ef334" dependencies: + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map "^0.5.6" + source-map-support "^0.4.2" + +tsickle@^0.32.1: + version "0.32.1" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5" + dependencies: + jasmine-diff "^0.1.3" minimist "^1.2.0" mkdirp "^0.5.1" source-map "^0.6.0" @@ -5378,8 +5423,8 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7" tslint@^5.9.1: - version "5.10.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.10.0.tgz#11e26bccb88afa02dd0d9956cae3d4540b5f54c3" + version "5.11.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed" dependencies: babel-code-frame "^6.22.0" builtin-modules "^1.1.1" @@ -5392,15 +5437,21 @@ tslint@^5.9.1: resolve "^1.3.2" semver "^5.3.0" tslib "^1.8.0" - tsutils "^2.12.1" + tsutils "^2.27.2" tsscmp@~1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97" + version "1.0.6" + resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" + +tsutils@2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" + dependencies: + tslib "^1.8.1" -tsutils@^2.12.1, tsutils@^2.21.2: - version "2.27.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.1.tgz#ab0276ac23664f36ce8fd4414daec4aebf4373ee" +tsutils@^2.21.2, tsutils@^2.27.2: + version "2.29.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" dependencies: tslib "^1.8.1" @@ -5460,17 +5511,13 @@ uglify-js@^3.0.9: version "3.3.25" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.25.tgz#3266ccb87c5bea229f69041a0296010d6477d539" dependencies: - commander "~2.15.0" + commander "~2.16.0" source-map "~0.6.1" uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -ultron@1.0.x: - version "1.0.2" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" - ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" @@ -5489,8 +5536,8 @@ union-value@^1.0.0: set-value "^0.4.3" universalify@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" @@ -5555,9 +5602,9 @@ utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" -uuid@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" uws@~9.14.0: version "9.14.0" @@ -5570,8 +5617,8 @@ v8flags@^3.0.0: homedir-polyfill "^1.0.1" validate-npm-package-license@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -5614,25 +5661,25 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -webdriver-js-extender@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz#81c533a9e33d5bfb597b4e63e2cdb25b54777515" +webdriver-js-extender@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-2.0.0.tgz#b27fc1ed1afbf78f0ac57e4c878f31b10e57f146" dependencies: - "@types/selenium-webdriver" "^2.53.35" - selenium-webdriver "^2.53.2" + "@types/selenium-webdriver" "^3.0.0" + selenium-webdriver "^3.0.1" webdriver-manager@^12.0.6: - version "12.0.6" - resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.0.6.tgz#3df1a481977010b4cbf8c9d85c7a577828c0e70b" + version "12.1.0" + resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.0.tgz#f6601e52de5f0c97fc7024c889eeb2416f2f1d9d" dependencies: - adm-zip "^0.4.7" + adm-zip "^0.4.9" chalk "^1.1.1" del "^2.2.0" glob "^7.0.3" ini "^1.3.4" minimist "^1.2.0" q "^1.4.1" - request "^2.78.0" + request "^2.87.0" rimraf "^2.5.2" semver "^5.3.0" xml2js "^0.4.17" @@ -5699,13 +5746,6 @@ wreck@14.x.x: boom "7.x.x" hoek "5.x.x" -ws@^1.0.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51" - dependencies: - options ">=0.0.5" - ultron "1.0.x" - ws@~3.3.1: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -5718,13 +5758,6 @@ xhr2@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" -xml2js@0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.4.tgz#3111010003008ae19240eba17497b57c729c555d" - dependencies: - sax "0.6.x" - xmlbuilder ">=1.0.0" - xml2js@^0.4.17: version "0.4.19" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" @@ -5732,10 +5765,6 @@ xml2js@^0.4.17: sax ">=0.6.0" xmlbuilder "~9.0.1" -xmlbuilder@>=1.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.0.0.tgz#c64e52f8ae097fe5fd46d1c38adaade071ee1b55" - xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" @@ -5748,6 +5777,10 @@ xregexp@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" +xregexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -5756,6 +5789,10 @@ y18n@^3.2.0, y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -5764,25 +5801,25 @@ yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" -yargs-parser@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" +yargs-parser@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" dependencies: camelcase "^4.1.0" -yargs-parser@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" dependencies: camelcase "^4.1.0" -yargs@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b" +yargs@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.1.tgz#6432e56123bb4e7c3562115401e98374060261c2" dependencies: cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" + decamelize "^2.0.0" + find-up "^3.0.0" get-caller-file "^1.0.1" os-locale "^2.0.0" require-directory "^2.1.1" @@ -5790,8 +5827,8 @@ yargs@^11.0.0: set-blocking "^2.0.0" string-width "^2.0.0" which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^9.0.2" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^10.1.0" yargs@^3.10.0: version "3.32.0" From 362c6ed3673cd1a4b298825005cb721eac601db9 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 11:12:15 -0500 Subject: [PATCH 05/13] fixup! feat(express-engine): add schematics --- BUILD.bazel | 4 + modules/express-engine/BUILD.bazel | 1 + modules/express-engine/schematics/BUILD.bazel | 42 +++ package.json | 24 +- tools/defaults.bzl | 8 + yarn.lock | 280 +++++++++++------- 6 files changed, 248 insertions(+), 111 deletions(-) create mode 100644 modules/express-engine/schematics/BUILD.bazel diff --git a/BUILD.bazel b/BUILD.bazel index d5da6326f..76ff5c9f1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,6 +14,10 @@ alias( node_modules_filegroup( name = "node_modules", packages = [ + "@angular-devkit", + "@schematics", + "bytebuffer", + "protobufjs", "express", "hapi", "jasmine", diff --git a/modules/express-engine/BUILD.bazel b/modules/express-engine/BUILD.bazel index 04b14891c..70c74f136 100644 --- a/modules/express-engine/BUILD.bazel +++ b/modules/express-engine/BUILD.bazel @@ -26,6 +26,7 @@ ng_package( ":express-engine", "//modules/express-engine/tokens", ], + packages = ["//modules/express-engine/schematics:npm_package"], ) ts_library( diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel new file mode 100644 index 000000000..09c3e6976 --- /dev/null +++ b/modules/express-engine/schematics/BUILD.bazel @@ -0,0 +1,42 @@ +package(default_visibility = ["//visibility:public"]) + +load("//tools:defaults.bzl", "ts_library", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") + +filegroup( + name = "schematics_assets", + srcs = glob(["**/files/**/*"]) + ["README.md", "collection.json"], +) + +ts_library( + name = "schematics", + module_name = "@nguniversal/express-engine/schematics", + srcs = glob(["**/*.ts"], exclude=[ + "**/*.spec.ts", + "**/files/**/*", + ]), + tsconfig = ":tsconfig.json", +) + +# This package is intended to be combined into the main @nguniversal/express-engine package as a dep. +npm_package( + name = "npm_package", + srcs = [":schematics_assets"], + deps = [":schematics"], +) + +### Testing rules + +jasmine_node_test( + name = "unit_tests", + srcs = [":schematics_test_sources"], + data = [":schematics_assets"], +) + +ts_library( + name = "schematics_test_sources", + srcs = glob(["**/*.spec.ts"], exclude=["**/files/**/*"]), + deps = [":schematics"], + tsconfig = ":tsconfig.json", + testonly = True, +) diff --git a/package.json b/package.json index 81f935465..98414af3f 100644 --- a/package.json +++ b/package.json @@ -74,18 +74,18 @@ "devDependencies": { "@angular-devkit/core": "^0.7.3", "@angular-devkit/schematics": "^0.7.3", - "@angular/animations": "^6.0.4", - "@angular/bazel": "^6.0.4", - "@angular/common": "^6.0.4", - "@angular/compiler": "^6.0.4", - "@angular/compiler-cli": "^6.0.4", - "@angular/core": "^6.0.4", - "@angular/http": "^6.0.4", - "@angular/platform-browser": "^6.0.4", - "@angular/platform-browser-dynamic": "^6.0.4", - "@angular/platform-server": "^6.0.4", - "@angular/router": "^6.0.4", - "@angular/upgrade": "^6.0.4", + "@angular/animations": "6.0.0", + "@angular/bazel": "6.0.0", + "@angular/common": "6.0.0", + "@angular/compiler": "6.0.0", + "@angular/compiler-cli": "6.0.0", + "@angular/core": "6.0.0", + "@angular/http": "6.0.0", + "@angular/platform-browser": "6.0.0", + "@angular/platform-browser-dynamic": "6.0.0", + "@angular/platform-server": "6.0.0", + "@angular/router": "6.0.0", + "@angular/upgrade": "6.0.0", "@bazel/ibazel": "^0.3.1", "@schematics/angular": "^0.7.3", "@types/express": "^4.0.39", diff --git a/tools/defaults.bzl b/tools/defaults.bzl index a4ce1c219..6e965aa12 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -2,6 +2,7 @@ load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library") load("@angular//:index.bzl", _ng_module = "ng_module") load("@angular//:index.bzl", _ng_package = "ng_package") +load("@build_bazel_rules_nodejs//:defs.bzl", _npm_package = "npm_package") DEFAULT_TS_CONFIG = "//:tsconfig.json" DEFAULT_NODE_MODULES = "//:node_modules" @@ -72,3 +73,10 @@ def ng_package(globals = {}, **kwargs): globals = dict(globals, **GLOBALS) _ng_package(globals = globals, replacements=PKG_GROUP_REPLACEMENTS, **kwargs) + +def npm_package(name, replacements = {}, **kwargs): + _npm_package( + name = name, + replacements = dict(replacements, **PKG_GROUP_REPLACEMENTS), + **kwargs + ) diff --git a/yarn.lock b/yarn.lock index 35d47190f..e54d758a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,82 +18,84 @@ "@angular-devkit/core" "0.7.3" rxjs "^6.0.0" -"@angular/animations@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.1.2.tgz#31070ac85bca47e3feab887fed8872c147fcf63e" +"@angular/animations@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.0.tgz#cfc825dbfdf33bf3bf75962d1e12495aed5e3c32" dependencies: tslib "^1.9.0" -"@angular/bazel@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.1.2.tgz#ebfa8c1948f25ce95b288f5eebd3c0290852e616" +"@angular/bazel@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.0.0.tgz#e9050648fe2cd43533b15f4cb0060cd64cf79bbe" dependencies: - "@bazel/typescript" "^0.15.0" + "@bazel/typescript" "^0.11.1" "@types/node" "6.0.84" + "@types/shelljs" "0.7.7" protobufjs "5.0.0" + shelljs "0.7.8" -"@angular/common@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.1.2.tgz#6e3bd4b16975dbb4ba67e2fc7589d0a036e5df12" +"@angular/common@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.0.tgz#ca3b6b6b96837fe048861da897c31991aa04954f" dependencies: tslib "^1.9.0" -"@angular/compiler-cli@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.1.2.tgz#00829df848210a8a06c3641428f36525fdf41e53" +"@angular/compiler-cli@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.0.tgz#be50277faaa5ac08f3002c2c8cb8c39d220c76d5" dependencies: chokidar "^1.4.2" minimist "^1.2.0" reflect-metadata "^0.1.2" - tsickle "^0.32.1" + tsickle "^0.27.2" -"@angular/compiler@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.1.2.tgz#56fada04cb7dc77a5d3f0b786be713130293d468" +"@angular/compiler@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.0.tgz#9092a0f02f33dd1108276ab93cc48142e36a1e95" dependencies: tslib "^1.9.0" -"@angular/core@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.1.2.tgz#412dd32a91ec1d5d6db508babbb36e9799235d8d" +"@angular/core@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.0.tgz#785cc8a37b7fb784a6b7dcbd0984abb4f10e5dfe" dependencies: tslib "^1.9.0" -"@angular/http@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.1.2.tgz#2e0e376686f4bf51ef043856b26679e88d7a92b9" +"@angular/http@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.0.tgz#f409e35cd2f4990b43a37beab915ffdcd9c7c992" dependencies: tslib "^1.9.0" -"@angular/platform-browser-dynamic@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.1.2.tgz#76d813e6ab577ce1ffdb31e88d37df9a5177f55c" +"@angular/platform-browser-dynamic@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.0.tgz#66a34b65136446cb3ec39362fd6d2dbb5482ba70" dependencies: tslib "^1.9.0" -"@angular/platform-browser@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.1.2.tgz#9a2a498e27e2bcd0fc8d6c696340c258f8b3e322" +"@angular/platform-browser@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.0.tgz#848b687ea46786483fddcdbbbd17b29c7adcc768" dependencies: tslib "^1.9.0" -"@angular/platform-server@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.1.2.tgz#f8954c5720169c4a2433cb73678c8a8709b12271" +"@angular/platform-server@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.0.0.tgz#482878cc538a80caa3962e9376e4225b20c2a4bd" dependencies: domino "^2.0.1" tslib "^1.9.0" xhr2 "^0.1.4" -"@angular/router@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.1.2.tgz#5e9e12225b41940fe346675caf1ed15033738abc" +"@angular/router@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.0.tgz#09a5c6f6220084c3575df81e8b36cbe9fff10d1f" dependencies: tslib "^1.9.0" -"@angular/upgrade@^6.0.4": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.1.2.tgz#0ad539347ae3028c39fd31a12c91b1feb7f11ae7" +"@angular/upgrade@6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.0.0.tgz#932e39709b17a455018c3dfe63a5b8e794027f05" dependencies: tslib "^1.9.0" @@ -101,13 +103,9 @@ version "0.3.1" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.3.1.tgz#5f02f208f138e581bbdb1534d5c013d7a0ac9799" -"@bazel/typescript@^0.15.0": - version "0.15.3" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.3.tgz#5c32b3bf664b268f9ffb634b86f40004a50e7ef9" - dependencies: - protobufjs "5.0.0" - tsickle "0.25.x" - tsutils "2.20.0" +"@bazel/typescript@^0.11.1": + version "0.11.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.11.1.tgz#54409d6ed1f43e71fce047fb4e229f9cc8a5ff68" "@schematics/angular@^0.7.3": version "0.7.3" @@ -164,6 +162,14 @@ dependencies: "@types/node" "*" +"@types/glob@*": + version "5.0.35" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a" + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + "@types/hapi@^17.0.12": version "17.0.17" resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.17.tgz#376b823c09d9f3537d3b4eb80f1fe30deffae8a0" @@ -205,6 +211,10 @@ dependencies: "@types/mime-db" "*" +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + "@types/node@*": version "10.1.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.2.tgz#1b928a0baa408fc8ae3ac012cc81375addc147c6" @@ -244,6 +254,13 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" +"@types/shelljs@0.7.7": + version "0.7.7" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.7.tgz#1f7bfa28947661afea06365db9b1135bbc903ec4" + dependencies: + "@types/glob" "*" + "@types/node" "*" + "@types/shot@*": version "3.4.0" resolved "https://registry.yarnpkg.com/@types/shot/-/shot-3.4.0.tgz#459477c5187d3ebd303660ab099e7e9e0f3b656f" @@ -305,7 +322,7 @@ agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: dependencies: es6-promisify "^5.0.0" -ajv@^5.3.0: +ajv@^5.1.0, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -564,7 +581,7 @@ aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" -aws4@^1.2.1, aws4@^1.8.0: +aws4@^1.2.1, aws4@^1.6.0, aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" @@ -704,6 +721,18 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + boom@7.x.x: version "7.2.0" resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.0.tgz#2bff24a55565767fde869ec808317eb10c48e966" @@ -1140,9 +1169,9 @@ commander@^2.12.1, commander@^2.9.0: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" -commander@~2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" +commander@~2.15.0: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" compare-func@^1.3.1: version "1.3.2" @@ -1427,6 +1456,12 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + cryptiles@4.x.x: version "4.1.2" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.2.tgz#363c9ab5c859da9d2d6fb901b64d980966181184" @@ -1535,9 +1570,9 @@ decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" -deep-extend@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.5.1.tgz#b894a9dd90d3023fbf1c55a394fb858eb2066f1f" +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" deep-is@~0.1.3: version "0.1.3" @@ -1953,7 +1988,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.2: +extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -2107,7 +2142,7 @@ form-data@~2.0.0: combined-stream "^1.0.5" mime-types "^2.1.11" -form-data@~2.3.0, form-data@~2.3.2: +form-data@~2.3.0, form-data@~2.3.1, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -2293,7 +2328,7 @@ glob@^5.0.10, glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -2364,6 +2399,13 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + har-validator@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" @@ -2449,6 +2491,15 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + heavy@6.x.x: version "6.1.0" resolved "https://registry.yarnpkg.com/heavy/-/heavy-6.1.0.tgz#1bbfa43dc61dd4b543ede3ff87db8306b7967274" @@ -2476,6 +2527,10 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hoek@4.x.x: + version "4.2.1" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" + hoek@5.x.x: version "5.0.4" resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.4.tgz#0f7fa270a1cafeb364a4b2ddfaa33f864e4157da" @@ -2636,6 +2691,10 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" +interpret@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" @@ -2953,12 +3012,6 @@ jasmine-core@~2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" -jasmine-diff@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8" - dependencies: - diff "^3.2.0" - jasmine@2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" @@ -3289,9 +3342,9 @@ log4js@^1.1.1: semver "^5.3.0" streamroller "^0.4.0" -log4js@^2.3.9: - version "2.6.1" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.6.1.tgz#497289259b5b941dd518f6ce219e6768aec87a96" +log4js@^2.5.3: + version "2.11.0" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.11.0.tgz#bf3902eff65c6923d9ce9cfbd2db54160e34005a" dependencies: circular-json "^0.5.4" date-format "^1.2.0" @@ -3496,7 +3549,7 @@ mime-db@1.x.x, mime-db@~1.35.0: version "1.35.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: +mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: version "2.1.19" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" dependencies: @@ -3761,7 +3814,7 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1: +oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -4253,7 +4306,7 @@ qs@6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -qs@6.5.2, qs@~6.5.2: +qs@6.5.2, qs@~6.5.1, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -4316,11 +4369,11 @@ raw-body@2.3.3, raw-body@^2.2.0: iconv-lite "0.4.23" unpipe "1.0.0" -rc@^1.1.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.7.tgz#8a10ca30d588d00464360372b890d06dacd02297" +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" dependencies: - deep-extend "^0.5.1" + deep-extend "^0.6.0" ini "~1.3.0" minimist "^1.2.0" strip-json-comments "~2.0.1" @@ -4411,6 +4464,12 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -4525,15 +4584,15 @@ request@2.75.x: tough-cookie "~2.3.0" tunnel-agent "~0.4.1" -request@^2.0.0, request@^2.74.0, request@^2.78.0: +request@^2.0.0, request@^2.74.0: version "2.86.0" resolved "https://registry.yarnpkg.com/request/-/request-2.86.0.tgz#2b9497f449b0a32654c081a5cf426bbfb5bf5b69" dependencies: aws-sign2 "~0.7.0" - aws4 "^1.8.0" + aws4 "^1.6.0" caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" + combined-stream "~1.0.5" + extend "~3.0.1" forever-agent "~0.6.1" form-data "~2.3.1" har-validator "~5.0.3" @@ -4542,6 +4601,31 @@ request@^2.0.0, request@^2.74.0, request@^2.78.0: is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" mime-types "~2.1.19" oauth-sign "~0.9.0" performance-now "^2.1.0" @@ -4795,6 +4879,14 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shelljs@0.7.8: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shot@4.x.x: version "4.0.5" resolved "https://registry.yarnpkg.com/shot/-/shot-4.0.5.tgz#c7e7455d11d60f6b6cd3c43e15a3b431c17e5566" @@ -4864,6 +4956,12 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + socket.io-adapter@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" @@ -4959,7 +5057,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.0, source-map-support@^0.4.2, source-map-support@~0.4.0: +source-map-support@^0.4.0, source-map-support@~0.4.0: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: @@ -5344,7 +5442,7 @@ topo@3.x.x: dependencies: hoek "5.x.x" -tough-cookie@~2.3.0: +tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: @@ -5399,20 +5497,10 @@ tsconfig@^6.0.0: strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tsickle@0.25.x: - version "0.25.6" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.25.6.tgz#b595db16b236721824eeeda8bb262365b47ef334" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.5.6" - source-map-support "^0.4.2" - -tsickle@^0.32.1: - version "0.32.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5" +tsickle@^0.27.2: + version "0.27.5" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.5.tgz#41e1a41a5acf971cbb2b0558a9590779234d591f" dependencies: - jasmine-diff "^0.1.3" minimist "^1.2.0" mkdirp "^0.5.1" source-map "^0.6.0" @@ -5443,12 +5531,6 @@ tsscmp@~1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" -tsutils@2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" - dependencies: - tslib "^1.8.1" - tsutils@^2.21.2, tsutils@^2.27.2: version "2.29.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" @@ -5511,7 +5593,7 @@ uglify-js@^3.0.9: version "3.3.25" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.25.tgz#3266ccb87c5bea229f69041a0296010d6477d539" dependencies: - commander "~2.16.0" + commander "~2.15.0" source-map "~0.6.1" uglify-to-browserify@~1.0.0: @@ -5602,7 +5684,7 @@ utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" -uuid@^3.3.2: +uuid@^3.1.0, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" From 99b5593d4d0cc9805997862513cb8083d8e3da31 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 11:14:10 -0500 Subject: [PATCH 06/13] fixup! feat(express-engine): add schematics --- BUILD.bazel | 6 +-- modules/express-engine/BUILD.bazel | 2 +- modules/express-engine/schematics/BUILD.bazel | 49 +++++++++++-------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 76ff5c9f1..b4a274664 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,13 +14,11 @@ alias( node_modules_filegroup( name = "node_modules", packages = [ - "@angular-devkit", - "@schematics", "bytebuffer", - "protobufjs", "express", "hapi", "jasmine", + "protobufjs", "rxjs", "tsickle", "tslib", @@ -28,6 +26,8 @@ node_modules_filegroup( "typescript", "zone.js", "@angular", + "@angular-devkit", + "@schematics", "@types", ], ) diff --git a/modules/express-engine/BUILD.bazel b/modules/express-engine/BUILD.bazel index 70c74f136..8bc473643 100644 --- a/modules/express-engine/BUILD.bazel +++ b/modules/express-engine/BUILD.bazel @@ -21,12 +21,12 @@ ng_package( ":package.json", ], entry_point = "modules/express-engine/index.js", + packages = ["//modules/express-engine/schematics:npm_package"], readme_md = ":README.md", deps = [ ":express-engine", "//modules/express-engine/tokens", ], - packages = ["//modules/express-engine/schematics:npm_package"], ) ts_library( diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel index 09c3e6976..cd8be5ba6 100644 --- a/modules/express-engine/schematics/BUILD.bazel +++ b/modules/express-engine/schematics/BUILD.bazel @@ -4,39 +4,48 @@ load("//tools:defaults.bzl", "ts_library", "npm_package") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") filegroup( - name = "schematics_assets", - srcs = glob(["**/files/**/*"]) + ["README.md", "collection.json"], + name = "schematics_assets", + srcs = glob(["**/files/**/*"]) + [ + "README.md", + "collection.json", + ], ) ts_library( - name = "schematics", - module_name = "@nguniversal/express-engine/schematics", - srcs = glob(["**/*.ts"], exclude=[ - "**/*.spec.ts", - "**/files/**/*", - ]), - tsconfig = ":tsconfig.json", + name = "schematics", + srcs = glob( + ["**/*.ts"], + exclude = [ + "**/*.spec.ts", + "**/files/**/*", + ], + ), + module_name = "@nguniversal/express-engine/schematics", + tsconfig = ":tsconfig.json", ) # This package is intended to be combined into the main @nguniversal/express-engine package as a dep. npm_package( - name = "npm_package", - srcs = [":schematics_assets"], - deps = [":schematics"], + name = "npm_package", + srcs = [":schematics_assets"], + deps = [":schematics"], ) ### Testing rules jasmine_node_test( - name = "unit_tests", - srcs = [":schematics_test_sources"], - data = [":schematics_assets"], + name = "unit_tests", + srcs = [":schematics_test_sources"], + data = [":schematics_assets"], ) ts_library( - name = "schematics_test_sources", - srcs = glob(["**/*.spec.ts"], exclude=["**/files/**/*"]), - deps = [":schematics"], - tsconfig = ":tsconfig.json", - testonly = True, + name = "schematics_test_sources", + testonly = True, + srcs = glob( + ["**/*.spec.ts"], + exclude = ["**/files/**/*"], + ), + tsconfig = ":tsconfig.json", + deps = [":schematics"], ) From 8e9fc1880dfc8758913b8bc3f2156429adfb113c Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 13:30:59 -0500 Subject: [PATCH 07/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/BUILD.bazel | 3 +-- .../install/files/root/webpack.server.config.js | 2 +- modules/express-engine/schematics/install/index.ts | 14 ++++---------- .../express-engine/schematics/install/schema.json | 2 +- modules/express-engine/version.ts | 12 ++++++++++++ package.json | 3 ++- tools/defaults.bzl | 4 ++-- 7 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 modules/express-engine/version.ts diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel index cd8be5ba6..fb2794483 100644 --- a/modules/express-engine/schematics/BUILD.bazel +++ b/modules/express-engine/schematics/BUILD.bazel @@ -5,9 +5,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") filegroup( name = "schematics_assets", - srcs = glob(["**/files/**/*"]) + [ + srcs = glob(["**/files/**/*", "**/*.json"]) + [ "README.md", - "collection.json", ], ) diff --git a/modules/express-engine/schematics/install/files/root/webpack.server.config.js b/modules/express-engine/schematics/install/files/root/webpack.server.config.js index a62a2c95c..5ebd04e04 100644 --- a/modules/express-engine/schematics/install/files/root/webpack.server.config.js +++ b/modules/express-engine/schematics/install/files/root/webpack.server.config.js @@ -7,7 +7,7 @@ module.exports = { mode: 'none', entry: { // This is our Express server for Dynamic universal - server: './<%= serverFileName %>.ts' + server: './<%= stripTsExtension(serverFileName) %>.ts' }, target: 'node', resolve: {extensions: ['.ts', '.js']}, diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts index 569096518..f40d5f551 100644 --- a/modules/express-engine/schematics/install/index.ts +++ b/modules/express-engine/schematics/install/index.ts @@ -61,12 +61,6 @@ function getClientArchitect( function addDependenciesAndScripts(options: UniversalOptions): Rule { return (host: Tree) => { - const workspace = getWorkspace(host); - if (!workspace.projects[options.clientProject]) { - throw new SchematicsException(`Client app ${options.clientProject} not found.`); - } - - const clientProject = workspace.projects[options.clientProject]; const pkgPath = '/package.json'; const buffer = host.read(pkgPath); if (buffer === null) { @@ -75,14 +69,14 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { const pkg = JSON.parse(buffer.toString()); - pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = 'TEMP'; - pkg.dependencies['@nguniversal/express-engine'] = 'TEMP'; - pkg.dependencies['express'] = 'TEMP'; + pkg.dependencies['@nguniversal/express-engine'] = '0.0.0-PLACEHOLDER'; + pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = '6.0.0' || '0.0.0-PLACEHOLDER'; + pkg.dependencies['express'] = 'EXPRESS_VERSION'; pkg.scripts['serve:ssr'] = 'node dist/server'; pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run webpack:server'; pkg.scripts['build:client-and-server-bundles'] = - `ng build --prod && ng run ${clientProject}:server:production`; + `ng build --prod && ng run ${options.clientProject}:server:production`; pkg.scripts['webpack:server'] = 'webpack --config webpack.server.config.js --progress --colors'; host.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); diff --git a/modules/express-engine/schematics/install/schema.json b/modules/express-engine/schematics/install/schema.json index 65804a475..945b18e89 100644 --- a/modules/express-engine/schematics/install/schema.json +++ b/modules/express-engine/schematics/install/schema.json @@ -34,7 +34,7 @@ "type": "number", "default": 4000, "description": "The port for the Express server." - } + }, "tsconfigFileName": { "type": "string", "default": "tsconfig.server", diff --git a/modules/express-engine/version.ts b/modules/express-engine/version.ts new file mode 100644 index 000000000..dfb0e53a4 --- /dev/null +++ b/modules/express-engine/version.ts @@ -0,0 +1,12 @@ +/** + * @license + * Copyright Google LLC 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 {Version} from '@angular/core'; + +/** Current version of Angular NgUniversal. */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/package.json b/package.json index 98414af3f..a63efd756 100644 --- a/package.json +++ b/package.json @@ -125,5 +125,6 @@ "typescript": "~2.7.2", "uglify-js": "^2.8.14", "zone.js": "^0.8.26" - } + }, + "dependencies": {} } diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 6e965aa12..7a83b8e0c 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -7,8 +7,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl", _npm_package = "npm_package") DEFAULT_TS_CONFIG = "//:tsconfig.json" DEFAULT_NODE_MODULES = "//:node_modules" -NG_VERSION = "^6.0.0-rc.0" -RXJS_VERSION = "^6.0.0-beta.0" +NG_VERSION = "^6.0.0" +RXJS_VERSION = "^6.0.0" HAPI_VERSION = "^17.0.0" EXPRESS_VERSION = "^4.15.2" From a7a96dc507aec8c1cc392e1e3c23f4bf20724ab5 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 13:33:02 -0500 Subject: [PATCH 08/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/BUILD.bazel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel index fb2794483..34c7d45e8 100644 --- a/modules/express-engine/schematics/BUILD.bazel +++ b/modules/express-engine/schematics/BUILD.bazel @@ -5,7 +5,10 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") filegroup( name = "schematics_assets", - srcs = glob(["**/files/**/*", "**/*.json"]) + [ + srcs = glob([ + "**/files/**/*", + "**/*.json", + ]) + [ "README.md", ], ) From 29cda31a09c958be63e0c1c82d33e1a06b6f9bae Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 13:57:44 -0500 Subject: [PATCH 09/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/BUILD.bazel | 10 +- .../schematics/install/index.spec.ts | 59 ++-------- .../schematics/test-setup/bazel-test-init.ts | 43 +++++++ .../test-setup/post-scheduled-tasks.ts | 41 +++++++ .../schematics/test-setup/test-app.ts | 27 +++++ package.json | 24 ++-- yarn.lock | 109 ++++++++++-------- 7 files changed, 203 insertions(+), 110 deletions(-) create mode 100644 modules/express-engine/schematics/test-setup/bazel-test-init.ts create mode 100644 modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts create mode 100644 modules/express-engine/schematics/test-setup/test-app.ts diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel index 34c7d45e8..c022d993d 100644 --- a/modules/express-engine/schematics/BUILD.bazel +++ b/modules/express-engine/schematics/BUILD.bazel @@ -20,6 +20,7 @@ ts_library( exclude = [ "**/*.spec.ts", "**/files/**/*", + "test-setup/**/*", ], ), module_name = "@nguniversal/express-engine/schematics", @@ -43,11 +44,8 @@ jasmine_node_test( ts_library( name = "schematics_test_sources", - testonly = True, - srcs = glob( - ["**/*.spec.ts"], - exclude = ["**/files/**/*"], - ), - tsconfig = ":tsconfig.json", + srcs = glob(["**/*.spec.ts", "test-setup/**/*.ts"], exclude=["**/files/**/*"]), deps = [":schematics"], + tsconfig = ":tsconfig.json", + testonly = True, ) diff --git a/modules/express-engine/schematics/install/index.spec.ts b/modules/express-engine/schematics/install/index.spec.ts index c2e0b8520..15e78a7ae 100644 --- a/modules/express-engine/schematics/install/index.spec.ts +++ b/modules/express-engine/schematics/install/index.spec.ts @@ -5,83 +5,48 @@ * 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 {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing'; -import * as path from 'path'; -import {Schema as ApplicationOptions} from '@schematics/angular/application/schema'; -import {Schema as WorkspaceOptions} from '@schematics/angular/workspace/schema'; +import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {Schema as UniversalOptions} from './schema'; +import {collectionPath, createTestApp} from '@nguniversal/express-engine/schematics/test-setup/test-app'; +import {Tree} from '@angular-devkit/schematics'; describe('Universal Schematic', () => { - const schematicRunner = new SchematicTestRunner( - '@schematics/angular', - path.join(__dirname, '../collection.json'), - ); const defaultOptions: UniversalOptions = { clientProject: 'bar', }; - // const workspaceUniversalOptions: UniversalOptions = { - // clientProject: 'workspace', - // }; - const workspaceOptions: WorkspaceOptions = { - name: 'workspace', - newProjectRoot: 'projects', - version: '6.0.0', - }; - - const appOptions: ApplicationOptions = { - name: 'bar', - inlineStyle: false, - inlineTemplate: false, - routing: false, - style: 'css', - skipTests: false, - skipPackageJson: false, - }; - - const initialWorkspaceAppOptions: ApplicationOptions = { - name: 'workspace', - projectRoot: '', - inlineStyle: false, - inlineTemplate: false, - routing: false, - style: 'css', - skipTests: false, - skipPackageJson: false, - }; - - let appTree: UnitTestTree; + let schematicRunner: SchematicTestRunner; + let appTree: Tree; beforeEach(() => { - appTree = schematicRunner.runSchematic('workspace', workspaceOptions); - appTree = schematicRunner.runSchematic('application', initialWorkspaceAppOptions, appTree); - appTree = schematicRunner.runSchematic('application', appOptions, appTree); + appTree = createTestApp(); + schematicRunner = new SchematicTestRunner('schematics', collectionPath); }); it('should add dependency: @nguniversal/module-map-ngfactory-loader', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const tree = schematicRunner.runSchematic('ng-add', defaultOptions, appTree); const filePath = '/package.json'; const contents = tree.readContent(filePath); expect(contents).toMatch(/\"@nguniversal\/module-map-ngfactory-loader\": \"/); }); it('should add dependency: @nguniversal/express-engine', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const tree = schematicRunner.runSchematic('ng-add', defaultOptions, appTree); const filePath = '/package.json'; const contents = tree.readContent(filePath); expect(contents).toMatch(/\"@nguniversal\/express-engine\": \"/); }); it('should add dependency: express', () => { - const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree); + const tree = schematicRunner.runSchematic('ng-add', defaultOptions, appTree); const filePath = '/package.json'; const contents = tree.readContent(filePath); expect(contents).toMatch(/\"express\": \"/); }); it('should install npm dependencies', () => { - schematicRunner.runSchematic('universal', defaultOptions, appTree); - expect(schematicRunner.tasks.length).toBe(1); + schematicRunner.runSchematic('ng-add', defaultOptions, appTree); + expect(schematicRunner.tasks.length).toBe(2); expect(schematicRunner.tasks[0].name).toBe('node-package'); expect((schematicRunner.tasks[0].options as {command: string}).command).toBe('install'); }); diff --git a/modules/express-engine/schematics/test-setup/bazel-test-init.ts b/modules/express-engine/schematics/test-setup/bazel-test-init.ts new file mode 100644 index 000000000..6b06ed23b --- /dev/null +++ b/modules/express-engine/schematics/test-setup/bazel-test-init.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright Google LLC 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 + */ + +/* + * NOTE: This file will run before the actual tests start inside of Bazel. + * + * It automatically runs before all spec files because the spec files are blocked + * until Jasmine runs the `describe` blocks. + * + * We copy all needed files into the proper Bazel bin output in order to be able to test + * the schematics. Workaround for: https://github.com/bazelbuild/rules_typescript/issues/154 + */ + +import {sync as globSync} from 'glob'; +import {dirname, join} from 'path'; +import {copySync} from 'fs-extra'; + +// Adding the test case files to the data of the `jasmine_node_test` Bazel rule does not mean +// that the files are being copied over to the Bazel bin output. Bazel just patches the NodeJS +// resolve function and maps the module paths to the original file location. Since we want to copy +// the files to the bazel test directory because TSLint and the schematic test runner expect a real +// file system, we need to resolve the original file path through a Bazel mapped file. +const sourceDirectory = dirname( + require.resolve('nguniversal/modules/express-engine/schematics/collection.json')); + +const bazelBinDir = join(__dirname, '../'); + +// Copy all schema files to the bazel bin directory. +globSync('**/schema.json', {cwd: sourceDirectory}) + .forEach(file => copySync(join(sourceDirectory, file), join(bazelBinDir, file))); + +// Copy all template files to the bazel bin directory. +globSync('**/files/**/*', {cwd: sourceDirectory}) + .forEach(file => copySync(join(sourceDirectory, file), join(bazelBinDir, file))); + +// Copy the collection.json file to the bazel bin directory. +globSync('collection.json', {cwd: sourceDirectory}) + .forEach(file => copySync(join(sourceDirectory, file), join(bazelBinDir, file))); diff --git a/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts b/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts new file mode 100644 index 000000000..e63d2b6a9 --- /dev/null +++ b/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright Google LLC 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 {EngineHost, TaskScheduler} from '@angular-devkit/schematics'; +import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; +import {from as observableFrom, Observable} from 'rxjs'; +import {concatMap, filter, last} from 'rxjs/operators'; + +/** + * Due to the fact that the Angular devkit does not support running scheduled tasks from a + * schematic that has been launched through the TestRunner, we need to manually find the task + * executor for the given task name and run all scheduled instances. + * + * Note that this means that there can be multiple tasks with the same name. The observable emits + * only when all tasks finished executing. + */ +export function runPostScheduledTasks(runner: SchematicTestRunner, taskName: string) + : Observable { + + // Workaround until there is a public API to run scheduled tasks in the @angular-devkit. + // See: https://github.com/angular/angular-cli/issues/11739 + const host = runner.engine['_host'] as EngineHost<{}, {}>; + const tasks = runner.engine['_taskSchedulers'] as TaskScheduler[]; + + return observableFrom(tasks).pipe( + concatMap(scheduler => scheduler.finalize()), + filter(task => task.configuration.name === taskName), + concatMap(task => { + return host.createTaskExecutor(task.configuration.name) + .pipe(concatMap(executor => executor(task.configuration.options, task.context))); + }), + // Only emit the last emitted value because there can be multiple tasks with the same name. + // The observable should only emit a value if all tasks completed. + last() + ); +} diff --git a/modules/express-engine/schematics/test-setup/test-app.ts b/modules/express-engine/schematics/test-setup/test-app.ts new file mode 100644 index 000000000..78de4030a --- /dev/null +++ b/modules/express-engine/schematics/test-setup/test-app.ts @@ -0,0 +1,27 @@ +/** + * @license + * Copyright Google LLC 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 {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing'; +import {join} from 'path'; + +/** Path to the collection file for the NgUniversal schematics */ +export const collectionPath = join(__dirname, '..', 'collection.json'); + +/** Create a base app used for testing. */ +export function createTestApp(appOptions = {}): UnitTestTree { + const baseRunner = new SchematicTestRunner('universal-schematics', collectionPath); + + const workspaceTree = baseRunner.runExternalSchematic('@schematics/angular', 'workspace', { + name: 'workspace', + version: '6.0.0', + newProjectRoot: 'projects', + }); + + return baseRunner.runExternalSchematic('@schematics/angular', 'application', + {...appOptions, name: 'bar'}, workspaceTree); +} diff --git a/package.json b/package.json index a63efd756..7f19aa2a7 100644 --- a/package.json +++ b/package.json @@ -74,18 +74,18 @@ "devDependencies": { "@angular-devkit/core": "^0.7.3", "@angular-devkit/schematics": "^0.7.3", - "@angular/animations": "6.0.0", - "@angular/bazel": "6.0.0", - "@angular/common": "6.0.0", - "@angular/compiler": "6.0.0", - "@angular/compiler-cli": "6.0.0", - "@angular/core": "6.0.0", - "@angular/http": "6.0.0", - "@angular/platform-browser": "6.0.0", - "@angular/platform-browser-dynamic": "6.0.0", - "@angular/platform-server": "6.0.0", - "@angular/router": "6.0.0", - "@angular/upgrade": "6.0.0", + "@angular/animations": "6.0.4", + "@angular/bazel": "6.0.4", + "@angular/common": "6.0.4", + "@angular/compiler": "6.0.4", + "@angular/compiler-cli": "6.0.4", + "@angular/core": "6.0.4", + "@angular/http": "6.0.4", + "@angular/platform-browser": "6.0.4", + "@angular/platform-browser-dynamic": "6.0.4", + "@angular/platform-server": "6.0.4", + "@angular/router": "6.0.4", + "@angular/upgrade": "6.0.4", "@bazel/ibazel": "^0.3.1", "@schematics/angular": "^0.7.3", "@types/express": "^4.0.39", diff --git a/yarn.lock b/yarn.lock index e54d758a6..fad67d08f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,84 +18,84 @@ "@angular-devkit/core" "0.7.3" rxjs "^6.0.0" -"@angular/animations@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.0.tgz#cfc825dbfdf33bf3bf75962d1e12495aed5e3c32" +"@angular/animations@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-6.0.4.tgz#4e22612e8fed3193983d985c748514a03404bd96" dependencies: tslib "^1.9.0" -"@angular/bazel@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.0.0.tgz#e9050648fe2cd43533b15f4cb0060cd64cf79bbe" +"@angular/bazel@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.0.4.tgz#a87edd5b5c9b23cdb2b3f2188d95d18f87c1d1a4" dependencies: - "@bazel/typescript" "^0.11.1" + "@bazel/typescript" "^0.15.0" "@types/node" "6.0.84" "@types/shelljs" "0.7.7" protobufjs "5.0.0" shelljs "0.7.8" -"@angular/common@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.0.tgz#ca3b6b6b96837fe048861da897c31991aa04954f" +"@angular/common@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-6.0.4.tgz#e3d194a1bb1e143044774488d610437a982179fa" dependencies: tslib "^1.9.0" -"@angular/compiler-cli@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.0.tgz#be50277faaa5ac08f3002c2c8cb8c39d220c76d5" +"@angular/compiler-cli@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.0.4.tgz#03596a2365aaed418e09999493560ba82fd45190" dependencies: chokidar "^1.4.2" minimist "^1.2.0" reflect-metadata "^0.1.2" - tsickle "^0.27.2" + tsickle "^0.29.0" -"@angular/compiler@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.0.tgz#9092a0f02f33dd1108276ab93cc48142e36a1e95" +"@angular/compiler@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.0.4.tgz#86d3adc2c915ee98aa8e00c542c2ef1c09f9c61f" dependencies: tslib "^1.9.0" -"@angular/core@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.0.tgz#785cc8a37b7fb784a6b7dcbd0984abb4f10e5dfe" +"@angular/core@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-6.0.4.tgz#80b19624493126b6c7e3a180a33dee92c84b4bd6" dependencies: tslib "^1.9.0" -"@angular/http@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.0.tgz#f409e35cd2f4990b43a37beab915ffdcd9c7c992" +"@angular/http@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/http/-/http-6.0.4.tgz#5598c6eec895014da9242c22236af2757ae9fef1" dependencies: tslib "^1.9.0" -"@angular/platform-browser-dynamic@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.0.tgz#66a34b65136446cb3ec39362fd6d2dbb5482ba70" +"@angular/platform-browser-dynamic@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.4.tgz#3b86f6b826d45418520da583eb8ba0526f62a4bb" dependencies: tslib "^1.9.0" -"@angular/platform-browser@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.0.tgz#848b687ea46786483fddcdbbbd17b29c7adcc768" +"@angular/platform-browser@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-6.0.4.tgz#3a86890324fd9de37df8d7195fcedf4145eefb3b" dependencies: tslib "^1.9.0" -"@angular/platform-server@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.0.0.tgz#482878cc538a80caa3962e9376e4225b20c2a4bd" +"@angular/platform-server@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-6.0.4.tgz#38de69d98ca01a4e20d6eac7d19b85d9257f06aa" dependencies: domino "^2.0.1" tslib "^1.9.0" xhr2 "^0.1.4" -"@angular/router@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.0.tgz#09a5c6f6220084c3575df81e8b36cbe9fff10d1f" +"@angular/router@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-6.0.4.tgz#81c96dfa42a8c4a218cbd450b1e8959a76ea9595" dependencies: tslib "^1.9.0" -"@angular/upgrade@6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.0.0.tgz#932e39709b17a455018c3dfe63a5b8e794027f05" +"@angular/upgrade@6.0.4": + version "6.0.4" + resolved "https://registry.yarnpkg.com/@angular/upgrade/-/upgrade-6.0.4.tgz#b12a016bab98db77bacbe9b1a83c4c2a47e5baf5" dependencies: tslib "^1.9.0" @@ -103,9 +103,13 @@ version "0.3.1" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.3.1.tgz#5f02f208f138e581bbdb1534d5c013d7a0ac9799" -"@bazel/typescript@^0.11.1": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.11.1.tgz#54409d6ed1f43e71fce047fb4e229f9cc8a5ff68" +"@bazel/typescript@^0.15.0": + version "0.15.3" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.3.tgz#5c32b3bf664b268f9ffb634b86f40004a50e7ef9" + dependencies: + protobufjs "5.0.0" + tsickle "0.25.x" + tsutils "2.20.0" "@schematics/angular@^0.7.3": version "0.7.3" @@ -5057,7 +5061,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.0, source-map-support@~0.4.0: +source-map-support@^0.4.0, source-map-support@^0.4.2, source-map-support@~0.4.0: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: @@ -5497,9 +5501,18 @@ tsconfig@^6.0.0: strip-bom "^3.0.0" strip-json-comments "^2.0.0" -tsickle@^0.27.2: - version "0.27.5" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.5.tgz#41e1a41a5acf971cbb2b0558a9590779234d591f" +tsickle@0.25.x: + version "0.25.6" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.25.6.tgz#b595db16b236721824eeeda8bb262365b47ef334" + dependencies: + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map "^0.5.6" + source-map-support "^0.4.2" + +tsickle@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.29.0.tgz#812806554bb46c1aa16eb0fe2a051da95ca8f5a4" dependencies: minimist "^1.2.0" mkdirp "^0.5.1" @@ -5531,6 +5544,12 @@ tsscmp@~1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" +tsutils@2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" + dependencies: + tslib "^1.8.1" + tsutils@^2.21.2, tsutils@^2.27.2: version "2.29.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" From 575ddbcae2a06e60762cab01f6b98020ec195d2f Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 14:00:21 -0500 Subject: [PATCH 10/13] fixup! feat(express-engine): add schematics --- modules/express-engine/schematics/BUILD.bazel | 12 +++++++++--- .../express-engine/schematics/install/index.spec.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/express-engine/schematics/BUILD.bazel b/modules/express-engine/schematics/BUILD.bazel index c022d993d..77979b928 100644 --- a/modules/express-engine/schematics/BUILD.bazel +++ b/modules/express-engine/schematics/BUILD.bazel @@ -44,8 +44,14 @@ jasmine_node_test( ts_library( name = "schematics_test_sources", - srcs = glob(["**/*.spec.ts", "test-setup/**/*.ts"], exclude=["**/files/**/*"]), - deps = [":schematics"], - tsconfig = ":tsconfig.json", testonly = True, + srcs = glob( + [ + "**/*.spec.ts", + "test-setup/**/*.ts", + ], + exclude = ["**/files/**/*"], + ), + tsconfig = ":tsconfig.json", + deps = [":schematics"], ) diff --git a/modules/express-engine/schematics/install/index.spec.ts b/modules/express-engine/schematics/install/index.spec.ts index 15e78a7ae..c383d40c8 100644 --- a/modules/express-engine/schematics/install/index.spec.ts +++ b/modules/express-engine/schematics/install/index.spec.ts @@ -7,7 +7,7 @@ */ import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {Schema as UniversalOptions} from './schema'; -import {collectionPath, createTestApp} from '@nguniversal/express-engine/schematics/test-setup/test-app'; +import {collectionPath, createTestApp} from '../test-setup/test-app'; import {Tree} from '@angular-devkit/schematics'; describe('Universal Schematic', () => { From fb3e8e5cddc089198dfb0d90895952a715d09f59 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 18 Aug 2018 16:30:22 -0500 Subject: [PATCH 11/13] fixup! feat(express-engine): add schematics --- .../__serverFileName@stripTsExtension__.ts | 2 +- ...rFileName@stripTsExtension__.tsconfig.json | 20 ++++++++ .../files/root/webpack.server.config.js | 47 ------------------- .../schematics/install/index.ts | 5 +- 4 files changed, 24 insertions(+), 50 deletions(-) create mode 100644 modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.tsconfig.json delete mode 100644 modules/express-engine/schematics/install/files/root/webpack.server.config.js diff --git a/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts index f13571512..ad83aa1d8 100644 --- a/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts +++ b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.ts @@ -19,7 +19,7 @@ const PORT = process.env.PORT || <%= serverPort %>; const DIST_FOLDER = join(process.cwd(), 'dist'); // * NOTE :: leave this as require() since this file is built Dynamically from webpack -const {AppServerModuleNgFactory, LAZY_MODULE_MAP} = require('./dist/server/main'); +const {AppServerModuleNgFactory, LAZY_MODULE_MAP} = require('./server/main'); // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine) app.engine('html', ngExpressEngine({ diff --git a/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.tsconfig.json b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.tsconfig.json new file mode 100644 index 000000000..fc01f69ab --- /dev/null +++ b/modules/express-engine/schematics/install/files/root/__serverFileName@stripTsExtension__.tsconfig.json @@ -0,0 +1,20 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2017", + "dom" + ] + }, + "include": ["<%= stripTsExtension(serverFileName) %>.ts"] +} \ No newline at end of file diff --git a/modules/express-engine/schematics/install/files/root/webpack.server.config.js b/modules/express-engine/schematics/install/files/root/webpack.server.config.js deleted file mode 100644 index 5ebd04e04..000000000 --- a/modules/express-engine/schematics/install/files/root/webpack.server.config.js +++ /dev/null @@ -1,47 +0,0 @@ -// Work around for https://github.com/angular/angular-cli/issues/7200 - -const path = require('path'); -const webpack = require('webpack'); - -module.exports = { - mode: 'none', - entry: { - // This is our Express server for Dynamic universal - server: './<%= stripTsExtension(serverFileName) %>.ts' - }, - target: 'node', - resolve: {extensions: ['.ts', '.js']}, - optimization: { - minimize: false - }, - output: { - // Puts the output at the root of the dist folder - path: path.join(__dirname, 'dist'), - filename: '[name].js' - }, - module: { - rules: [ - {test: /\.ts$/, loader: 'ts-loader'}, - { - // Mark files inside `@angular/core` as using SystemJS style dynamic imports. - // Removing this will cause deprecation warnings to appear. - test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/, - parser: {system: true}, - }, - ] - }, - plugins: [ - new webpack.ContextReplacementPlugin( - // fixes WARNING Critical dependency: the request of a dependency is an expression - /(.+)?angular(\\|\/)core(.+)?/, - path.join(__dirname, 'src'), // location of your src - {} // a map of your routes - ), - new webpack.ContextReplacementPlugin( - // fixes WARNING Critical dependency: the request of a dependency is an expression - /(.+)?express(\\|\/)(.+)?/, - path.join(__dirname, 'src'), - {} - ) - ] -} diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts index f40d5f551..0ae51bd4c 100644 --- a/modules/express-engine/schematics/install/index.ts +++ b/modules/express-engine/schematics/install/index.ts @@ -74,10 +74,11 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { pkg.dependencies['express'] = 'EXPRESS_VERSION'; pkg.scripts['serve:ssr'] = 'node dist/server'; - pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run webpack:server'; + pkg.scripts['build:ssr'] = 'npm run build:client-and-server-bundles && npm run compile:server'; pkg.scripts['build:client-and-server-bundles'] = `ng build --prod && ng run ${options.clientProject}:server:production`; - pkg.scripts['webpack:server'] = 'webpack --config webpack.server.config.js --progress --colors'; + pkg.scripts['compile:server'] = + `tsc -p ${options.serverFileName.replace(/\.ts$/, '')}.tsconfig.json`; host.overwrite(pkgPath, JSON.stringify(pkg, null, 2)); From ca9d2b6ac999740a6b784c6619d5eaf6ec0b69aa Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Tue, 21 Aug 2018 20:53:13 -0500 Subject: [PATCH 12/13] fixup! feat(express-engine): add schematics --- .../test-setup/post-scheduled-tasks.ts | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts diff --git a/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts b/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts deleted file mode 100644 index e63d2b6a9..000000000 --- a/modules/express-engine/schematics/test-setup/post-scheduled-tasks.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright Google LLC 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 {EngineHost, TaskScheduler} from '@angular-devkit/schematics'; -import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; -import {from as observableFrom, Observable} from 'rxjs'; -import {concatMap, filter, last} from 'rxjs/operators'; - -/** - * Due to the fact that the Angular devkit does not support running scheduled tasks from a - * schematic that has been launched through the TestRunner, we need to manually find the task - * executor for the given task name and run all scheduled instances. - * - * Note that this means that there can be multiple tasks with the same name. The observable emits - * only when all tasks finished executing. - */ -export function runPostScheduledTasks(runner: SchematicTestRunner, taskName: string) - : Observable { - - // Workaround until there is a public API to run scheduled tasks in the @angular-devkit. - // See: https://github.com/angular/angular-cli/issues/11739 - const host = runner.engine['_host'] as EngineHost<{}, {}>; - const tasks = runner.engine['_taskSchedulers'] as TaskScheduler[]; - - return observableFrom(tasks).pipe( - concatMap(scheduler => scheduler.finalize()), - filter(task => task.configuration.name === taskName), - concatMap(task => { - return host.createTaskExecutor(task.configuration.name) - .pipe(concatMap(executor => executor(task.configuration.options, task.context))); - }), - // Only emit the last emitted value because there can be multiple tasks with the same name. - // The observable should only emit a value if all tasks completed. - last() - ); -} From ee90d728768d941295b4d38f204b8b26202e8758 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Tue, 21 Aug 2018 21:17:07 -0500 Subject: [PATCH 13/13] fixup! feat(express-engine): add schematics --- .../schematics/install/index.ts | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/modules/express-engine/schematics/install/index.ts b/modules/express-engine/schematics/install/index.ts index 0ae51bd4c..78219e905 100644 --- a/modules/express-engine/schematics/install/index.ts +++ b/modules/express-engine/schematics/install/index.ts @@ -70,7 +70,7 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { const pkg = JSON.parse(buffer.toString()); pkg.dependencies['@nguniversal/express-engine'] = '0.0.0-PLACEHOLDER'; - pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = '6.0.0' || '0.0.0-PLACEHOLDER'; + pkg.dependencies['@nguniversal/module-map-ngfactory-loader'] = '0.0.0-PLACEHOLDER'; pkg.dependencies['express'] = 'EXPRESS_VERSION'; pkg.scripts['serve:ssr'] = 'node dist/server'; @@ -86,24 +86,6 @@ function addDependenciesAndScripts(options: UniversalOptions): Rule { }; } -function getTsConfigOutDir(host: Tree, architect: experimental.workspace.WorkspaceTool): string { - const tsConfigPath = architect.build.options.tsConfig; - const tsConfigBuffer = host.read(tsConfigPath); - if (!tsConfigBuffer) { - throw new SchematicsException(`Could not read ${tsConfigPath}`); - } - const tsConfigContent = tsConfigBuffer.toString(); - const tsConfig = parseJson(tsConfigContent); - if (tsConfig === null || typeof tsConfig !== 'object' || Array.isArray(tsConfig) || - tsConfig.compilerOptions === null || typeof tsConfig.compilerOptions !== 'object' || - Array.isArray(tsConfig.compilerOptions)) { - throw new SchematicsException(`Invalid tsconfig - ${tsConfigPath}`); - } - const outDir = tsConfig.compilerOptions.outDir; - - return outDir as string; -} - export default function (options: UniversalOptions): Rule { return (host: Tree, context: SchematicContext) => { const clientProject = getClientProject(host, options); @@ -111,7 +93,6 @@ export default function (options: UniversalOptions): Rule { throw new SchematicsException(`Universal requires a project type of "application".`); } const clientArchitect = getClientArchitect(host, options); - const outDir = getTsConfigOutDir(host, clientArchitect); const tsConfigExtends = basename(clientArchitect.build.options.tsConfig); const rootInSrc = clientProject.root === ''; const tsConfigDirectory = join(normalize(clientProject.root), rootInSrc ? 'src' : ''); @@ -126,7 +107,6 @@ export default function (options: UniversalOptions): Rule { ...strings, ...options as object, stripTsExtension: (s: string) => { return s.replace(/\.ts$/, ''); }, - outDir, tsConfigExtends, rootInSrc, }),