mirror of
https://github.com/LuanRT/googlevideo.git
synced 2026-06-13 00:32:11 +00:00
refactor!: drop cjs support
+ Publish to JSR (jsr.io)
This commit is contained in:
6
.github/workflows/release-please.yml
vendored
6
.github/workflows/release-please.yml
vendored
@@ -49,3 +49,9 @@ jobs:
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
|
||||
- name: Publish to JSR
|
||||
run: |
|
||||
npm run build --if-present
|
||||
npx jsr publish
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
21
jsr.json
Normal file
21
jsr.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@luanrt/googlevideo",
|
||||
"version": "1.1.0",
|
||||
"exports": "./src/index.ts",
|
||||
"imports": {
|
||||
"@bufbuild/protobuf": "npm:@bufbuild/protobuf@^2.0.0"
|
||||
},
|
||||
"publish": {
|
||||
"include": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"protos/generated/**/*.ts",
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"test",
|
||||
"scripts",
|
||||
"examples"
|
||||
]
|
||||
}
|
||||
}
|
||||
46
package.json
46
package.json
@@ -7,34 +7,35 @@
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"module": "./dist/src/index.js",
|
||||
"scripts": {
|
||||
"watch": "npx tsc --watch",
|
||||
"lint": "npx eslint ./src/**/*.ts",
|
||||
"lint:fix": "npx eslint --fix ./src/**/*.ts",
|
||||
"clean": "npx rimraf ./dist ./bundle ./protos/generated",
|
||||
"build": "npm run clean && npm run lint && npm run build:proto && npm run build:esm && npm run bundle:node",
|
||||
"clean": "npx rimraf ./dist ./protos/generated",
|
||||
"build": "npm run clean && npm run lint && npm run build:proto && npm run build:esm",
|
||||
"build:esm": "npx tsc",
|
||||
"build:proto": "node ./dev-scripts/generate-proto.mjs",
|
||||
"bundle:node": "npx esbuild ./dist/src/index.js --bundle --outfile=./bundle/index.cjs --platform=node --target=node16 --format=cjs --sourcemap --banner:js=\"/* eslint-disable */\"",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/LuanRT/GoogleVideo.git"
|
||||
},
|
||||
"author": "LuanRT <luan.lrt4@gmail.com> (https://github.com/LuanRT)",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/LuanRT"
|
||||
],
|
||||
"keywords": [
|
||||
"UMP",
|
||||
"SABR",
|
||||
"Google",
|
||||
"YouTube"
|
||||
],
|
||||
"author": "LuanRT <luan.lrt4@gmail.com> (https://github.com/LuanRT)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/LuanRT/GoogleVideo/issues"
|
||||
"exports": {
|
||||
".": {
|
||||
"node": {
|
||||
"import": "./dist/src/index.js"
|
||||
},
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"default": "./dist/src/index.js"
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/LuanRT/GoogleVideo#readme",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/LuanRT"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.9.0",
|
||||
"@stylistic/eslint-plugin": "^2.6.4",
|
||||
@@ -46,14 +47,15 @@
|
||||
"typescript": "^5.5.4",
|
||||
"typescript-eslint": "^8.2.0"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"import": "./dist/src/index.js",
|
||||
"require": "./bundle/index.cjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^2.0.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/LuanRT/GoogleVideo/issues"
|
||||
},
|
||||
"homepage": "https://github.com/LuanRT/GoogleVideo#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/LuanRT/GoogleVideo.git"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,6 @@ export class UMP {
|
||||
}
|
||||
|
||||
public canReadFromCurrentChunk(offset: number, length: number): boolean {
|
||||
this.chunkedDataBuffer.isFocused(offset);
|
||||
return offset - this.chunkedDataBuffer.currentChunkOffset + length <= this.chunkedDataBuffer.chunks[this.chunkedDataBuffer.currentChunkIndex].length;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export class CustomEvent extends Event {
|
||||
this.#detail = options?.detail ?? null;
|
||||
}
|
||||
|
||||
get detail() {
|
||||
get detail(): any[] | null {
|
||||
return this.#detail;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user