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
38 changes: 10 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
# Do not run workflow for now
name: Publish
name: Publish to pub.dev

on:
release:
types: [published]
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
runs-on: ubuntu-latest

container:
image: dart:latest

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: dart pub get
- name: Install Cider
run: dart pub global activate cider
- name: Set new version
run: dart pub global run cider version ${{ github.event.release.tag_name }}
- name: Set a new release
run: dart pub global run cider release
- name: Build Runner
run: dart pub run build_runner build --delete-conflicting-outputs
- name: Run tests
run: dart pub run test
- name: Publish Dart/Flutter package
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
with:
credential: ${{ secrets.PUB_CREDENTIALS }}
flutter_package: false
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: pub.dev
31 changes: 8 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,22 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

container:
image: dart:latest
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: dart pub get
# Builder
- name: Build Runner
run: dart pub run build_runner build --delete-conflicting-outputs
# Run test
run: dart run build_runner build
- name: Analyze
run: dart analyze
- name: Run tests
run: dart pub run test
# # Get coverage
# - name: Test Coverage
# run: pub run test_cov
# # Activate remove coverage
# - name: Remove Coverage activate
# run: pub global activate remove_from_coverage
# # Remove build files from coverage report
# - name: Remove generated files from Coverage
# run: pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.g.dart$'
# - name: Remove freezed files from Coverage
# run: pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.freezed.dart$'
# # Upload coverage report
# - name: Coveralls GitHub Action
# uses: coverallsapp/github-action@v1.1.2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
run: dart test
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
## 4.0.0

### Breaking changes

- Added `SearchOrder.trending` for pub.dev's trend-score ordering. Consumers
with an exhaustive switch over `SearchOrder` must add a `trending` case

### Added

- `packageLikes` — public like count of a package, no authentication required
(`GET /api/packages/<package>/likes`)
- `publisherInfo` — public publisher profile
(`GET /api/publishers/<publisherId>`)
- `packageVersionScore` — score of a single package version
(`GET /api/packages/<package>/versions/<version>/score`)
- `packageVersionOptions` — retraction status of a single package version
(`GET /api/packages/<package>/versions/<version>/options`)
- `topicNameCompletion` — every topic mapped to its package count
(`GET /api/topic-name-completion-data`)
- `SearchResults.message`, set when pub.dev could not fully honour the query
- `PackageScoreCard.weeklyVersionDownloads`, `WeeklyVersionDownloads`, and
`VersionRangeWeeklyDownloads` — total weekly downloads plus major, minor,
and patch version-range histories
[#78](https://github.com/leoafarias/pub_api_client/pull/78)
- `Repository.fromMap` and `Repository.fromJson`, matching the other models
- Re-export the `pubspec_parse` dependency types (`Dependency`,
`HostedDependency`, `GitDependency`, `PathDependency`, `SdkDependency`,
`HostedDetails`, `Pubspec`) so consumers can name the types reachable from
`PubPackage.latestPubspec`
[#78](https://github.com/leoafarias/pub_api_client/pull/78)

### Fixed

- Search queries are now percent-encoded. Previously a `#` or `&` in the query
or in a tag silently truncated the request, so searches like `c# & c++`
returned results for `c`
- `fetchGooglePackages` no longer sends a malformed `tools.dart.dev ` publisher
tag, and now includes the `labs.dart.dev` publisher

### Deprecated

- `SearchOrder.popularity` — pub.dev retired the popularity score and serves
these requests as `SearchOrder.top`. Use `SearchOrder.downloads`
- `PackageScore.popularityScore` — pub.dev no longer returns this field. Use
`PackageScore.downloadCount30Days`
- `LatestVersion` — unreachable model; no endpoint returns it and no client
method produces it. Scheduled for removal in 5.0.0

### Changed

- Documented that search paging is capped at 10 pages (100 results) by
pub.dev. The cap applies once to `fetchAllPackages`,
`fetchPublisherPackages`, and `fetchFlutterFavorites`, and separately for
each publisher queried by `fetchGooglePackages`
- Generated `*.mapper.dart` files are excluded from analysis, and three lint
rules removed from the Dart SDK were dropped from `analysis_options.yaml`

## 3.2.0

- Expose discontinued/advisory metadata on `PubPackage` and drop the large cached fixture from version control [#75](https://github.com/leoafarias/pub_api_client/pull/75)
Expand Down
Loading
Loading