Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/html.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [3.2, stable, dev]
sdk: [3.6, stable, dev]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pubspec_parse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [3.6, dev]
sdk: [3.8, dev]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
Expand Down
2 changes: 1 addition & 1 deletion pkgs/graphs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dev_dependencies:
test: ^1.21.6

# For examples
analyzer: '>=5.2.0 <8.0.0'
analyzer: '>=5.2.0 <9.0.0'
path: ^1.8.0
pool: ^1.5.0
4 changes: 4 additions & 0 deletions pkgs/html/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.15.7-wip

- Require Dart `3.6`

## 0.15.6

- Performance improvements.
Expand Down
6 changes: 3 additions & 3 deletions pkgs/html/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: html
version: 0.15.6
version: 0.15.7-wip
description: APIs for parsing and manipulating HTML content outside the browser.
repository: https://github.com/dart-lang/tools/tree/main/pkgs/html
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ahtml
Expand All @@ -9,14 +9,14 @@ topics:
- web

environment:
sdk: ^3.2.0
sdk: ^3.6.0

dependencies:
csslib: ^1.0.0
source_span: ^1.8.0

dev_dependencies:
dart_flutter_team_lints: ^3.0.0
dart_style: ^2.3.6
dart_style: ^3.0.0
path: ^1.8.0
test: ^1.16.6
4 changes: 3 additions & 1 deletion pkgs/html/tool/generate_trie.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ void main() {
'''// AUTO GENERATED by 'tool/generate_trie.dart'. DO NOT EDIT!\n'''
'const entitiesTrieRoot = $root;'
.replaceAll('{}', '<int, dynamic>{}');
final formatted = DartFormatter().format(source);
final formatted = DartFormatter(
languageVersion: DartFormatter.latestShortStyleLanguageVersion)
.format(source);
final htmlDir = File(Platform.script.path).parent.parent;
File(join(htmlDir.path, 'lib', 'src', 'trie.dart'))
.writeAsStringSync(formatted);
Expand Down
2 changes: 1 addition & 1 deletion pkgs/process/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ dependencies:
platform: '^3.0.0'

dev_dependencies:
lints: ^5.0.0
lints: ^6.0.0
test: ^1.16.8
4 changes: 4 additions & 0 deletions pkgs/pubspec_parse/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.5.1-wip

- Require Dart 3.8

## 1.5.0

- Added fields to `Pubspec`: `executables`, `resolution`, `workspace`.
Expand Down
20 changes: 12 additions & 8 deletions pkgs/pubspec_parse/lib/src/dependency.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ Dependency? _fromJson(Object? data, String name) {
}

if (data is Map) {
final matchedKeys =
data.keys.cast<String>().where((key) => key != 'version').toList();
final matchedKeys = data.keys
.cast<String>()
.where((key) => key != 'version')
.toList();

if (data.isEmpty || (matchedKeys.isEmpty && data.containsKey('version'))) {
return _$HostedDependencyFromJson(data);
} else {
final firstUnrecognizedKey =
matchedKeys.firstWhereOrNull((k) => !_sourceKeys.contains(k));
final firstUnrecognizedKey = matchedKeys.firstWhereOrNull(
(k) => !_sourceKeys.contains(k),
);

return $checkedNew<Dependency>('Dependency', data, () {
if (firstUnrecognizedKey != null) {
Expand All @@ -78,8 +81,9 @@ Dependency? _fromJson(Object? data, String name) {
'git' => GitDependency.fromData(data[key]),
'path' => PathDependency.fromData(data[key]),
'sdk' => _$SdkDependencyFromJson(data),
'hosted' => _$HostedDependencyFromJson(data)
..hosted?._nameOfPackage = name,
'hosted' => _$HostedDependencyFromJson(
data,
)..hosted?._nameOfPackage = name,
_ => throw StateError('There is a bug in pubspec_parse.'),
};
});
Expand All @@ -99,7 +103,7 @@ class SdkDependency extends Dependency {
final VersionConstraint version;

SdkDependency(this.sdk, {VersionConstraint? version})
: version = version ?? VersionConstraint.any;
: version = version ?? VersionConstraint.any;
Comment on lines 105 to +106
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This public constructor lacks documentation. The repository style guide requires all public members to be documented to improve clarity.1

Suggested change
SdkDependency(this.sdk, {VersionConstraint? version})
: version = version ?? VersionConstraint.any;
: version = version ?? VersionConstraint.any;
/// Creates a new [SdkDependency].
SdkDependency(this.sdk, {VersionConstraint? version})
: version = version ?? VersionConstraint.any;

Style Guide References

Footnotes

  1. The style guide states that at least all public members should have documentation.


@override
bool operator ==(Object other) =>
Expand Down Expand Up @@ -215,7 +219,7 @@ class HostedDependency extends Dependency {
final HostedDetails? hosted;

HostedDependency({VersionConstraint? version, this.hosted})
: version = version ?? VersionConstraint.any;
: version = version ?? VersionConstraint.any;
Comment on lines 221 to +222
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This public constructor lacks documentation. The repository style guide requires all public members to be documented to improve clarity.1

Suggested change
HostedDependency({VersionConstraint? version, this.hosted})
: version = version ?? VersionConstraint.any;
: version = version ?? VersionConstraint.any;
/// Creates a new [HostedDependency].
HostedDependency({VersionConstraint? version, this.hosted})
: version = version ?? VersionConstraint.any;

Style Guide References

Footnotes

  1. The style guide states that at least all public members should have documentation.


@override
bool operator ==(Object other) =>
Expand Down
111 changes: 52 additions & 59 deletions pkgs/pubspec_parse/lib/src/dependency.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 15 additions & 24 deletions pkgs/pubspec_parse/lib/src/pubspec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,15 @@ class Pubspec {
/// If there is exactly 1 value in [authors], returns it.
///
/// If there are 0 or more than 1, returns `null`.
@Deprecated(
'See https://dart.dev/tools/pub/pubspec#authorauthors',
)
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
String? get author {
if (authors.length == 1) {
return authors.single;
}
return null;
}

@Deprecated(
'See https://dart.dev/tools/pub/pubspec#authorauthors',
)
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
final List<String> authors;
Comment on lines +68 to 69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This public field authors is not documented. While it is deprecated, adding a doc comment would clarify its purpose, as per the repository's style guide.1

Suggested change
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
final List<String> authors;
/// A list of authors of the package.
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
final List<String> authors;

Style Guide References

Footnotes

  1. The style guide states that at least all public members should have documentation.

final String? documentation;

Expand Down Expand Up @@ -109,13 +105,9 @@ class Pubspec {
this.name, {
this.version,
this.publishTo,
@Deprecated(
'See https://dart.dev/tools/pub/pubspec#authorauthors',
)
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
String? author,
@Deprecated(
'See https://dart.dev/tools/pub/pubspec#authorauthors',
)
@Deprecated('See https://dart.dev/tools/pub/pubspec#authorauthors')
List<String>? authors,
Map<String, VersionConstraint?>? environment,
this.homepage,
Expand All @@ -134,14 +126,16 @@ class Pubspec {
Map<String, Dependency>? dependencyOverrides,
this.flutter,
Map<String, String?>? executables,
}) :
// ignore: deprecated_member_use_from_same_package
authors = _normalizeAuthors(author, authors),
environment = environment ?? const {},
dependencies = dependencies ?? const {},
devDependencies = devDependencies ?? const {},
executables = executables ?? const {},
dependencyOverrides = dependencyOverrides ?? const {} {
}) : authors // ignore: deprecated_member_use_from_same_package
= _normalizeAuthors(
author,
authors,
),
environment = environment ?? const {},
dependencies = dependencies ?? const {},
devDependencies = devDependencies ?? const {},
executables = executables ?? const {},
dependencyOverrides = dependencyOverrides ?? const {} {
if (name.isEmpty) {
throw ArgumentError.value(name, 'name', '"name" cannot be empty.');
}
Expand Down Expand Up @@ -189,10 +183,7 @@ class Pubspec {
);

static List<String> _normalizeAuthors(String? author, List<String>? authors) {
final value = <String>{
if (author != null) author,
...?authors,
};
final value = <String>{if (author != null) author, ...?authors};
return value.toList();
}
}
Expand Down
Loading
Loading