Encourage hot reload

This commit is contained in:
thosakwe 2017-06-06 08:23:28 -04:00
parent 0df2157300
commit 1af44cab90
3 changed files with 12 additions and 4 deletions

View file

@ -34,6 +34,14 @@ class StartCommand extends Command {
@override @override
run() async { run() async {
stderr
..writeln(
'WARNING: `angel start` is now deprecated, in favor of `package:angel_hot`.')
..writeln(
'This new alternative supports hot reloading, which is faster and more reliable.')
..writeln()
..writeln('Find it on Pub: https://pub.dartlang.org/packages/angel_hot');
if (argResults['watch']) { if (argResults['watch']) {
try { try {
new DirectoryWatcher('bin').events.listen((_) async => start()); new DirectoryWatcher('bin').events.listen((_) async => start());
@ -76,8 +84,8 @@ class StartCommand extends Command {
if (scriptsNode != null && scriptsNode.containsKey('start')) { if (scriptsNode != null && scriptsNode.containsKey('start')) {
try { try {
var scripts = var scripts = await Process.start(
await Process.start(InitCommand.resolvePub(), ['global', 'run', 'scripts', 'start']); InitCommand.resolvePub(), ['global', 'run', 'scripts', 'start']);
listen(scripts.stdout, stdout); listen(scripts.stdout, stdout);
listen(scripts.stderr, stderr); listen(scripts.stderr, stderr);
int code = await scripts.exitCode; int code = await scripts.exitCode;

View file

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:http/src/base_client.dart' as http; import 'package:http/src/base_client.dart' as http;
import 'package:pub_semver/pub_semver.dart'; import 'package:pub_semver/pub_semver.dart';
final Version PACKAGE_VERSION = new Version(1, 0, 12); final Version PACKAGE_VERSION = new Version(1, 1, 0);
Future<Version> fetchCurrentVersion(http.BaseClient client) async { Future<Version> fetchCurrentVersion(http.BaseClient client) async {
var response = var response =
await client.get('https://pub.dartlang.org/api/packages/angel_cli'); await client.get('https://pub.dartlang.org/api/packages/angel_cli');

View file

@ -2,7 +2,7 @@ author: "Tobe O <thosakwe@gmail.com>"
description: "Command-line tools for the Angel framework." description: "Command-line tools for the Angel framework."
homepage: "https://github.com/angel-dart/angel_cli" homepage: "https://github.com/angel-dart/angel_cli"
name: "angel_cli" name: "angel_cli"
version: 1.0.12 version: 1.1.0
dependencies: dependencies:
# analyzer: "^0.29.0" # analyzer: "^0.29.0"
args: "^0.13.7" args: "^0.13.7"