Skip to content

Commit 5ed9323

Browse files
authored
Merge pull request #405 from dart-lang/merge-typed_data-package
Merge `package:typed_data`
2 parents 07aff97 + 5e83b5b commit 5ed9323

18 files changed

+2293
-0
lines changed

.github/ISSUE_TEMPLATE/typed_data.md

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

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939
"package:platform":
4040
- changed-files:
4141
- any-glob-to-any-file: 'pkgs/platform/**'
42+
43+
"package:typed_data":
44+
- changed-files:
45+
- any-glob-to-any-file: 'pkgs/typed_data/**'

.github/workflows/typed_data.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: package:typed_data
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/typed_data.yaml'
9+
- 'pkgs/typed_data/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/typed_data.yaml'
14+
- 'pkgs/typed_data/**'
15+
schedule:
16+
- cron: "0 0 * * 0"
17+
env:
18+
PUB_ENVIRONMENT: bot.github
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/typed_data/
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]
59+
sdk: [3.5, 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'
74+
- name: Run Chrome tests - wasm
75+
run: dart test --platform chrome --compiler dart2wasm
76+
if: always() && steps.install.outcome == 'success'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
1818
| [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) |
1919
| [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) |
2020
| [platform](pkgs/platform/) | A pluggable, mockable platform information abstraction for Dart. | [![pub package](https://img.shields.io/pub/v/platform.svg)](https://pub.dev/packages/platform) |
21+
| [typed_data](pkgs/typed_data/) | Utility functions and classes related to the dart:typed_data library. | [![pub package](https://img.shields.io/pub/v/typed_data.svg)](https://pub.dev/packages/typed_data) |
2122

2223
## Publishing automation
2324

pkgs/typed_data/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.buildlog
2+
.DS_Store
3+
.idea
4+
.dart_tool/
5+
.pub/
6+
.settings/
7+
build/
8+
packages
9+
.packages
10+
pubspec.lock

pkgs/typed_data/AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

pkgs/typed_data/CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## 1.4.0
2+
3+
* The type of the `buffer` constructor argument to `TypedDataBuffer` is now
4+
`TypeDataList<E>` (instead of `List<E>`). While this is breaking change
5+
statically there was a runtime cast that makes this change a no-op in
6+
practice.
7+
* Require Dart 3.5
8+
* Move to `dart-lang/core` monorepo.
9+
10+
## 1.3.2
11+
12+
* Added package topics to the pubspec file.
13+
* Require Dart 2.17.
14+
15+
## 1.3.1
16+
17+
* Switch to using `package:lints`.
18+
* Populate the pubspec `repository` field.
19+
20+
## 1.3.0
21+
22+
* Stable release for null safety.
23+
* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
24+
guidelines.
25+
26+
## 1.2.0
27+
28+
* Add typed queue classes such as `Uint8Queue`. These classes implement both
29+
`Queue` and `List` with a highly-efficient typed-data-backed implementation.
30+
Their `sublist()` methods also return typed data classes.
31+
* Update min Dart SDK to `2.4.0`.
32+
33+
## 1.1.6
34+
35+
* Set max SDK version to `<3.0.0`, and adjust other dependencies.
36+
37+
## 1.1.5
38+
39+
* Undo unnecessary SDK version constraint tweak.
40+
41+
## 1.1.4
42+
43+
* Expand the SDK version constraint to include `<2.0.0-dev.infinity`.
44+
45+
## 1.1.3
46+
47+
* Fix all strong-mode warnings.
48+
49+
## 1.1.2
50+
51+
* Fix a bug where `TypedDataBuffer.insertAll` could fail to insert some elements
52+
of an `Iterable`.
53+
54+
## 1.1.1
55+
56+
* Optimize `insertAll` with an `Iterable` argument and no end-point.
57+
58+
## 1.1.0
59+
60+
* Add `start` and `end` parameters to the `addAll()` and `insertAll()` methods
61+
for the typed data buffer classes. These allow efficient concatenation of
62+
slices of existing typed data.
63+
64+
* Make `addAll()` for typed data buffer classes more efficient for lists,
65+
especially typed data lists.
66+
67+
## 1.0.0
68+
69+
* ChangeLog starts here

pkgs/typed_data/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2015, 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/typed_data/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[![Dart CI](https://github.com/dart-lang/core/actions/workflows/typed_data.yaml/badge.svg)](https://github.com/dart-lang/core/actions/workflows/typed_data.yaml)
2+
[![pub package](https://img.shields.io/pub/v/typed_data.svg)](https://pub.dev/packages/typed_data)
3+
[![package publisher](https://img.shields.io/pub/publisher/typed_data.svg)](https://pub.dev/packages/typed_data/publisher)
4+
5+
Helper libraries for working with typed data lists.
6+
7+
The `typed_data` package contains utility functions and classes that makes working with typed data lists easier.
8+
9+
## Using
10+
11+
The `typed_data` package can be imported using:
12+
13+
```dart
14+
import 'package:typed_data/typed_data.dart';
15+
```
16+
17+
## Typed buffers
18+
19+
Typed buffers are growable lists backed by typed arrays. These are similar to
20+
the growable lists created by `<int>[]` or `<double>[]`, but store typed data
21+
like a typed data list.

pkgs/typed_data/analysis_options.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
8+
linter:
9+
rules:
10+
- avoid_unused_constructor_parameters
11+
- cancel_subscriptions
12+
- no_adjacent_strings_in_list
13+
- package_api_docs

0 commit comments

Comments
 (0)