chore: add sideEffects: false

This commit is contained in:
Simon Chan 2024-07-07 16:59:28 +08:00
parent 0224f0512f
commit 087e01b11b
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
24 changed files with 102 additions and 63 deletions

View file

@ -29,7 +29,7 @@ Try it out at https://app.tangoapp.dev
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/
## Contribute ## Contribute

View file

@ -30,7 +30,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/tango/daemon/credential-store/
## Sponsors ## Sponsors

View file

@ -23,6 +23,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -30,7 +30,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/tango/daemon/usb/device-manager/
## Sponsors ## Sponsors

View file

@ -24,6 +24,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -30,7 +30,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/scrcpy/
## Sponsors ## Sponsors

View file

@ -25,6 +25,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -30,7 +30,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/tango/server/client/
## Sponsors ## Sponsors

View file

@ -26,6 +26,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -24,6 +24,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -24,6 +24,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -24,6 +24,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -25,6 +25,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -27,7 +27,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/scrcpy/prepare-server/
## Sponsors ## Sponsors

View file

@ -26,6 +26,7 @@
"type": "module", "type": "module",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
"sideEffects": false,
"dependencies": { "dependencies": {
"gh-release-fetch": "^4.0.3" "gh-release-fetch": "^4.0.3"
}, },

View file

@ -21,6 +21,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"benchmark": "node benchmark.js", "benchmark": "node benchmark.js",
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",

View file

@ -23,6 +23,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.dom.json && tsc -b tsconfig.worker.json", "build": "tsc -b tsconfig.dom.json && tsc -b tsconfig.worker.json",
"build:watch": "tsc -b tsconfig.dom.json && tsc -b tsconfig.worker.json", "build:watch": "tsc -b tsconfig.dom.json && tsc -b tsconfig.worker.json",

View file

@ -1,45 +1,49 @@
# @yume-chan/scrcpy-decoder-tinyh264 <p align="center">
<img alt="Tango" src="https://raw.githubusercontent.com/yume-chan/ya-webadb/main/.github/logo.svg" width="200">
</p>
Decode and render H.264 streams using TinyH264, the old Android H.264 software decoder (now deprecated and removed), compiled into WebAssembly and wrapped in a Web Worker. <h1 align="center">@yume-chan/scrcpy-decoder-tinyh264</h1>
The video stream will be decoded into YUV frames on CPU, then converted to RGB using a WebGL shader (using GPU). It's slow, but works on most browsers. <p align="center">
Raw H.264 stream decoder and renderer wrapping TinyH264 and YUVCanvas packages (software decoding).
</p>
**WARNING:** The public API is UNSTABLE. Open a GitHub discussion if you have any questions. <p align="center">
<a href="https://github.com/yume-chan/ya-webadb/blob/main/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/yume-chan/ya-webadb">
</a>
<a href="https://github.com/yume-chan/ya-webadb/releases">
<img alt="GitHub release" src="https://img.shields.io/github/v/release/yume-chan/ya-webadb?logo=github">
</a>
<a href="https://bundlephobia.com/package/@yume-chan/scrcpy-decoder-tinyh264">
<img alt="Package Size" src="https://img.shields.io/bundlephobia/minzip/%40yume-chan%2Fscrcpy-decoder-tinyh264">
</a>
<a href="https://www.npmjs.com/package/@yume-chan/scrcpy-decoder-tinyh264">
<img alt="npm" src="https://img.shields.io/npm/dm/%40yume-chan/scrcpy-decoder-tinyh264?logo=npm">
</a>
<a href="https://discord.gg/26k3ttC2PN">
<img alt="Discord" src="https://img.shields.io/discord/1120215514732564502?logo=discord&logoColor=%23ffffff&label=Discord">
</a>
</p>
## Compatibility This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Generally you need multiple packages to build a complete ADB client that can run on Web browsers and Node.js. Read the documentation for more information.
| Chrome | Firefox | Safari | Performance | Supported H.264 profile/level | ## Documentation
| ------ | ------- | ------ | ----------- | ----------------------------- |
| 57 | 52 | 11 | Poor | Baseline level 4 |
## Usage Check the latest documentation at https://docs.tangoapp.dev/scrcpy/video/tiny-h264/
The bundler you use must support the `new Worker(new URL('./worker.js', import.meta.url))` syntax. It's known that Webpack 5 works. ## Sponsors
### Limit profile/level [Become a backer](https://opencollective.com/ya-webadb) and get your image on our README on Github with a link to your site.
Because it only supports Baseline level 4 codec, but many newer devices default to higher profiles/levels, you can limit it by using the `codecOptions` option: <a href="https://opencollective.com/ya-webadb/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/0/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/1/avatar.svg?requireActive=false"></a>
```ts <a href="https://opencollective.com/ya-webadb/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/2/avatar.svg?requireActive=false"></a>
new ScrcpyOptions1_24({ <a href="https://opencollective.com/ya-webadb/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/3/avatar.svg?requireActive=false"></a>
codecOptions: new CodecOptions({ <a href="https://opencollective.com/ya-webadb/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/4/avatar.svg?requireActive=false"></a>
profile: TinyH264Decoder.maxProfile, <a href="https://opencollective.com/ya-webadb/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/5/avatar.svg?requireActive=false"></a>
level: TinyH264Decoder.maxLevel, <a href="https://opencollective.com/ya-webadb/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/6/avatar.svg?requireActive=false"></a>
}), <a href="https://opencollective.com/ya-webadb/backer/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/7/avatar.svg?requireActive=false"></a>
}); <a href="https://opencollective.com/ya-webadb/backer/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/8/avatar.svg?requireActive=false"></a>
``` <a href="https://opencollective.com/ya-webadb/backer/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/9/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/10/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/10/avatar.svg?requireActive=false"></a>
However, it can fail on some very old devices that doesn't support even Baseline level 4 codec. You can retry without the `codecOptions` option if that happens.
### Render the video
It draws frames onto `decoder.renderer` (a `<canvas>` element), you can insert it anywhere you want to display the video.
```ts
const decoder = new TinyH264Decoder();
document.body.appendChild(decoder.renderer);
videoPacketStream // from `@yume-chan/scrcpy`
.pipeTo(decoder.writable)
.catch(() => {});
```

View file

@ -1,29 +1,49 @@
# @yume-chan/scrcpy-decoder-webcodecs <p align="center">
<img alt="Tango" src="https://raw.githubusercontent.com/yume-chan/ya-webadb/main/.github/logo.svg" width="200">
</p>
Decode and render H.264 streams using the [WebCodecs API](https://developer.mozilla.org/en-US/docs/Web/API/WebCodecs_API). <h1 align="center">@yume-chan/scrcpy-decoder-webcodecs</h1>
It has no dependencies and high performance, but is only available on recent versions of Chrome. <p align="center">
Raw H.264 stream decoder and renderer using WebCodecs API (requires modern browser).
</p>
**WARNING:** The public API is UNSTABLE. Open a GitHub discussion if you have any questions. <p align="center">
<a href="https://github.com/yume-chan/ya-webadb/blob/main/LICENSE">
<img alt="MIT License" src="https://img.shields.io/github/license/yume-chan/ya-webadb">
</a>
<a href="https://github.com/yume-chan/ya-webadb/releases">
<img alt="GitHub release" src="https://img.shields.io/github/v/release/yume-chan/ya-webadb?logo=github">
</a>
<a href="https://bundlephobia.com/package/@yume-chan/scrcpy-decoder-webcodecs">
<img alt="Package Size" src="https://img.shields.io/bundlephobia/minzip/%40yume-chan%2Fscrcpy-decoder-webcodecs">
</a>
<a href="https://www.npmjs.com/package/@yume-chan/scrcpy-decoder-webcodecs">
<img alt="npm" src="https://img.shields.io/npm/dm/%40yume-chan/scrcpy-decoder-webcodecs?logo=npm">
</a>
<a href="https://discord.gg/26k3ttC2PN">
<img alt="Discord" src="https://img.shields.io/discord/1120215514732564502?logo=discord&logoColor=%23ffffff&label=Discord">
</a>
</p>
- [Compatibility](#compatibility) This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Generally you need multiple packages to build a complete ADB client that can run on Web browsers and Node.js. Read the documentation for more information.
- [Usage](#usage)
## Compatibility ## Documentation
| Chrome | Firefox | Safari | Performance | Supported H.264 profile/level | Check the latest documentation at https://docs.tangoapp.dev/scrcpy/video/web-codecs/
| ------ | ------- | ------ | ------------------------------- | ----------------------------- |
| 94 | No | No | High with hardware acceleration | High level 5 |
## Usage ## Sponsors
It draws frames onto `decoder.renderer` (a `<canvas>` element), you can insert it anywhere you want to display the video. [Become a backer](https://opencollective.com/ya-webadb) and get your image on our README on Github with a link to your site.
```ts <a href="https://opencollective.com/ya-webadb/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/0/avatar.svg?requireActive=false"></a>
const decoder = new WebCodecsDecoder(); <a href="https://opencollective.com/ya-webadb/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/1/avatar.svg?requireActive=false"></a>
document.body.appendChild(decoder.renderer); <a href="https://opencollective.com/ya-webadb/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/2/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/3/avatar.svg?requireActive=false"></a>
videoPacketStream // from `@yume-chan/scrcpy` <a href="https://opencollective.com/ya-webadb/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/4/avatar.svg?requireActive=false"></a>
.pipeTo(decoder.writable) <a href="https://opencollective.com/ya-webadb/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/5/avatar.svg?requireActive=false"></a>
.catch(() => {}); <a href="https://opencollective.com/ya-webadb/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/6/avatar.svg?requireActive=false"></a>
``` <a href="https://opencollective.com/ya-webadb/backer/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/7/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/8/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/9/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/ya-webadb/backer/10/website?requireActive=false" target="_blank"><img src="https://opencollective.com/ya-webadb/backer/10/avatar.svg?requireActive=false"></a>

View file

@ -26,6 +26,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -30,7 +30,7 @@ This package is part of [Tango ADB](https://github.com/yume-chan/ya-webadb). Gen
## Documentation ## Documentation
Check the latest documentation at https://tango-adb.github.io/docs/ Check the latest documentation at https://docs.tangoapp.dev/scrcpy/
## Sponsors ## Sponsors

View file

@ -25,6 +25,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -24,6 +24,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",

View file

@ -26,6 +26,7 @@
"type": "module", "type": "module",
"main": "esm/index.js", "main": "esm/index.js",
"types": "esm/index.d.ts", "types": "esm/index.d.ts",
"sideEffects": false,
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json", "build": "tsc -b tsconfig.build.json",
"build:watch": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json",