Skip to content

Commit

Permalink
Release 3.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
l7ssha committed Sep 25, 2023
1 parent b38c42c commit 35deb5a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.3.3

- Fix docs command

## 3.3.2

- Fix docs command
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.9'
services:
running_on_dart:
image: ghcr.io/nyxx-discord/running_on_dart:3.3.2
image: ghcr.io/nyxx-discord/running_on_dart:3.3.3
container_name: running_on_dart
env_file:
- .env
Expand Down
49 changes: 39 additions & 10 deletions lib/src/models/docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class PackageDocs {
entries = {};

for (final dataEntry in data) {
if (dataEntry['__PACKAGE_ORDER__'] != null) {
continue;
}

final entry = DocEntry.fromJson(dataEntry);

entries[entry.qualifiedName] = entry;
Expand Down Expand Up @@ -92,24 +96,49 @@ class DocEntry {
/// Create a [DocEntry] from a documentation entry object received from a dartdoc `index.json` file.
factory DocEntry.fromJson(Map<String, dynamic> json) {
String displayName;
String type;

switch (json['type']) {
case 'constant':
case 'property':
case 'method':
displayName =
'${json['enclosedBy']['name'] as String}.${json['name'] as String}';
switch (json['kind'] as int) {
case 1:
case 16:
case 10:
displayName = '${json['enclosedBy']['name'] as String}.${json['name'] as String}';
break;
case 'library':
case 9:
displayName =
'${json['packageName'] != json['name'] ? '${json['packageName'] as String}.' : ''}${json['name'] as String}';
break;
case 'constructor':
case 2:
displayName =
'${json['name'] == json['enclosedBy']['name'] ? '(new) ' : ''}${json['name'] as String}';
break;
default:
displayName = json['name'] as String? ?? '[Unknown]';
displayName = json['name'] as String? ?? '';
break;
}

switch (json['kind'] as int) {
case 1:
case 18:
type = 'constant';
break;
case 16:
type = 'property';
break;
case 10:
type = 'method';
break;
case 9:
type = 'library';
break;
case 2:
type = 'constructor';
break;
case 3:
type = 'class';
break;
default:
type = '';
break;
}

Expand All @@ -118,7 +147,7 @@ class DocEntry {
displayName: displayName,
qualifiedName: json['qualifiedName'] as String,
packageName: json['packageName'] as String,
type: json['type'] as String,
type: type,
urlToDocs:
'https://pub.dev/documentation/${json['packageName'] as String}/latest/${json['href'] as String}',
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:io';

import 'package:nyxx/nyxx.dart';

String get version => '3.3.2';
String get version => '3.3.3';

/// Get a [String] from an environment variable, throwing an exception if it is not set.
///
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: running_on_dart
version: 3.3.2
version: 3.3.3
description: Discord Bot for nyxx development
homepage: https://github.com/nyxx-discord/running_on_dart
repository: https://github.com/nyxx-discord/running_on_dart
Expand Down

0 comments on commit 35deb5a

Please sign in to comment.