-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf03a73
commit 125847b
Showing
5 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,34 @@ import { | |
replaceInFile, | ||
writeFile, | ||
} from '../../utils/fs'; | ||
import { ng, npm } from '../../utils/process'; | ||
import { ng, silentNpm } from '../../utils/process'; | ||
import { updateJsonFile } from '../../utils/project'; | ||
import { expectToFail } from '../../utils/utils'; | ||
import { readNgVersion } from '../../utils/version'; | ||
|
||
const snapshots = require('../../ng-snapshot/package.json'); | ||
|
||
export default async function () { | ||
let localizeVersion = '@angular/localize@' + readNgVersion(); | ||
if (getGlobalVariable('argv')['ng-snapshots']) { | ||
localizeVersion = require('../../ng-snapshot/package.json').dependencies['@angular/localize']; | ||
} | ||
const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots']; | ||
|
||
await npm('install', `${localizeVersion}`); | ||
await updateJsonFile('package.json', packageJson => { | ||
const dependencies = packageJson['dependencies']; | ||
dependencies['@angular/localize'] = isSnapshotBuild | ||
? snapshots.dependencies['@angular/localize'] | ||
: readNgVersion(); | ||
}); | ||
|
||
// Add universal to the project | ||
await ng('add', '@nguniversal/[email protected]'); | ||
await ng('add', '@nguniversal/[email protected]', '--skip-install'); | ||
|
||
if (isSnapshotBuild) { | ||
await updateJsonFile('package.json', packageJson => { | ||
const dependencies = packageJson['dependencies']; | ||
dependencies['@angular/platform-server'] = snapshots.dependencies['@angular/platform-server']; | ||
}); | ||
} | ||
|
||
await npm('run', 'webdriver-update'); | ||
await silentNpm('install'); | ||
|
||
const serverbaseDir = 'dist/test-project/server'; | ||
const serverBuildArgs = ['run', 'test-project:server']; | ||
|
@@ -34,7 +45,6 @@ export default async function () { | |
const langTranslations = [ | ||
{ lang: 'en-US', translation: 'Hello i18n!' }, | ||
{ lang: 'fr', translation: 'Bonjour i18n!' }, | ||
{ lang: 'de', translation: 'Hallo i18n!' }, | ||
]; | ||
|
||
await updateJsonFile('angular.json', workspaceJson => { | ||
|