Refactor: changing namespace, imports, re-branding

This commit is contained in:
Patrick Stewart 2024-10-12 03:39:20 -07:00
parent 3865bd41df
commit 67d5f183c1
106 changed files with 193 additions and 193 deletions

View file

@ -141,7 +141,7 @@
## 2.0.0-alpha
* Depend on Dart 2 and Angel 2.
* Depend on Dart 2 and Protevus 2.
* Remove `dart2_constant`.
* Remove `requireAuth`.
* Remove `userKey`, instead favoring generic parameters.

View file

@ -17,7 +17,7 @@ A complete authentication plugin for Protevus. Inspired by Passport. More detail
Ensure you have read the [User Guide](https://angel3-docs.dukefirehawk.com/guides/authentication).
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
var auth = AngelAuth<User>(
serializer: (user) => user.id ?? '',
deserializer: (id) => fetchAUserByIdSomehow(id
@ -27,7 +27,7 @@ configureServer(Angel app) async {
// POST route to handle username+password
app.post('/local', auth.authenticate('local'));
// Using Angel's asynchronous injections, we can parse the JWT
// Using Protevus's asynchronous injections, we can parse the JWT
// on demand. It won't be parsed until we check.
app.get('/profile', ioc((User user) {
print(user.description);
@ -55,7 +55,7 @@ configureServer(Angel app) async {
A frequent use case within SPA's is opening OAuth login endpoints in a separate window. [`angel3_client`](https://pub.dev/packages/angel3_client) provides a facility for this, which works perfectly with the default callback provided in this package.
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
var handler = auth.authenticate(
'facebook',
AngelAuthOptions(callback: confirmPopupAuthentication()));

View file

@ -9,7 +9,7 @@ import 'auth_token.dart';
import 'options.dart';
import 'strategy.dart';
/// Handles authentication within an Angel application.
/// Handles authentication within an Protevus application.
class AngelAuth<User> {
final _log = Logger('AngelAuth');
@ -95,7 +95,7 @@ class AngelAuth<User> {
_jwtLifeSpan = jwtLifeSpan.toInt();
}
/// Configures an Angel server to decode and validate JSON Web tokens on demand,
/// Configures an Protevus server to decode and validate JSON Web tokens on demand,
/// whenever an instance of [User] is injected.
Future<void> configureServer(Protevus app) async {
/*
@ -111,7 +111,7 @@ class AngelAuth<User> {
if (app.container == null) {
_log.severe('Protevus container is null');
throw StateError(
'Angel.container is null. All authentication will fail.');
'Protevus.container is null. All authentication will fail.');
}
*/
var appContainer = app.container;
@ -184,7 +184,7 @@ class AngelAuth<User> {
///
/// Now that `package:angel_framework` supports asynchronous injections, this middleware
/// is no longer directly necessary. Instead, call [configureServer]. You can then use
/// `makeAsync<User>`, or Angel's injections directly:
/// `makeAsync<User>`, or Protevus's injections directly:
///
/// ```dart
/// var auth = AngelAuth<User>(...);

View file

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:angel3_framework/angel3_framework.dart';
import 'options.dart';
/// A function that handles login and signup for an Angel application.
/// A function that handles login and signup for an Protevus application.
abstract class AuthStrategy<User> {
/// Authenticates or rejects an incoming user.
FutureOr<User?> authenticate(RequestContext req, ResponseContext res,

View file

@ -57,7 +57,7 @@
## 2.1.0
* Angel 2 + Dart 2 update
* Protevus 2 + Dart 2 update
* Support for handling errors + rejections.
* Use `ExternalAuthOptions`.
@ -67,7 +67,7 @@
## 2.0.0
* Angel 2 + Dart 2 updates.
* Protevus 2 + Dart 2 updates.
## 1.0.2

View file

@ -12,7 +12,7 @@ Protevus library for authenticating users with remote identity providers via OAu
First, create an options object:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
// Load from a Map, i.e. app config:
var opts = ExternalAuthOptions.fromMap(app.configuration['auth0'] as Map);
@ -55,7 +55,7 @@ OAuth2Verifier oauth2verifier(Service<User> userService) {
Now, initialize an `OAuth2Strategy`, using the options and verifier. You'll also need to provide a name for this instance of the strategy. Consider using the name of the remote authentication provider (ex. `facebook`).
```dart
configureServer(Angel app) {
configureServer(Protevus app) {
auth.strategies['github'] = OAuth2Strategy(
options,
authorizationEndpoint,
@ -71,7 +71,7 @@ configureServer(Angel app) {
}
```
Lastly, connect it to an `AngelAuth` instance, and wire it up to an `Angel` server. Set up two routes:
Lastly, connect it to an `AngelAuth` instance, and wire it up to an `Protevus` server. Set up two routes:
1. Redirect users to the external provider
2. Acts as a callback and handles an access code
@ -79,7 +79,7 @@ Lastly, connect it to an `AngelAuth` instance, and wire it up to an `Angel` serv
In the case of the callback route, you may want to display an HTML page that closes a popup window. In this case, use `confirmPopupAuthentication`, which is bundled with `package:angel3_auth`, as a `callback` function:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
// ...
var auth = AngelAuth<User>();
auth.strategies['github'] = oauth2Strategy;
@ -103,7 +103,7 @@ configureServer(Angel app) async {
This package should work out-of-the-box for most OAuth2 providers, such as Github or Dropbox. However, if your OAuth2 scopes are separated by a delimiter other than the default (`' '`), you can add it in the `OAuth2Strategy` constructor:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
OAuth2Strategy(..., delimiter: ' ');
}
```

View file

@ -6,7 +6,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:http_parser/http_parser.dart';
import 'package:oauth2/oauth2.dart' as oauth2;
/// An Angel [AuthStrategy] that signs users in via a third-party service that speaks OAuth 2.0.
/// An Protevus [AuthStrategy] that signs users in via a third-party service that speaks OAuth 2.0.
class OAuth2Strategy<User> implements AuthStrategy<User> {
/// A callback that uses the third-party service to authenticate a [User].
///

View file

@ -30,7 +30,7 @@
## 2.0.0
* Angel 2 + Dart 2 suppport.
* Protevus 2 + Dart 2 suppport.
* Use `package:twitter` instead of `package:twit`.
* Add `TwitterAuthorizationException`.
* Add `onError` callback.

View file

@ -19,7 +19,7 @@ This can improve the performance of sending objects that are complex to serializ
```dart
void main() async {
var app = Angel()..lazyParseBodies = true;
var app = Protevus()..lazyParseBodies = true;
app.use(
'/api/todos',
@ -49,7 +49,7 @@ Supports the `If-Modified-Since` header, as well as storing the contents of resp
To initialize a simple cache:
```dart
Future configureServer(Angel app) async {
Future configureServer(Protevus app) async {
// Simple instance.
var cache = ResponseCache();
@ -81,7 +81,7 @@ Call `invalidate` to remove a resource from a `ResponseCache`.
Some servers expect a reverse proxy or caching layer to support `PURGE` requests. If this is your case, make sure to include some sort of validation (maybe IP-based) to ensure no arbitrary attacker can hack your cache:
```dart
Future configureServer(Angel app) async {
Future configureServer(Protevus app) async {
app.addRoute('PURGE', '*', (req, res) {
if (req.ip != '127.0.0.1')
throw AngelHttpException.forbidden();

View file

@ -4,7 +4,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:pool/pool.dart';
import 'package:logging/logging.dart';
/// A flexible response cache for Angel.
/// A flexible response cache for Protevus.
///
/// Use this to improve real and perceived response of Web applications,
/// as well as to memorize expensive responses.

View file

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:collection/collection.dart';
import 'package:angel3_framework/angel3_framework.dart';
/// An Angel [Service] that caches data from another service.
/// An Protevus [Service] that caches data from another service.
///
/// This is useful for applications of scale, where network latency
/// can have real implications on application performance.

View file

@ -77,7 +77,7 @@
## 2.0.0
* Deprecate `basePath` in favor of `baseUrl`.
* `Angel` now extends `http.Client`.
* `Protevus` now extends `http.Client`.
* Deprecate `auth_types`.
## 2.0.0-alpha.2
@ -92,7 +92,7 @@
## 2.0.0-alpha
* Depend on Dart 2.
* Depend on Angel 2.
* Depend on Protevus 2.
* Remove `dart2_constant`.
## 1.2.0+2

View file

@ -16,7 +16,7 @@ import 'package:angel3_client/browser.dart';
import 'package:angel3_client/flutter.dart';
main() async {
Angel app = Rest("http://localhost:3000");
Protevus app = Rest("http://localhost:3000");
}
```

View file

@ -1,4 +1,4 @@
/// Client library for the Angel framework.
/// Client library for the Protevus framework.
library angel3_client;
import 'dart:async';
@ -17,9 +17,9 @@ typedef ProtevusConfigurer = FutureOr<void> Function(Protevus app);
/// doesn't work.
typedef ProtevusDeserializer<T> = T? Function(dynamic x);
/// Represents an Angel server that we are querying.
/// Represents an Protevus server that we are querying.
abstract class Protevus extends http.BaseClient {
//final _log = Logger('Angel');
//final _log = Logger('Protevus');
/// A mutable member. When this is set, it holds a JSON Web Token
/// that is automatically attached to every request sent.
@ -72,7 +72,7 @@ abstract class Protevus extends http.BaseClient {
/// Creates a [Service] instance that queries a given path on the server.
///
/// This expects that there is an Angel `Service` mounted on the server.
/// This expects that there is an Protevus `Service` mounted on the server.
///
/// In other words, all endpoints will return [Data], except for the root of
/// [path], which returns a [List<Data>].
@ -104,7 +104,7 @@ abstract class Protevus extends http.BaseClient {
{body, Map<String, String>? headers, Encoding? encoding});
}
/// Represents the result of authentication with an Angel server.
/// Represents the result of authentication with an Protevus server.
class ProtevusAuthResult {
String? _token;
final Map<String, dynamic> data = {};
@ -150,7 +150,7 @@ class ProtevusAuthResult {
}
}
/// Queries a service on an Angel server, with the same API.
/// Queries a service on an Protevus server, with the same API.
abstract class Service<Id, Data> {
/// Fired on `indexed` events.
Stream<List<Data>> get onIndexed;
@ -170,7 +170,7 @@ abstract class Service<Id, Data> {
/// Fired on `removed` events.
Stream<Data> get onRemoved;
/// The Angel instance powering this service.
/// The Protevus instance powering this service.
Protevus get app;
Future close();

View file

@ -28,14 +28,14 @@ ProtevusHttpException failure(Response response,
} else {
return ProtevusHttpException(
message: message ??
'Unhandled exception while connecting to Angel backend.',
'Unhandled exception while connecting to Protevus backend.',
statusCode: response.statusCode,
stackTrace: stack);
}
} catch (e, st) {
return ProtevusHttpException(
message: message ??
'Angel backend did not return JSON - an error likely occurred.',
'Protevus backend did not return JSON - an error likely occurred.',
statusCode: response.statusCode,
stackTrace: stack ?? st);
}

View file

@ -1,4 +1,4 @@
/// Browser client library for the Angel framework.
/// Browser client library for the Protevus framework.
library angel_client.browser;
import 'dart:async'
@ -11,7 +11,7 @@ import 'angel3_client.dart';
import 'base_angel_client.dart';
export 'angel3_client.dart';
/// Queries an Angel server via REST.
/// Queries an Protevus server via REST.
class Rest extends BaseProtevusClient {
Rest(String basePath) : super(http.BrowserClient(), basePath);

View file

@ -1,4 +1,4 @@
/// Flutter-compatible client library for the Angel framework.
/// Flutter-compatible client library for the Protevus framework.
library angel_client.flutter;
import 'dart:async';
@ -6,7 +6,7 @@ import 'package:http/http.dart' as http;
import 'base_angel_client.dart';
export 'angel3_client.dart';
/// Queries an Angel server via REST.
/// Queries an Protevus server via REST.
class Rest extends BaseProtevusClient {
Rest(String basePath) : super(http.Client() as http.BaseClient, basePath);

View file

@ -1,4 +1,4 @@
/// Command-line client library for the Angel framework.
/// Command-line client library for the Protevus framework.
library angel_client.cli;
import 'dart:async';
@ -10,7 +10,7 @@ import 'angel3_client.dart';
import 'base_angel_client.dart';
export 'angel3_client.dart';
/// Queries an Angel server via REST.
/// Queries an Protevus server via REST.
class Rest extends BaseProtevusClient {
//final _log = Logger('REST');
final List<Service> _services = [];
@ -42,7 +42,7 @@ class Rest extends BaseProtevusClient {
}
}
/// Queries an Angel service via REST.
/// Queries an Protevus service via REST.
class RestService<Id, Data> extends BaseProtevusService<Id, Data> {
final _log = Logger('RestService');

View file

@ -1,7 +1,7 @@
{
"name": "angel_client",
"version": "1.0.0-dev",
"description": "Client library for the Angel framework.",
"description": "Client library for the Protevus framework.",
"main": "build/angel_client.js",
"jsnext:main": "lib/angel_client.js",
"directories": {

View file

@ -61,7 +61,7 @@ but instead throw an exception.
## 2.0.0
* Use Angel 2.
* Use Protevus 2.
## 1.2.0-rc.0

View file

@ -1,6 +1,6 @@
name: angel3_configuration
version: 8.2.0
description: Automatic YAML application configuration loader for Angel 3, with .env support.
description: Automatic YAML application configuration loader for Protevus 3, with .env support.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/configuration
environment:

View file

@ -32,7 +32,7 @@ A better IoC container for Protevus, ultimately allowing Protevus to be used wit
void main() async {
// Using Mirror Reflector
var app = Angel(reflector: MirrorsReflector());
var app = Protevus(reflector: MirrorsReflector());
// Sales Controller
app.container.registerSingleton<SalesController>(SalesController());

View file

@ -195,7 +195,7 @@ handlers to run, even after the response was closed.
## 2.0.0
* Angel 2! :protevus: :rocket:
* Protevus 2! :protevus: :rocket:
## 2.0.0-rc.10
@ -247,7 +247,7 @@ the outputs of `before` events.
* Log a warning when no `reflector` is provided.
* Add `AngelEnvironment` class.
* Add `Angel.environment`.
* Add `Protevus.environment`.
* Deprecated `app.isProduction` in favor of `app.environment.isProduction`.
* Allow setting of `bodyAsObject`, `bodyAsMap`, or `bodyAsList` **exactly once**.
* Resolve named singletons in `resolveInjection`.
@ -257,7 +257,7 @@ the outputs of `before` events.
## 2.0.0-alpha.24
* Add `AngelEnv` class to `core`.
* Deprecate `Angel.isProduction`, in favor of `AngelEnv`.
* Deprecate `Protevus.isProduction`, in favor of `AngelEnv`.
## 2.0.0-alpha.23
@ -306,7 +306,7 @@ stable, there'll be a conversion, perhaps.
* `RequestContext` now exposes a `Stream<List<int>> get body` getter.
* Calling `RequestContext.parseBody()` parses its contents.
* Added `bodyAsMap`, `bodyAsList`, `bodyAsObject`, and `uploadedFiles` to `RequestContext`.
* Removed `Angel.keepRawRequestBuffers` and anything that had to do with buffering request bodies.
* Removed `Protevus.keepRawRequestBuffers` and anything that had to do with buffering request bodies.
## 2.0.0-alpha.14
@ -319,15 +319,15 @@ stable, there'll be a conversion, perhaps.
## 2.0.0-alpha.12
* Remove `ResponseContext.sendFile`.
* Add `Angel.mimeTypeResolver`.
* Add `Protevus.mimeTypeResolver`.
* Fix a bug where an unknown MIME type on `streamFile` would return a 500.
## 2.0.0-alpha.11
* Add `readMany` to `Service`.
* Allow `ResponseContext.redirect` to take a `Uri`.
* Add `Angel.mountController`.
* Add `Angel.findServiceOf`.
* Add `Protevus.mountController`.
* Add `Protevus.findServiceOf`.
* Roll in HTTP/2. See `pkg:angel_framework/http2.dart`.
## 2.0.0-alpha.10
@ -379,10 +379,10 @@ stable, there'll be a conversion, perhaps.
## 2.0.0-alpha.1
* Removed `Angel.injectEncoders`.
* Removed `Protevus.injectEncoders`.
* Added `Providers.toJson`.
* Moved `Providers.graphql` to `Providers.graphQL`.
* `Angel.optimizeForProduction` no longer calls `preInject`,
* `Protevus.optimizeForProduction` no longer calls `preInject`,
as it does not need to.
* Rename `ResponseContext.enableBuffer` to `ResponseContext.useBuffer`.
@ -409,15 +409,15 @@ stable, there'll be a conversion, perhaps.
gone.
* `HttpRequestContextImpl` and `HttpResponseContextImpl` were renamed to
`HttpRequestContext` and `HttpResponseContext`.
* Lazy-parsing request bodies is now the default; `Angel.lazyParseBodies` was replaced
with `Angel.eagerParseRequestBodies`.
* `Angel.storeOriginalBuffer` -> `Angel.storeRawRequestBuffers`.
* Lazy-parsing request bodies is now the default; `Protevus.lazyParseBodies` was replaced
with `Protevus.eagerParseRequestBodies`.
* `Protevus.storeOriginalBuffer` -> `Protevus.storeRawRequestBuffers`.
* The methods `lazyBody`, `lazyFiles`, and `lazyOriginalBuffer` on `ResponseContext` were all
replaced with `parseBody`, `parseUploadedFiles`, and `parseRawRequestBuffer`, respectively.
* Removed the synchronous equivalents of the above methods (`body`, `files`, and `originalBuffer`),
as well as `query`.
* Removed `Angel.injections` and `RequestContext.injections`.
* Removed `Angel.inject` and `RequestContext.inject`.
* Removed `Protevus.injections` and `RequestContext.injections`.
* Removed `Protevus.inject` and `RequestContext.inject`.
* Removed a dependency on `package:pool`, which also meant removing `AngelHttp.throttle`.
* Remove the `RequestMiddleware` typedef; from now on, one should use `ResponseContext.end`
exclusively to close responses.
@ -434,9 +434,9 @@ stable, there'll be a conversion, perhaps.
* Removed `RequestContext.properties`.
* Removed the defunct `debug` property where it still existed.
* `Routable.use` now only accepts a `Service`.
* Removed `Angel.createZoneForRequest`.
* Removed `Angel.defaultZoneCreator`.
* Added all flags to the `Angel` constructor, ex. `Angel.eagerParseBodies`.
* Removed `Protevus.createZoneForRequest`.
* Removed `Protevus.defaultZoneCreator`.
* Added all flags to the `Protevus` constructor, ex. `Protevus.eagerParseBodies`.
* Fix a bug where synchronous errors in `handleRequest` would not be caught.
* `AngelHttp.useZone` now defaults to `false`.
* `ResponseContext` now starts in streaming mode by default; the response buffer is opt-in,
@ -448,5 +448,5 @@ stable, there'll be a conversion, perhaps.
* Removed the now-obsolete `ResponseContext.end`.
* Removed the now-obsolete `ResponseContext.releaseCorrespondingRequest`.
* `preInject` now takes a `Reflector` as its second argument.
* `Angel.reflector` defaults to `const EmptyReflector()`, disabling
* `Protevus.reflector` defaults to `const EmptyReflector()`, disabling
reflection out-of-the-box.

View file

@ -74,7 +74,7 @@ The performance benchmark can be found at
[TechEmpower Framework Benchmarks Round 21](https://www.techempower.com/benchmarks/#section=data-r21&test=composite)
### Migrating from Angel to Protevus
### Migrating from Protevus to Protevus
Check out [Migrating to Protevus](https://angel3-docs.dukefirehawk.com/migration/protevus-2.x.x-to-angel3/migration-guide-3)

View file

@ -7,7 +7,7 @@ window.onload = function() {
$app.appendChild($h1);
$app.appendChild($button);
$h1.textContent = '~Angel HTTP/2 server push~';
$h1.textContent = '~Protevus HTTP/2 server push~';
$button.textContent = 'Change color';
$button.onclick = function() {

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angel HTTP/2</title>
<title>Protevus HTTP/2</title>
<style>
input:not([type="submit"]) {
margin-bottom: 2em;

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angel HTTP/2</title>
<title>Protevus HTTP/2</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

View file

@ -26,7 +26,7 @@ void main() async {
serverMain(null);
print('Angel listening at http://localhost:3000');
print('Protevus listening at http://localhost:3000');
await c.future;
}

View file

@ -14,7 +14,7 @@ void main() async {
);
// Index route. Returns JSON.
app.get('/', (req, res) => 'Welcome to Angel!');
app.get('/', (req, res) => 'Welcome to Protevus!');
// Accepts a URL like /greet/foo or /greet/bob.
app.get(
@ -50,7 +50,7 @@ void main() async {
var server = await http.startServer('127.0.0.1', 3000);
var url = 'http://${server.address.address}:${server.port}';
print('Listening at $url');
print('Visit these pages to see Angel in action:');
print('Visit these pages to see Protevus in action:');
print('* $url/greet/bob');
print('* $url/greet/?name=emoji');
print('* $url/greet/?name=jack');

View file

@ -14,7 +14,7 @@ class Controller {
/// The [Protevus] application powering this controller.
Protevus get app {
if (_app == null) {
throw ArgumentError("Angel is not instantiated.");
throw ArgumentError("Protevus is not instantiated.");
}
return _app!;

View file

@ -8,7 +8,7 @@ import 'package:stack_trace/stack_trace.dart';
import 'package:tuple/tuple.dart';
import 'core.dart';
/// Base driver class for Angel implementations.
/// Base driver class for Protevus implementations.
///
/// Powers both AngelHttp and AngelHttp2.
abstract class Driver<

View file

@ -131,7 +131,7 @@ abstract class RequestContext<RawRequest> {
/// This setter allows you to explicitly set the request body **exactly once**.
///
/// Use this if the format of the body is not natively parsed by Angel.
/// Use this if the format of the body is not natively parsed by Protevus.
set bodyAsMap(Map<String, dynamic>? value) => bodyAsObject = value;
/// Returns a *mutable* [List] parsed from the request [body].
@ -151,7 +151,7 @@ abstract class RequestContext<RawRequest> {
/// This setter allows you to explicitly set the request body **exactly once**.
///
/// Use this if the format of the body is not natively parsed by Angel.
/// Use this if the format of the body is not natively parsed by Protevus.
set bodyAsList(List? value) => bodyAsObject = value;
/// Returns the parsed request body, whatever it may be (typically a [Map] or [List]).
@ -167,7 +167,7 @@ abstract class RequestContext<RawRequest> {
/// This setter allows you to explicitly set the request body **exactly once**.
///
/// Use this if the format of the body is not natively parsed by Angel.
/// Use this if the format of the body is not natively parsed by Protevus.
set bodyAsObject(value) {
if (_bodyObject != null) {
throw StateError(

View file

@ -84,9 +84,9 @@ abstract class ResponseContext<RawResponse>
}
}
/// Returns `true` if the response is still available for processing by Angel.
/// Returns `true` if the response is still available for processing by Protevus.
///
/// If it is `false`, then Angel will stop executing handlers, and will only run
/// If it is `false`, then Protevus will stop executing handlers, and will only run
/// response finalizers if the response [isBuffered].
bool get isOpen;
@ -99,7 +99,7 @@ abstract class ResponseContext<RawResponse>
/// The underlying [RawResponse] under this instance.
RawResponse get rawResponse;
/// Signals Angel that the response is being held alive deliberately, and that the framework should not automatically close it.
/// Signals Protevus that the response is being held alive deliberately, and that the framework should not automatically close it.
///
/// This is mostly used in situations like WebSocket handlers, where the connection should remain
/// open indefinitely.

View file

@ -321,7 +321,7 @@ class Protevus extends Routable {
void optimizeForProduction({bool force = false}) {
if (environment.isProduction || force == true) {
_flattened ??= flatten(this);
logger.info('Angel is running in production mode.');
logger.info('Protevus is running in production mode.');
}
}
@ -412,7 +412,7 @@ class Protevus extends Routable {
if (reflector is EmptyReflector || reflector is ThrowingReflector) {
var msg =
'No `reflector` was passed to the Angel constructor, so reflection will not be available.\n$_reflectionInfo';
'No `reflector` was passed to the Protevus constructor, so reflection will not be available.\n$_reflectionInfo';
this.logger.warning(msg);
}

View file

@ -72,7 +72,7 @@ class Service<Id, Data> extends Routable {
Protevus get app {
if (_app == null) {
throw ArgumentError("Angel is not initialized");
throw ArgumentError("Protevus is not initialized");
}
return _app!;
}

View file

@ -17,7 +17,7 @@ final RegExp _straySlashes = RegExp(r'(^/+)|(/+$)');
typedef ServerGeneratorType = Future<HttpServer> Function(dynamic, int);
/// Adapts `dart:io`'s [HttpServer] to serve Angel.
/// Adapts `dart:io`'s [HttpServer] to serve Protevus.
class ProtevusHttp extends Driver<HttpRequest, HttpResponse, HttpServer,
HttpRequestContext, HttpResponseContext> {
@override

View file

@ -15,7 +15,7 @@ Future<SecureServerSocket> startSharedHttp2(
return SecureServerSocket.bind(address, port, ctx, shared: true);
}
/// Adapts `package:http2`'s [ServerTransportConnection] to serve Angel.
/// Adapts `package:http2`'s [ServerTransportConnection] to serve Protevus.
class ProtevusHttp2 extends Driver<Socket, ServerTransportStream,
SecureServerSocket, Http2RequestContext, Http2ResponseContext> {
final ServerSettings? settings;

View file

@ -1,10 +1,10 @@
# Angel Performance Results
# Protevus Performance Results
5 consecutive trials run on a Windows 10 box with 4GB RAM, and several programs open in the background.
Setup:
* Angel framework `1.0.8`
* Protevus framework `1.0.8`
* Running `wrk` 4.0.2.2
* 2 threads
* 256 connections

View file

@ -22,7 +22,7 @@ void main() {
var rs = rq.response;
var body = await rs.transform(utf8.decoder).join();
expect(body, json.encode('bar'));
}, skip: 'Angel no longer has to preinject functions');
}, skip: 'Protevus no longer has to preinject functions');
}
String echoAppFoo(String foo) => foo;

View file

@ -141,13 +141,13 @@ void main() {
expect(response.body, equals('abc'));
});
test('Can nest another Angel instance', () async {
test('Can nest another Protevus instance', () async {
var response = await client.post(Uri.parse('$url/nes/ted/foo'));
var json_ = json.decode(response.body);
expect(json_['route'], equals('foo'));
});
test('Can parse parameters from a nested Angel instance', () async {
test('Can parse parameters from a nested Protevus instance', () async {
var response = await client.get(Uri.parse('$url/todos/1337/action/test'));
var json_ = json.decode(response.body);
print('JSON: $json_');

View file

@ -80,4 +80,4 @@
## 1.0.3
* Dart2 fixes
* Apparently fix hangs that break Angel tests
* Apparently fix hangs that break Protevus tests

View file

@ -9,7 +9,7 @@ void main() {
//var uri = Uri.parse('http://localhost:3000');
/*
var app = Angel()
var app = Protevus()
..get('/foo', (req, res) => 'Hello, world!')
..post('/body',
(req, res) => req.parseBody().then((_) => req.bodyAsMap.length))

View file

@ -9,7 +9,7 @@ A powerful, isomorphic routing library for Dart.
`angel3_route` exposes a routing system that takes the shape of a tree. This tree structure can be easily navigated, in a fashion somewhat similar to a filesystem. The `Router` API is a very straightforward interface that allows for your code to take a shape similar to the route tree. Users of Laravel and Express will be very happy.
`angel3_route` does not require the use of [Angel 3](https://pub.dev/packages/angel3_framework), and has minimal dependencies. Thus, it can be used in any application, regardless of framework. This includes Web apps, Flutter apps, CLI apps, and smaller servers which do not need all the features of the Angel framework.
`angel3_route` does not require the use of [Protevus 3](https://pub.dev/packages/angel3_framework), and has minimal dependencies. Thus, it can be used in any application, regardless of framework. This includes Web apps, Flutter apps, CLI apps, and smaller servers which do not need all the features of the Protevus framework.
## Contents
@ -26,7 +26,7 @@ A powerful, isomorphic routing library for Dart.
### Routing
If you use [Protevus](https://pub.dev/packages/angel3_framework), every `Angel` instance is a `Router` in itself.
If you use [Protevus](https://pub.dev/packages/angel3_framework), every `Protevus` instance is a `Router` in itself.
```dart
void main() {

View file

@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Angel Route Samples</title>
<title>Protevus Route Samples</title>
</head>
<body>
<h1>Angel Route Samples</h1>
<h1>Protevus Route Samples</h1>
<ul>
<li><a href="hash/basic.html">Hash-based</a></li>
<li><a href="push_state/basic.html">Push-state</a></li>

View file

@ -53,4 +53,4 @@
## 2.0.0
* Updates for Dart 2 and Angel 2.
* Updates for Dart 2 and Protevus 2.

View file

@ -1,4 +1,4 @@
/// Angel CORS middleware.
/// Protevus CORS middleware.
library angel3_cors;
import 'dart:async';

View file

@ -58,7 +58,7 @@
## 2.0.0
* Dart/Angel 2 update.
* Dart/Protevus 2 update.
* Remove `package:dart2_constant`
* Update `package:file` to `^5.0.0`.

View file

@ -5,7 +5,7 @@
[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)
[![License](https://img.shields.io/github/license/dart-backend/protevus)](https://github.com/dart-backend/protevus/tree/master/packages/file_service/LICENSE)
Angel service that persists data to a file on disk, stored as a JSON list. It uses a simple mutex to prevent race conditions, and caches contents in memory until changes are made.
Protevus service that persists data to a file on disk, stored as a JSON list. It uses a simple mutex to prevent race conditions, and caches contents in memory until changes are made.
The file will be created on read/write, if it does not already exist.
@ -18,7 +18,7 @@ While not necessarily *slow*, this package makes no promises about performance.
## Usage
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
// Just like a normal service
app.use(
'/api/todos',

View file

@ -1,6 +1,6 @@
name: angel3_file_service
version: 8.2.0
description: Angel service that persists data to a file on disk, stored as a JSON list.
description: Protevus service that persists data to a file on disk, stored as a JSON list.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/file_service
environment:

View file

@ -106,7 +106,7 @@
## 2.0.0
* Update for Dart 2 + Angel 2.
* Update for Dart 2 + Protevus 2.
## 1.1.1+1
@ -115,5 +115,5 @@
## 1.1.1
* Disable the observatory from pausing the isolate
on exceptions, because Angel already handles
on exceptions, because Protevus already handles
all exceptions by itself.

View file

@ -23,7 +23,7 @@ dependencies:
## Usage
This package is dependent on the Dart VM service, so you *must* run Dart with the `--observe` (or `--enable-vm-service`) argument. Usage is fairly simple. Pass a function that creates an `Angel` server, along with a collection of paths to watch, to the `HotReloader` constructor. The recommended pattern is to only use hot-reloading in your application entry point. Create your `Angel` instance within a separate function, conventionally named `createServer`.
This package is dependent on the Dart VM service, so you *must* run Dart with the `--observe` (or `--enable-vm-service`) argument. Usage is fairly simple. Pass a function that creates an `Protevus` server, along with a collection of paths to watch, to the `HotReloader` constructor. The recommended pattern is to only use hot-reloading in your application entry point. Create your `Protevus` instance within a separate function, conventionally named `createServer`.
You can watch:
@ -51,8 +51,8 @@ main() async {
await hot.startServer('127.0.0.1', 3000);
}
Future<Angel> createServer() async {
var app = Angel()..serializer = json.encode;
Future<Protevus> createServer() async {
var app = Protevus()..serializer = json.encode;
// Edit this line, and then refresh the page in your browser!
app.get('/', (req, res) => {'hello': 'hot world!'});

View file

@ -18,7 +18,7 @@ import 'package:vm_service/vm_service.dart' as vm;
import 'package:vm_service/vm_service_io.dart' as vm;
import 'package:watcher/watcher.dart';
/// A utility class that watches the filesystem for changes, and starts new instances of an Angel server.
/// A utility class that watches the filesystem for changes, and starts new instances of an Protevus server.
class HotReloader {
final StreamController<WatchEvent> _onChange =
StreamController<WatchEvent>.broadcast();

View file

@ -34,4 +34,4 @@
## 2.0.0
* Angel 2 + Dart 2 updates.
* Protevus 2 + Dart 2 updates.

View file

@ -27,7 +27,7 @@ Node myDom = html(lang: 'en', c: [
]);
```
This plug-in means that you can now `return` these AST's, and Angel will automatically send them to clients. Ultimately, the implication is that you can use `belatuk_html_builder` as a substitute for a templating system within Dart. With [hot reloading](https://pub.dev/packages/angel3_hot), you won't even need to reload your server (as it should be).
This plug-in means that you can now `return` these AST's, and Protevus will automatically send them to clients. Ultimately, the implication is that you can use `belatuk_html_builder` as a substitute for a templating system within Dart. With [hot reloading](https://pub.dev/packages/angel3_hot), you won't even need to reload your server (as it should be).
## Installation
@ -43,7 +43,7 @@ dependencies:
The `renderHtml` function does all the magic for you.
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
// Wire it up!
app.fallback(renderHtml());
@ -71,7 +71,7 @@ configureServer(Angel app) async {
By default, `renderHtml` will ignore the client's `Accept` header. However, if you pass `enforceAcceptHeader` as `true`, then a `406 Not Acceptable` error will be thrown if the client doesn't accept `*/*` or `text/html`.
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
// Wire it up!
app.fallback(renderHtml(enforceAcceptHeader: true));

View file

@ -1,6 +1,6 @@
name: angel3_html
version: 8.1.0
description: Support for rendering html_builder AST's as responses in Angel.
description: Support for rendering html_builder AST's as responses in Protevus.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/angel3/packages/html_builder
environment:

View file

@ -74,7 +74,7 @@
## 2.0.0
* Angel 2 and Dart 2 updates.
* Protevus 2 and Dart 2 updates.
* Default to `.jael` instead of `.jl`.
## 1.0.3

View file

@ -5,7 +5,7 @@
[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)
[![License](https://img.shields.io/github/license/dart-backend/protevus)](https://github.com/dart-backend/protevus/tree/master/packages/jael/angel_jael/LICENSE)
[Angel 3](https://pub.dev/packages/angel3_framework) support for [Jael 3](https://pub.dev/packages/jael3).
[Protevus 3](https://pub.dev/packages/angel3_framework) support for [Jael 3](https://pub.dev/packages/jael3).
## Installation
@ -18,7 +18,7 @@ dependencies:
## Usage
Just like `mustache` and other renderers, configuring Angel to use Jael is as simple as calling `app.configure`:
Just like `mustache` and other renderers, configuring Protevus to use Jael is as simple as calling `app.configure`:
```dart
import 'package:angel3_framework/angel3_framework.dart';
@ -26,7 +26,7 @@ import 'package:angel3_jael/angel3_jael.dart';
import 'package:file/file.dart';
AngelConfigurer myPlugin(FileSystem fileSystem) {
return (Angel app) async {
return (Protevus app) async {
// Connect Jael to your server...
await app.configure(
jael(fileSystem.directory('views')),
@ -52,7 +52,7 @@ import 'package:file/local.dart';
import 'package:logging/logging.dart';
void main() async {
var app = Angel();
var app = Protevus();
var fileSystem = const LocalFileSystem();
await app.configure(

View file

@ -5,7 +5,7 @@ import 'package:jael3/jael3.dart';
import 'package:jael3_preprocessor/jael3_preprocessor.dart';
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
/// Configures an Angel server to use Jael to render templates.
/// Configures an Protevus server to use Jael to render templates.
///
/// To enable "minified" output, set minified to true
///

View file

@ -1,6 +1,6 @@
name: angel3_jael
version: 8.2.0
description: Angel support for the Jael templating engine, similar to Blade or Liquid.
description: Protevus support for the Jael templating engine, similar to Blade or Liquid.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/jael/angel_jael
environment:

View file

@ -33,7 +33,7 @@ void main() {
// e.jl
fileSystem.file('e.jl').writeAsStringSync(
'<extend src="c.jl"><block name="greeting">Angel <b><block name="name">default</block></b></block></extend>');
'<extend src="c.jl"><block name="greeting">Protevus <b><block name="name">default</block></b></block></extend>');
// fox.jl
fileSystem.file('fox.jl').writeAsStringSync(

View file

@ -17,7 +17,7 @@ import 'package:angel_jinja/angel_jinja.dart';
import 'package:path/path.dart' as p;
void main() async {
var app = Angel();
var app = Protevus();
var http = AngelHttp(app);
var viewsDir = p.join(
p.dirname(

View file

@ -2,7 +2,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:jinja/jinja.dart';
import 'package:jinja/loaders.dart';
/// Configures an Angel server to use Jinja2 to render templates.
/// Configures an Protevus server to use Jinja2 to render templates.
///
/// By default, templates are loaded from the filesystem;
/// pass your own [createLoader] callback to override this.

View file

@ -49,5 +49,5 @@
## 2.0.0
* Angel 2 + Dart 2 updates.
* Protevus 2 + Dart 2 updates.
* Use `package:file`.

View file

@ -21,10 +21,10 @@ dependencies:
## Usage
It's very straightforward to configure an Angel server to use Markdown. Keep in mind to use `package:file` instead of `dart:io`:
It's very straightforward to configure an Protevus server to use Markdown. Keep in mind to use `package:file` instead of `dart:io`:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
var fs = LocalFileSystem();
await app.configure(markdown(
// The directory where your views are located.
@ -36,7 +36,7 @@ configureServer(Angel app) async {
You can then generate HTML on-the-fly in a request handler. Assuming your view directory contained a file named `hello.md`, the following would render it as an HTML response:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
app.get('/hello', (res) => res.render('hello'));
}
```
@ -72,7 +72,7 @@ You might want to wrap the content of pages in a custom template to apply pretty
CSS and JS, etc:
```dart
configureServer(Angel app) async {
configureServer(Protevus app) async {
await app.configure(
markdown(
// The directory where your views are located.

View file

@ -68,4 +68,4 @@
## 2.0.0-
* Delete `mongo_service_typed`.
* Update for Angel 2.
* Update for Protevus 2.

View file

@ -22,7 +22,7 @@ This library exposes one main class: `MongoService`.
## Model
`Model` is class with no real functionality; however, it represents a basic document, and your services should host inherited classes. Other Angel service providers host `Model` as well, so you will easily be able to modify your application if you ever switch databases.
`Model` is class with no real functionality; however, it represents a basic document, and your services should host inherited classes. Other Protevus service providers host `Model` as well, so you will easily be able to modify your application if you ever switch databases.
```dart
class User extends Model {

View file

@ -49,4 +49,4 @@
## 2.0.0
* Angel 2 and Dart 2 support.
* Protevus 2 and Dart 2 support.

View file

@ -23,7 +23,7 @@ dependencies:
```dart
const FileSystem fs = const LocalFileSystem();
configureServer(Angel app) async {
configureServer(Protevus app) async {
// Run the plug-in
await app.configure(mustache(fs.directory('views')));

View file

@ -73,7 +73,7 @@
## 2.0.0
* Angel 2 support.
* Protevus 2 support.
## 1.0.0+1

View file

@ -5,7 +5,7 @@
[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)
[![License](https://img.shields.io/github/license/dart-backend/protevus)](https://github.com/dart-backend/protevus/tree/master/packages/oauth2/LICENSE)
A class containing handlers that can be used within [Angel](https://angel3-framework.web.app/) to build a spec-compliant OAuth 2.0 server, including PKCE support.
A class containing handlers that can be used within [Protevus](https://angel3-framework.web.app/) to build a spec-compliant OAuth 2.0 server, including PKCE support.
- [Protevus OAuth2 Server](#angel3-oauth2-server)
- [Installation](#installation)

View file

@ -1,6 +1,6 @@
import 'package:angel3_http_exception/angel3_http_exception.dart';
/// An Angel-friendly wrapper around OAuth2 [ErrorResponse] instances.
/// An Protevus-friendly wrapper around OAuth2 [ErrorResponse] instances.
class AuthorizationException extends ProtevusHttpException {
final ErrorResponse errorResponse;

View file

@ -1,6 +1,6 @@
name: angel3_oauth2
version: 8.2.0
description: A class containing handlers that can be used within Angel to build a spec-compliant OAuth 2.0 server.
description: A class containing handlers that can be used within Protevus to build a spec-compliant OAuth 2.0 server.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/oauth2
environment:

View file

@ -96,10 +96,10 @@ import 'package:angel3_orm/angel3_orm.dart';
import 'car.dart';
import 'car.orm.g.dart';
/// Returns an Angel plug-in that connects to a database, and sets up a controller connected to it...
/// Returns an Protevus plug-in that connects to a database, and sets up a controller connected to it...
AngelConfigurer connectToCarsTable(QueryExecutor executor) {
return (Angel app) async {
// Register the connection with Angel's dependency injection system.
return (Protevus app) async {
// Register the connection with Protevus's dependency injection system.
//
// This means that we can use it as a parameter in routes and controllers.
app.container.registerSingleton(executor);

View file

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:args/command_runner.dart';
import 'runner.dart';
/// Runs the Angel Migration CLI.
/// Runs the Protevus Migration CLI.
Future runMigrations(MigrationRunner migrationRunner, List<String> args) {
var cmd = CommandRunner('migration_runner', 'Executes Protevus migrations.')
..addCommand(_UpCommand(migrationRunner))

View file

@ -3,7 +3,7 @@ import 'package:angel3_framework/angel3_framework.dart' hide Query;
import 'package:angel3_orm/angel3_orm.dart';
/// A [Service] implementation that wraps over a [Query] class generated
/// via the Angel ORM.
/// via the Protevus ORM.
class OrmService<Id, Data, TQuery extends Query<Data, QueryWhere>>
extends Service<Id, Data> {
/// The [QueryExecutor] used to communicate with a database.

View file

@ -161,7 +161,7 @@ void standaloneTests(FutureOr<QueryExecutor> Function() createExecutor,
});
test('update car', () async {
var cloned = ferrari!.copyWith(make: 'Angel');
var cloned = ferrari!.copyWith(make: 'Protevus');
var query = CarQuery()..values.copyFrom(cloned);
var carOpt = await (query.updateOne(executor!));
expect(carOpt.isPresent, true);

View file

@ -25,7 +25,7 @@ import 'package:angel3_production/angel3_production.dart';
void main(List<String> args) => Runner('example', configureServer).run(args);
Future configureServer(Angel app) async {
Future configureServer(Protevus app) async {
app.get('/', (req, res) => 'Hello, production world!');
app.get('/crash', (req, res) {

View file

@ -15,7 +15,7 @@ import 'package:logging/logging.dart';
import 'instance_info.dart';
import 'options.dart';
/// A command-line utility for easier running of multiple instances of an Angel application.
/// A command-line utility for easier running of multiple instances of an Protevus application.
///
/// Makes it easy to do things like configure SSL, log messages, and send messages between
/// all running instances.
@ -156,7 +156,7 @@ class Runner {
.whenComplete(onLogRecord.close);
}
/// Starts a number of isolates, running identical instances of an Angel application.
/// Starts a number of isolates, running identical instances of an Protevus application.
Future run(List<String> args) async {
Server? server;

View file

@ -77,7 +77,7 @@ optional parameter.
## 2.0.0
* Updates for Angel 2. Big thanks to @denkuy!
* Updates for Protevus 2. Big thanks to @denkuy!
* Use `package:path` for better path resolution.
## 1.1.1

View file

@ -1,6 +1,6 @@
name: angel3_proxy
version: 8.2.0
description: Angel middleware to forward requests to another server (i.e. pub serve).
description: Protevus middleware to forward requests to another server (i.e. pub serve).
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/proxy
environment:

View file

@ -4,7 +4,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:resp_client/resp_client.dart';
import 'package:resp_client/resp_commands.dart';
/// An Angel service that reads and writes JSON within a Redis store.
/// An Protevus service that reads and writes JSON within a Redis store.
class RedisService extends Service<String, Map<String, dynamic>> {
final RespCommandsTier2 respCommands;

View file

@ -25,7 +25,7 @@ a problem, as it lowers the number of events that need to be handled on the clie
## Model
`Model` is class with no real functionality; however, it represents a basic document, and your services should host inherited classes. Other Angel service providers host `Model` as well, so you will easily be able to modify your application if you ever switch databases.
`Model` is class with no real functionality; however, it represents a basic document, and your services should host inherited classes. Other Protevus service providers host `Model` as well, so you will easily be able to modify your application if you ever switch databases.
```dart
class User extends Model {

View file

@ -57,5 +57,5 @@
## 2.0.0-alpha
* Angel 2 updates. Remove previous functionality.
* Protevus 2 updates. Remove previous functionality.
* Add `CookieSigner`, `RateLimiter`/`InMemoryRateLimiter`/`ServiceRateLimiter`

View file

@ -45,7 +45,7 @@
## 2.0.0
* Angel 2 updates.
* Protevus 2 updates.
## 1.0.0

View file

@ -5,7 +5,7 @@
[![Discord](https://img.shields.io/discord/1060322353214660698)](https://discord.gg/3X6bxTUdCM)
[![License](https://img.shields.io/github/license/dart-backend/protevus)](https://github.com/dart-backend/protevus/tree/master/packages/seo/LICENSE)
Helpers for building SEO-friendly Web pages in Angel. The goal of `package:angel3_seo` is to speed up perceived client page loads, prevent the infamous [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content), and other SEO optimizations that can easily become tedious to perform by hand.
Helpers for building SEO-friendly Web pages in Protevus. The goal of `package:angel3_seo` is to speed up perceived client page loads, prevent the infamous [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content), and other SEO optimizations that can easily become tedious to perform by hand.
## Disabling inlining per-element
@ -30,7 +30,7 @@ import 'package:angel3_static/angel3_static.dart';
import 'package:file/local.dart';
void main() async {
var app = Angel()..lazyParseBodies = true;
var app = Protevus()..lazyParseBodies = true;
var fs = const LocalFileSystem();
var http = AngelHttp(app);
@ -54,7 +54,7 @@ import 'package:angel3_static/angel3_static.dart';
import 'package:file/local.dart';
void main() async {
var app = Angel()..lazyParseBodies = true;
var app = Protevus()..lazyParseBodies = true;
var fs = const LocalFileSystem();
var http = AngelHttp(app);

View file

@ -9,10 +9,10 @@
<link rel="stylesheet" href="not-inlined.css" data-no-inline>
<script src="site.js"></script>
<script src="not-inlined.js" data-no-inline></script>
<title>Angel SEO</title>
<title>Protevus SEO</title>
</head>
<body>
<h1>Angel SEO</h1>
<h1>Protevus SEO</h1>
<p>Embrace the power of inlined styles, etc.</p>
</body>
</html>

View file

@ -134,10 +134,10 @@ var contents = <String, String>{
<link data-foo="bar" rel="stylesheet" href="not-inlined.css" data-no-inline>
<script data-foo="bar" src="site.js"></script>
<script type="text/javascript" src="not-inlined.js" data-no-inline></script>
<title>Angel SEO</title>
<title>Protevus SEO</title>
</head>
<body>
<h1>Angel SEO</h1>
<h1>Protevus SEO</h1>
<p>Embrace the power of inlined styles, etc.</p>
</body>
</html>''',

View file

@ -1,6 +1,6 @@
name: angel3_serialize_generator
version: 8.3.1
description: Protevus model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
description: Protevus model serialization generators, designed for use with Protevus. Combine with angel_serialize for flexible modeling.
homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/protevus/tree/master/packages/serialize/angel_serialize_generator
environment:

View file

@ -47,7 +47,7 @@
## 2.1.0
* `pedantic` lints.
* Add the `AngelShelf` driver class, which allows you to embed Angel within shelf.
* Add the `AngelShelf` driver class, which allows you to embed Protevus within shelf.
## 2.0.0

View file

@ -7,19 +7,19 @@
**Replacement of `package:angel_shelf` with breaking changes to support NNBD.**
Shelf interop with Protevus. This package lets you run `package:shelf` handlers via a custom adapter. Use the code in this repo to embed existing Angel/shelf apps into other Angel/shelf applications. This way, you can migrate legacy applications without having to rewrite your business logic. This will make it easy to layer your API over a production application, rather than having to port code.
Shelf interop with Protevus. This package lets you run `package:shelf` handlers via a custom adapter. Use the code in this repo to embed existing Protevus/shelf apps into other Protevus/shelf applications. This way, you can migrate legacy applications without having to rewrite your business logic. This will make it easy to layer your API over a production application, rather than having to port code.
- [Protevus Shelf](#angel3-shelf)
- [Usage](#usage)
- [embedShelf](#embedshelf)
- [Communicating with Angel with embedShelf](#communicating-with-protevus-with-embedshelf)
- [Communicating with Protevus with embedShelf](#communicating-with-protevus-with-embedshelf)
- [AngelShelf](#angelshelf)
## Usage
### embedShelf
This is a compliant `shelf` adapter that acts as an Angel request handler. You can use it as a middleware,
This is a compliant `shelf` adapter that acts as an Protevus request handler. You can use it as a middleware,
or attach it to individual routes.
```dart
@ -30,10 +30,10 @@ import 'package:shelf/shelf.dart' as shelf;
import 'api/api.dart';
void main() async {
var app = Angel();
var app = Protevus();
var http = AngelHttp(app);
// Angel routes on top
// Protevus routes on top
await app.mountController<ApiController>();
// Re-route all other traffic to an
@ -52,13 +52,13 @@ void main() async {
}
```
### Communicating with Angel with embedShelf
### Communicating with Protevus with embedShelf
You can communicate with Protevus:
```dart
handleRequest(shelf.Request request) {
// Access original Angel request...
// Access original Protevus request...
var req = request.context['angel_shelf.request'] as RequestContext;
// ... And then interact with it.
@ -72,7 +72,7 @@ handleRequest(shelf.Request request) {
### AngelShelf
Protevus brought about the generic `Driver` class, which is implemented by `AngelHttp`, `AngelHttp2`, `AngelGopher`, etc., and provides the core infrastructure for request handling in Angel. `AngelShelf` is an implementation that wraps shelf requests and responses in their Angel equivalents. Using it is as simple using as using `AngelHttp`, or any other driver:
Protevus brought about the generic `Driver` class, which is implemented by `AngelHttp`, `AngelHttp2`, `AngelGopher`, etc., and provides the core infrastructure for request handling in Protevus. `AngelShelf` is an implementation that wraps shelf requests and responses in their Protevus equivalents. Using it is as simple using as using `AngelHttp`, or any other driver:
```dart
// Create an AngelShelf driver.
@ -89,7 +89,7 @@ await shelf_io.serve(angelShelf.handler, InternetAddress.loopbackIPv4, 8081);
You can also use the `AngelShelf` driver as a shelf middleware - just use
`angelShelf.middleware` instead of `angelShelf.handler`. When used as a middleware,
if the Angel response context is still open after all handlers run (i.e. no routes were
if the Protevus response context is still open after all handlers run (i.e. no routes were
matched), the next shelf handler will be called.
```dart

View file

@ -27,7 +27,7 @@ import 'package:angel3_static/angel3_static.dart';
import 'package:file/local.dart';
void main() async {
var app = Angel();
var app = Protevus();
var fs = const LocalFileSystem();
// Normal static server

View file

@ -50,5 +50,5 @@
## 2.0.0
* Dart 2 + Angel 2 updates.
* Dart 2 + Protevus 2 updates.
* Extend `StreamChannel`, instead of the defunct `WebSocketSynchronizer`.

View file

@ -97,7 +97,7 @@
## 2.0.0-alpha
* Depend on Dart 2 and Angel 2.
* Depend on Dart 2 and Protevus 2.
## 1.1.0+1

View file

@ -21,7 +21,7 @@ ws.onData.listen(...);
## Matchers
Several `Matcher`s are bundled with this package, and run on any `package:http` `Response`, not just those returned by Angel.
Several `Matcher`s are bundled with this package, and run on any `package:http` `Response`, not just those returned by Protevus.
```dart
void test('foo', () async {

View file

@ -41,4 +41,4 @@
## 2.0.0
* Angel 2 + Dart 2 updates
* Protevus 2 + Dart 2 updates

View file

@ -78,11 +78,11 @@
## 2.0.0
* Finish update for Angel 2.
* Finish update for Protevus 2.
## 2.0.0-alpha.1
* Update for Angel 2.
* Update for Protevus 2.
## 1.0.5-beta

View file

@ -284,7 +284,7 @@ final Validator todo = Validator({
});
void main() async {
var app = Angel();
var app = Protevus();
app.chain([validate(echo)]).post('/echo', (req, res) async {
res.write('You said: "${req.bodyAsMap["message"]}"');

View file

@ -1,4 +1,4 @@
/// Support for using `angel_validate` with the Angel Framework.
/// Support for using `angel_validate` with the Protevus Framework.
library angel3_validate.server;
import 'dart:async';

View file

@ -105,7 +105,7 @@
## 2.0.0-alpha.3
* Directly import Angel HTTP.
* Directly import Protevus HTTP.
## 2.0.0-alpha.2
@ -113,12 +113,12 @@
## 2.0.0-alpha.1
* Refactorings for updated Angel 2 versions.
* Refactorings for updated Protevus 2 versions.
* Remove `package:dart2_constant`.
## 2.0.0-alpha
* Depend on Dart 2 and Angel 2.
* Depend on Dart 2 and Protevus 2.
## 1.1.2

View file

@ -18,7 +18,7 @@ import "package:angel3_framework/angel3_framework.dart";
import "package:angel3_websocket/server.dart";
void main() async {
var app = Angel();
var app = Protevus();
var ws = AngelWebSocket();
@ -95,7 +95,7 @@ Clients can even perform authentication over WebSockets.
import "package:angel3_websocket/browser.dart";
void main() async {
Angel app = WebSockets("/ws");
Protevus app = WebSockets("/ws");
await app.connect();
var Cars = app.service("api/cars");
@ -134,7 +134,7 @@ class Car extends Model {
}
void main() async {
Angel app = WebSockets("/ws");
Protevus app = WebSockets("/ws");
// Wait for WebSocket connection...
await app.connect();

Some files were not shown because too many files have changed in this diff Show more