Skip to content

Commit

Permalink
Merge pull request #405 from dart-lang/merge-typed_data-package
Browse files Browse the repository at this point in the history
Merge `package:typed_data`
  • Loading branch information
mosuem authored Oct 17, 2024
2 parents 07aff97 + 5e83b5b commit 5ed9323
Show file tree
Hide file tree
Showing 18 changed files with 2,293 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/typed_data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:typed_data"
about: "Create a bug or file a feature request against package:typed_data."
labels: "package:typed_data"
---
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@
"package:platform":
- changed-files:
- any-glob-to-any-file: 'pkgs/platform/**'

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

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

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

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]
sdk: [3.5, 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'
- name: Run Chrome tests - wasm
run: dart test --platform chrome --compiler dart2wasm
if: always() && steps.install.outcome == 'success'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
| [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) |
| [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) |
| [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) |

## Publishing automation

Expand Down
10 changes: 10 additions & 0 deletions pkgs/typed_data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.buildlog
.DS_Store
.idea
.dart_tool/
.pub/
.settings/
build/
packages
.packages
pubspec.lock
6 changes: 6 additions & 0 deletions pkgs/typed_data/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Below is a list of people and organizations that have contributed
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
69 changes: 69 additions & 0 deletions pkgs/typed_data/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## 1.4.0

* The type of the `buffer` constructor argument to `TypedDataBuffer` is now
`TypeDataList<E>` (instead of `List<E>`). While this is breaking change
statically there was a runtime cast that makes this change a no-op in
practice.
* Require Dart 3.5
* Move to `dart-lang/core` monorepo.

## 1.3.2

* Added package topics to the pubspec file.
* Require Dart 2.17.

## 1.3.1

* Switch to using `package:lints`.
* Populate the pubspec `repository` field.

## 1.3.0

* Stable release for null safety.
* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
guidelines.

## 1.2.0

* Add typed queue classes such as `Uint8Queue`. These classes implement both
`Queue` and `List` with a highly-efficient typed-data-backed implementation.
Their `sublist()` methods also return typed data classes.
* Update min Dart SDK to `2.4.0`.

## 1.1.6

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

## 1.1.5

* Undo unnecessary SDK version constraint tweak.

## 1.1.4

* Expand the SDK version constraint to include `<2.0.0-dev.infinity`.

## 1.1.3

* Fix all strong-mode warnings.

## 1.1.2

* Fix a bug where `TypedDataBuffer.insertAll` could fail to insert some elements
of an `Iterable`.

## 1.1.1

* Optimize `insertAll` with an `Iterable` argument and no end-point.

## 1.1.0

* Add `start` and `end` parameters to the `addAll()` and `insertAll()` methods
for the typed data buffer classes. These allow efficient concatenation of
slices of existing typed data.

* Make `addAll()` for typed data buffer classes more efficient for lists,
especially typed data lists.

## 1.0.0

* ChangeLog starts here
27 changes: 27 additions & 0 deletions pkgs/typed_data/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2015, 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.
21 changes: 21 additions & 0 deletions pkgs/typed_data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[![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)
[![pub package](https://img.shields.io/pub/v/typed_data.svg)](https://pub.dev/packages/typed_data)
[![package publisher](https://img.shields.io/pub/publisher/typed_data.svg)](https://pub.dev/packages/typed_data/publisher)

Helper libraries for working with typed data lists.

The `typed_data` package contains utility functions and classes that makes working with typed data lists easier.

## Using

The `typed_data` package can be imported using:

```dart
import 'package:typed_data/typed_data.dart';
```

## Typed buffers

Typed buffers are growable lists backed by typed arrays. These are similar to
the growable lists created by `<int>[]` or `<double>[]`, but store typed data
like a typed data list.
13 changes: 13 additions & 0 deletions pkgs/typed_data/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://dart.dev/guides/language/analysis-options
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-casts: true

linter:
rules:
- avoid_unused_constructor_parameters
- cancel_subscriptions
- no_adjacent_strings_in_list
- package_api_docs
Loading

0 comments on commit 5ed9323

Please sign in to comment.