Skip to content

Commit

Permalink
Merge package:markdown (#1208)
Browse files Browse the repository at this point in the history
- [x] Move and fix workflow files, labeler.yaml, and badges in the
README.md
- [x] Rev the version of the package, so that pub.dev points to the
correct site
- [x] Add a line to the changelog:
```
* Move to `dart-lang/tools` monorepo.
```

- [x] Add the package to the top-level readme of the monorepo:
```
| [markdown](pkgs/markdown/) | A portable Markdown library written in Dart that can parse Markdown into HTML. | [![pub package](https://img.shields.io/pub/v/markdown.svg)](https://pub.dev/packages/markdown) |
```

- [ ] **Important!** Merge the PR with 'Create a merge commit' (enabling
then disabling the `Allow merge commits` admin setting)
- [x] Update the auto-publishing settings on
https://pub.dev/packages/markdown/admin
- [x] Add the following text to https://github.com/dart-lang/markdown/:'

```
> [!IMPORTANT]  
> This repo has moved to https://github.com/dart-lang/tools/tree/main/pkgs/markdown
```

- [ ] Publish using the autopublish workflow
- [ ] Push tags to GitHub using
```git tag --list 'markdown*' | xargs git push origin```

- [x] Close open PRs in dart-lang/markdown with the following message:

```
Closing as the
[dart-lang/markdown](https://github.com/dart-lang/markdown) repository
is merged into the [dart-lang/tools](https://github.com/dart-lang/tools)
monorepo. Please re-open this PR there!
```
      
- [x] Transfer issues by running
```dart run pkgs/repo_manage/bin/report.dart transfer-issues
--source-repo dart-lang/markdown --target-repo dart-lang/tools
--add-label package:markdown --apply-changes```

- [ ] Archive https://github.com/dart-lang/markdown/


---

- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.

<details>
  <summary>Contribution guidelines:</summary><br>

- See our [contributor
guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use `dart
format`.
- Most changes should add an entry to the changelog and may need to [rev
the pubspec package
version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change).
- Changes to packages require [corresponding
tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing).

Note that many Dart repos have a weekly cadence for reviewing PRs -
please allow for some latency before initial review feedback.
</details>
  • Loading branch information
mosuem authored Jan 13, 2025
2 parents 54b8998 + a8abbfb commit d785fbb
Show file tree
Hide file tree
Showing 205 changed files with 46,200 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:markdown"
about: "Create a bug or file a feature request against package:markdown."
labels: "package:markdown"
---
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/json_rpc_2/**'

'package:markdown':
- changed-files:
- any-glob-to-any-file: 'pkgs/markdown/**'

'package:mime':
- changed-files:
- any-glob-to-any-file: 'pkgs/mime/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
with:
ignore_coverage: "**.mock.dart,**.g.dart"
ignore_license: "**.mock.dart,**.g.dart,**.mocks.dart"
ignore_license: "**.mock.dart,**.g.dart,**.mocks.dart,pkgs/markdown/**"
permissions:
pull-requests: write
93 changes: 93 additions & 0 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: package:markdown

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/markdown.yaml'
- 'pkgs/markdown/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/markdown.yaml'
- 'pkgs/markdown/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github


defaults:
run:
working-directory: pkgs/markdown/


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:
# Add macos-latest and/or windows-latest if relevant for this package.
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
if: always() && steps.install.outcome == 'success'

coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: dev
- name: Install dependencies
run: dart pub get
- name: Install coverage
run: dart pub global activate coverage
- name: Collect and report coverage
run: dart pub global run coverage:test_with_coverage
- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: pkgs/markdown/coverage/lcov.info
27 changes: 27 additions & 0 deletions .github/workflows/markdown_crash_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Run against all markdown files in latest version of packages on pub.dev to
# see if any can provoke a crash

name: package:markdown: crash tests

on:
schedule:
# “At 00:00 (UTC) on Sunday.”
- cron: '0 0 * * 0'

defaults:
run:
working-directory: pkgs/markdown/

jobs:
crash-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94

- name: Install dependencies
run: dart pub get

- name: Run crash_test.dart
run: dart test -P crash_test test/crash_test.dart
66 changes: 66 additions & 0 deletions .github/workflows/markdown_flutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Run a smoke test against package:flutter_markdown.

name: package:markdown: flutter

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/markdown_flutter.yaml'
- 'pkgs/markdown/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/markdown_flutter.yaml'
- 'pkgs/markdown/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

jobs:
smoke-test:
runs-on: ubuntu-latest

steps:
- name: clone dart-lang/tools
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: dart-lang/tools
path: tools_repo

- name: clone flutter/packages
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: flutter/packages
path: flutter_packages

# Install the Flutter SDK using the subosito/flutter-action GitHub action.
- name: install the flutter sdk
uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: beta

- name: flutter --version
run: flutter --version

- name: create pubspec_overrides.yaml
working-directory: flutter_packages/packages/flutter_markdown
run: |
echo "dependency_overrides:" > pubspec_overrides.yaml
echo " markdown:" >> pubspec_overrides.yaml
echo " path: ../../../tools_repo/pkgs/markdown" >> pubspec_overrides.yaml
- name: flutter pub get
working-directory: flutter_packages/packages/flutter_markdown
run: flutter pub get

- name: flutter analyze package:flutter_markdown
working-directory: flutter_packages/packages/flutter_markdown
run: flutter analyze

- name: flutter test package:flutter_markdown
working-directory: flutter_packages/packages/flutter_markdown
run: flutter test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ don't naturally belong to other topic monorepos (like
| [html](pkgs/html/) | APIs for parsing and manipulating HTML content outside the browser. | [![package issues](https://img.shields.io/badge/package:html-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ahtml) | [![pub package](https://img.shields.io/pub/v/html.svg)](https://pub.dev/packages/html) |
| [io](pkgs/io/) | Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values. | [![pub package](https://img.shields.io/pub/v/io.svg)](https://pub.dev/packages/io) |
| [json_rpc_2](pkgs/json_rpc_2/) | Utilities to write a client or server using the JSON-RPC 2.0 spec. | [![package issues](https://img.shields.io/badge/package:json_rpc_2-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajson_rpc_2) | [![pub package](https://img.shields.io/pub/v/json_rpc_2.svg)](https://pub.dev/packages/json_rpc_2) |
| [markdown](pkgs/markdown/) | A portable Markdown library written in Dart that can parse Markdown into HTML. | [![pub package](https://img.shields.io/pub/v/markdown.svg)](https://pub.dev/packages/markdown) |
| [mime](pkgs/mime/) | Utilities for handling media (MIME) types, including determining a type from a file extension and file contents. | [![package issues](https://img.shields.io/badge/package:mime-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Amime) | [![pub package](https://img.shields.io/pub/v/mime.svg)](https://pub.dev/packages/mime) |
| [oauth2](pkgs/oauth2/) | A client library for authenticating with a remote service via OAuth2 on behalf of a user, and making authorized HTTP requests with the user's OAuth2 credentials. | [![package issues](https://img.shields.io/badge/package:oauth2-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aoauth2) | [![pub package](https://img.shields.io/pub/v/oauth2.svg)](https://pub.dev/packages/oauth2) |
| [package_config](pkgs/package_config/) | Support for reading and writing Dart Package Configuration files. | [![package issues](https://img.shields.io/badge/package:package_config-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Apackage_config) | [![pub package](https://img.shields.io/pub/v/package_config.svg)](https://pub.dev/packages/package_config) |
Expand Down
5 changes: 5 additions & 0 deletions pkgs/markdown/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dart_tool
.packages
.pub
pubspec.lock
doc/
13 changes: 13 additions & 0 deletions pkgs/markdown/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Below is a list of people and organizations that have contributed
# to the Dart project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.

David Peek <[email protected]>
Daniel Schubert <[email protected]>
Jirka Daněk <[email protected]>
Seth Westphal <[email protected]>
Tim Maffett <[email protected]>
Alex Li <[email protected]>
Loading

0 comments on commit d785fbb

Please sign in to comment.