(skipInstall: boolean | undefined)
| 139 | } |
| 140 | |
| 141 | function addDependencies(skipInstall: boolean | undefined): Rule { |
| 142 | return (host: Tree) => { |
| 143 | const coreDep = getPackageJsonDependency(host, '@angular/core'); |
| 144 | if (coreDep === null) { |
| 145 | throw new SchematicsException('Could not find version.'); |
| 146 | } |
| 147 | |
| 148 | const install = skipInstall ? InstallBehavior.None : InstallBehavior.Auto; |
| 149 | |
| 150 | return chain([ |
| 151 | addDependency('@angular/ssr', latestVersions.AngularSSR, { |
| 152 | type: DependencyType.Default, |
| 153 | install, |
| 154 | }), |
| 155 | addDependency('@angular/platform-server', coreDep.version, { |
| 156 | type: DependencyType.Default, |
| 157 | install, |
| 158 | }), |
| 159 | addDependency('@types/node', latestVersions['@types/node'], { |
| 160 | type: DependencyType.Dev, |
| 161 | install, |
| 162 | }), |
| 163 | ]); |
| 164 | }; |
| 165 | } |
| 166 | |
| 167 | const serverSchematic: RuleFactory<ServerOptions> = createProjectSchematic( |
| 168 | async (options, { project, tree }) => { |
no test coverage detected