Skip to content

Commit bcb44d8

Browse files
committed
Merge package:pubspec_parse into the tools monorepo
2 parents 3815ff3 + a0c9f10 commit bcb44d8

23 files changed

+2491
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration file.
2+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: monthly
10+
labels:
11+
- autosubmit
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
pull_request:
7+
branches: [ master ]
8+
push:
9+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
10+
11+
jobs:
12+
publish:
13+
if: ${{ github.repository_owner == 'dart-lang' }}
14+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
15+
permissions:
16+
id-token: write # Required for authentication using OIDC
17+
pull-requests: write # Required for writing the pull request note
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Dart CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
26+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
27+
with:
28+
sdk: ${{ matrix.sdk }}
29+
- id: install
30+
name: Install dependencies
31+
run: dart pub get
32+
- name: Check formatting
33+
run: dart format --output=none --set-exit-if-changed .
34+
if: always() && steps.install.outcome == 'success'
35+
- name: Analyze code
36+
run: dart analyze --fatal-infos
37+
if: always() && steps.install.outcome == 'success'
38+
39+
# Run tests on a matrix consisting of two dimensions:
40+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
41+
# 2. release channel: dev
42+
test:
43+
needs: analyze
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
os: [ubuntu-latest]
49+
sdk: [3.2, dev]
50+
steps:
51+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
52+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
53+
with:
54+
sdk: ${{ matrix.sdk }}
55+
- id: install
56+
name: Install dependencies
57+
run: dart pub get
58+
- name: Run VM tests
59+
run: dart test --platform vm --run-skipped
60+
if: always() && steps.install.outcome == 'success'

pkgs/pubspec_parse/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Don’t commit the following directories created by pub.
2+
.dart_tool/
3+
.packages
4+
pubspec.lock

pkgs/pubspec_parse/CHANGELOG.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
## 1.4.0-wip
2+
3+
- Require Dart 3.2
4+
- Seal the `Dependency` class.
5+
- Set `Pubspec.environment` to non-nullable.
6+
- Remove deprecated package_api_docs rule
7+
8+
## 1.3.0
9+
10+
- Require Dart 3.0
11+
- Added support for `ignored_advisories` field.
12+
- Added structural equality for `Dependency` subclasses and `HostedDetails`.
13+
14+
## 1.2.3
15+
16+
- Added topics to `pubspec.yaml`.
17+
18+
## 1.2.2
19+
20+
- Require Dart SDK >= 2.18.0
21+
- Required `json_annotation: ^4.8.0`
22+
- Added support for `topics` field.
23+
24+
## 1.2.1
25+
26+
- Added support for `funding` field.
27+
28+
## 1.2.0
29+
30+
- Added support for `screenshots` field.
31+
- Update `HostedDetails` to reflect how `hosted` dependencies are parsed in
32+
Dart 2.15:
33+
- Add `HostedDetails.declaredName` as the (optional) `name` property in a
34+
`hosted` block.
35+
- `HostedDetails.name` now falls back to the name of the dependency if no
36+
name is declared in the block.
37+
- Require Dart SDK >= 2.14.0
38+
39+
## 1.1.0
40+
41+
- Export `HostedDetails` publicly.
42+
43+
## 1.0.0
44+
45+
- Migrate to null-safety.
46+
- Pubspec: `author` and `authors` are both now deprecated.
47+
See https://dart.dev/tools/pub/pubspec#authorauthors
48+
49+
## 0.1.8
50+
51+
- Allow the latest `package:pub_semver`.
52+
53+
## 0.1.7
54+
55+
- Allow `package:yaml` `v3.x`.
56+
57+
## 0.1.6
58+
59+
- Update SDK requirement to `>=2.7.0 <3.0.0`.
60+
- Allow `package:json_annotation` `v4.x`.
61+
62+
## 0.1.5
63+
64+
- Update SDK requirement to `>=2.2.0 <3.0.0`.
65+
- Support the latest `package:json_annotation`.
66+
67+
## 0.1.4
68+
69+
- Added `lenient` named argument to `Pubspec.fromJson` to ignore format and type errors.
70+
71+
## 0.1.3
72+
73+
- Added support for `flutter`, `issue_tracker`, `publish_to`, and `repository`
74+
fields.
75+
76+
## 0.1.2+3
77+
78+
- Support the latest version of `package:json_annotation`.
79+
80+
## 0.1.2+2
81+
82+
- Support `package:json_annotation` v1.
83+
84+
## 0.1.2+1
85+
86+
- Support the Dart 2 stable release.
87+
88+
## 0.1.2
89+
90+
- Allow superfluous `version` keys with `git` and `path` dependencies.
91+
- Improve errors when unsupported keys are provided in dependencies.
92+
- Provide better errors with invalid `sdk` dependency values.
93+
- Support "scp-like syntax" for Git SSH URIs in the form
94+
`[user@]host.xz:path/to/repo.git/`.
95+
96+
## 0.1.1
97+
98+
- Fixed name collision with error type in latest `package:json_annotation`.
99+
- Improved parsing of hosted dependencies and environment constraints.
100+
101+
## 0.1.0
102+
103+
- Initial release.

pkgs/pubspec_parse/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2018, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkgs/pubspec_parse/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[![Dart CI](https://github.com/dart-lang/pubspec_parse/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/pubspec_parse/actions/workflows/test-package.yml)
2+
[![pub package](https://img.shields.io/pub/v/pubspec_parse.svg)](https://pub.dev/packages/pubspec_parse)
3+
[![package publisher](https://img.shields.io/pub/publisher/pubspec_parse.svg)](https://pub.dev/packages/pubspec_parse/publisher)
4+
5+
## What's this?
6+
7+
Supports parsing `pubspec.yaml` files with robust error reporting and support
8+
for most of the documented features.
9+
10+
## More information
11+
12+
Read more about the [pubspec format](https://dart.dev/tools/pub/pubspec).
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# https://dart.dev/guides/language/analysis-options
2+
include: package:dart_flutter_team_lints/analysis_options.yaml
3+
4+
analyzer:
5+
language:
6+
strict-casts: true
7+
strict-inference: true
8+
9+
linter:
10+
rules:
11+
- avoid_bool_literals_in_conditional_expressions
12+
- avoid_classes_with_only_static_members
13+
- avoid_private_typedef_functions
14+
- avoid_redundant_argument_values
15+
- avoid_returning_this
16+
- avoid_unused_constructor_parameters
17+
- avoid_void_async
18+
- cancel_subscriptions
19+
- cascade_invocations
20+
- join_return_with_assignment
21+
- literal_only_boolean_expressions
22+
- missing_whitespace_between_adjacent_strings
23+
- no_adjacent_strings_in_list
24+
- no_runtimeType_toString
25+
- prefer_const_declarations
26+
- prefer_expression_function_bodies
27+
- prefer_final_locals
28+
- require_trailing_commas
29+
- unnecessary_await_in_return
30+
- use_string_buffers

pkgs/pubspec_parse/build.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Read about `build.yaml` at https://pub.dev/packages/build_config
2+
# To update generated code, run `pub run build_runner build`
3+
targets:
4+
$default:
5+
builders:
6+
json_serializable:
7+
generate_for:
8+
- lib/src/pubspec.dart
9+
- lib/src/dependency.dart
10+
options:
11+
any_map: true
12+
checked: true
13+
create_to_json: false
14+
field_rename: snake
15+
16+
# The end-user of a builder which applies "source_gen|combining_builder"
17+
# may configure the builder to ignore specific lints for their project
18+
source_gen|combining_builder:
19+
options:
20+
ignore_for_file:
21+
- deprecated_member_use_from_same_package
22+
- lines_longer_than_80_chars
23+
- require_trailing_commas
24+
# https://github.com/google/json_serializable.dart/issues/945
25+
- unnecessary_cast

pkgs/pubspec_parse/dart_test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tags:
2+
presubmit-only:
3+
skip: "Should only be run during presubmit"

0 commit comments

Comments
 (0)