Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return chain([
updateJsonInTree('package.json', json => {
json.devDependencies = json.devDependencies || {};
json.devDependencies = {
...json.devDependencies,
codelyzer: '~4.5.0',
'jasmine-marbles': '0.4.0'
};
if (json.devDependencies['ng-packagr']) {
json.devDependencies['ng-packagr'] = '^4.2.0';
}
return json;
}),
addUpdateTask('@angular/core', '7.0.0'),
addUpdateTask('@angular/cli', '7.0.1')
]);
}
updateJsonInTree('package.json', json => {
json.devDependencies = json.devDependencies || {};
json.devDependencies = {
...json.devDependencies,
codelyzer: '~4.5.0',
'jasmine-marbles': '0.4.0'
};
if (json.devDependencies['ng-packagr']) {
json.devDependencies['ng-packagr'] = '^4.2.0';
}
return json;
}),
addUpdateTask('@angular/core', '7.0.0'),
addUpdateTask('@angular/cli', '7.0.1')
]);
}
return (host: Tree) => {
const { dependencies } = readJsonInTree(host, 'package.json');
if (dependencies && dependencies['@ngrx/store']) {
return chain([
addUpdateTask('@ngrx/store', '8.1.0', updateDeps),
formatFiles()
]);
}
return noop();
};
}
export const runAngularMigrations: Rule = (
host: Tree,
context: SchematicContext
) => {
const { dependencies } = readJsonInTree(host, 'package.json');
return chain([
addUpdateTask('@angular/cli', '8.0.1'),
...(dependencies['@angular/core']
? [addUpdateTask('@angular/core', '8.0.0')]
: [])
]);
};
return (_, context: SchematicContext) => {
const postInstallTask = context.addTask(
new RunSchematicTask(
join(__dirname, '../../../migrations.json'),
'add-postinstall',
{}
)
);
return chain([
addUpdateTask('@angular/core', '9.0.0-rc.4', [postInstallTask]),
addUpdateTask('@angular/cli', '9.0.0-rc.4', [postInstallTask])
])
};
}
}
if (!json.schematics['@nrwl/schematics:application'].e2eTestRunner) {
json.schematics['@nrwl/schematics:application'].e2eTestRunner =
'protractor';
}
if (!json.schematics['@nrwl/schematics:node-application']) {
json.schematics['@nrwl/schematics:node-application'] = {};
}
if (!json.schematics['@nrwl/schematics:node-application'].framework) {
json.schematics['@nrwl/schematics:node-application'].framework = 'express';
}
return json;
});
const updateAngularCLI = chain([
addUpdateTask('@angular/cli', '7.3.1'),
addDepsToPackageJson(
{},
{
'@angular-devkit/build-angular': '~0.13.1'
}
)
]);
export default function(): Rule {
return chain([
addExtensionRecommendations,
addDotEnv,
updateAngularCLI,
migrateNgrx,
updateNgrx,
setDefaults,
export const runAngularMigrations: Rule = (
host: Tree,
context: SchematicContext
) => {
const { dependencies } = readJsonInTree(host, 'package.json');
return chain([
addUpdateTask('@angular/cli', '8.0.1'),
...(dependencies['@angular/core']
? [addUpdateTask('@angular/core', '8.0.0')]
: [])
]);
};
import { chain, Tree, noop, TaskId } from '@angular-devkit/schematics';
import {
addUpdateTask,
readJsonInTree,
formatFiles,
updateJsonInTree,
checkAndCleanWithSemver
} from '@nrwl/workspace';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
import { gt } from 'semver';
const updateAngular = addUpdateTask('@angular/core', '8.2.4');
function updateCLI() {
const tasks: TaskId[] = [];
const rule = chain([
updateJsonInTree('package.json', json => {
json.devDependencies = json.devDependencies || {};
const cliVersion = json.devDependencies['@angular/cli'];
const cleanCliVersion = checkAndCleanWithSemver(
'@angular/cli',
cliVersion
);
if (cleanCliVersion && gt(cleanCliVersion, '8.3.3')) {
return json;
}
import { Rule, chain, externalSchematic } from '@angular-devkit/schematics';
import { updateJsonInTree, addUpdateTask } from '@nrwl/workspace';
const updateAngularCLI = addUpdateTask('@angular/cli', '7.2.2');
const updateTypescript = updateJsonInTree('package.json', json => {
json.devDependencies = json.devDependencies || {};
json.devDependencies = {
...json.devDependencies,
typescript: '~3.2.2'
};
return json;
});
export default function(): Rule {
return chain([updateTypescript, updateAngularCLI]);
}