-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1261 from dart-lang/merge-pubspec_parse-package
Merge `package:pubspec_parse`
- Loading branch information
Showing
24 changed files
with
2,485 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: "package:pubspec_parse" | ||
about: "Create a bug or file a feature request against package:pubspec_parse." | ||
labels: "package:pubspec_parse" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: package:pubspec_parse | ||
|
||
on: | ||
# Run on PRs and pushes to the default branch. | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/pubspec_parse.yaml' | ||
- 'pkgs/pubspec_parse/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/pubspec_parse.yaml' | ||
- 'pkgs/pubspec_parse/**' | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/pubspec_parse/ | ||
|
||
jobs: | ||
# Check code formatting and static analysis on a single OS (linux) | ||
# against Dart dev. | ||
analyze: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sdk: [dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Check formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Analyze code | ||
run: dart analyze --fatal-infos | ||
if: always() && steps.install.outcome == 'success' | ||
|
||
# Run tests on a matrix consisting of two dimensions: | ||
# 1. OS: ubuntu-latest, (macos-latest, windows-latest) | ||
# 2. release channel: dev | ||
test: | ||
needs: analyze | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
sdk: [3.2, dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Run VM tests | ||
run: dart test --platform vm --run-skipped | ||
if: always() && steps.install.outcome == 'success' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Don’t commit the following directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
pubspec.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
## 1.4.0 | ||
|
||
- Require Dart 3.2 | ||
- Seal the `Dependency` class. | ||
- Set `Pubspec.environment` to non-nullable. | ||
- Remove deprecated package_api_docs rule | ||
- Move to `dart-lang/tools` monorepo. | ||
|
||
## 1.3.0 | ||
|
||
- Require Dart 3.0 | ||
- Added support for `ignored_advisories` field. | ||
- Added structural equality for `Dependency` subclasses and `HostedDetails`. | ||
|
||
## 1.2.3 | ||
|
||
- Added topics to `pubspec.yaml`. | ||
|
||
## 1.2.2 | ||
|
||
- Require Dart SDK >= 2.18.0 | ||
- Required `json_annotation: ^4.8.0` | ||
- Added support for `topics` field. | ||
|
||
## 1.2.1 | ||
|
||
- Added support for `funding` field. | ||
|
||
## 1.2.0 | ||
|
||
- Added support for `screenshots` field. | ||
- Update `HostedDetails` to reflect how `hosted` dependencies are parsed in | ||
Dart 2.15: | ||
- Add `HostedDetails.declaredName` as the (optional) `name` property in a | ||
`hosted` block. | ||
- `HostedDetails.name` now falls back to the name of the dependency if no | ||
name is declared in the block. | ||
- Require Dart SDK >= 2.14.0 | ||
|
||
## 1.1.0 | ||
|
||
- Export `HostedDetails` publicly. | ||
|
||
## 1.0.0 | ||
|
||
- Migrate to null-safety. | ||
- Pubspec: `author` and `authors` are both now deprecated. | ||
See https://dart.dev/tools/pub/pubspec#authorauthors | ||
|
||
## 0.1.8 | ||
|
||
- Allow the latest `package:pub_semver`. | ||
|
||
## 0.1.7 | ||
|
||
- Allow `package:yaml` `v3.x`. | ||
|
||
## 0.1.6 | ||
|
||
- Update SDK requirement to `>=2.7.0 <3.0.0`. | ||
- Allow `package:json_annotation` `v4.x`. | ||
|
||
## 0.1.5 | ||
|
||
- Update SDK requirement to `>=2.2.0 <3.0.0`. | ||
- Support the latest `package:json_annotation`. | ||
|
||
## 0.1.4 | ||
|
||
- Added `lenient` named argument to `Pubspec.fromJson` to ignore format and type errors. | ||
|
||
## 0.1.3 | ||
|
||
- Added support for `flutter`, `issue_tracker`, `publish_to`, and `repository` | ||
fields. | ||
|
||
## 0.1.2+3 | ||
|
||
- Support the latest version of `package:json_annotation`. | ||
|
||
## 0.1.2+2 | ||
|
||
- Support `package:json_annotation` v1. | ||
|
||
## 0.1.2+1 | ||
|
||
- Support the Dart 2 stable release. | ||
|
||
## 0.1.2 | ||
|
||
- Allow superfluous `version` keys with `git` and `path` dependencies. | ||
- Improve errors when unsupported keys are provided in dependencies. | ||
- Provide better errors with invalid `sdk` dependency values. | ||
- Support "scp-like syntax" for Git SSH URIs in the form | ||
`[user@]host.xz:path/to/repo.git/`. | ||
|
||
## 0.1.1 | ||
|
||
- Fixed name collision with error type in latest `package:json_annotation`. | ||
- Improved parsing of hosted dependencies and environment constraints. | ||
|
||
## 0.1.0 | ||
|
||
- Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2018, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[![Build Status](https://github.com/dart-lang/tools/actions/workflows/pubspec_parse.yaml/badge.svg)](https://github.com/dart-lang/tools/actions/workflows/pubspec_parse.yaml) | ||
[![pub package](https://img.shields.io/pub/v/pubspec_parse.svg)](https://pub.dev/packages/pubspec_parse) | ||
[![package publisher](https://img.shields.io/pub/publisher/pubspec_parse.svg)](https://pub.dev/packages/pubspec_parse/publisher) | ||
|
||
## What's this? | ||
|
||
Supports parsing `pubspec.yaml` files with robust error reporting and support | ||
for most of the documented features. | ||
|
||
## More information | ||
|
||
Read more about the [pubspec format](https://dart.dev/tools/pub/pubspec). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# https://dart.dev/guides/language/analysis-options | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
analyzer: | ||
language: | ||
strict-casts: true | ||
strict-inference: true | ||
|
||
linter: | ||
rules: | ||
- avoid_bool_literals_in_conditional_expressions | ||
- avoid_classes_with_only_static_members | ||
- avoid_private_typedef_functions | ||
- avoid_redundant_argument_values | ||
- avoid_returning_this | ||
- avoid_unused_constructor_parameters | ||
- avoid_void_async | ||
- cancel_subscriptions | ||
- cascade_invocations | ||
- join_return_with_assignment | ||
- literal_only_boolean_expressions | ||
- missing_whitespace_between_adjacent_strings | ||
- no_adjacent_strings_in_list | ||
- no_runtimeType_toString | ||
- prefer_const_declarations | ||
- prefer_expression_function_bodies | ||
- prefer_final_locals | ||
- require_trailing_commas | ||
- unnecessary_await_in_return | ||
- use_string_buffers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Read about `build.yaml` at https://pub.dev/packages/build_config | ||
# To update generated code, run `pub run build_runner build` | ||
targets: | ||
$default: | ||
builders: | ||
json_serializable: | ||
generate_for: | ||
- lib/src/pubspec.dart | ||
- lib/src/dependency.dart | ||
options: | ||
any_map: true | ||
checked: true | ||
create_to_json: false | ||
field_rename: snake | ||
|
||
# The end-user of a builder which applies "source_gen|combining_builder" | ||
# may configure the builder to ignore specific lints for their project | ||
source_gen|combining_builder: | ||
options: | ||
ignore_for_file: | ||
- deprecated_member_use_from_same_package | ||
- lines_longer_than_80_chars | ||
- require_trailing_commas | ||
# https://github.com/google/json_serializable.dart/issues/945 | ||
- unnecessary_cast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tags: | ||
presubmit-only: | ||
skip: "Should only be run during presubmit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
export 'src/dependency.dart' | ||
show | ||
Dependency, | ||
GitDependency, | ||
HostedDependency, | ||
HostedDetails, | ||
PathDependency, | ||
SdkDependency; | ||
export 'src/pubspec.dart' show Pubspec; | ||
export 'src/screenshot.dart' show Screenshot; |
Oops, something went wrong.