Skip to content

Commit

Permalink
feat(generators): updates for NativeScript 5.1.0 and support for Angu…
Browse files Browse the repository at this point in the history
…lar 7.1.0 (#62)
  • Loading branch information
NathanWalker authored Dec 14, 2018
1 parent e5c02bc commit 7ff77f8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app.nativescript/_files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@angular/compiler-cli": "~7.0.0",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "file:../../node_modules/@angular/language-service",
"@ngtools/webpack": "~7.0.0",
"@ngtools/webpack": "~7.1.0",
"codelyzer": "file:../../node_modules/codelyzer",
"nativescript-dev-webpack": "~0.18.0",
"tns-platform-declarations": "file:../../node_modules/tns-platform-declarations",
Expand Down
5 changes: 5 additions & 0 deletions src/migrations/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
"version": "7.0.1",
"description": "Add {N} HMR livesync navigation hook",
"factory": "./update-7-0-1/update-7-0-1"
},
"update-to-7.1.0": {
"version": "7.1.0",
"description": "Update NativeScript 5.1.0 and support for Angular 7.1.0",
"factory": "./update-7-1-0/update-7-1-0"
}
}
}
33 changes: 33 additions & 0 deletions src/migrations/update-7-1-0/update-7-1-0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
chain,
Rule,
SchematicContext,
Tree
} from "@angular-devkit/schematics";
import { join } from 'path';
import * as fs from 'fs';

import { getJsonFromFile, updateJsonFile, createOrUpdate, updateJsonInTree } from '../../utils';

export default function(): Rule {
return chain([updateRootPackage]);
}

function updateRootPackage(tree: Tree, context: SchematicContext) {
return updateJsonInTree("package.json", json => {
json.scripts = json.scripts || {};
json.dependencies = json.dependencies || {};
json.dependencies = {
...json.dependencies,
"nativescript-angular": "~7.1.0",
"tns-core-modules": "~5.1.0"
}
json.devDependencies = json.devDependencies || {};
json.devDependencies = {
...json.devDependencies,
"tns-platform-declarations": "~5.1.0"
}

return json;
})(tree, context);
}
6 changes: 3 additions & 3 deletions src/utils/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function addRootDeps(
if (targetPlatforms.nativescript) {
dep = {
name: "nativescript-angular",
version: "~7.0.0",
version: "~7.1.0",
type: "dependency"
};
deps.push(dep);
Expand Down Expand Up @@ -241,14 +241,14 @@ export function addRootDeps(

dep = {
name: "tns-core-modules",
version: "~5.0.0",
version: "~5.1.0",
type: "dependency"
};
deps.push(dep);

dep = {
name: "tns-platform-declarations",
version: "~5.0.0",
version: "~5.1.0",
type: "devDependency"
};
deps.push(dep);
Expand Down

0 comments on commit 7ff77f8

Please sign in to comment.