Skip to content

Commit

Permalink
Merge branch 'main' into merge-path-package
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem authored Oct 17, 2024
2 parents bab3e3c + 1a3e04e commit ad17462
Show file tree
Hide file tree
Showing 41 changed files with 2,538 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/args.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:args"
about: "Create a bug or file a feature request against package:args."
labels: "package:args"
---
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:logging"
about: "Create a bug or file a feature request against package:logging."
labels: "package:logging"
---
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/os_detect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:os_detect"
about: "Create a bug or file a feature request against package:os_detect."
labels: "package:os_detect"
---
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/fixnum/**'

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

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

"package:path":
- changed-files:
- any-glob-to-any-file: 'pkgs/path/**'
70 changes: 70 additions & 0 deletions .github/workflows/logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: package:logging

on:
# Run CI on pushes to the main branch, and on PRs against main.
push:
branches: [ main ]
paths:
- '.github/workflows/logging.yaml'
- 'pkgs/logging/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/logging.yaml'
- 'pkgs/logging/**'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github

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

jobs:
# Check code formatting and static analysis.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
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 of platforms and sdk versions.
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.4, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
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'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
73 changes: 73 additions & 0 deletions .github/workflows/os_detect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: package:os_detect

on:
# Run CI on pushes to the main branch, and on PRs against main.
push:
branches: [ main ]
paths:
- '.github/workflows/os_detect.yaml'
- 'pkgs/os_detect/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/os_detect.yaml'
- 'pkgs/os_detect/**'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github

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

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@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
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, windows-latest, macos-latest]
sdk: [3.0.0, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
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'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ new file please also add this. The year should be a single number stating the
year the file was created (don't use a range like "2011-2012"). Additionally, if
you edit an existing file, you shouldn't update the year.

// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// Copyright (c) 2024, 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.

Expand All @@ -48,4 +48,4 @@ This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

We pledge to maintain an open and welcoming environment. For details, see our
[code of conduct](https://dart.dev/code-of-conduct).
[code of conduct](https://dart.dev/code-of-conduct).
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
| [convert](pkgs/convert/) | Utilities for converting between data representations. | [![pub package](https://img.shields.io/pub/v/convert.svg)](https://pub.dev/packages/convert) |
| [crypto](pkgs/crypto/) | Implementations of SHA, MD5, and HMAC cryptographic functions. | [![pub package](https://img.shields.io/pub/v/crypto.svg)](https://pub.dev/packages/crypto) |
| [fixnum](pkgs/fixnum/) | Library for 32- and 64-bit signed fixed-width integers. | [![pub package](https://img.shields.io/pub/v/fixnum.svg)](https://pub.dev/packages/fixnum) |
| [logging](pkgs/logging/) | Provides APIs for debugging and error logging. | [![pub package](https://img.shields.io/pub/v/logging.svg)](https://pub.dev/packages/logging) |
| [os_detect](pkgs/os_detect/) | Platform independent OS detection. | [![pub package](https://img.shields.io/pub/v/os_detect.svg)](https://pub.dev/packages/os_detect) |
| [path](pkgs/path/) | A string-based path manipulation library for all of the path operations you know and love. | [![pub package](https://img.shields.io/pub/v/path.svg)](https://pub.dev/packages/path) |

## Publishing automation
Expand Down
4 changes: 3 additions & 1 deletion pkgs/args/example/arg_parser/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ name: arg_parser_example
version: 1.0.0
description: An example of using ArgParser
publish_to: 'none'

environment:
sdk: '>=2.14.0 <3.0.0'
sdk: ^3.0.0

dependencies:
args:
path: ../..
4 changes: 3 additions & 1 deletion pkgs/args/example/command_runner/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ name: command_runner_example
version: 1.0.0
description: An example of using CommandRunner
publish_to: 'none'

environment:
sdk: '>=2.14.0 <3.0.0'
sdk: ^3.0.0

dependencies:
args:
path: ../..
3 changes: 3 additions & 0 deletions pkgs/logging/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.dart_tool
.packages
pubspec.lock
10 changes: 10 additions & 0 deletions pkgs/logging/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Names should be added to this file with this pattern:
#
# For individuals:
# Name <email address>
#
# For organizations:
# Organization <fnmatch pattern>
#
Google Inc. <*@google.com>
Anton Astashov <[email protected]>
92 changes: 92 additions & 0 deletions pkgs/logging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
## 1.3.0

* Override empty stack traces for trace level events.
* Require Dart 3.4
* Move to `dart-lang/core` monorepo.

## 1.2.0

* Add notification when the log level is changed. Logger `onLevelChanged` broadcasts a stream of level values.
* Require Dart 2.19.

## 1.1.1

* Add a check that throws if a logger name ends with '.'.
* Require Dart 2.18

## 1.1.0

* Add `Logger.attachedLoggers` which exposes all loggers created with the
default constructor.
* Enable the `avoid_dynamic_calls` lint.

## 1.0.2

* Update description.
* Add example.

## 1.0.1

* List log levels in README.

## 1.0.0

* Stable null safety release.

## 1.0.0-nullsafety.0

* Migrate to null safety.
* Removed the deprecated `LoggerHandler` typedef.

## 0.11.4

* Add top level `defaultLevel`.
* Require Dart `>=2.0.0`.
* Make detached loggers work regardless of `hierarchicalLoggingEnabled`.

## 0.11.3+2

* Set max SDK version to `<3.0.0`, and adjust other dependencies.

## 0.11.3+1

* Fixed several documentation comments.

## 0.11.3

* Added optional `LogRecord.object` field.

* `Logger.log` sets `LogRecord.object` if the message is not a string or a
function that returns a string. So that a handler can access the original
object instead of just its `toString()`.

## 0.11.2

* Added `Logger.detached` - a convenience factory to obtain a logger that is not
attached to this library's logger hierarchy.

## 0.11.1+1

* Include default error with the auto-generated stack traces.

## 0.11.1

* Add support for automatically logging the stack trace on error messages. Note
this can be expensive, so it is off by default.

## 0.11.0

* Revert change in `0.10.0`. `stackTrace` must be an instance of `StackTrace`.
Use the `Trace` class from the [stack_trace package][] to convert strings.

[stack_trace package]: https://pub.dev/packages/stack_trace

## 0.10.0

* Change type of `stackTrace` from `StackTrace` to `Object`.

## 0.9.3

* Added optional `LogRecord.zone` field.

* Record current zone (or user specified zone) when creating new `LogRecord`s.
27 changes: 27 additions & 0 deletions pkgs/logging/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2013, 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.
Loading

0 comments on commit ad17462

Please sign in to comment.