Publish hot

This commit is contained in:
thomashii 2021-05-15 21:17:18 +08:00
parent 3f55c1df67
commit 43640a56f1
5 changed files with 23 additions and 32 deletions

View file

@ -1,20 +1,24 @@
# hot
[![Pub](https://img.shields.io/pub/v/angel_hot.svg)](https://pub.dartlang.org/packages/angel_hot)
# angel3_hot
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_hot)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/hot/LICENSE)
![Screenshot of terminal](screenshots/screenshot.png)
Supports *hot reloading* of Angel servers on file changes. This is faster and
more reliable than merely reactively restarting a `Process`.
This package only works with the [Angel framework](https://github.com/angel-dart/angel).
This package only works with the [Angel framework](https://github.com/dukefirehawk/angel/tree/angel3).
# Installation
In your `pubspec.yaml`:
```yaml
dependencies:
angel_framework: ^2.0.0-alpha
angel_hot: ^2.0.0
angel3_framework: ^4.0.0
angel3_hot: ^4.0.0
```
# Usage

View file

@ -1,5 +1,5 @@
import 'dart:io';
import 'package:angel_hot/angel_hot.dart';
import 'package:angel3_hot/angel3_hot.dart';
import 'server.dart';
void main() async {
@ -7,7 +7,7 @@ void main() async {
Directory('src'),
'server.dart',
// Also allowed: Platform.script,
Uri.parse('package:angel_hot/angel_hot.dart')
Uri.parse('package:angel3_hot/angel3_hot.dart')
]);
await hot.startServer('127.0.0.1', 3000);
}

View file

@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:logging/logging.dart';
import 'src/foo.dart';

View file

@ -4,14 +4,14 @@ import 'dart:convert';
import 'dart:developer' as dev;
import 'dart:io';
import 'dart:isolate';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
import 'package:angel_websocket/server.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart';
import 'package:angel3_websocket/server.dart';
import 'package:charcode/ascii.dart';
import 'package:glob/glob.dart';
import 'package:glob/list_local_fs.dart';
import 'package:html_builder/elements.dart';
import 'package:html_builder/html_builder.dart';
import 'package:angel3_html_builder/elements.dart';
import 'package:angel3_html_builder/angel3_html_builder.dart';
import 'package:io/ansi.dart';
import 'package:path/path.dart' as p;
import 'package:vm_service/vm_service.dart' as vm;
@ -193,7 +193,7 @@ class HotReloader {
}
_onChange.stream
//.transform(new _Debounce(new Duration(seconds: 1)))
//.transform( _Debounce( Duration(seconds: 1)))
.listen(_handleWatchEvent);
while (_requestQueue.isNotEmpty) {

View file

@ -1,26 +1,13 @@
name: angel_hot
name: angel3_hot
description: Supports hot reloading/hot code push of Angel servers on file changes.
version: 4.0.0
homepage: https://github.com/dukefirehawk/angel
publish_to: none
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/hot
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
angel_framework:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/framework
angel_websocket:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/websocket
html_builder:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/html_builder
angel3_framework: ^4.0.0
angel3_websocket: ^4.0.0
angel3_html_builder: ^2.0.0
charcode: ^1.2.0
glob: ^2.0.1
io: ^1.0.0