Updated configuration

This commit is contained in:
thomashii 2021-07-08 13:23:02 +08:00
parent c4f26ad4ca
commit 5a014bf1d0
8 changed files with 48 additions and 27 deletions

View file

@ -1,6 +1,6 @@
# Angel3 Anthentication # Angel3 Anthentication
[![version](https://img.shields.io/badge/pub-v4.0.4-brightgreen)](https://pub.dartlang.org/packages/angel3_auth) [![version](https://img.shields.io/badge/pub-v4.0.4-brightgreen)](https://pub.dev/packages/angel3_auth)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![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) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)

View file

@ -1,12 +1,12 @@
# HTTP Caching for Angel3 # HTTP Caching for Angel3
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_cache) [![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dev/packages/angel3_cache)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![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) [![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/cache/LICENSE) [![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/cache/LICENSE)
A service that provides HTTP caching to the response data for [Angel3](https://github.com/dukefirehawk/angel). A service that provides HTTP caching to the response data for [Angel3 framework](https://pub.dev/packages/angel3).
## `CacheService` ## `CacheService`

View file

@ -1,29 +1,45 @@
# 4.0.0 # Change Log
## 4.0.1
* Updated README
* Fixed unit tests
* All 8 unit test passed
## 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0 ## 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD * Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.2.0 ## 2.2.0
* Allow including one configuration within another. * Allow including one configuration within another.
* Badly-formatted `.env` files will no longer issue a warning, * Badly-formatted `.env` files will no longer issue a warning,
but instead throw an exception. but instead throw an exception.
# 2.1.0 ## 2.1.0
* Add `loadStandaloneConfiguration`. * Add `loadStandaloneConfiguration`.
# 2.0.0 ## 2.0.0
* Use Angel 2. * Use Angel 2.
# 1.2.0-rc.0 ## 1.2.0-rc.0
* Removed the `Configuration` class. * Removed the `Configuration` class.
* Removed the `ConfigurationTransformer` class. * Removed the `ConfigurationTransformer` class.
* Use `Map` casting to prevent runtime cast errors. * Use `Map` casting to prevent runtime cast errors.
# 1.1.0 (Retroactive changelog) ## 1.1.0 (Retroactive changelog)
* Use `package:file`. * Use `package:file`.
# 1.0.5 ## 1.0.5
* Now using `package:merge_map` to merge configurations. Resolves * Now using `package:merge_map` to merge configurations. Resolves
[#5](https://github.com/angel-dart/configuration/issues/5). [#5](https://github.com/angel-dart/configuration/issues/5).
* You can now specify a custom `envPath`. * You can now specify a custom `envPath`.

View file

@ -1,21 +1,23 @@
# angel3_configuration # Angel3 Configuration Loader
[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_configuration)
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dev/packages/angel3_configuration)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![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) [![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/configuration/LICENSE) [![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/configuration/LICENSE)
Automatic YAML configuration loader for [Angel3 framework](https://pub.dev/packages/angel3)
Automatic YAML configuration loader for Angel. ## About
# About
Any web app needs different configuration for development and production. This plugin will search Any web app needs different configuration for development and production. This plugin will search
for a `config/default.yaml` file. If it is found, configuration from it is loaded into `app.configuration`. for a `config/default.yaml` file. If it is found, configuration from it is loaded into `app.configuration`.
Then, it will look for a `config/$ANGEL_ENV` file. (i.e. config/development.yaml). If this found, all of its Then, it will look for a `config/$ANGEL_ENV` file. (i.e. config/development.yaml). If this found, all of its
configuration be loaded, and will override anything loaded from the `default.yaml` file. This allows for your configuration be loaded, and will override anything loaded from the `default.yaml` file. This allows for your
app to work under different conditions without you re-coding anything. :) app to work under different conditions without you re-coding anything. :)
# Installation ## Installation
In `pubspec.yaml`: In `pubspec.yaml`:
```yaml ```yaml
@ -23,9 +25,10 @@ dependencies:
angel3_configuration: ^3.0.0 angel3_configuration: ^3.0.0
``` ```
# Usage ## Usage
Example Configuration
**Example Configuration**
```yaml ```yaml
# Define normal YAML objects # Define normal YAML objects
some_key: foo some_key: foo
@ -36,6 +39,7 @@ this_is_a_map:
``` ```
You can also load configuration from the environment: You can also load configuration from the environment:
```yaml ```yaml
# Loaded from the environment # Loaded from the environment
system_path: $PATH system_path: $PATH
@ -45,6 +49,7 @@ If a `.env` file is present in your configuration directory (i.e. `config/.env`)
applying YAML configuration. applying YAML configuration.
You can also include values from one file into another: You can also include values from one file into another:
```yaml ```yaml
_include: _include:
- "./include-prod.yaml" - "./include-prod.yaml"
@ -53,15 +58,13 @@ _include: "just-one-file.yaml"
``` ```
**Server-side** **Server-side**
Call `configuration()`. The loaded configuration will be available in your application's Call `configuration()`. The loaded configuration will be available in your application's `configuration` map.
`configuration` map.
`configuration` also accepts a `sourceDirectory` or `overrideEnvironmentName` parameter. `configuration` also accepts a `sourceDirectory` or `overrideEnvironmentName` parameter.
The former will allow you to search in a directory other than `config`, and the latter lets you The former will allow you to search in a directory other than `config`, and the latter lets you
override `$ANGEL_ENV` by specifying a specific configuration name to look for (i.e. `production`). override `$ANGEL_ENV` by specifying a specific configuration name to look for (i.e. `production`).
This package uses This package uses [`package:angel3_merge_map`](https://pub.dev/packages/angel3_merge_map)
[`package:merge_map`](https://github.com/thosakwe/merge_map)
internally, so existing configurations can be deeply merged. internally, so existing configurations can be deeply merged.
Example: Example:

View file

@ -1,7 +1,8 @@
name: angel3_configuration name: angel3_configuration
description: Automatic YAML application configuration loader for Angel, with .env support. description: Automatic YAML application configuration loader for Angel, with .env support.
version: 4.0.0 version: 4.0.1
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/configuration homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/configuration
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:

View file

@ -0,0 +1 @@
included: true

View file

@ -1,5 +1,5 @@
_include: _include:
- "./include.yaml" - "./custom.yaml"
hello: world hello: world
foo: foo:
version: bar version: bar

View file

@ -1,6 +1,6 @@
# Angel3 Framework # Angel3 Framework
[![version](https://img.shields.io/badge/pub-v4.1.1-brightgreen)](https://pub.dartlang.org/packages/angel3_framework) [![version](https://img.shields.io/badge/pub-v4.1.1-brightgreen)](https://pub.dev/packages/angel3_framework)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![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) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)