Skip to content

Commit 3bd22c7

Browse files
committed
3.0.0 rewrite
1 parent 7a04b78 commit 3bd22c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2043
-1293
lines changed

.github/workflows/deploy_docs.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: deploy dev docs
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
deploy-docs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Cache
14+
uses: actions/cache@v2
15+
with:
16+
path: ~/.pub_cache
17+
key: ${{ runner.os }}
18+
19+
- name: Setup Dart Action
20+
uses: cedx/setup-dart@v2.3.0
21+
with:
22+
release-channel: stable
23+
24+
- name: Checkout
25+
uses: actions/checkout@v2.3.4
26+
27+
- name: Install dependencies
28+
run: dart pub get
29+
30+
- name: Generate docs
31+
run: dartdoc
32+
33+
- name: Deploy nyxx dev docs
34+
uses: easingthemes/ssh-deploy@v2.1.5
35+
env:
36+
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_SERVER_KEY }}
37+
ARGS: "-rltDzvO"
38+
SOURCE: "doc/api/"
39+
REMOTE_HOST: ${{ secrets.DEPLOY_REMOTE_HOST }}
40+
REMOTE_USER: ${{ secrets.DEPLOY_REMOTE_USER }}
41+
TARGET: "${{ secrets.DEPLOY_REMOTE_TARGET }}/dartdocs/nyxx_lavalink/"

.github/workflows/publish.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
nyxx_publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: 'publish nyxx package to pub.dev'
14+
id: publish
15+
uses: k-paxian/dart-package-publisher@master
16+
with:
17+
skipTests: true
18+
force: true
19+
suppressBuildRunner: true
20+
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
21+
- name: 'Commit release tag'
22+
if: steps.publish.outputs.success
23+
uses: hole19/git-tag-action@master
24+
env:
25+
TAG: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
26+
GITHUB_TOKEN: ${{ secrets.TAG_RELEASE_TOKEN }}

.github/workflows/unit_tests.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: unit tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
8+
jobs:
9+
analyze:
10+
name: Analyze
11+
runs-on: ubuntu-latest
12+
env:
13+
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
14+
steps:
15+
- name: Cache
16+
uses: actions/cache@v2
17+
with:
18+
path: ~/.pub_cache
19+
key: ${{ runner.os }}
20+
21+
- name: Setup Dart Action
22+
uses: cedx/setup-dart@v2.3.0
23+
with:
24+
release-channel: stable
25+
26+
- name: Checkout
27+
uses: actions/checkout@v2.3.4
28+
29+
- name: Install dependencies
30+
run: dart pub get
31+
32+
- name: Analyze project source
33+
run: dart analyze
34+
35+
format:
36+
name: Format
37+
runs-on: ubuntu-latest
38+
env:
39+
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
40+
steps:
41+
- name: Cache
42+
uses: actions/cache@v2
43+
with:
44+
path: ~/.pub_cache
45+
key: ${{ runner.os }}
46+
47+
- name: Setup Dart Action
48+
uses: cedx/setup-dart@v2.3.0
49+
with:
50+
release-channel: stable
51+
52+
- name: Checkout
53+
uses: actions/checkout@v2.3.4
54+
55+
- name: Install dependencies
56+
run: dart pub get
57+
58+
- name: Format
59+
run: dart format --set-exit-if-changed -l 160 ./lib
60+
61+
tests:
62+
needs: [ format, analyze ]
63+
name: Tests
64+
runs-on: ubuntu-latest
65+
env:
66+
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
67+
steps:
68+
- name: Cache
69+
uses: actions/cache@v2
70+
with:
71+
path: ~/.pub_cache
72+
key: ${{ runner.os }}
73+
74+
- name: Setup Dart Action
75+
uses: cedx/setup-dart@v2.3.0
76+
with:
77+
release-channel: stable
78+
79+
- name: Install lcov
80+
run: sudo apt-get install -y lcov
81+
82+
- name: Checkout
83+
uses: actions/checkout@v2.3.4
84+
85+
- name: Install dependencies
86+
run: dart pub get
87+
88+
- name: Unit tests
89+
run: dart run test --coverage="coverage" test/unit/**
90+
91+
- name: Integration tests
92+
run: dart run test --coverage="coverage" test/integration/**
93+
continue-on-error: true
94+
95+
- name: Format coverage
96+
run: dart run coverage:format_coverage --lcov --in=coverage --out=coverage/coverage.lcov --packages=.packages --report-on=lib
97+
98+
- name: Generate coverage
99+
run: genhtml coverage/coverage.lcov -o coverage/coverage_gen
100+
101+
- name: Extract branch name
102+
shell: bash
103+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
104+
id: extract_branch
105+
106+
- name: Deploy code coverage
107+
uses: easingthemes/ssh-deploy@v2.1.5
108+
env:
109+
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_SERVER_KEY }}
110+
ARGS: '-rltDzvO --rsync-path="mkdir -p ${{ secrets.DEPLOY_REMOTE_TARGET }}/coverage/nyxx_lavalink/${{ steps.extract_branch.outputs.branch }}/ && rsync"'
111+
SOURCE: "coverage/coverage_gen/"
112+
REMOTE_HOST: ${{ secrets.DEPLOY_REMOTE_HOST }}
113+
REMOTE_USER: ${{ secrets.DEPLOY_REMOTE_USER }}
114+
TARGET: "${{ secrets.DEPLOY_REMOTE_TARGET }}/coverage/nyxx_lavalink/${{ steps.extract_branch.outputs.branch }}/"

.gitignore

+37-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
1-
# Files and directories created by pub.
2-
.dart_tool/
1+
local/
2+
.atom/
3+
.vscode/
4+
index.html
5+
docs/
6+
.buildlog
37
.packages
4-
5-
# Conventional directory for build outputs.
6-
build/
7-
8-
# Omit committing pubspec.lock for library packages; see
9-
# https://dart.dev/guides/libraries/private-files#pubspeclock.
8+
.project
9+
.pub
10+
**/build
11+
**/packages
12+
*.dart.js
13+
*.part.js
14+
*.js.deps
15+
*.js.map
16+
*.info.json
17+
doc/api/
18+
pubspec.lock
19+
*.iml
20+
.idea
21+
*~
22+
*#
23+
.#*
24+
.dart_tool/
25+
/README.html
26+
/log.txt
27+
/nyxx.wiki/
28+
/test/private.dart
29+
/publish_docs.sh
30+
/test/mirrors.dart
31+
/private
32+
private-*.dart
33+
test-*.dart
34+
[Rr]pc*
35+
**/doc/api/**
36+
**/coverage/**
37+
coverage.json
38+
lcov.info
1039
pubspec.lock

Makefile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.PHONY: help
2+
help:
3+
@fgrep -h "##" $(MAKEFILE_LIST) | sed -e 's/\(\:.*\#\#\)/\:\ /' | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
4+
5+
.PHONY: app-check ## Run basic format checks and then generate code coverage
6+
app-check: format-check generate-coverage
7+
8+
.PHONY: format-check ## Check basic format
9+
format-check: format analyze
10+
11+
.PHONY: generate-coverage
12+
generate-coverage: integration-tests unit-tests coverage-format coverage-gen-html ## Run all test and generate html code coverage
13+
14+
.PHONY: integration-tests
15+
integration-tests: ## Run integration tests with coverage
16+
(timeout 20s dart run test --coverage="coverage" --timeout=none test/integration ; exit 0)
17+
18+
.PHONY: unit-tests
19+
unit-tests: ## Run unit tests with coverage
20+
(timeout 10s dart run test --coverage="coverage" --timeout=none test/unit ; exit 0)
21+
22+
.PHONY: coverage-format
23+
coverage-format: ## Format dart coverage output to lcov
24+
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/coverage.lcov --packages=.packages --report-on=lib
25+
26+
.PHONY: coverage-gen-html
27+
coverage-gen-html: ## Generate html coverage from lcov data
28+
genhtml coverage/coverage.lcov -o coverage/coverage_gen
29+
30+
.PHONY: format
31+
format: ## Run dart format
32+
dart format --set-exit-if-changed -l 160 ./lib
33+
34+
.PHONY: format-apply
35+
format-apply: ## Run dart format
36+
dart format --fix -l 160 ./lib
37+
38+
.PHONY: analyze
39+
analyze: ## Run dart analyze
40+
dart analyze

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# nyxx_lavalink
22

3-
[![pub](https://img.shields.io/pub/v/nyxx.svg)](https://pub.dartlang.org/packages/nyxx)
4-
[![documentation](https://img.shields.io/badge/Documentation-nyxx-yellow.svg)](https://www.dartdocs.org/documentation/nyxx/latest/)
5-
[![documentation](https://img.shields.io/badge/Documentation-nyxx.commander-yellow.svg)](https://www.dartdocs.org/documentation/nyxx.commander/latest/)
6-
[![documentation](https://img.shields.io/badge/Documentation-nyxx.interactions-yellow.svg)](https://www.dartdocs.org/documentation/nyxx.interactions/latest/)
7-
[![documentation](https://img.shields.io/badge/Documentation-nyxx.extentions-yellow.svg)](https://www.dartdocs.org/documentation/nyxx.extensions/latest/)
3+
[![pub](https://img.shields.io/pub/v/nyxx_lavalink.svg)](https://pub.dartlang.org/packages/nyxx_lavalink)
4+
[![documentation](https://img.shields.io/badge/Documentation-nyxx_lavalink-yellow.svg)](https://www.dartdocs.org/documentation/nyxx_lavalink/latest/)
85

96
Simple, robust framework for creating discord bots for Dart language.
107

analysis_options.yaml

+5-102
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,8 @@
1+
include: package:lints/recommended.yaml
2+
13
analyzer:
4+
exclude: [build/**]
5+
language:
6+
strict-raw-types: true
27
strong-mode:
38
implicit-casts: false
4-
linter:
5-
rules:
6-
- avoid_empty_else
7-
- comment_references
8-
- control_flow_in_finally
9-
- empty_statements
10-
- hash_and_equals
11-
- iterable_contains_unrelated_type
12-
- list_remove_unrelated_type
13-
- avoid_slow_async_io
14-
- cancel_subscriptions
15-
- test_types_in_equals
16-
- throw_in_finally
17-
- valid_regexps
18-
- always_declare_return_types
19-
- annotate_overrides
20-
- avoid_init_to_null
21-
- avoid_return_types_on_setters
22-
- await_only_futures
23-
- camel_case_types
24-
- constant_identifier_names
25-
- empty_constructor_bodies
26-
- library_names
27-
- library_prefixes
28-
- non_constant_identifier_names
29-
- only_throw_errors
30-
- package_api_docs
31-
- package_prefixed_library_names
32-
- prefer_is_not_empty
33-
- slash_for_doc_comments
34-
- type_init_formals
35-
- unnecessary_getters_setters
36-
- package_names
37-
- unnecessary_await_in_return
38-
- use_function_type_syntax_for_parameters
39-
- avoid_returning_null_for_future
40-
- no_duplicate_case_values
41-
- unnecessary_statements
42-
- always_require_non_null_named_parameters
43-
- always_put_required_named_parameters_first
44-
- avoid_catches_without_on_clauses
45-
- avoid_function_literals_in_foreach_calls
46-
- avoid_redundant_argument_values
47-
- avoid_returning_null
48-
- avoid_returning_null_for_void
49-
- avoid_returning_this
50-
- camel_case_extensions
51-
- curly_braces_in_flow_control_structures
52-
- directives_ordering
53-
- empty_catches
54-
- join_return_with_assignment
55-
- leading_newlines_in_multiline_strings
56-
- missing_whitespace_between_adjacent_strings
57-
- no_runtimeType_toString
58-
- null_closures
59-
- omit_local_variable_types
60-
- one_member_abstracts
61-
- prefer_adjacent_string_concatenation
62-
- prefer_collection_literals
63-
- prefer_conditional_assignment
64-
- prefer_const_constructors
65-
- prefer_const_constructors_in_immutables
66-
- prefer_const_declarations
67-
- prefer_const_literals_to_create_immutables
68-
- prefer_constructors_over_static_methods
69-
- prefer_contains
70-
- prefer_equal_for_default_values
71-
- prefer_expression_function_bodies
72-
- prefer_final_fields
73-
- prefer_final_in_for_each
74-
- prefer_final_locals
75-
- prefer_for_elements_to_map_fromIterable
76-
- prefer_foreach
77-
- prefer_function_declarations_over_variables
78-
- prefer_generic_function_type_aliases
79-
- prefer_if_elements_to_conditional_expressions
80-
- prefer_if_null_operators
81-
- prefer_initializing_formals
82-
- prefer_inlined_adds
83-
- prefer_int_literals
84-
- prefer_interpolation_to_compose_strings
85-
- prefer_is_empty
86-
- provide_deprecation_message
87-
- prefer_typing_uninitialized_variables
88-
- public_member_api_docs
89-
- unawaited_futures
90-
- unnecessary_brace_in_string_interps
91-
- unnecessary_lambdas
92-
- unnecessary_null_in_if_null_operators
93-
- unnecessary_parenthesis
94-
- unnecessary_raw_strings
95-
- unnecessary_string_escapes
96-
- use_rethrow_when_possible
97-
- use_string_buffers
98-
- void_checks
99-
- use_to_and_as_if_applicable
100-
- sort_pub_dependencies
101-
- prefer_is_not_operator
102-
- prefer_iterable_whereType
103-
- prefer_mixin
104-
- prefer_null_aware_operators
105-
- prefer_spread_collections

0 commit comments

Comments
 (0)