Skip to content

Commit ad17462

Browse files
authored
Merge branch 'main' into merge-path-package
2 parents bab3e3c + 1a3e04e commit ad17462

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2538
-4
lines changed

.github/ISSUE_TEMPLATE/args.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:args"
3+
about: "Create a bug or file a feature request against package:args."
4+
labels: "package:args"
5+
---

.github/ISSUE_TEMPLATE/logging.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:logging"
3+
about: "Create a bug or file a feature request against package:logging."
4+
labels: "package:logging"
5+
---

.github/ISSUE_TEMPLATE/os_detect.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
name: "package:os_detect"
3+
about: "Create a bug or file a feature request against package:os_detect."
4+
labels: "package:os_detect"
5+
---

.github/labeler.yml

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
- changed-files:
2525
- any-glob-to-any-file: 'pkgs/fixnum/**'
2626

27+
"package:logging":
28+
- changed-files:
29+
- any-glob-to-any-file: 'pkgs/logging/**'
30+
31+
"package:os_detect":
32+
- changed-files:
33+
- any-glob-to-any-file: 'pkgs/os_detect/**'
34+
2735
"package:path":
2836
- changed-files:
2937
- any-glob-to-any-file: 'pkgs/path/**'

.github/workflows/logging.yaml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: package:logging
2+
3+
on:
4+
# Run CI on pushes to the main branch, and on PRs against main.
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.github/workflows/logging.yaml'
9+
- 'pkgs/logging/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/logging.yaml'
14+
- 'pkgs/logging/**'
15+
schedule:
16+
- cron: "0 0 * * 0"
17+
env:
18+
PUB_ENVIRONMENT: bot.github
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/logging/
23+
24+
jobs:
25+
# Check code formatting and static analysis.
26+
analyze:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
sdk: [dev]
32+
steps:
33+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
34+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
35+
with:
36+
sdk: ${{ matrix.sdk }}
37+
- id: install
38+
name: Install dependencies
39+
run: dart pub get
40+
- name: Check formatting
41+
run: dart format --output=none --set-exit-if-changed .
42+
if: always() && steps.install.outcome == 'success'
43+
- name: Analyze code
44+
run: dart analyze --fatal-infos
45+
if: always() && steps.install.outcome == 'success'
46+
47+
# Run tests on a matrix of platforms and sdk versions.
48+
test:
49+
needs: analyze
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
# Add macos-latest and/or windows-latest if relevant for this package.
55+
os: [ubuntu-latest]
56+
sdk: [3.4, dev]
57+
steps:
58+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
59+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
60+
with:
61+
sdk: ${{ matrix.sdk }}
62+
- id: install
63+
name: Install dependencies
64+
run: dart pub get
65+
- name: Run VM tests
66+
run: dart test --platform vm
67+
if: always() && steps.install.outcome == 'success'
68+
- name: Run Chrome tests
69+
run: dart test --platform chrome
70+
if: always() && steps.install.outcome == 'success'

.github/workflows/os_detect.yaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: package:os_detect
2+
3+
on:
4+
# Run CI on pushes to the main branch, and on PRs against main.
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.github/workflows/os_detect.yaml'
9+
- 'pkgs/os_detect/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/os_detect.yaml'
14+
- 'pkgs/os_detect/**'
15+
schedule:
16+
- cron: "0 0 * * 0"
17+
env:
18+
PUB_ENVIRONMENT: bot.github
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/os_detect/
23+
24+
jobs:
25+
# Check code formatting and static analysis on a single OS (linux)
26+
# against Dart dev.
27+
analyze:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
sdk: [dev]
33+
steps:
34+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
35+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
36+
with:
37+
sdk: ${{ matrix.sdk }}
38+
- id: install
39+
name: Install dependencies
40+
run: dart pub get
41+
- name: Check formatting
42+
run: dart format --output=none --set-exit-if-changed .
43+
if: always() && steps.install.outcome == 'success'
44+
- name: Analyze code
45+
run: dart analyze --fatal-infos
46+
if: always() && steps.install.outcome == 'success'
47+
48+
# Run tests on a matrix consisting of two dimensions:
49+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
50+
# 2. release channel: dev
51+
test:
52+
needs: analyze
53+
runs-on: ${{ matrix.os }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
# Add macos-latest and/or windows-latest if relevant for this package.
58+
os: [ubuntu-latest, windows-latest, macos-latest]
59+
sdk: [3.0.0, dev]
60+
steps:
61+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
62+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
63+
with:
64+
sdk: ${{ matrix.sdk }}
65+
- id: install
66+
name: Install dependencies
67+
run: dart pub get
68+
- name: Run VM tests
69+
run: dart test --platform vm
70+
if: always() && steps.install.outcome == 'success'
71+
- name: Run Chrome tests
72+
run: dart test --platform chrome
73+
if: always() && steps.install.outcome == 'success'

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ new file please also add this. The year should be a single number stating the
3838
year the file was created (don't use a range like "2011-2012"). Additionally, if
3939
you edit an existing file, you shouldn't update the year.
4040

41-
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
41+
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
4242
// for details. All rights reserved. Use of this source code is governed by a
4343
// BSD-style license that can be found in the LICENSE file.
4444

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

5050
We pledge to maintain an open and welcoming environment. For details, see our
51-
[code of conduct](https://dart.dev/code-of-conduct).
51+
[code of conduct](https://dart.dev/code-of-conduct).

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
1414
| [convert](pkgs/convert/) | Utilities for converting between data representations. | [![pub package](https://img.shields.io/pub/v/convert.svg)](https://pub.dev/packages/convert) |
1515
| [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) |
1616
| [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) |
17+
| [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) |
18+
| [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) |
1719
| [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) |
1820

1921
## Publishing automation

pkgs/args/example/arg_parser/pubspec.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ name: arg_parser_example
66
version: 1.0.0
77
description: An example of using ArgParser
88
publish_to: 'none'
9+
910
environment:
10-
sdk: '>=2.14.0 <3.0.0'
11+
sdk: ^3.0.0
12+
1113
dependencies:
1214
args:
1315
path: ../..

pkgs/args/example/command_runner/pubspec.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ name: command_runner_example
66
version: 1.0.0
77
description: An example of using CommandRunner
88
publish_to: 'none'
9+
910
environment:
10-
sdk: '>=2.14.0 <3.0.0'
11+
sdk: ^3.0.0
12+
1113
dependencies:
1214
args:
1315
path: ../..

pkgs/logging/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dart_tool
2+
.packages
3+
pubspec.lock

pkgs/logging/AUTHORS

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Names should be added to this file with this pattern:
2+
#
3+
# For individuals:
4+
# Name <email address>
5+
#
6+
# For organizations:
7+
# Organization <fnmatch pattern>
8+
#
9+
Google Inc. <*@google.com>
10+
Anton Astashov <[email protected]>

pkgs/logging/CHANGELOG.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
## 1.3.0
2+
3+
* Override empty stack traces for trace level events.
4+
* Require Dart 3.4
5+
* Move to `dart-lang/core` monorepo.
6+
7+
## 1.2.0
8+
9+
* Add notification when the log level is changed. Logger `onLevelChanged` broadcasts a stream of level values.
10+
* Require Dart 2.19.
11+
12+
## 1.1.1
13+
14+
* Add a check that throws if a logger name ends with '.'.
15+
* Require Dart 2.18
16+
17+
## 1.1.0
18+
19+
* Add `Logger.attachedLoggers` which exposes all loggers created with the
20+
default constructor.
21+
* Enable the `avoid_dynamic_calls` lint.
22+
23+
## 1.0.2
24+
25+
* Update description.
26+
* Add example.
27+
28+
## 1.0.1
29+
30+
* List log levels in README.
31+
32+
## 1.0.0
33+
34+
* Stable null safety release.
35+
36+
## 1.0.0-nullsafety.0
37+
38+
* Migrate to null safety.
39+
* Removed the deprecated `LoggerHandler` typedef.
40+
41+
## 0.11.4
42+
43+
* Add top level `defaultLevel`.
44+
* Require Dart `>=2.0.0`.
45+
* Make detached loggers work regardless of `hierarchicalLoggingEnabled`.
46+
47+
## 0.11.3+2
48+
49+
* Set max SDK version to `<3.0.0`, and adjust other dependencies.
50+
51+
## 0.11.3+1
52+
53+
* Fixed several documentation comments.
54+
55+
## 0.11.3
56+
57+
* Added optional `LogRecord.object` field.
58+
59+
* `Logger.log` sets `LogRecord.object` if the message is not a string or a
60+
function that returns a string. So that a handler can access the original
61+
object instead of just its `toString()`.
62+
63+
## 0.11.2
64+
65+
* Added `Logger.detached` - a convenience factory to obtain a logger that is not
66+
attached to this library's logger hierarchy.
67+
68+
## 0.11.1+1
69+
70+
* Include default error with the auto-generated stack traces.
71+
72+
## 0.11.1
73+
74+
* Add support for automatically logging the stack trace on error messages. Note
75+
this can be expensive, so it is off by default.
76+
77+
## 0.11.0
78+
79+
* Revert change in `0.10.0`. `stackTrace` must be an instance of `StackTrace`.
80+
Use the `Trace` class from the [stack_trace package][] to convert strings.
81+
82+
[stack_trace package]: https://pub.dev/packages/stack_trace
83+
84+
## 0.10.0
85+
86+
* Change type of `stackTrace` from `StackTrace` to `Object`.
87+
88+
## 0.9.3
89+
90+
* Added optional `LogRecord.zone` field.
91+
92+
* Record current zone (or user specified zone) when creating new `LogRecord`s.

pkgs/logging/LICENSE

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2013, 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.

0 commit comments

Comments
 (0)