Skip to content

Commit

Permalink
chore!: Update package names and URLs
Browse files Browse the repository at this point in the history
Fork for the control of the release pace and versioning.
To avoid confusion with the original package, we need to rename the
package name.
  • Loading branch information
Gasol committed Aug 14, 2024
1 parent 33823df commit 6eb7e25
Show file tree
Hide file tree
Showing 133 changed files with 634 additions and 675 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ jobs:
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write # to be able to publish a GitHub release
id-token: write # to enable use of OIDC for npm provenance
issues: write # to be able to comment on released issues
packages: write # to be able to publish a GitHub package
pull-requests: write # to be able to comment on released pull requests
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -26,8 +30,8 @@ jobs:

- run: pnpm run build
- run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
npm config set "//npm.pkg.github.com/:_authToken" "${NPM_TOKEN}"
pnpm recursive publish --access public --no-git-checks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
20 changes: 10 additions & 10 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@yume-chan/adb-cli",
"name": "@gasol/adb-cli",
"private": true,
"version": "0.0.19",
"description": "Re-implement `adb`",
Expand All @@ -13,14 +13,14 @@
"email": "[email protected]",
"url": "https://chensi.moe/blog"
},
"homepage": "https://github.com/yume-chan/ya-webadb/tree/main/apps/adb-cli#readme",
"homepage": "https://github.com/Gasol/ya-webadb/tree/main/apps/adb-cli#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/yume-chan/ya-webadb.git",
"url": "git+https://github.com/Gasol/ya-webadb.git",
"directory": "apps/adb-cli"
},
"bugs": {
"url": "https://github.com/yume-chan/ya-webadb/issues"
"url": "https://github.com/Gasol/ya-webadb/issues"
},
"type": "module",
"main": "esm/index.js",
Expand All @@ -33,17 +33,17 @@
"tango-cli": "esm/index.js"
},
"dependencies": {
"@yume-chan/adb": "workspace:^0.0.24",
"@yume-chan/adb-server-node-tcp": "workspace:^0.0.24",
"@yume-chan/android-bin": "workspace:^0.0.24",
"@yume-chan/stream-extra": "workspace:^0.0.24",
"@gasol/adb": "workspace:^0.0.24",
"@gasol/adb-server-node-tcp": "workspace:^0.0.24",
"@gasol/android-bin": "workspace:^0.0.24",
"@gasol/stream-extra": "workspace:^0.0.24",
"commander": "^12.1.0",
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@types/node": "^22.2.0",
"@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0",
"@gasol/eslint-config": "workspace:^1.0.0",
"@gasol/tsconfig": "workspace:^1.0.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
}
Expand Down
47 changes: 21 additions & 26 deletions apps/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import "source-map-support/register.js";

import { Adb, AdbServerClient } from "@yume-chan/adb";
import { AdbServerNodeTcpConnector } from "@yume-chan/adb-server-node-tcp";
import { WritableStream } from "@yume-chan/stream-extra";
import { Adb, AdbServerClient } from "@gasol/adb";
import { AdbServerNodeTcpConnector } from "@gasol/adb-server-node-tcp";
import { WritableStream } from "@gasol/stream-extra";
import { program } from "commander";

program
Expand All @@ -29,7 +29,7 @@ program
});

function createClient() {
const opts: { H: string; P: number } = program.opts();
const opts: { H: string; P: number; } = program.opts();
const connection = new AdbServerNodeTcpConnector({
host: opts.H,
port: opts.P,
Expand All @@ -43,7 +43,7 @@ program
.usage("[-l]")
.description("list connected devices (-l for long output)")
.option("-l", "long output", false)
.action(async (options: { l: boolean }) => {
.action(async (options: { l: boolean; }) => {
function appendTransportInfo(key: string, value: string | undefined) {
if (value) {
return ` ${key}:${value}`;
Expand All @@ -57,16 +57,11 @@ program
if (options.l) {
console.log(
// prettier-ignore
`${
device.serial.padEnd(22)
}device${
appendTransportInfo("product", device.product)
}${
appendTransportInfo("model", device.model)
}${
appendTransportInfo("device", device.device)
}${
appendTransportInfo("transport_id", device.transportId.toString())
`${device.serial.padEnd(22)
}device${appendTransportInfo("product", device.product)
}${appendTransportInfo("model", device.model)
}${appendTransportInfo("device", device.device)
}${appendTransportInfo("transport_id", device.transportId.toString())
}`,
);
} else {
Expand Down Expand Up @@ -105,21 +100,21 @@ async function createAdb(options: DeviceCommandOptions) {
const transport = await client.createTransport(
options.d
? {
usb: true,
}
usb: true,
}
: options.e
? {
? {
tcp: true,
}
: options.s !== undefined
? {
serial: options.s,
}
: options.t !== undefined
? {
transportId: options.t,
: options.s !== undefined
? {
serial: options.s,
}
: undefined,
: options.t !== undefined
? {
transportId: options.t,
}
: undefined,
);
const adb = new Adb(transport);
return adb;
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./node_modules/@yume-chan/tsconfig/tsconfig.base.json",
"extends": "./node_modules/@gasol/tsconfig/tsconfig.base.json",
"compilerOptions": {
"lib": [
"ESNext",
Expand Down
16 changes: 8 additions & 8 deletions libraries/adb-credential-web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@yume-chan/adb-credential-web",
"name": "@gasol/adb-credential-web",
"version": "0.0.24",
"description": "Credential Store for `@yume-chan/adb` using WebCrypto and IndexedDB APIs.",
"description": "Credential Store for `@gasol/adb` using WebCrypto and IndexedDB APIs.",
"keywords": [
"adb"
],
Expand All @@ -11,14 +11,14 @@
"email": "[email protected]",
"url": "https://chensi.moe/blog"
},
"homepage": "https://github.com/yume-chan/ya-webadb/tree/main/libraries/adb-credential-web#readme",
"homepage": "https://github.com/Gasol/ya-webadb/tree/main/libraries/adb-credential-web#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/yume-chan/ya-webadb.git",
"url": "git+https://github.com/Gasol/ya-webadb.git",
"directory": "libraries/adb-credential-web"
},
"bugs": {
"url": "https://github.com/yume-chan/ya-webadb/issues"
"url": "https://github.com/Gasol/ya-webadb/issues"
},
"type": "module",
"main": "esm/index.js",
Expand All @@ -30,11 +30,11 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@yume-chan/adb": "workspace:^0.0.24"
"@gasol/adb": "workspace:^0.0.24"
},
"devDependencies": {
"@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0",
"@gasol/eslint-config": "workspace:^1.0.0",
"@gasol/tsconfig": "workspace:^1.0.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/adb-credential-web/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// cspell: ignore RSASSA

import type { AdbCredentialStore, AdbPrivateKey } from "@yume-chan/adb";
import type { AdbCredentialStore, AdbPrivateKey } from "@gasol/adb";

function openDatabase() {
return new Promise<IDBDatabase>((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion libraries/adb-credential-web/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./node_modules/@yume-chan/tsconfig/tsconfig.base.json",
"extends": "./node_modules/@gasol/tsconfig/tsconfig.base.json",
"compilerOptions": {
"lib": [
"ESNext",
Expand Down
22 changes: 11 additions & 11 deletions libraries/adb-daemon-webusb/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@yume-chan/adb-daemon-webusb",
"name": "@gasol/adb-daemon-webusb",
"version": "0.0.24",
"description": "Adb daemon transport connection for `@yume-chan/adb` using WebUSB API.",
"description": "Adb daemon transport connection for `@gasol/adb` using WebUSB API.",
"keywords": [
"webusb",
"adb"
Expand All @@ -12,14 +12,14 @@
"email": "[email protected]",
"url": "https://chensi.moe/blog"
},
"homepage": "https://github.com/yume-chan/ya-webadb/tree/main/libraries/adb-daemon-webusb#readme",
"homepage": "https://github.com/Gasol/ya-webadb/tree/main/libraries/adb-daemon-webusb#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/yume-chan/ya-webadb.git",
"url": "git+https://github.com/Gasol/ya-webadb.git",
"directory": "libraries/adb-daemon-webusb"
},
"bugs": {
"url": "https://github.com/yume-chan/ya-webadb/issues"
"url": "https://github.com/Gasol/ya-webadb/issues"
},
"type": "module",
"main": "esm/index.js",
Expand All @@ -33,15 +33,15 @@
},
"dependencies": {
"@types/w3c-web-usb": "^1.0.10",
"@yume-chan/adb": "workspace:^0.0.24",
"@yume-chan/stream-extra": "workspace:^0.0.24",
"@yume-chan/struct": "workspace:^0.0.24"
"@gasol/adb": "workspace:^0.0.24",
"@gasol/stream-extra": "workspace:^0.0.24",
"@gasol/struct": "workspace:^0.0.24"
},
"devDependencies": {
"@types/node": "^22.2.0",
"@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/test-runner": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0",
"@gasol/eslint-config": "workspace:^1.0.0",
"@gasol/test-runner": "workspace:^1.0.0",
"@gasol/tsconfig": "workspace:^1.0.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
}
Expand Down
17 changes: 8 additions & 9 deletions libraries/adb-daemon-webusb/src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import type {
AdbDaemonDevice,
AdbPacketData,
AdbPacketInit,
} from "@yume-chan/adb";
} from "@gasol/adb";
import {
AdbPacketHeader,
AdbPacketSerializeStream,
unreachable,
} from "@yume-chan/adb";
} from "@gasol/adb";
import type {
Consumable,
ReadableWritablePair,
WritableStream,
} from "@yume-chan/stream-extra";
} from "@gasol/stream-extra";
import {
DuplexStreamFactory,
MaybeConsumable,
ReadableStream,
pipeFrom,
} from "@yume-chan/stream-extra";
import type { ExactReadable } from "@yume-chan/struct";
import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import type { ExactReadable } from "@gasol/struct";
import { EMPTY_UINT8_ARRAY } from "@gasol/struct";

import type { UsbInterfaceFilter } from "./utils.js";
import {
Expand Down Expand Up @@ -83,8 +83,7 @@ class Uint8ArrayExactReadable implements ExactReadable {
}

export class AdbDaemonWebUsbConnection
implements ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>>
{
implements ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>> {
#device: AdbDaemonWebUsbDevice;
get device() {
return this.#device;
Expand Down Expand Up @@ -221,7 +220,7 @@ export class AdbDaemonWebUsbConnection
// Add `payload` field to its type, it's assigned below.
const packet = AdbPacketHeader.deserialize(
stream,
) as AdbPacketHeader & { payload: Uint8Array };
) as AdbPacketHeader & { payload: Uint8Array; };

if (packet.magic !== (packet.command ^ 0xffffffff)) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion libraries/adb-daemon-webusb/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./node_modules/@yume-chan/tsconfig/tsconfig.base.json",
"extends": "./node_modules/@gasol/tsconfig/tsconfig.base.json",
"compilerOptions": {
"lib": [
"ESNext",
Expand Down
24 changes: 12 additions & 12 deletions libraries/adb-scrcpy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@yume-chan/adb-scrcpy",
"name": "@gasol/adb-scrcpy",
"version": "0.0.24",
"description": "Use `@yume-chan/adb` to bootstrap `@yume-chan/scrcpy`.",
"description": "Use `@gasol/adb` to bootstrap `@gasol/scrcpy`.",
"keywords": [
"adb",
"android-phone",
Expand All @@ -13,14 +13,14 @@
"email": "[email protected]",
"url": "https://chensi.moe/blog"
},
"homepage": "https://github.com/yume-chan/ya-webadb/tree/main/packages/adb-scrcpy#readme",
"homepage": "https://github.com/Gasol/ya-webadb/tree/main/packages/adb-scrcpy#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/yume-chan/ya-webadb.git",
"url": "git+https://github.com/Gasol/ya-webadb.git",
"directory": "packages/adb-scrcpy"
},
"bugs": {
"url": "https://github.com/yume-chan/ya-webadb/issues"
"url": "https://github.com/Gasol/ya-webadb/issues"
},
"type": "module",
"main": "esm/index.js",
Expand All @@ -32,16 +32,16 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@yume-chan/adb": "workspace:^0.0.24",
"@gasol/adb": "workspace:^0.0.24",
"@yume-chan/async": "^2.2.0",
"@yume-chan/event": "workspace:^0.0.24",
"@yume-chan/scrcpy": "workspace:^0.0.24",
"@yume-chan/stream-extra": "workspace:^0.0.24",
"@yume-chan/struct": "workspace:^0.0.24"
"@gasol/event": "workspace:^0.0.24",
"@gasol/scrcpy": "workspace:^0.0.24",
"@gasol/stream-extra": "workspace:^0.0.24",
"@gasol/struct": "workspace:^0.0.24"
},
"devDependencies": {
"@yume-chan/eslint-config": "workspace:^1.0.0",
"@yume-chan/tsconfig": "workspace:^1.0.0",
"@gasol/eslint-config": "workspace:^1.0.0",
"@gasol/tsconfig": "workspace:^1.0.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
}
Expand Down
Loading

0 comments on commit 6eb7e25

Please sign in to comment.