mirror of
https://github.com/yt-dlp/ejs.git
synced 2026-06-25 07:41:58 +00:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f8587bb70 | ||
|
|
54e5179b16 | ||
|
|
2597979114 | ||
|
|
44d6ff9c90 | ||
|
|
830f4ce421 | ||
|
|
d60b8244e7 | ||
|
|
64067b031b | ||
|
|
7c5c5e0dd1 | ||
|
|
2231f1fd6e | ||
|
|
aef78f70e7 | ||
|
|
4fb477f4af | ||
|
|
68448fa0ab | ||
|
|
cd4e87f52e | ||
|
|
41ff68e6f8 | ||
|
|
5bc9811c7a | ||
|
|
1b648c34c1 | ||
|
|
d13ca53401 | ||
|
|
a3095891a9 | ||
|
|
c51d14fa61 | ||
|
|
96c417f90a | ||
|
|
e91d03f58a | ||
|
|
32e63d577f | ||
|
|
83777e845d | ||
|
|
f4189efdc7 | ||
|
|
a0faf4144a | ||
|
|
06d71457ef | ||
|
|
3e76dde153 | ||
|
|
4f1d91dbb1 | ||
|
|
4b4ac2b896 | ||
|
|
2655b1f55f | ||
|
|
877164a326 | ||
|
|
25b77b7310 | ||
|
|
57fe708cf4 | ||
|
|
508dddae12 | ||
|
|
32e6af5fb2 | ||
|
|
e0560ee403 | ||
|
|
b57ce18965 | ||
|
|
52a4f9d19a | ||
|
|
5d7bf090bb | ||
|
|
6a73fa37ba | ||
|
|
bf12d399b2 | ||
|
|
c9bbdcb445 | ||
|
|
4d0d39eca4 | ||
|
|
398f81bbed |
642
.github/workflows/ci.yml
vendored
Normal file
642
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,642 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['main']
|
||||||
|
# This workflow contains required checks and needs to run for EVERY pull_request
|
||||||
|
pull_request:
|
||||||
|
branches: ['**']
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
ACTIONLINT_VERSION: "1.7.12"
|
||||||
|
ACTIONLINT_SHA256SUM: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
|
||||||
|
ACTIONLINT_REPO: rhysd/actionlint
|
||||||
|
GH_TELEMETRY: "false"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
actionlint:
|
||||||
|
name: Lint workflows
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install requirements
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
ACTIONLINT_TARBALL: ${{ format('actionlint_{0}_linux_amd64.tar.gz', env.ACTIONLINT_VERSION) }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt -y install shellcheck
|
||||||
|
gh release download \
|
||||||
|
--repo "${ACTIONLINT_REPO}" \
|
||||||
|
--pattern "${ACTIONLINT_TARBALL}" \
|
||||||
|
"v${ACTIONLINT_VERSION}"
|
||||||
|
gh attestation verify \
|
||||||
|
--repo "${ACTIONLINT_REPO}" \
|
||||||
|
"${ACTIONLINT_TARBALL}"
|
||||||
|
printf '%s %s' "${ACTIONLINT_SHA256SUM}" "${ACTIONLINT_TARBALL}" | sha256sum -c -
|
||||||
|
tar xvzf "${ACTIONLINT_TARBALL}" actionlint
|
||||||
|
sudo install -D --mode=755 actionlint /usr/bin/
|
||||||
|
|
||||||
|
- name: Run actionlint
|
||||||
|
run: |
|
||||||
|
actionlint -color
|
||||||
|
|
||||||
|
zizmor:
|
||||||
|
name: Audit workflows
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: read # Needed by zizmorcore/zizmor-action if repository is private
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Run zizmor
|
||||||
|
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
|
||||||
|
with:
|
||||||
|
advanced-security: false
|
||||||
|
persona: pedantic
|
||||||
|
|
||||||
|
py_format:
|
||||||
|
name: Python format check
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
|
||||||
|
with:
|
||||||
|
args: "check --output-format github"
|
||||||
|
|
||||||
|
py_lint:
|
||||||
|
name: Python lint check
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
|
||||||
|
with:
|
||||||
|
args: "format --check --diff"
|
||||||
|
|
||||||
|
js_format:
|
||||||
|
name: JavaScript format check
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno v2.x (latest)
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
deno-version: v2.x
|
||||||
|
|
||||||
|
- name: Install Deno requirements
|
||||||
|
run: |
|
||||||
|
deno install --frozen
|
||||||
|
|
||||||
|
- name: Run format check
|
||||||
|
run: |
|
||||||
|
deno task fmt:check
|
||||||
|
|
||||||
|
js_lint:
|
||||||
|
name: JavaScript lint check
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno v2.x (latest)
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
deno-version: v2.x
|
||||||
|
|
||||||
|
- name: Install Deno requirements
|
||||||
|
run: |
|
||||||
|
deno install --frozen
|
||||||
|
|
||||||
|
- name: Run lint check
|
||||||
|
run: |
|
||||||
|
deno task lint
|
||||||
|
|
||||||
|
python_tests:
|
||||||
|
name: Python tests
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
runner: [ubuntu-latest, windows-latest]
|
||||||
|
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15', pypy-3.11]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
# required for hatch-vcs versioning
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno v2.x (latest)
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
deno-version: v2.x
|
||||||
|
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
allow-prereleases: true
|
||||||
|
|
||||||
|
- name: Build project
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# `pip install -e` omits the force-included JS, so use `build` instead
|
||||||
|
python -m pip install -U build
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Unpack wheel (Linux)
|
||||||
|
if: matrix.runner == 'ubuntu-latest'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
unzip -u dist/yt_dlp_ejs-*.whl "yt_dlp_ejs/*"
|
||||||
|
|
||||||
|
- name: Unpack wheel (Windows)
|
||||||
|
if: matrix.runner == 'windows-latest'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$PSNativeCommandUseErrorActionPreference = $true
|
||||||
|
Expand-Archive -Path dist/yt_dlp_ejs-*.whl -DestinationPath ./ -Force
|
||||||
|
|
||||||
|
- name: Run Python tests
|
||||||
|
timeout-minutes: 5
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -Werror -m unittest
|
||||||
|
|
||||||
|
prepare:
|
||||||
|
name: Prepare JS runtime tests
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno v2.x (latest)
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
deno-version: v2.x
|
||||||
|
|
||||||
|
- name: Install Deno requirements
|
||||||
|
run: |
|
||||||
|
deno install --frozen
|
||||||
|
|
||||||
|
- name: Build control bundle
|
||||||
|
run: |
|
||||||
|
deno task bundle
|
||||||
|
|
||||||
|
- name: Generate bundle hashes
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pushd dist
|
||||||
|
sha256sum -- yt.solver.*.js | tee SHA2-256SUMS
|
||||||
|
popd
|
||||||
|
|
||||||
|
- name: Upload bundle hashes
|
||||||
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
|
with:
|
||||||
|
name: bundle-hashes
|
||||||
|
path: |
|
||||||
|
dist/SHA2-256SUMS
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
|
- name: Cache player JS files
|
||||||
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||||
|
env:
|
||||||
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
src/yt/solver/test/players
|
||||||
|
key: test-player-js-${{ hashFiles('src/yt/solver/test/tests.ts') }}
|
||||||
|
|
||||||
|
- name: Download player JS files
|
||||||
|
timeout-minutes: 15
|
||||||
|
run: |
|
||||||
|
deno run \
|
||||||
|
--no-prompt \
|
||||||
|
--allow-read=src/yt/solver/test/players/ \
|
||||||
|
--allow-write=src/yt/solver/test/players/ \
|
||||||
|
--allow-net=www.youtube.com \
|
||||||
|
--allow-sys=uid \
|
||||||
|
src/yt/solver/test/download.ts
|
||||||
|
|
||||||
|
- name: Upload player JS artifact
|
||||||
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
|
with:
|
||||||
|
name: player-js
|
||||||
|
path: |
|
||||||
|
src/yt/solver/test/players/*
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
|
pnpm_build:
|
||||||
|
name: Test pnpm build
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
# required for hatch-vcs versioning
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
version: "10.16.0"
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install Python requirements
|
||||||
|
run: |
|
||||||
|
python -m pip install -U build
|
||||||
|
|
||||||
|
- name: Test pnpm build
|
||||||
|
run: |
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Verify artifact contents
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -tvzf dist/yt_dlp_ejs-*.tar.gz
|
||||||
|
unzip -l dist/yt_dlp_ejs-*.whl | tee .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/core\.min\.js' .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/lib\.min\.js' .wheel_contents
|
||||||
|
|
||||||
|
- name: Install pnpm requirements
|
||||||
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Bundle with pnpm
|
||||||
|
run: |
|
||||||
|
pnpm run bundle
|
||||||
|
|
||||||
|
- name: Download bundle hashes
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
name: bundle-hashes
|
||||||
|
|
||||||
|
- name: Verify bundle hashes
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -c SHA2-256SUMS
|
||||||
|
|
||||||
|
deno_lock_check:
|
||||||
|
name: Test Deno lockfile
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Verify lockfile
|
||||||
|
run: |
|
||||||
|
python ./check.py
|
||||||
|
|
||||||
|
deno_build:
|
||||||
|
name: Test Deno build
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
# required for hatch-vcs versioning
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
deno-version: "2.3.0"
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install Python requirements
|
||||||
|
run: |
|
||||||
|
python -m pip install -U build
|
||||||
|
|
||||||
|
- name: Test Deno build
|
||||||
|
run: |
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Verify artifact contents
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -tvzf dist/yt_dlp_ejs-*.tar.gz
|
||||||
|
unzip -l dist/yt_dlp_ejs-*.whl | tee .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/core\.min\.js' .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/lib\.min\.js' .wheel_contents
|
||||||
|
|
||||||
|
- name: Install Deno requirements
|
||||||
|
run: |
|
||||||
|
deno install --frozen
|
||||||
|
|
||||||
|
- name: Bundle with Deno
|
||||||
|
run: |
|
||||||
|
deno task bundle
|
||||||
|
|
||||||
|
- name: Download bundle hashes
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
name: bundle-hashes
|
||||||
|
|
||||||
|
- name: Verify bundle hashes
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -c SHA2-256SUMS
|
||||||
|
|
||||||
|
deno_tests:
|
||||||
|
name: Run Deno tests
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Deno
|
||||||
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
deno-version: "2.3.0"
|
||||||
|
|
||||||
|
- name: Install Deno requirements
|
||||||
|
run: |
|
||||||
|
deno install --frozen
|
||||||
|
|
||||||
|
- name: Download player JS artifact
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: src/yt/solver/test/players
|
||||||
|
name: player-js
|
||||||
|
|
||||||
|
- name: Run Deno tests
|
||||||
|
run: |
|
||||||
|
xargs -n 1 -P 10 deno test \
|
||||||
|
--no-prompt \
|
||||||
|
--no-check \
|
||||||
|
--allow-read=src/yt/solver/test/players/ \
|
||||||
|
--filter <<<"$(printf -- '-%s-\n' main tcc tce es5 es6 tv tv_es6 phone es6_tcc es6_tce)"
|
||||||
|
|
||||||
|
bun_build:
|
||||||
|
name: Test Bun build
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
# required for hatch-vcs versioning
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Bun
|
||||||
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
bun-version: "1.2.11"
|
||||||
|
no-cache: true
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install Python requirements
|
||||||
|
run: |
|
||||||
|
python -m pip install -U build
|
||||||
|
|
||||||
|
- name: Test Bun build
|
||||||
|
run: |
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Verify artifact contents
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -tvzf dist/yt_dlp_ejs-*.tar.gz
|
||||||
|
unzip -l dist/yt_dlp_ejs-*.whl | tee .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/core\.min\.js' .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/lib\.min\.js' .wheel_contents
|
||||||
|
|
||||||
|
- name: Install Bun requirements
|
||||||
|
run: |
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Bundle with Bun
|
||||||
|
run: |
|
||||||
|
bun --bun run bundle
|
||||||
|
|
||||||
|
- name: Download bundle hashes
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
name: bundle-hashes
|
||||||
|
|
||||||
|
- name: Verify bundle hashes
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -c SHA2-256SUMS
|
||||||
|
|
||||||
|
bun_tests:
|
||||||
|
name: Run Bun tests
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Bun
|
||||||
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
bun-version: "1.2.11"
|
||||||
|
no-cache: true
|
||||||
|
|
||||||
|
- name: Install Bun requirements
|
||||||
|
run: |
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Download player JS artifact
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: src/yt/solver/test/players
|
||||||
|
name: player-js
|
||||||
|
|
||||||
|
- name: Run Bun tests
|
||||||
|
run: |
|
||||||
|
bun test
|
||||||
|
|
||||||
|
node_build:
|
||||||
|
name: Test Node build
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
# required for hatch-vcs versioning
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Node
|
||||||
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
node-version: "22.0.0"
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Install Python requirements
|
||||||
|
run: |
|
||||||
|
python -m pip install -U build
|
||||||
|
|
||||||
|
- name: Test Node build
|
||||||
|
run: |
|
||||||
|
python -m build
|
||||||
|
|
||||||
|
- name: Verify artifact contents
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -tvzf dist/yt_dlp_ejs-*.tar.gz
|
||||||
|
unzip -l dist/yt_dlp_ejs-*.whl | tee .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/core\.min\.js' .wheel_contents
|
||||||
|
grep -q 'yt_dlp_ejs/yt/solver/lib\.min\.js' .wheel_contents
|
||||||
|
|
||||||
|
- name: Install Node requirements
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Bundle with Node
|
||||||
|
run: |
|
||||||
|
npm run bundle
|
||||||
|
|
||||||
|
- name: Download bundle hashes
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
name: bundle-hashes
|
||||||
|
|
||||||
|
- name: Verify bundle hashes
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -c SHA2-256SUMS
|
||||||
|
|
||||||
|
node_tests:
|
||||||
|
name: Run Node tests
|
||||||
|
needs: [prepare]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install Node
|
||||||
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
|
with:
|
||||||
|
# minimum supported version
|
||||||
|
node-version: "22.0.0"
|
||||||
|
|
||||||
|
- name: Install Node requirements
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Download player JS artifact
|
||||||
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
|
with:
|
||||||
|
path: src/yt/solver/test/players
|
||||||
|
name: player-js
|
||||||
|
|
||||||
|
- name: Run Node tests
|
||||||
|
run: |
|
||||||
|
node --test
|
||||||
|
|
||||||
|
all_passed:
|
||||||
|
# Required check; do not change name
|
||||||
|
name: all_passed
|
||||||
|
needs:
|
||||||
|
- actionlint
|
||||||
|
- zizmor
|
||||||
|
- py_format
|
||||||
|
- py_lint
|
||||||
|
- js_format
|
||||||
|
- js_lint
|
||||||
|
- python_tests
|
||||||
|
- pnpm_build
|
||||||
|
- deno_lock_check
|
||||||
|
- deno_build
|
||||||
|
- deno_tests
|
||||||
|
- bun_build
|
||||||
|
- bun_tests
|
||||||
|
- node_build
|
||||||
|
- node_tests
|
||||||
|
runs-on: ubuntu-slim
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
true
|
||||||
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
@@ -4,43 +4,56 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
permissions:
|
permissions: {}
|
||||||
contents: read
|
|
||||||
|
env:
|
||||||
|
GH_TELEMETRY: "false"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build artifacts
|
name: Build artifacts
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # Needed for hatch-vcs versioning
|
||||||
- uses: denoland/setup-deno@v2
|
persist-credentials: false
|
||||||
|
|
||||||
|
- uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
||||||
with:
|
with:
|
||||||
deno-version: v2.x
|
deno-version: 3fbb1daddbc9333cddf0d8c0735811717dd70f7a # v2.6.3
|
||||||
- uses: actions/setup-python@v6
|
cache: false
|
||||||
|
|
||||||
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.14"
|
||||||
|
|
||||||
- name: Install Python requirements
|
- name: Install Python requirements
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U build
|
python -m pip install -U build
|
||||||
|
|
||||||
- name: Build Python artifacts
|
- name: Build Python artifacts
|
||||||
run: |
|
run: |
|
||||||
python -m build
|
python -m build
|
||||||
|
|
||||||
- name: Upload Python artifacts
|
- name: Upload Python artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: artifacts-py
|
name: artifacts-py
|
||||||
path: |
|
path: |
|
||||||
dist/yt_dlp_ejs-*.whl
|
dist/yt_dlp_ejs-*.whl
|
||||||
dist/yt_dlp_ejs-*.tar.gz
|
dist/yt_dlp_ejs-*.tar.gz
|
||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
|
||||||
- name: Build JavaScript artifacts
|
- name: Build JavaScript artifacts
|
||||||
run: |
|
run: |
|
||||||
deno install
|
deno install --frozen
|
||||||
deno task bundle
|
deno task bundle
|
||||||
|
|
||||||
- name: Upload JavaScript artifacts
|
- name: Upload JavaScript artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: artifacts-js
|
name: artifacts-js
|
||||||
path: |
|
path: |
|
||||||
@@ -51,17 +64,17 @@ jobs:
|
|||||||
name: Publish to PyPI
|
name: Publish to PyPI
|
||||||
needs: [build]
|
needs: [build]
|
||||||
if: github.repository == 'yt-dlp/ejs'
|
if: github.repository == 'yt-dlp/ejs'
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
id-token: write # Needed for PyPI trusted publishing
|
||||||
id-token: write # required for PyPI trusted publishing
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
with:
|
with:
|
||||||
path: dist
|
path: dist
|
||||||
name: artifacts-py
|
name: artifacts-py
|
||||||
|
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
||||||
with:
|
with:
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
@@ -69,18 +82,20 @@ jobs:
|
|||||||
name: Create GitHub release
|
name: Create GitHub release
|
||||||
needs: [build, publish_pypi]
|
needs: [build, publish_pypi]
|
||||||
if: always() && !failure() && !cancelled()
|
if: always() && !failure() && !cancelled()
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write # Needed by gh to publish release to Github
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
persist-credentials: false
|
||||||
- uses: actions/download-artifact@v5
|
|
||||||
|
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
with:
|
with:
|
||||||
path: dist
|
path: dist
|
||||||
pattern: artifacts-*
|
pattern: artifacts-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
env:
|
env:
|
||||||
TAG: ${{ github.ref_name }}
|
TAG: ${{ github.ref_name }}
|
||||||
@@ -88,7 +103,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
gh release create "${TAG}" \
|
gh release create "${TAG}" \
|
||||||
--title "yt-dlp-ejs ${TAG}" \
|
--title "yt-dlp-ejs ${TAG}" \
|
||||||
--notes-from-tag \
|
--generate-notes \
|
||||||
--verify-tag \
|
--verify-tag \
|
||||||
dist/yt.solver.*.js \
|
dist/yt.solver.*.js \
|
||||||
dist/yt_dlp_ejs-*.whl \
|
dist/yt_dlp_ejs-*.whl \
|
||||||
|
|||||||
8
.github/zizmor.yml
vendored
Normal file
8
.github/zizmor.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
rules:
|
||||||
|
concurrency-limits:
|
||||||
|
ignore:
|
||||||
|
- release.yml # Can only be triggered by a tag pushed by a maintainer
|
||||||
|
unpinned-uses:
|
||||||
|
config:
|
||||||
|
policies:
|
||||||
|
"*": hash-pin
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,7 +2,5 @@
|
|||||||
*.py[cd]
|
*.py[cd]
|
||||||
/yt_dlp_ejs/_version.py
|
/yt_dlp_ejs/_version.py
|
||||||
/node_modules
|
/node_modules
|
||||||
/bun.lock
|
|
||||||
/deno.lock
|
|
||||||
/package-lock.json
|
|
||||||
/.idea
|
/.idea
|
||||||
|
/.venv
|
||||||
|
|||||||
6
.oxfmtrc.json
Normal file
6
.oxfmtrc.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||||
|
"printWidth": 80,
|
||||||
|
"sortImports": true,
|
||||||
|
"ignorePatterns": ["**/*.toml", ".github/**"]
|
||||||
|
}
|
||||||
133
README.md
133
README.md
@@ -1,43 +1,142 @@
|
|||||||
# yt-dlp-ejs
|
# yt-dlp-ejs
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> This is currently in development
|
|
||||||
|
|
||||||
External JavaScript for yt-dlp supporting many runtimes
|
External JavaScript for yt-dlp supporting many runtimes
|
||||||
|
|
||||||
## Manual Installation
|
## Manual Installation
|
||||||
|
|
||||||
In the yt-dlp repository, install the python package, either directly or from url:
|
Install ejs into the same environment as yt-dlp:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
pip install git+https://github.com/yt-dlp/ejs@main
|
pip install -U yt-dlp-ejs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Runtime requirements
|
||||||
|
|
||||||
|
This project supports the following runtimes/engines:
|
||||||
|
|
||||||
|
| Runtime / engine | Required version |
|
||||||
|
| ------------------ | -------------------- |
|
||||||
|
| deno | `>=2.3` |
|
||||||
|
| node | `>=22` |
|
||||||
|
| quickjs | `>=2023-12-9` |
|
||||||
|
| quickjs-ng | any |
|
||||||
|
| bun _(deprecated)_ | `>=1.2.11, <=1.3.14` |
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
While this project does pin its dependencies,
|
The project provides lockfiles for every supported package manager.
|
||||||
it does not use lockfiles or enforce a particular package manager.
|
|
||||||
You may install dependencies using any compatible package manager.
|
If you only have Python and a JS runtime, then you may instead run `./hatch_build.py`.
|
||||||
If you notice differences between different runtimes builds
|
This will transparently invoke one of the supported JS runtimes for the build.
|
||||||
please open an issue [here](<https://github.com/yt-dlp/ejs/issues/new>).
|
|
||||||
|
If you notice differences between different runtimes' builds
|
||||||
|
please open an issue [here](https://github.com/yt-dlp/ejs/issues/new).
|
||||||
|
|
||||||
|
### Development requirements
|
||||||
|
|
||||||
|
Developers should have the following tools installed:
|
||||||
|
|
||||||
|
| Runtime / package manager | Required version |
|
||||||
|
| ------------------------- | --------------------------------- |
|
||||||
|
| deno | `>=2.6` |
|
||||||
|
| node | `^24.14.1 \|\| ^25.7.0 \|\| >=26` |
|
||||||
|
| npm | `>=11.10` |
|
||||||
|
| bun | `>=1.2.11, <=1.3.14` |
|
||||||
|
| pnpm | `>=10.16.0` |
|
||||||
|
| quickjs _(optional)_ | `>=2025-4-26` |
|
||||||
|
| quickjs-ng _(optional)_ | `>=0.12.0` |
|
||||||
|
|
||||||
|
quickjs/quickjs-ng is only needed for yt-dlp integration tests,
|
||||||
|
which can usually be handled by CI.
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
To build the Python package you need a PEP518 compatible builder.
|
To build the Python package you need a PEP518 compatible builder.
|
||||||
The build hook will automatically invoke `deno`, `bun` or `node` as required.
|
The build hook will automatically invoke `deno`, `bun` or `node` as required.
|
||||||
|
|
||||||
Alternatively, to only build the JavaScript files you can run the `bundle` script manually.
|
Alternatively, to only build the JavaScript files you can run the `bundle` script manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python hatch_build.py
|
||||||
|
```
|
||||||
|
|
||||||
|
This will automatically select an available runtime and build using it.
|
||||||
|
|
||||||
|
For more fine-grained control over how to build the package, you can set these environment variables:
|
||||||
|
|
||||||
|
- `EJS_BUILD_SKIP_INSTALL`: If this environment variable is set, the install step will be skipped.
|
||||||
|
It is expected that the required packages are available for the selected bundler.
|
||||||
|
No network access should be required if this variable is set.
|
||||||
|
- `EJS_BUILD_INSTALLER`: Order of installers to try, separated by `:` on POSIX or `;` on Windows.
|
||||||
|
These will be used to install the required dependencies for bundling the JavaScript package.
|
||||||
|
Can be any of `pnpm`, `deno`, `bun` or `npm` (this is also the default order).
|
||||||
|
- `EJS_BUILD_BUNDLER`: Order of bundlers to try, separated by `:` on POSIX or `;` on Windows.
|
||||||
|
These will be used to perform the bundling of the JavaScript package (calling rollup under the hood).
|
||||||
|
Can be any of `esbuild`, `pnpm`, `deno`, `bun`, `node` (this is also the default order).
|
||||||
|
|
||||||
### Tests
|
### Tests
|
||||||
|
|
||||||
First, to download the player files, run `src/yt/solver/test/download.ts`.
|
First, make sure the project's dependencies are installed and download the player JS files:
|
||||||
|
|
||||||
After running that once, use any of `deno test`, `bun test` or `node --test`.
|
```bash
|
||||||
|
# Deno:
|
||||||
|
deno install --frozen
|
||||||
|
deno run src/yt/solver/test/download.ts
|
||||||
|
|
||||||
|
# Bun:
|
||||||
|
bun install --frozen-lockfile
|
||||||
|
bun --bun run src/yt/solver/test/download.ts
|
||||||
|
|
||||||
|
# Node 22.6+:
|
||||||
|
npm ci
|
||||||
|
node --experimental-strip-types src/yt/solver/test/download.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
Then the tests can be run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Deno
|
||||||
|
deno test
|
||||||
|
|
||||||
|
# Bun
|
||||||
|
bun test
|
||||||
|
|
||||||
|
# Node
|
||||||
|
node --test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading packages
|
||||||
|
|
||||||
|
When upgrading packages in package.json, all lockfiles must be updated simultaneously.
|
||||||
|
To do this, run the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Upgrade all packages automatically
|
||||||
|
pnpm upgrade --latest
|
||||||
|
# or upgrade only development dependencies
|
||||||
|
pnpm upgrade --latest --dev
|
||||||
|
# or upgrade a specific package, e.g. meriyah
|
||||||
|
pnpm upgrade --latest meriyah
|
||||||
|
|
||||||
|
# 2. Generate base `package-lock.json` with npm
|
||||||
|
rm -rf node_modules package-lock.json
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# 3. Migrate to other package managers
|
||||||
|
pnpm import
|
||||||
|
bun pm migrate --force
|
||||||
|
|
||||||
|
# 4. Generate a separate `deno.lock`
|
||||||
|
deno install --lockfile-only
|
||||||
|
|
||||||
|
# 5. Ensure that `deno.lock` is equivalent to `package-lock.json`
|
||||||
|
python check.py
|
||||||
|
```
|
||||||
|
|
||||||
## Licensing
|
## Licensing
|
||||||
|
|
||||||
This code is licensed under [Unlicense](<https://unlicense.org/>).
|
This code is licensed under [Unlicense](https://unlicense.org/).
|
||||||
|
|
||||||
An exception to this are the prebuilt wheels, which contain both
|
An exception to this is the prebuilt wheels, which contain both
|
||||||
[`meriyah`](<https://github.com/meriyah/meriyah>) and [`astring`](<https://github.com/davidbonnet/astring>),
|
[`meriyah`](https://github.com/meriyah/meriyah) and [`astring`](https://github.com/davidbonnet/astring),
|
||||||
licensed under [`ISC`](<https://github.com/meriyah/meriyah?tab=ISC-1-ov-file>) and [`MIT`](<https://github.com/davidbonnet/astring?tab=MIT-1-ov-file>), respectively.
|
licensed under [`ISC`](https://github.com/meriyah/meriyah?tab=ISC-1-ov-file) and [`MIT`](https://github.com/davidbonnet/astring?tab=MIT-1-ov-file), respectively.
|
||||||
|
|||||||
32
build.mjs
Normal file
32
build.mjs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import * as esbuild from "esbuild";
|
||||||
|
|
||||||
|
const buildConfig = await stdinJSON();
|
||||||
|
const result = await esbuild.build(buildConfig);
|
||||||
|
console.log(JSON.stringify(result.metafile ?? null));
|
||||||
|
await esbuild.stop();
|
||||||
|
|
||||||
|
async function stdinJSON() {
|
||||||
|
const chunks = [];
|
||||||
|
if (globalThis.Deno) {
|
||||||
|
for await (const chunk of globalThis.Deno.stdin.readable) {
|
||||||
|
chunks.push(chunk);
|
||||||
|
}
|
||||||
|
const length = chunks.reduce(
|
||||||
|
(previous, chunk) => previous + chunk.length,
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
const buffer = new Uint8Array(length);
|
||||||
|
let offset = 0;
|
||||||
|
for (const chunk of chunks) {
|
||||||
|
buffer.set(chunk, offset);
|
||||||
|
offset += chunk.length;
|
||||||
|
}
|
||||||
|
return JSON.parse(new TextDecoder().decode(buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
for await (const chunk of process.stdin) {
|
||||||
|
chunks.push(chunk);
|
||||||
|
}
|
||||||
|
const text = Buffer.concat(chunks).toString("utf-8");
|
||||||
|
return JSON.parse(text);
|
||||||
|
}
|
||||||
175
bun.lock
Normal file
175
bun.lock
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"configVersion": 1,
|
||||||
|
"workspaces": {
|
||||||
|
"": {
|
||||||
|
"name": "ejs",
|
||||||
|
"dependencies": {
|
||||||
|
"astring": "1.9.0",
|
||||||
|
"meriyah": "6.1.4",
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bun": "1.3.14",
|
||||||
|
"@types/deno": "2.7.0",
|
||||||
|
"@types/node": "25.9.3",
|
||||||
|
"esbuild": "0.28.1",
|
||||||
|
"globals": "17.6.0",
|
||||||
|
"oxfmt": "^0.54.0",
|
||||||
|
"oxlint": "^1.69.0",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.1", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ=="],
|
||||||
|
|
||||||
|
"@esbuild/android-arm": ["@esbuild/android-arm@0.28.1", "", { "os": "android", "cpu": "arm" }, "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ=="],
|
||||||
|
|
||||||
|
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.1", "", { "os": "android", "cpu": "arm64" }, "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg=="],
|
||||||
|
|
||||||
|
"@esbuild/android-x64": ["@esbuild/android-x64@0.28.1", "", { "os": "android", "cpu": "x64" }, "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng=="],
|
||||||
|
|
||||||
|
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q=="],
|
||||||
|
|
||||||
|
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ=="],
|
||||||
|
|
||||||
|
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.1", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw=="],
|
||||||
|
|
||||||
|
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.1", "", { "os": "linux", "cpu": "arm" }, "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.1", "", { "os": "linux", "cpu": "ia32" }, "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag=="],
|
||||||
|
|
||||||
|
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.1", "", { "os": "linux", "cpu": "x64" }, "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA=="],
|
||||||
|
|
||||||
|
"@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw=="],
|
||||||
|
|
||||||
|
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.1", "", { "os": "none", "cpu": "x64" }, "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg=="],
|
||||||
|
|
||||||
|
"@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.1", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q=="],
|
||||||
|
|
||||||
|
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.1", "", { "os": "openbsd", "cpu": "x64" }, "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw=="],
|
||||||
|
|
||||||
|
"@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg=="],
|
||||||
|
|
||||||
|
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.1", "", { "os": "sunos", "cpu": "x64" }, "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg=="],
|
||||||
|
|
||||||
|
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.54.0", "", { "os": "android", "cpu": "arm" }, "sha512-NAtpl/SiaeU103e7/OmZw0MvUnsUUopW7hEm/ecegJg7YM0skQaA0IXEZoyTV6NUdiNPupdIUreRqUZTShbn/g=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.54.0", "", { "os": "android", "cpu": "arm64" }, "sha512-B4VZfBUlKK1rmMChsssNZbkZjE8+FzG3avMjGgMDwbGxXRoXkoeXiAZ+78Oa+eyDPHvDCiUb4zH/vmCOUSafLQ=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.54.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-i02vF75b+ePsQP3tHqSxVYI5S6b8X/xqdPu7/mDHXtpgXLTYXi3jJmfHU0j+dnZZDKaYTx/ioCK7QYJmtiJR2g=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.54.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-8VMFvGvooXj7mswkbrhdVZ2/sgiDaBzWpkkbtO+qGDLV4EfJd67nQadHkQC0ZNbaWA9ajXfqI6i7PZLIeDzxEQ=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.54.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-0cRHnp43WN1Jrc5s0BdbdKgR1XirdvHy7TAFi3JEsoEVQVJxTXMbpVd76sxXlgRswNMDhVFSJw+y7Eb8mEavFQ=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.54.0", "", { "os": "linux", "cpu": "arm" }, "sha512-JyQAk3hK/OEtup7Rw6kZwfdzbKqTVD5jXXb8Xpfay29suwZyfBDMVW/bj4RqEPySYWc6zCp198pOluf8n5uYzg=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.54.0", "", { "os": "linux", "cpu": "arm" }, "sha512-qnvLatTpM8vtvjOfcckBOzJjk+n6ce/wwpP8OFeUrD5aNLYcKyWAitwj+Rk3PK9jGanbZvKsJnv14JGQ6XqFdw=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.54.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-SMkhnCzIYZYDk9vw3W/80eeYKmrMpGF0Giuxt4HruFlCH7jEtnPeb3SdQKMfgYi/dgtaf+hZAb5XWPYnxqCQ3w=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.54.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-QrwJlBFFKnxOd95TAaszpMbZBLzMoYMpGaQTZF8oibacnF5rv8l12IhILhQRPmksWiBqg0YSe2Mnl7ayeJAHSA=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.54.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WILatiol/TUHTlhod7R09+7Az/XlhKwmY1MHfLZNmewltPWNN/EwxP2rQSHahibZ/cB8gmckEBjBOByD+5bYsQ=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.54.0", "", { "os": "linux", "cpu": "none" }, "sha512-f05YMG4BH4G8S4ME6UM6fi1MnJ9094mrnvO5Pa4SJlMfWlUM+1/ZWMEF4NnjM7shZAvbHsHRuVYpUo0PHC4P9Q=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.54.0", "", { "os": "linux", "cpu": "none" }, "sha512-UfL+2hj1ClNqcCRT9s8vBU4axDpjxgVxX96G+9DYAYjoc5b0u15CJtn2jgsi9iM+EbGNc5CW1HVRgwVu76UsSA=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.54.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-3/XZe931Hka+J6NjnaqJzYpsWWxDTuRdUdwSQHnOuJEgbC+SehIMFJS8hsEjV7LBhVSL2OCnRLvbVW8O97XIyw=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.54.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Ik93RlObtu43GbxApafayFjwYE06L6Xr08cSwpBPYbDrLp2ReZx0Jm1DqwRyYRnukUJy+rK2WaEvUQOxdytU9Q=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.54.0", "", { "os": "linux", "cpu": "x64" }, "sha512-yZcakmPlD86CNymknd7KfW+FH+qfbqJH+i0h69CYfV1+KMoVeM9UED+8+TDVoU4haxI0NxY7RPCvRLy3Sqd2Qg=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.54.0", "", { "os": "none", "cpu": "arm64" }, "sha512-GiVBZNnEZnKu00f1jTg49nomv187d0GQX+O+ocykoLeiaALuEO+swoTehHn9TehTfi7V8H0i0e/yvUjCqnwk1w=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.54.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-J0SSB8Z1Fre2sxRolYcW6Rl1RQmKdQ2hnHyq4YJrfBRiXTObLw4DXnIVraM/UyqGqwOi7yTrQA4VT7DPxlHVKA=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.54.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-O61UDVj8zz6yXJjkHPf05VaMLOXmEF8P5kf/N0W7AQMmd6bcQogl+KJc7rMutKTL524oE9iH32JXZClBFmEQIg=="],
|
||||||
|
|
||||||
|
"@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.54.0", "", { "os": "win32", "cpu": "x64" }, "sha512-1MDpqJPiFqxWtIHas8vkb1VZ7f7eKyTffAwmO8isxQYMaG1OFKsH666BWLeXQLO+IWNfiMssLD55hbR1lIPTqg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.69.0", "", { "os": "android", "cpu": "arm" }, "sha512-DKQQbD5cZ/MYfDgDI7YGyGD9FSxABlsBsYFo5p26lloob543tP9+4N3guwdXIYJN+7HSZxLe8YJuwcOWw5qnHg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.69.0", "", { "os": "android", "cpu": "arm64" }, "sha512-lEhb+I5pr4inux+JFwfCa1HRq3Os7NirEFQ0H1I35SVEHPm6byX0Ah47xmRha3qi6LAkxUcxViL8o/9PivjzBg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.69.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-GY2YE8lOZW59BW1Ia1y+1gR0XyjrZRvVWHAr8LGeGhYHE0OQJ/7cRKXTkx1P+E9/6awEc3SX8a68SFTjh/E//A=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.69.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ax1oZnOjHX3LB7myQyHEaQkDwfLb6str3/nSP6O7EVUviQGNkEGzGV0EqcBJWK+Ufwx0l4xPgyYayurvhAdl2Q=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.69.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-kHWeHv4g2h8NY+mpCxzCtY4uerMJWTN/TSnNj1CPbakFpHEJ6cTya2wWV0pDSYWOJ2+0UiEbhn3AtXxHtsnKjg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.69.0", "", { "os": "linux", "cpu": "arm" }, "sha512-gq84vM1a1oEehXo27YCDzGVcxPsZDI1yswZwz2Da1/cbnWtrL16XZZnz0G/+gIU8edtHpfjxq5c+vWEHqJfWoQ=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.69.0", "", { "os": "linux", "cpu": "arm" }, "sha512-kIqEa98JQ0VRyrcncxA417m2AzasqTlD+FyVT1AksjvjkqQcvm7pBWYvoW3/mpyOP2XYvi5nSCCTIe6De1yu5g=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.69.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-j+xYiXozxGWx2cpjCrwwGR4awTxPFsRv3JZrv23RCogEPMc4R7UqjHW47p/RG0aRlbWiROCJ8coUfCwy0dvzHA=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.69.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-xEPpNppTfN1l/nM7gYSf9iocscu/as+p/7vxkLeLEKnYU+09Dm+5V6IhDYDh+Uz6FajEupWwCLt5SOG0y1PCKg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.69.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-Ug0+eU7HJBlek+SjklYH62IlOMirEJsdxpihH0kSqX0XdrDD4NdHpQc10fK1JC35yn6KrrcN+uYzlHD38XAf8Q=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.69.0", "", { "os": "linux", "cpu": "none" }, "sha512-iEyI3GIg0l/s3G4qy2TlaaWKdzj4PJJStwtlocpDTC00PY9hZueotf6OKUj9+yfQh0lrpBW/pLMgTztbAHKJEg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.69.0", "", { "os": "linux", "cpu": "none" }, "sha512-NjHjpiI4WIKSMwuoJSZi5VToPeoYOS1FR52HLIDG6lidMdqquusgtODb4iLk0+lb1q3Z0nv2/aPRcC/olmpQGg=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.69.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-Ai/prDewoItkDXbp38gwGZi41DycZbUTZJ3UidwoHgQC0/DaqC2TGdtBTQLJ6hSD+SAxASzh8+/eSBPmxfOacA=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.69.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Gt3KHgp46mRKz4sJeaASmKvD8ayXookRw07RMf+NowhEztGGDZ7VrXpoW96XuKJLjFukWizOFVNjmYb/u7caNQ=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.69.0", "", { "os": "linux", "cpu": "x64" }, "sha512-7tQhJ2+p/oHv1zcfnjYI7YVzC/7iBaVOfIvFYtxdJ5F45mWgEdrCyXZXZGfiLey5t/5JhOhsaMnnv1kAzckd7g=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.69.0", "", { "os": "none", "cpu": "arm64" }, "sha512-vmWz6TKp/3hfA4lksR0zHBv/6xuX1jhym6eqOjdH2DXsDDHZWcp2f0KG0VCAnlVbIrjk29G4wAWMXb/Hn1YobA=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.69.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-9RExaLgmaw6IoIkU9cTpT71mLfI0xZ86iZH8x518LVsOkjquJMYqb9P7KpC8lgd1t0Dxs41p2pxynq4XR3Ttzw=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.69.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-1907kRPF8/PrcIw1E7LMs9JbVrpgnt/MvFdss3an8oDkYNAACXzTntV3t3869ZZhMZxb2AzRGbz1pA/jdFatXA=="],
|
||||||
|
|
||||||
|
"@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.69.0", "", { "os": "win32", "cpu": "x64" }, "sha512-w8SOXv3mT9Fi6jY8OXdXCfnvX/3KNLXGNr4HEz2TA7S4Mv/PYAOmpB8y/ge40mxvBMgGNaSaaDwZpAsQn7HtWA=="],
|
||||||
|
|
||||||
|
"@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
|
||||||
|
|
||||||
|
"@types/deno": ["@types/deno@2.7.0", "", {}, "sha512-Y6fWcV8KpYeO3Lik/RiYnUxtr/LWqoeACciU0CA+dr1U/45tGgaX3HWQQAPCNN53raN4Rr4Fht4y6qsUH57fDA=="],
|
||||||
|
|
||||||
|
"@types/node": ["@types/node@25.9.3", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg=="],
|
||||||
|
|
||||||
|
"astring": ["astring@1.9.0", "", { "bin": "bin/astring" }, "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg=="],
|
||||||
|
|
||||||
|
"bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
|
||||||
|
|
||||||
|
"esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": "bin/esbuild" }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="],
|
||||||
|
|
||||||
|
"globals": ["globals@17.6.0", "", {}, "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA=="],
|
||||||
|
|
||||||
|
"meriyah": ["meriyah@6.1.4", "", {}, "sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ=="],
|
||||||
|
|
||||||
|
"oxfmt": ["oxfmt@0.54.0", "", { "dependencies": { "tinypool": "2.1.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.54.0", "@oxfmt/binding-android-arm64": "0.54.0", "@oxfmt/binding-darwin-arm64": "0.54.0", "@oxfmt/binding-darwin-x64": "0.54.0", "@oxfmt/binding-freebsd-x64": "0.54.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.54.0", "@oxfmt/binding-linux-arm-musleabihf": "0.54.0", "@oxfmt/binding-linux-arm64-gnu": "0.54.0", "@oxfmt/binding-linux-arm64-musl": "0.54.0", "@oxfmt/binding-linux-ppc64-gnu": "0.54.0", "@oxfmt/binding-linux-riscv64-gnu": "0.54.0", "@oxfmt/binding-linux-riscv64-musl": "0.54.0", "@oxfmt/binding-linux-s390x-gnu": "0.54.0", "@oxfmt/binding-linux-x64-gnu": "0.54.0", "@oxfmt/binding-linux-x64-musl": "0.54.0", "@oxfmt/binding-openharmony-arm64": "0.54.0", "@oxfmt/binding-win32-arm64-msvc": "0.54.0", "@oxfmt/binding-win32-ia32-msvc": "0.54.0", "@oxfmt/binding-win32-x64-msvc": "0.54.0" }, "peerDependencies": { "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["svelte", "vite-plus"], "bin": "bin/oxfmt" }, "sha512-DjnMwn7smSLF+Mc2+pRItnuPftm/dkUFpY/d4+33y9TfKrsHZo8GLhmUg9BrOIUEy94Rlom1Q11N6vuhE+e0oQ=="],
|
||||||
|
|
||||||
|
"oxlint": ["oxlint@1.69.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.69.0", "@oxlint/binding-android-arm64": "1.69.0", "@oxlint/binding-darwin-arm64": "1.69.0", "@oxlint/binding-darwin-x64": "1.69.0", "@oxlint/binding-freebsd-x64": "1.69.0", "@oxlint/binding-linux-arm-gnueabihf": "1.69.0", "@oxlint/binding-linux-arm-musleabihf": "1.69.0", "@oxlint/binding-linux-arm64-gnu": "1.69.0", "@oxlint/binding-linux-arm64-musl": "1.69.0", "@oxlint/binding-linux-ppc64-gnu": "1.69.0", "@oxlint/binding-linux-riscv64-gnu": "1.69.0", "@oxlint/binding-linux-riscv64-musl": "1.69.0", "@oxlint/binding-linux-s390x-gnu": "1.69.0", "@oxlint/binding-linux-x64-gnu": "1.69.0", "@oxlint/binding-linux-x64-musl": "1.69.0", "@oxlint/binding-openharmony-arm64": "1.69.0", "@oxlint/binding-win32-arm64-msvc": "1.69.0", "@oxlint/binding-win32-ia32-msvc": "1.69.0", "@oxlint/binding-win32-x64-msvc": "1.69.0" }, "peerDependencies": { "oxlint-tsgolint": ">=0.22.1", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": "bin/oxlint" }, "sha512-ypZkK/aDc5NQV8zIR6s2H2Tl3aNW8FmJ1m9+2qsaYuRenl8vgnHNCGwTHviWJdUQzglOlHFchgopdtGhSy17Rw=="],
|
||||||
|
|
||||||
|
"tinypool": ["tinypool@2.1.0", "", {}, "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw=="],
|
||||||
|
|
||||||
|
"undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="],
|
||||||
|
}
|
||||||
|
}
|
||||||
101
check.py
Executable file
101
check.py
Executable file
@@ -0,0 +1,101 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
import pathlib
|
||||||
|
import sys
|
||||||
|
|
||||||
|
ADDITIONAL_PACKAGES_NODE = {}
|
||||||
|
ADDITIONAL_PACKAGES_DENO = {}
|
||||||
|
BASE_PATH = pathlib.Path(__file__).parent
|
||||||
|
|
||||||
|
|
||||||
|
def parse_deno() -> dict[str, str]:
|
||||||
|
path = BASE_PATH / "deno.lock"
|
||||||
|
with path.open("rb") as file:
|
||||||
|
lockfile = json.load(file)
|
||||||
|
|
||||||
|
v = lockfile["version"]
|
||||||
|
if v != "5":
|
||||||
|
msg = f"Unsupported lockfile version: {v} (expected 5)"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
integrities = {}
|
||||||
|
for name, info in lockfile["npm"].items():
|
||||||
|
integrity = info["integrity"]
|
||||||
|
other = integrities.get(integrity)
|
||||||
|
if other and other != name:
|
||||||
|
msg = f"Duplicate integrity for {name} and {other}: {integrity}"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
integrities[integrity] = name
|
||||||
|
|
||||||
|
return integrities
|
||||||
|
|
||||||
|
|
||||||
|
def parse_node() -> dict[str, str]:
|
||||||
|
path = BASE_PATH / "package-lock.json"
|
||||||
|
with path.open("rb") as file:
|
||||||
|
lockfile = json.load(file)
|
||||||
|
|
||||||
|
v = lockfile["lockfileVersion"]
|
||||||
|
if v != 3:
|
||||||
|
msg = f"Unsupported lockfile version: {v} (expected 3)"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
integrities = {}
|
||||||
|
for path, info in lockfile["packages"].items():
|
||||||
|
if not path:
|
||||||
|
continue
|
||||||
|
|
||||||
|
_, _, mod_name = path.rpartition("node_modules/")
|
||||||
|
version = info["version"]
|
||||||
|
name = f"{mod_name}@{version}"
|
||||||
|
|
||||||
|
integrity = info["integrity"]
|
||||||
|
other = integrities.get(integrity)
|
||||||
|
if other and other != name:
|
||||||
|
msg = f"Duplicate integrity for {name} and {other}: {integrity}"
|
||||||
|
raise ValueError(msg)
|
||||||
|
integrities[integrity] = name
|
||||||
|
|
||||||
|
return integrities
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
try:
|
||||||
|
packages_deno = parse_deno()
|
||||||
|
except Exception as error:
|
||||||
|
print(f"ERROR: Could not read deno lockfile: {error}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
packages_node = parse_node()
|
||||||
|
except Exception as error:
|
||||||
|
print(f"ERROR: Could not read npm lockfile: {error}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
packages_deno.update({v: k for k, v in ADDITIONAL_PACKAGES_NODE.items()})
|
||||||
|
packages_node.update({v: k for k, v in ADDITIONAL_PACKAGES_DENO.items()})
|
||||||
|
differences = packages_deno.keys() ^ packages_node.keys()
|
||||||
|
|
||||||
|
if diffs_deno := differences.intersection(packages_deno):
|
||||||
|
print(
|
||||||
|
"deno => npm:",
|
||||||
|
*(f"{packages_deno[h]} ({h})" for h in diffs_deno),
|
||||||
|
sep="\n\t",
|
||||||
|
)
|
||||||
|
|
||||||
|
if diffs_node := differences.intersection(packages_node):
|
||||||
|
print(
|
||||||
|
" npm => deno:",
|
||||||
|
*(f"{packages_node[h]} ({h})" for h in diffs_node),
|
||||||
|
sep="\n\t",
|
||||||
|
)
|
||||||
|
|
||||||
|
if differences:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
474
deno.lock
generated
Normal file
474
deno.lock
generated
Normal file
@@ -0,0 +1,474 @@
|
|||||||
|
{
|
||||||
|
"version": "5",
|
||||||
|
"specifiers": {
|
||||||
|
"npm:@types/bun@1.3.14": "1.3.14",
|
||||||
|
"npm:@types/deno@2.7.0": "2.7.0",
|
||||||
|
"npm:@types/node@25.9.3": "25.9.3",
|
||||||
|
"npm:astring@1.9.0": "1.9.0",
|
||||||
|
"npm:esbuild@0.28.1": "0.28.1",
|
||||||
|
"npm:globals@17.6.0": "17.6.0",
|
||||||
|
"npm:meriyah@6.1.4": "6.1.4",
|
||||||
|
"npm:oxfmt@0.54": "0.54.0",
|
||||||
|
"npm:oxlint@^1.69.0": "1.69.0"
|
||||||
|
},
|
||||||
|
"npm": {
|
||||||
|
"@esbuild/aix-ppc64@0.28.1": {
|
||||||
|
"integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
|
||||||
|
"os": ["aix"],
|
||||||
|
"cpu": ["ppc64"]
|
||||||
|
},
|
||||||
|
"@esbuild/android-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/android-arm@0.28.1": {
|
||||||
|
"integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@esbuild/android-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/darwin-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/darwin-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/freebsd-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
|
||||||
|
"os": ["freebsd"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/freebsd-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
|
||||||
|
"os": ["freebsd"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-arm@0.28.1": {
|
||||||
|
"integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-ia32@0.28.1": {
|
||||||
|
"integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["ia32"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-loong64@0.28.1": {
|
||||||
|
"integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["loong64"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-mips64el@0.28.1": {
|
||||||
|
"integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["mips64el"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-ppc64@0.28.1": {
|
||||||
|
"integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["ppc64"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-riscv64@0.28.1": {
|
||||||
|
"integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["riscv64"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-s390x@0.28.1": {
|
||||||
|
"integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["s390x"]
|
||||||
|
},
|
||||||
|
"@esbuild/linux-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/netbsd-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
|
||||||
|
"os": ["netbsd"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/netbsd-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
|
||||||
|
"os": ["netbsd"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/openbsd-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
|
||||||
|
"os": ["openbsd"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/openbsd-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
|
||||||
|
"os": ["openbsd"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/openharmony-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
|
||||||
|
"os": ["openharmony"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/sunos-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
|
||||||
|
"os": ["sunos"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@esbuild/win32-arm64@0.28.1": {
|
||||||
|
"integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@esbuild/win32-ia32@0.28.1": {
|
||||||
|
"integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["ia32"]
|
||||||
|
},
|
||||||
|
"@esbuild/win32-x64@0.28.1": {
|
||||||
|
"integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-android-arm-eabi@0.54.0": {
|
||||||
|
"integrity": "sha512-NAtpl/SiaeU103e7/OmZw0MvUnsUUopW7hEm/ecegJg7YM0skQaA0IXEZoyTV6NUdiNPupdIUreRqUZTShbn/g==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-android-arm64@0.54.0": {
|
||||||
|
"integrity": "sha512-B4VZfBUlKK1rmMChsssNZbkZjE8+FzG3avMjGgMDwbGxXRoXkoeXiAZ+78Oa+eyDPHvDCiUb4zH/vmCOUSafLQ==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-darwin-arm64@0.54.0": {
|
||||||
|
"integrity": "sha512-i02vF75b+ePsQP3tHqSxVYI5S6b8X/xqdPu7/mDHXtpgXLTYXi3jJmfHU0j+dnZZDKaYTx/ioCK7QYJmtiJR2g==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-darwin-x64@0.54.0": {
|
||||||
|
"integrity": "sha512-8VMFvGvooXj7mswkbrhdVZ2/sgiDaBzWpkkbtO+qGDLV4EfJd67nQadHkQC0ZNbaWA9ajXfqI6i7PZLIeDzxEQ==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-freebsd-x64@0.54.0": {
|
||||||
|
"integrity": "sha512-0cRHnp43WN1Jrc5s0BdbdKgR1XirdvHy7TAFi3JEsoEVQVJxTXMbpVd76sxXlgRswNMDhVFSJw+y7Eb8mEavFQ==",
|
||||||
|
"os": ["freebsd"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-arm-gnueabihf@0.54.0": {
|
||||||
|
"integrity": "sha512-JyQAk3hK/OEtup7Rw6kZwfdzbKqTVD5jXXb8Xpfay29suwZyfBDMVW/bj4RqEPySYWc6zCp198pOluf8n5uYzg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-arm-musleabihf@0.54.0": {
|
||||||
|
"integrity": "sha512-qnvLatTpM8vtvjOfcckBOzJjk+n6ce/wwpP8OFeUrD5aNLYcKyWAitwj+Rk3PK9jGanbZvKsJnv14JGQ6XqFdw==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-arm64-gnu@0.54.0": {
|
||||||
|
"integrity": "sha512-SMkhnCzIYZYDk9vw3W/80eeYKmrMpGF0Giuxt4HruFlCH7jEtnPeb3SdQKMfgYi/dgtaf+hZAb5XWPYnxqCQ3w==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-arm64-musl@0.54.0": {
|
||||||
|
"integrity": "sha512-QrwJlBFFKnxOd95TAaszpMbZBLzMoYMpGaQTZF8oibacnF5rv8l12IhILhQRPmksWiBqg0YSe2Mnl7ayeJAHSA==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-ppc64-gnu@0.54.0": {
|
||||||
|
"integrity": "sha512-WILatiol/TUHTlhod7R09+7Az/XlhKwmY1MHfLZNmewltPWNN/EwxP2rQSHahibZ/cB8gmckEBjBOByD+5bYsQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["ppc64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-riscv64-gnu@0.54.0": {
|
||||||
|
"integrity": "sha512-f05YMG4BH4G8S4ME6UM6fi1MnJ9094mrnvO5Pa4SJlMfWlUM+1/ZWMEF4NnjM7shZAvbHsHRuVYpUo0PHC4P9Q==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["riscv64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-riscv64-musl@0.54.0": {
|
||||||
|
"integrity": "sha512-UfL+2hj1ClNqcCRT9s8vBU4axDpjxgVxX96G+9DYAYjoc5b0u15CJtn2jgsi9iM+EbGNc5CW1HVRgwVu76UsSA==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["riscv64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-s390x-gnu@0.54.0": {
|
||||||
|
"integrity": "sha512-3/XZe931Hka+J6NjnaqJzYpsWWxDTuRdUdwSQHnOuJEgbC+SehIMFJS8hsEjV7LBhVSL2OCnRLvbVW8O97XIyw==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["s390x"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-x64-gnu@0.54.0": {
|
||||||
|
"integrity": "sha512-Ik93RlObtu43GbxApafayFjwYE06L6Xr08cSwpBPYbDrLp2ReZx0Jm1DqwRyYRnukUJy+rK2WaEvUQOxdytU9Q==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-linux-x64-musl@0.54.0": {
|
||||||
|
"integrity": "sha512-yZcakmPlD86CNymknd7KfW+FH+qfbqJH+i0h69CYfV1+KMoVeM9UED+8+TDVoU4haxI0NxY7RPCvRLy3Sqd2Qg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-openharmony-arm64@0.54.0": {
|
||||||
|
"integrity": "sha512-GiVBZNnEZnKu00f1jTg49nomv187d0GQX+O+ocykoLeiaALuEO+swoTehHn9TehTfi7V8H0i0e/yvUjCqnwk1w==",
|
||||||
|
"os": ["openharmony"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-win32-arm64-msvc@0.54.0": {
|
||||||
|
"integrity": "sha512-J0SSB8Z1Fre2sxRolYcW6Rl1RQmKdQ2hnHyq4YJrfBRiXTObLw4DXnIVraM/UyqGqwOi7yTrQA4VT7DPxlHVKA==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-win32-ia32-msvc@0.54.0": {
|
||||||
|
"integrity": "sha512-O61UDVj8zz6yXJjkHPf05VaMLOXmEF8P5kf/N0W7AQMmd6bcQogl+KJc7rMutKTL524oE9iH32JXZClBFmEQIg==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["ia32"]
|
||||||
|
},
|
||||||
|
"@oxfmt/binding-win32-x64-msvc@0.54.0": {
|
||||||
|
"integrity": "sha512-1MDpqJPiFqxWtIHas8vkb1VZ7f7eKyTffAwmO8isxQYMaG1OFKsH666BWLeXQLO+IWNfiMssLD55hbR1lIPTqg==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-android-arm-eabi@1.69.0": {
|
||||||
|
"integrity": "sha512-DKQQbD5cZ/MYfDgDI7YGyGD9FSxABlsBsYFo5p26lloob543tP9+4N3guwdXIYJN+7HSZxLe8YJuwcOWw5qnHg==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-android-arm64@1.69.0": {
|
||||||
|
"integrity": "sha512-lEhb+I5pr4inux+JFwfCa1HRq3Os7NirEFQ0H1I35SVEHPm6byX0Ah47xmRha3qi6LAkxUcxViL8o/9PivjzBg==",
|
||||||
|
"os": ["android"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-darwin-arm64@1.69.0": {
|
||||||
|
"integrity": "sha512-GY2YE8lOZW59BW1Ia1y+1gR0XyjrZRvVWHAr8LGeGhYHE0OQJ/7cRKXTkx1P+E9/6awEc3SX8a68SFTjh/E//A==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-darwin-x64@1.69.0": {
|
||||||
|
"integrity": "sha512-ax1oZnOjHX3LB7myQyHEaQkDwfLb6str3/nSP6O7EVUviQGNkEGzGV0EqcBJWK+Ufwx0l4xPgyYayurvhAdl2Q==",
|
||||||
|
"os": ["darwin"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-freebsd-x64@1.69.0": {
|
||||||
|
"integrity": "sha512-kHWeHv4g2h8NY+mpCxzCtY4uerMJWTN/TSnNj1CPbakFpHEJ6cTya2wWV0pDSYWOJ2+0UiEbhn3AtXxHtsnKjg==",
|
||||||
|
"os": ["freebsd"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-arm-gnueabihf@1.69.0": {
|
||||||
|
"integrity": "sha512-gq84vM1a1oEehXo27YCDzGVcxPsZDI1yswZwz2Da1/cbnWtrL16XZZnz0G/+gIU8edtHpfjxq5c+vWEHqJfWoQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-arm-musleabihf@1.69.0": {
|
||||||
|
"integrity": "sha512-kIqEa98JQ0VRyrcncxA417m2AzasqTlD+FyVT1AksjvjkqQcvm7pBWYvoW3/mpyOP2XYvi5nSCCTIe6De1yu5g==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-arm64-gnu@1.69.0": {
|
||||||
|
"integrity": "sha512-j+xYiXozxGWx2cpjCrwwGR4awTxPFsRv3JZrv23RCogEPMc4R7UqjHW47p/RG0aRlbWiROCJ8coUfCwy0dvzHA==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-arm64-musl@1.69.0": {
|
||||||
|
"integrity": "sha512-xEPpNppTfN1l/nM7gYSf9iocscu/as+p/7vxkLeLEKnYU+09Dm+5V6IhDYDh+Uz6FajEupWwCLt5SOG0y1PCKg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-ppc64-gnu@1.69.0": {
|
||||||
|
"integrity": "sha512-Ug0+eU7HJBlek+SjklYH62IlOMirEJsdxpihH0kSqX0XdrDD4NdHpQc10fK1JC35yn6KrrcN+uYzlHD38XAf8Q==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["ppc64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-riscv64-gnu@1.69.0": {
|
||||||
|
"integrity": "sha512-iEyI3GIg0l/s3G4qy2TlaaWKdzj4PJJStwtlocpDTC00PY9hZueotf6OKUj9+yfQh0lrpBW/pLMgTztbAHKJEg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["riscv64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-riscv64-musl@1.69.0": {
|
||||||
|
"integrity": "sha512-NjHjpiI4WIKSMwuoJSZi5VToPeoYOS1FR52HLIDG6lidMdqquusgtODb4iLk0+lb1q3Z0nv2/aPRcC/olmpQGg==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["riscv64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-s390x-gnu@1.69.0": {
|
||||||
|
"integrity": "sha512-Ai/prDewoItkDXbp38gwGZi41DycZbUTZJ3UidwoHgQC0/DaqC2TGdtBTQLJ6hSD+SAxASzh8+/eSBPmxfOacA==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["s390x"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-x64-gnu@1.69.0": {
|
||||||
|
"integrity": "sha512-Gt3KHgp46mRKz4sJeaASmKvD8ayXookRw07RMf+NowhEztGGDZ7VrXpoW96XuKJLjFukWizOFVNjmYb/u7caNQ==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-linux-x64-musl@1.69.0": {
|
||||||
|
"integrity": "sha512-7tQhJ2+p/oHv1zcfnjYI7YVzC/7iBaVOfIvFYtxdJ5F45mWgEdrCyXZXZGfiLey5t/5JhOhsaMnnv1kAzckd7g==",
|
||||||
|
"os": ["linux"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-openharmony-arm64@1.69.0": {
|
||||||
|
"integrity": "sha512-vmWz6TKp/3hfA4lksR0zHBv/6xuX1jhym6eqOjdH2DXsDDHZWcp2f0KG0VCAnlVbIrjk29G4wAWMXb/Hn1YobA==",
|
||||||
|
"os": ["openharmony"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-win32-arm64-msvc@1.69.0": {
|
||||||
|
"integrity": "sha512-9RExaLgmaw6IoIkU9cTpT71mLfI0xZ86iZH8x518LVsOkjquJMYqb9P7KpC8lgd1t0Dxs41p2pxynq4XR3Ttzw==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["arm64"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-win32-ia32-msvc@1.69.0": {
|
||||||
|
"integrity": "sha512-1907kRPF8/PrcIw1E7LMs9JbVrpgnt/MvFdss3an8oDkYNAACXzTntV3t3869ZZhMZxb2AzRGbz1pA/jdFatXA==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["ia32"]
|
||||||
|
},
|
||||||
|
"@oxlint/binding-win32-x64-msvc@1.69.0": {
|
||||||
|
"integrity": "sha512-w8SOXv3mT9Fi6jY8OXdXCfnvX/3KNLXGNr4HEz2TA7S4Mv/PYAOmpB8y/ge40mxvBMgGNaSaaDwZpAsQn7HtWA==",
|
||||||
|
"os": ["win32"],
|
||||||
|
"cpu": ["x64"]
|
||||||
|
},
|
||||||
|
"@types/bun@1.3.14": {
|
||||||
|
"integrity": "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw==",
|
||||||
|
"dependencies": [
|
||||||
|
"bun-types"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"@types/deno@2.7.0": {
|
||||||
|
"integrity": "sha512-Y6fWcV8KpYeO3Lik/RiYnUxtr/LWqoeACciU0CA+dr1U/45tGgaX3HWQQAPCNN53raN4Rr4Fht4y6qsUH57fDA=="
|
||||||
|
},
|
||||||
|
"@types/node@25.9.3": {
|
||||||
|
"integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==",
|
||||||
|
"dependencies": [
|
||||||
|
"undici-types"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"astring@1.9.0": {
|
||||||
|
"integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==",
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
|
"bun-types@1.3.14": {
|
||||||
|
"integrity": "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"@types/node"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"esbuild@0.28.1": {
|
||||||
|
"integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
|
||||||
|
"optionalDependencies": [
|
||||||
|
"@esbuild/aix-ppc64",
|
||||||
|
"@esbuild/android-arm",
|
||||||
|
"@esbuild/android-arm64",
|
||||||
|
"@esbuild/android-x64",
|
||||||
|
"@esbuild/darwin-arm64",
|
||||||
|
"@esbuild/darwin-x64",
|
||||||
|
"@esbuild/freebsd-arm64",
|
||||||
|
"@esbuild/freebsd-x64",
|
||||||
|
"@esbuild/linux-arm",
|
||||||
|
"@esbuild/linux-arm64",
|
||||||
|
"@esbuild/linux-ia32",
|
||||||
|
"@esbuild/linux-loong64",
|
||||||
|
"@esbuild/linux-mips64el",
|
||||||
|
"@esbuild/linux-ppc64",
|
||||||
|
"@esbuild/linux-riscv64",
|
||||||
|
"@esbuild/linux-s390x",
|
||||||
|
"@esbuild/linux-x64",
|
||||||
|
"@esbuild/netbsd-arm64",
|
||||||
|
"@esbuild/netbsd-x64",
|
||||||
|
"@esbuild/openbsd-arm64",
|
||||||
|
"@esbuild/openbsd-x64",
|
||||||
|
"@esbuild/openharmony-arm64",
|
||||||
|
"@esbuild/sunos-x64",
|
||||||
|
"@esbuild/win32-arm64",
|
||||||
|
"@esbuild/win32-ia32",
|
||||||
|
"@esbuild/win32-x64"
|
||||||
|
],
|
||||||
|
"scripts": true,
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
|
"globals@17.6.0": {
|
||||||
|
"integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA=="
|
||||||
|
},
|
||||||
|
"meriyah@6.1.4": {
|
||||||
|
"integrity": "sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ=="
|
||||||
|
},
|
||||||
|
"oxfmt@0.54.0": {
|
||||||
|
"integrity": "sha512-DjnMwn7smSLF+Mc2+pRItnuPftm/dkUFpY/d4+33y9TfKrsHZo8GLhmUg9BrOIUEy94Rlom1Q11N6vuhE+e0oQ==",
|
||||||
|
"dependencies": [
|
||||||
|
"tinypool"
|
||||||
|
],
|
||||||
|
"optionalDependencies": [
|
||||||
|
"@oxfmt/binding-android-arm-eabi",
|
||||||
|
"@oxfmt/binding-android-arm64",
|
||||||
|
"@oxfmt/binding-darwin-arm64",
|
||||||
|
"@oxfmt/binding-darwin-x64",
|
||||||
|
"@oxfmt/binding-freebsd-x64",
|
||||||
|
"@oxfmt/binding-linux-arm-gnueabihf",
|
||||||
|
"@oxfmt/binding-linux-arm-musleabihf",
|
||||||
|
"@oxfmt/binding-linux-arm64-gnu",
|
||||||
|
"@oxfmt/binding-linux-arm64-musl",
|
||||||
|
"@oxfmt/binding-linux-ppc64-gnu",
|
||||||
|
"@oxfmt/binding-linux-riscv64-gnu",
|
||||||
|
"@oxfmt/binding-linux-riscv64-musl",
|
||||||
|
"@oxfmt/binding-linux-s390x-gnu",
|
||||||
|
"@oxfmt/binding-linux-x64-gnu",
|
||||||
|
"@oxfmt/binding-linux-x64-musl",
|
||||||
|
"@oxfmt/binding-openharmony-arm64",
|
||||||
|
"@oxfmt/binding-win32-arm64-msvc",
|
||||||
|
"@oxfmt/binding-win32-ia32-msvc",
|
||||||
|
"@oxfmt/binding-win32-x64-msvc"
|
||||||
|
],
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
|
"oxlint@1.69.0": {
|
||||||
|
"integrity": "sha512-ypZkK/aDc5NQV8zIR6s2H2Tl3aNW8FmJ1m9+2qsaYuRenl8vgnHNCGwTHviWJdUQzglOlHFchgopdtGhSy17Rw==",
|
||||||
|
"optionalDependencies": [
|
||||||
|
"@oxlint/binding-android-arm-eabi",
|
||||||
|
"@oxlint/binding-android-arm64",
|
||||||
|
"@oxlint/binding-darwin-arm64",
|
||||||
|
"@oxlint/binding-darwin-x64",
|
||||||
|
"@oxlint/binding-freebsd-x64",
|
||||||
|
"@oxlint/binding-linux-arm-gnueabihf",
|
||||||
|
"@oxlint/binding-linux-arm-musleabihf",
|
||||||
|
"@oxlint/binding-linux-arm64-gnu",
|
||||||
|
"@oxlint/binding-linux-arm64-musl",
|
||||||
|
"@oxlint/binding-linux-ppc64-gnu",
|
||||||
|
"@oxlint/binding-linux-riscv64-gnu",
|
||||||
|
"@oxlint/binding-linux-riscv64-musl",
|
||||||
|
"@oxlint/binding-linux-s390x-gnu",
|
||||||
|
"@oxlint/binding-linux-x64-gnu",
|
||||||
|
"@oxlint/binding-linux-x64-musl",
|
||||||
|
"@oxlint/binding-openharmony-arm64",
|
||||||
|
"@oxlint/binding-win32-arm64-msvc",
|
||||||
|
"@oxlint/binding-win32-ia32-msvc",
|
||||||
|
"@oxlint/binding-win32-x64-msvc"
|
||||||
|
],
|
||||||
|
"bin": true
|
||||||
|
},
|
||||||
|
"tinypool@2.1.0": {
|
||||||
|
"integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw=="
|
||||||
|
},
|
||||||
|
"undici-types@7.24.6": {
|
||||||
|
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"workspace": {
|
||||||
|
"packageJson": {
|
||||||
|
"dependencies": [
|
||||||
|
"npm:@types/bun@1.3.14",
|
||||||
|
"npm:@types/deno@2.7.0",
|
||||||
|
"npm:@types/node@25.9.3",
|
||||||
|
"npm:astring@1.9.0",
|
||||||
|
"npm:esbuild@0.28.1",
|
||||||
|
"npm:globals@17.6.0",
|
||||||
|
"npm:meriyah@6.1.4",
|
||||||
|
"npm:oxfmt@0.54",
|
||||||
|
"npm:oxlint@^1.69.0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
431
hatch_build.py
Normal file → Executable file
431
hatch_build.py
Normal file → Executable file
@@ -1,38 +1,425 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
|
import os.path
|
||||||
|
import pathlib
|
||||||
|
import re
|
||||||
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import typing
|
||||||
|
|
||||||
|
try:
|
||||||
|
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
||||||
|
except ImportError:
|
||||||
|
BuildHookInterface = object
|
||||||
|
|
||||||
|
|
||||||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
BASE_PATH = pathlib.Path(__file__).parent.resolve()
|
||||||
|
DEFAULT_BUNDLER = ["esbuild", "pnpm", "deno", "bun", "node"]
|
||||||
|
DEFAULT_INSTALLER = ["pnpm", "deno", "bun", "npm"]
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
if not os.environ.get("EJS_BUILD_SKIP_INSTALL"):
|
||||||
|
name, path = find_executable("EJS_BUILD_INSTALLER", DEFAULT_INSTALLER)
|
||||||
|
args, env = build_install_args(name)
|
||||||
|
cmd = [path, *args]
|
||||||
|
print(f"Install command: {shlex.join(cmd)}")
|
||||||
|
subprocess.run(cmd, env=env, check=False)
|
||||||
|
|
||||||
|
esbuild = ESBuild(*find_executable("EJS_BUILD_BUNDLER", DEFAULT_BUNDLER))
|
||||||
|
print(f"Bundle command: {shlex.join(esbuild.cmd)}", file=sys.stderr)
|
||||||
|
|
||||||
|
externals = list(get_external_packages(esbuild))
|
||||||
|
builds = create_builds(externals)
|
||||||
|
print("SHA3-512 checksums:", file=sys.stderr)
|
||||||
|
for build in builds:
|
||||||
|
outfile = build.get("outfile")
|
||||||
|
assert outfile
|
||||||
|
esbuild.run(build)
|
||||||
|
|
||||||
|
path = BASE_PATH / outfile
|
||||||
|
# Workaround for https://github.com/evanw/esbuild/issues/3717#issuecomment-3765731197
|
||||||
|
data = path.read_bytes()
|
||||||
|
if not build.get("minify"):
|
||||||
|
data = re.sub(
|
||||||
|
rb"^\s+// node_modules[^\n]+$",
|
||||||
|
b"",
|
||||||
|
data,
|
||||||
|
flags=re.ASCII | re.MULTILINE,
|
||||||
|
)
|
||||||
|
path.write_bytes(data)
|
||||||
|
digest = hashlib.sha3_512(data).hexdigest()
|
||||||
|
print(f"{digest} {path.name}")
|
||||||
|
|
||||||
|
|
||||||
|
def create_builds(externals: list[Package]) -> list[ESBuildOptions]:
|
||||||
|
with (BASE_PATH / "package.json").open("rb") as file:
|
||||||
|
pkg = json.load(file)
|
||||||
|
LICENSE_PREAMBLE = (
|
||||||
|
"SPDX-License-Identifier: Unlicense\n"
|
||||||
|
+ f"This file was automatically generated by {pkg['homepage']}"
|
||||||
|
)
|
||||||
|
BANNER_WITHOUT_DEPENDENCIES = {"js": license_comment(LICENSE_PREAMBLE)}
|
||||||
|
BANNER_WITH_DEPENDENCIES = {
|
||||||
|
"js": license_comment(
|
||||||
|
LICENSE_PREAMBLE
|
||||||
|
+ "\n\nBundled dependencies:\n\n"
|
||||||
|
+ "------\n\n".join(map(Package.license_comment, externals))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
EXTERNALS = [pkg.name for pkg in externals]
|
||||||
|
ALIASES_DENO = {pkg.name: f"npm:{pkg.name}@{pkg.version}" for pkg in externals}
|
||||||
|
ALIASES_BUN = {pkg.name: f"{pkg.name}@{pkg.version}" for pkg in externals}
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/main.ts"],
|
||||||
|
"outfile": "dist/yt.solver.core.js",
|
||||||
|
"format": "iife",
|
||||||
|
"globalName": "jsc",
|
||||||
|
"banner": BANNER_WITHOUT_DEPENDENCIES,
|
||||||
|
"external": EXTERNALS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/main.ts"],
|
||||||
|
"outfile": "dist/yt.solver.core.min.js",
|
||||||
|
"minify": True,
|
||||||
|
"format": "iife",
|
||||||
|
"globalName": "jsc",
|
||||||
|
"banner": BANNER_WITHOUT_DEPENDENCIES,
|
||||||
|
"external": EXTERNALS,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/lib.ts"],
|
||||||
|
"outfile": "dist/yt.solver.lib.js",
|
||||||
|
"format": "iife",
|
||||||
|
"globalName": "lib",
|
||||||
|
"banner": BANNER_WITH_DEPENDENCIES,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/lib.ts"],
|
||||||
|
"outfile": "dist/yt.solver.lib.min.js",
|
||||||
|
"minify": True,
|
||||||
|
"format": "iife",
|
||||||
|
"globalName": "lib",
|
||||||
|
"banner": BANNER_WITH_DEPENDENCIES,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/lib.ts"],
|
||||||
|
"outfile": "dist/yt.solver.bun.lib.js",
|
||||||
|
"minifySyntax": True,
|
||||||
|
"format": "esm",
|
||||||
|
"globalName": "lib",
|
||||||
|
"banner": BANNER_WITHOUT_DEPENDENCIES,
|
||||||
|
"alias": ALIASES_BUN,
|
||||||
|
"external": list(ALIASES_BUN.values()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/lib.ts"],
|
||||||
|
"outfile": "dist/yt.solver.deno.lib.js",
|
||||||
|
"minifySyntax": True,
|
||||||
|
"format": "esm",
|
||||||
|
"globalName": "lib",
|
||||||
|
"banner": BANNER_WITHOUT_DEPENDENCIES,
|
||||||
|
"alias": ALIASES_DENO,
|
||||||
|
"external": list(ALIASES_DENO.values()),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class CustomBuildHook(BuildHookInterface):
|
class CustomBuildHook(BuildHookInterface):
|
||||||
def initialize(self, version, build_data):
|
def initialize(self, version, build_data):
|
||||||
if shutil.which("deno"):
|
run()
|
||||||
print("Building with deno...", flush=True)
|
build_data["force_include"].update(
|
||||||
os.environ["DENO_NO_UPDATE_CHECK"] = "1"
|
{
|
||||||
subprocess.run(["deno", "install"], check=True)
|
"dist/yt.solver.core.min.js": "yt_dlp_ejs/yt/solver/core.min.js",
|
||||||
subprocess.run(["deno", "task", "bundle"], check=True)
|
"dist/yt.solver.lib.min.js": "yt_dlp_ejs/yt/solver/lib.min.js",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
elif shutil.which("bun"):
|
def clean(self, versions):
|
||||||
print("Building with bun...", flush=True)
|
shutil.rmtree("node_modules", ignore_errors=True)
|
||||||
subprocess.run(["bun", "install", "--frozen-lockfile"], check=True)
|
|
||||||
subprocess.run(["bun", "run", "bundle"], check=True)
|
|
||||||
|
|
||||||
elif shutil.which("npm"):
|
|
||||||
print("Building with npm...", flush=True)
|
def find_executable(env: str, defaults: list[str]):
|
||||||
# npm is a batch file (`npm.cmd`) on windows, which requires `shell=True`
|
values = defaults
|
||||||
requires_shell = os.name == "nt"
|
if value := os.getenv(env):
|
||||||
subprocess.run(["npm", "ci"], check=True, shell=requires_shell)
|
values = value.split(os.path.pathsep)
|
||||||
subprocess.run(["npm", "run", "bundle"], check=True, shell=requires_shell)
|
for value in values:
|
||||||
|
if path := shutil.which(value):
|
||||||
|
name = pathlib.Path(path).name.partition(".")[0]
|
||||||
|
return name, path
|
||||||
|
|
||||||
|
return None, ""
|
||||||
|
|
||||||
|
|
||||||
|
def build_install_args(name: str | None):
|
||||||
|
if name == "pnpm":
|
||||||
|
return ["install", "--frozen-lockfile"], None
|
||||||
|
|
||||||
|
if name == "deno":
|
||||||
|
env = os.environ.copy()
|
||||||
|
env["DENO_NO_UPDATE_CHECK"] = "1"
|
||||||
|
return ["install", "--frozen"], env
|
||||||
|
|
||||||
|
if name == "bun":
|
||||||
|
return ["install", "--frozen-lockfile"], None
|
||||||
|
|
||||||
|
if name == "npm":
|
||||||
|
return ["ci"], None
|
||||||
|
|
||||||
|
raise RuntimeError(
|
||||||
|
"Only 'pnpm', 'deno', 'bun', or 'npm' are supported for installing dependencies. "
|
||||||
|
"Please install one of them or pass EJS_BUILD_SKIP_INSTALL=1 to skip install step."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ESBuild:
|
||||||
|
def __init__(self, name: str | None, path: str, /):
|
||||||
|
self._stdin = True
|
||||||
|
self._env = None
|
||||||
|
|
||||||
|
if name == "esbuild":
|
||||||
|
self._stdin = False
|
||||||
|
self.cmd = [path]
|
||||||
|
|
||||||
|
elif name == "pnpm":
|
||||||
|
self._stdin = False
|
||||||
|
self.cmd = [path, "run", "esbuild"]
|
||||||
|
|
||||||
|
elif name == "deno":
|
||||||
|
self._env = os.environ.copy()
|
||||||
|
self._env["DENO_NO_UPDATE_CHECK"] = "1"
|
||||||
|
self.cmd = [
|
||||||
|
path,
|
||||||
|
"run",
|
||||||
|
"--allow-read",
|
||||||
|
"--allow-env",
|
||||||
|
"--allow-run",
|
||||||
|
"build.mjs",
|
||||||
|
]
|
||||||
|
|
||||||
|
elif name == "bun":
|
||||||
|
self.cmd = [path, "--bun", "run", "build.mjs"]
|
||||||
|
|
||||||
|
elif name == "node":
|
||||||
|
self.cmd = [path, "build.mjs"]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"One of 'deno', 'bun', or 'npm' could not be found. "
|
"One of 'esbuild', 'pnpm', 'deno', 'bun', or 'node' could not be found. "
|
||||||
"Please install one of them to proceed with the build.")
|
"Please install one of them to be able to run esbuild."
|
||||||
|
)
|
||||||
|
|
||||||
build_data["force_include"]["dist/yt.solver.core.min.js"] = "yt_dlp_ejs/yt/solver/core.min.js"
|
def run(self, options: ESBuildOptions, /):
|
||||||
build_data["force_include"]["dist/yt.solver.lib.min.js"] = "yt_dlp_ejs/yt/solver/lib.min.js"
|
options = options.copy()
|
||||||
|
if entrypoints := options.get("entryPoints"):
|
||||||
|
options["entryPoints"] = [str(BASE_PATH / path) for path in entrypoints]
|
||||||
|
if outfile := options.get("outfile"):
|
||||||
|
options["outfile"] = str(BASE_PATH / outfile)
|
||||||
|
|
||||||
def clean(self, versions):
|
if self._stdin:
|
||||||
shutil.rmtree('node_modules', ignore_errors=True)
|
process = self._run(self.cmd, json.dumps({"bundle": True, **options}))
|
||||||
|
return json.loads(process.stdout)
|
||||||
|
|
||||||
|
cmd = [*self.cmd, "--bundle", *self._convert_args(options)]
|
||||||
|
fd = name = None
|
||||||
|
if options.pop("metafile", None):
|
||||||
|
fd, name = tempfile.mkstemp(prefix="ejs-build-metadata-", suffix=".json")
|
||||||
|
cmd.append(f"--metafile={name}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
self._run(cmd)
|
||||||
|
if fd and name:
|
||||||
|
with open(fd, "rb", closefd=True) as file:
|
||||||
|
return json.load(file)
|
||||||
|
return None
|
||||||
|
finally:
|
||||||
|
if name:
|
||||||
|
os.unlink(name)
|
||||||
|
|
||||||
|
def _run(self, cmd: list[str], stdin: str | None = None, /):
|
||||||
|
process = subprocess.run(
|
||||||
|
cmd,
|
||||||
|
env=self._env,
|
||||||
|
input=stdin,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
text=True,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
if process.returncode:
|
||||||
|
raise RuntimeError(
|
||||||
|
f"failed to run esbuild:\n{process.stdout}{process.stderr}"
|
||||||
|
)
|
||||||
|
return process
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _convert_args(options: ESBuildOptions):
|
||||||
|
for entrypoint in options.pop("entryPoints", ()):
|
||||||
|
yield entrypoint
|
||||||
|
if not options.pop("write", True):
|
||||||
|
options["outfile"] = "NUL" if os.name == "nt" else "/dev/null"
|
||||||
|
|
||||||
|
for name, value in options.items():
|
||||||
|
parameter = "--" + re.sub(r"[A-Z]", lambda x: "-" + x[0].lower(), name)
|
||||||
|
if isinstance(value, bool):
|
||||||
|
yield f"{parameter}={str(value).lower()}"
|
||||||
|
elif isinstance(value, str):
|
||||||
|
yield f"{parameter}={value}"
|
||||||
|
elif isinstance(value, list):
|
||||||
|
if name == "absPaths":
|
||||||
|
v = ",".join(value)
|
||||||
|
yield f"{parameter}={v}"
|
||||||
|
else:
|
||||||
|
for v in value:
|
||||||
|
yield f"{parameter}:{v}"
|
||||||
|
elif isinstance(value, dict):
|
||||||
|
for k, v in value.items():
|
||||||
|
yield f"{parameter}:{k}={v}"
|
||||||
|
|
||||||
|
|
||||||
|
class ESBuildOptions(typing.TypedDict, total=False):
|
||||||
|
entryPoints: list[str]
|
||||||
|
write: bool
|
||||||
|
absPaths: list[str]
|
||||||
|
metafile: bool
|
||||||
|
outfile: str
|
||||||
|
minify: bool
|
||||||
|
minifySyntax: bool
|
||||||
|
format: str
|
||||||
|
globalName: str
|
||||||
|
banner: dict[str, str]
|
||||||
|
alias: dict[str, str]
|
||||||
|
external: list[str]
|
||||||
|
|
||||||
|
|
||||||
|
def get_external_packages(esbuild: ESBuild):
|
||||||
|
metafile = esbuild.run(
|
||||||
|
{
|
||||||
|
"entryPoints": ["src/yt/solver/lib.ts"],
|
||||||
|
"absPaths": ["metafile"],
|
||||||
|
"metafile": True,
|
||||||
|
"write": False,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if not metafile:
|
||||||
|
raise RuntimeError("failed to gather build metadata")
|
||||||
|
|
||||||
|
_externals = {}
|
||||||
|
for input_file, meta in metafile["inputs"].items():
|
||||||
|
try:
|
||||||
|
pathlib.Path(input_file).relative_to(BASE_PATH)
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
for import_meta in meta["imports"]:
|
||||||
|
if "." in (import_meta.get("original") or ""):
|
||||||
|
continue
|
||||||
|
path = pathlib.Path(import_meta["path"])
|
||||||
|
_externals[path] = None
|
||||||
|
|
||||||
|
for path in _externals:
|
||||||
|
current = path.parent
|
||||||
|
while current != BASE_PATH:
|
||||||
|
package_path = current / "package.json"
|
||||||
|
if package_path.is_file():
|
||||||
|
break
|
||||||
|
current = current.parent
|
||||||
|
else:
|
||||||
|
msg = f"Failed to find package dir for {path}"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
yield Package.parse(current / "package.json")
|
||||||
|
|
||||||
|
|
||||||
|
class Package:
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
/,
|
||||||
|
name: str,
|
||||||
|
description: str,
|
||||||
|
version: str,
|
||||||
|
author: str,
|
||||||
|
repository: str,
|
||||||
|
license: str,
|
||||||
|
license_text: str,
|
||||||
|
):
|
||||||
|
self.name = name
|
||||||
|
self.description = description
|
||||||
|
self.version = version
|
||||||
|
self.author = author
|
||||||
|
self.repository = repository
|
||||||
|
self.license = license
|
||||||
|
self.license_text = license_text
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _parse_author(author):
|
||||||
|
if isinstance(author, str):
|
||||||
|
return author
|
||||||
|
|
||||||
|
result = [author["name"]]
|
||||||
|
if email := author.get("email"):
|
||||||
|
result.append(f"<{email}>")
|
||||||
|
if url := author.get("url"):
|
||||||
|
result.append(f"({url})")
|
||||||
|
return " ".join(result)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def parse(cls, path: pathlib.Path, /):
|
||||||
|
with path.open("rb") as file:
|
||||||
|
data = json.load(file)
|
||||||
|
|
||||||
|
licenses = list(path.parent.glob("LICENSE*"))
|
||||||
|
if len(licenses) != 1:
|
||||||
|
msg = "could not find appropriate license"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
return cls(
|
||||||
|
name=data["name"],
|
||||||
|
version=data["version"],
|
||||||
|
author=cls._parse_author(data["author"]),
|
||||||
|
description=data["description"],
|
||||||
|
repository=data["repository"]["url"],
|
||||||
|
license=data["license"],
|
||||||
|
license_text=licenses[0].read_text(encoding="utf-8"),
|
||||||
|
)
|
||||||
|
|
||||||
|
def _license_comment(self, /):
|
||||||
|
for name in (
|
||||||
|
"name",
|
||||||
|
"description",
|
||||||
|
"version",
|
||||||
|
"author",
|
||||||
|
"repository",
|
||||||
|
"license",
|
||||||
|
"license_text",
|
||||||
|
):
|
||||||
|
if name == "license_text":
|
||||||
|
yield "\n"
|
||||||
|
else:
|
||||||
|
yield name.capitalize()
|
||||||
|
yield ": "
|
||||||
|
yield getattr(self, name)
|
||||||
|
yield "\n"
|
||||||
|
|
||||||
|
def license_comment(self, /):
|
||||||
|
return "".join(self._license_comment())
|
||||||
|
|
||||||
|
|
||||||
|
def license_comment(data: str):
|
||||||
|
return "/*!\n * " + "\n * ".join(data.splitlines()) + "\n */"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
run()
|
||||||
|
except RuntimeError as error:
|
||||||
|
print("ERROR:", error.args[0], file=sys.stderr)
|
||||||
|
sys.exit(128)
|
||||||
|
|||||||
1387
package-lock.json
generated
Normal file
1387
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@@ -1,23 +1,26 @@
|
|||||||
{
|
{
|
||||||
"name": "ejs",
|
"name": "ejs",
|
||||||
|
"homepage": "https://github.com/yt-dlp/ejs",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bundle": "rollup -c",
|
"bundle": "python hatch_build.py",
|
||||||
"fmt": "prettier --write \"src/**.ts\" \"package.json\" \"rollup.config.js\" \"run.ts\""
|
"esbuild": "esbuild",
|
||||||
|
"fmt": "oxfmt",
|
||||||
|
"fmt:check": "oxfmt --check",
|
||||||
|
"lint": "oxlint --fix",
|
||||||
|
"lint:check": "oxlint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astring": "1.9.0",
|
"astring": "1.9.0",
|
||||||
"meriyah": "6.1.4"
|
"meriyah": "6.1.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-node-resolve": "16.0.3",
|
"@types/bun": "1.3.14",
|
||||||
"@rollup/plugin-sucrase": "5.0.2",
|
"@types/deno": "2.7.0",
|
||||||
"@rollup/plugin-terser": "0.4.4",
|
"@types/node": "25.9.3",
|
||||||
"rollup-plugin-license": "3.6.0",
|
"esbuild": "0.28.1",
|
||||||
"@types/bun": "1.3.0",
|
"globals": "17.6.0",
|
||||||
"@types/deno": "2.5.0",
|
"oxfmt": "^0.54.0",
|
||||||
"@types/node": "24.8.1",
|
"oxlint": "^1.69.0"
|
||||||
"rollup": "4.52.5",
|
|
||||||
"prettier": "3.6.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
795
pnpm-lock.yaml
generated
Normal file
795
pnpm-lock.yaml
generated
Normal file
@@ -0,0 +1,795 @@
|
|||||||
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
dependencies:
|
||||||
|
astring:
|
||||||
|
specifier: 1.9.0
|
||||||
|
version: 1.9.0
|
||||||
|
meriyah:
|
||||||
|
specifier: 6.1.4
|
||||||
|
version: 6.1.4
|
||||||
|
devDependencies:
|
||||||
|
'@types/bun':
|
||||||
|
specifier: 1.3.14
|
||||||
|
version: 1.3.14
|
||||||
|
'@types/deno':
|
||||||
|
specifier: 2.7.0
|
||||||
|
version: 2.7.0
|
||||||
|
'@types/node':
|
||||||
|
specifier: 25.9.3
|
||||||
|
version: 25.9.3
|
||||||
|
esbuild:
|
||||||
|
specifier: 0.28.1
|
||||||
|
version: 0.28.1
|
||||||
|
globals:
|
||||||
|
specifier: 17.6.0
|
||||||
|
version: 17.6.0
|
||||||
|
oxfmt:
|
||||||
|
specifier: ^0.54.0
|
||||||
|
version: 0.54.0
|
||||||
|
oxlint:
|
||||||
|
specifier: ^1.69.0
|
||||||
|
version: 1.69.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
'@esbuild/aix-ppc64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [ppc64]
|
||||||
|
os: [aix]
|
||||||
|
|
||||||
|
'@esbuild/android-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@esbuild/android-arm@0.28.1':
|
||||||
|
resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@esbuild/android-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@esbuild/darwin-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@esbuild/darwin-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@esbuild/freebsd-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [freebsd]
|
||||||
|
|
||||||
|
'@esbuild/freebsd-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [freebsd]
|
||||||
|
|
||||||
|
'@esbuild/linux-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-arm@0.28.1':
|
||||||
|
resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-ia32@0.28.1':
|
||||||
|
resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-loong64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [loong64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-mips64el@0.28.1':
|
||||||
|
resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [mips64el]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-ppc64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [ppc64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-riscv64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-s390x@0.28.1':
|
||||||
|
resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [s390x]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/linux-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@esbuild/netbsd-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [netbsd]
|
||||||
|
|
||||||
|
'@esbuild/netbsd-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [netbsd]
|
||||||
|
|
||||||
|
'@esbuild/openbsd-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [openbsd]
|
||||||
|
|
||||||
|
'@esbuild/openbsd-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [openbsd]
|
||||||
|
|
||||||
|
'@esbuild/openharmony-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [openharmony]
|
||||||
|
|
||||||
|
'@esbuild/sunos-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [sunos]
|
||||||
|
|
||||||
|
'@esbuild/win32-arm64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@esbuild/win32-ia32@0.28.1':
|
||||||
|
resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@esbuild/win32-x64@0.28.1':
|
||||||
|
resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxfmt/binding-android-arm-eabi@0.54.0':
|
||||||
|
resolution: {integrity: sha512-NAtpl/SiaeU103e7/OmZw0MvUnsUUopW7hEm/ecegJg7YM0skQaA0IXEZoyTV6NUdiNPupdIUreRqUZTShbn/g==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@oxfmt/binding-android-arm64@0.54.0':
|
||||||
|
resolution: {integrity: sha512-B4VZfBUlKK1rmMChsssNZbkZjE8+FzG3avMjGgMDwbGxXRoXkoeXiAZ+78Oa+eyDPHvDCiUb4zH/vmCOUSafLQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@oxfmt/binding-darwin-arm64@0.54.0':
|
||||||
|
resolution: {integrity: sha512-i02vF75b+ePsQP3tHqSxVYI5S6b8X/xqdPu7/mDHXtpgXLTYXi3jJmfHU0j+dnZZDKaYTx/ioCK7QYJmtiJR2g==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@oxfmt/binding-darwin-x64@0.54.0':
|
||||||
|
resolution: {integrity: sha512-8VMFvGvooXj7mswkbrhdVZ2/sgiDaBzWpkkbtO+qGDLV4EfJd67nQadHkQC0ZNbaWA9ajXfqI6i7PZLIeDzxEQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@oxfmt/binding-freebsd-x64@0.54.0':
|
||||||
|
resolution: {integrity: sha512-0cRHnp43WN1Jrc5s0BdbdKgR1XirdvHy7TAFi3JEsoEVQVJxTXMbpVd76sxXlgRswNMDhVFSJw+y7Eb8mEavFQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [freebsd]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm-gnueabihf@0.54.0':
|
||||||
|
resolution: {integrity: sha512-JyQAk3hK/OEtup7Rw6kZwfdzbKqTVD5jXXb8Xpfay29suwZyfBDMVW/bj4RqEPySYWc6zCp198pOluf8n5uYzg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm-musleabihf@0.54.0':
|
||||||
|
resolution: {integrity: sha512-qnvLatTpM8vtvjOfcckBOzJjk+n6ce/wwpP8OFeUrD5aNLYcKyWAitwj+Rk3PK9jGanbZvKsJnv14JGQ6XqFdw==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm64-gnu@0.54.0':
|
||||||
|
resolution: {integrity: sha512-SMkhnCzIYZYDk9vw3W/80eeYKmrMpGF0Giuxt4HruFlCH7jEtnPeb3SdQKMfgYi/dgtaf+hZAb5XWPYnxqCQ3w==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm64-musl@0.54.0':
|
||||||
|
resolution: {integrity: sha512-QrwJlBFFKnxOd95TAaszpMbZBLzMoYMpGaQTZF8oibacnF5rv8l12IhILhQRPmksWiBqg0YSe2Mnl7ayeJAHSA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-ppc64-gnu@0.54.0':
|
||||||
|
resolution: {integrity: sha512-WILatiol/TUHTlhod7R09+7Az/XlhKwmY1MHfLZNmewltPWNN/EwxP2rQSHahibZ/cB8gmckEBjBOByD+5bYsQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [ppc64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-riscv64-gnu@0.54.0':
|
||||||
|
resolution: {integrity: sha512-f05YMG4BH4G8S4ME6UM6fi1MnJ9094mrnvO5Pa4SJlMfWlUM+1/ZWMEF4NnjM7shZAvbHsHRuVYpUo0PHC4P9Q==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-riscv64-musl@0.54.0':
|
||||||
|
resolution: {integrity: sha512-UfL+2hj1ClNqcCRT9s8vBU4axDpjxgVxX96G+9DYAYjoc5b0u15CJtn2jgsi9iM+EbGNc5CW1HVRgwVu76UsSA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-s390x-gnu@0.54.0':
|
||||||
|
resolution: {integrity: sha512-3/XZe931Hka+J6NjnaqJzYpsWWxDTuRdUdwSQHnOuJEgbC+SehIMFJS8hsEjV7LBhVSL2OCnRLvbVW8O97XIyw==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [s390x]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-x64-gnu@0.54.0':
|
||||||
|
resolution: {integrity: sha512-Ik93RlObtu43GbxApafayFjwYE06L6Xr08cSwpBPYbDrLp2ReZx0Jm1DqwRyYRnukUJy+rK2WaEvUQOxdytU9Q==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-x64-musl@0.54.0':
|
||||||
|
resolution: {integrity: sha512-yZcakmPlD86CNymknd7KfW+FH+qfbqJH+i0h69CYfV1+KMoVeM9UED+8+TDVoU4haxI0NxY7RPCvRLy3Sqd2Qg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxfmt/binding-openharmony-arm64@0.54.0':
|
||||||
|
resolution: {integrity: sha512-GiVBZNnEZnKu00f1jTg49nomv187d0GQX+O+ocykoLeiaALuEO+swoTehHn9TehTfi7V8H0i0e/yvUjCqnwk1w==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [openharmony]
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-arm64-msvc@0.54.0':
|
||||||
|
resolution: {integrity: sha512-J0SSB8Z1Fre2sxRolYcW6Rl1RQmKdQ2hnHyq4YJrfBRiXTObLw4DXnIVraM/UyqGqwOi7yTrQA4VT7DPxlHVKA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-ia32-msvc@0.54.0':
|
||||||
|
resolution: {integrity: sha512-O61UDVj8zz6yXJjkHPf05VaMLOXmEF8P5kf/N0W7AQMmd6bcQogl+KJc7rMutKTL524oE9iH32JXZClBFmEQIg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-x64-msvc@0.54.0':
|
||||||
|
resolution: {integrity: sha512-1MDpqJPiFqxWtIHas8vkb1VZ7f7eKyTffAwmO8isxQYMaG1OFKsH666BWLeXQLO+IWNfiMssLD55hbR1lIPTqg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxlint/binding-android-arm-eabi@1.69.0':
|
||||||
|
resolution: {integrity: sha512-DKQQbD5cZ/MYfDgDI7YGyGD9FSxABlsBsYFo5p26lloob543tP9+4N3guwdXIYJN+7HSZxLe8YJuwcOWw5qnHg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@oxlint/binding-android-arm64@1.69.0':
|
||||||
|
resolution: {integrity: sha512-lEhb+I5pr4inux+JFwfCa1HRq3Os7NirEFQ0H1I35SVEHPm6byX0Ah47xmRha3qi6LAkxUcxViL8o/9PivjzBg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [android]
|
||||||
|
|
||||||
|
'@oxlint/binding-darwin-arm64@1.69.0':
|
||||||
|
resolution: {integrity: sha512-GY2YE8lOZW59BW1Ia1y+1gR0XyjrZRvVWHAr8LGeGhYHE0OQJ/7cRKXTkx1P+E9/6awEc3SX8a68SFTjh/E//A==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@oxlint/binding-darwin-x64@1.69.0':
|
||||||
|
resolution: {integrity: sha512-ax1oZnOjHX3LB7myQyHEaQkDwfLb6str3/nSP6O7EVUviQGNkEGzGV0EqcBJWK+Ufwx0l4xPgyYayurvhAdl2Q==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [darwin]
|
||||||
|
|
||||||
|
'@oxlint/binding-freebsd-x64@1.69.0':
|
||||||
|
resolution: {integrity: sha512-kHWeHv4g2h8NY+mpCxzCtY4uerMJWTN/TSnNj1CPbakFpHEJ6cTya2wWV0pDSYWOJ2+0UiEbhn3AtXxHtsnKjg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [freebsd]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm-gnueabihf@1.69.0':
|
||||||
|
resolution: {integrity: sha512-gq84vM1a1oEehXo27YCDzGVcxPsZDI1yswZwz2Da1/cbnWtrL16XZZnz0G/+gIU8edtHpfjxq5c+vWEHqJfWoQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm-musleabihf@1.69.0':
|
||||||
|
resolution: {integrity: sha512-kIqEa98JQ0VRyrcncxA417m2AzasqTlD+FyVT1AksjvjkqQcvm7pBWYvoW3/mpyOP2XYvi5nSCCTIe6De1yu5g==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm64-gnu@1.69.0':
|
||||||
|
resolution: {integrity: sha512-j+xYiXozxGWx2cpjCrwwGR4awTxPFsRv3JZrv23RCogEPMc4R7UqjHW47p/RG0aRlbWiROCJ8coUfCwy0dvzHA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm64-musl@1.69.0':
|
||||||
|
resolution: {integrity: sha512-xEPpNppTfN1l/nM7gYSf9iocscu/as+p/7vxkLeLEKnYU+09Dm+5V6IhDYDh+Uz6FajEupWwCLt5SOG0y1PCKg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-ppc64-gnu@1.69.0':
|
||||||
|
resolution: {integrity: sha512-Ug0+eU7HJBlek+SjklYH62IlOMirEJsdxpihH0kSqX0XdrDD4NdHpQc10fK1JC35yn6KrrcN+uYzlHD38XAf8Q==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [ppc64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-riscv64-gnu@1.69.0':
|
||||||
|
resolution: {integrity: sha512-iEyI3GIg0l/s3G4qy2TlaaWKdzj4PJJStwtlocpDTC00PY9hZueotf6OKUj9+yfQh0lrpBW/pLMgTztbAHKJEg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-riscv64-musl@1.69.0':
|
||||||
|
resolution: {integrity: sha512-NjHjpiI4WIKSMwuoJSZi5VToPeoYOS1FR52HLIDG6lidMdqquusgtODb4iLk0+lb1q3Z0nv2/aPRcC/olmpQGg==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-s390x-gnu@1.69.0':
|
||||||
|
resolution: {integrity: sha512-Ai/prDewoItkDXbp38gwGZi41DycZbUTZJ3UidwoHgQC0/DaqC2TGdtBTQLJ6hSD+SAxASzh8+/eSBPmxfOacA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [s390x]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-x64-gnu@1.69.0':
|
||||||
|
resolution: {integrity: sha512-Gt3KHgp46mRKz4sJeaASmKvD8ayXookRw07RMf+NowhEztGGDZ7VrXpoW96XuKJLjFukWizOFVNjmYb/u7caNQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-x64-musl@1.69.0':
|
||||||
|
resolution: {integrity: sha512-7tQhJ2+p/oHv1zcfnjYI7YVzC/7iBaVOfIvFYtxdJ5F45mWgEdrCyXZXZGfiLey5t/5JhOhsaMnnv1kAzckd7g==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
|
'@oxlint/binding-openharmony-arm64@1.69.0':
|
||||||
|
resolution: {integrity: sha512-vmWz6TKp/3hfA4lksR0zHBv/6xuX1jhym6eqOjdH2DXsDDHZWcp2f0KG0VCAnlVbIrjk29G4wAWMXb/Hn1YobA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [openharmony]
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-arm64-msvc@1.69.0':
|
||||||
|
resolution: {integrity: sha512-9RExaLgmaw6IoIkU9cTpT71mLfI0xZ86iZH8x518LVsOkjquJMYqb9P7KpC8lgd1t0Dxs41p2pxynq4XR3Ttzw==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-ia32-msvc@1.69.0':
|
||||||
|
resolution: {integrity: sha512-1907kRPF8/PrcIw1E7LMs9JbVrpgnt/MvFdss3an8oDkYNAACXzTntV3t3869ZZhMZxb2AzRGbz1pA/jdFatXA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-x64-msvc@1.69.0':
|
||||||
|
resolution: {integrity: sha512-w8SOXv3mT9Fi6jY8OXdXCfnvX/3KNLXGNr4HEz2TA7S4Mv/PYAOmpB8y/ge40mxvBMgGNaSaaDwZpAsQn7HtWA==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [win32]
|
||||||
|
|
||||||
|
'@types/bun@1.3.14':
|
||||||
|
resolution: {integrity: sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw==}
|
||||||
|
|
||||||
|
'@types/deno@2.7.0':
|
||||||
|
resolution: {integrity: sha512-Y6fWcV8KpYeO3Lik/RiYnUxtr/LWqoeACciU0CA+dr1U/45tGgaX3HWQQAPCNN53raN4Rr4Fht4y6qsUH57fDA==}
|
||||||
|
|
||||||
|
'@types/node@25.9.3':
|
||||||
|
resolution: {integrity: sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==}
|
||||||
|
|
||||||
|
astring@1.9.0:
|
||||||
|
resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
bun-types@1.3.14:
|
||||||
|
resolution: {integrity: sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ==}
|
||||||
|
|
||||||
|
esbuild@0.28.1:
|
||||||
|
resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
globals@17.6.0:
|
||||||
|
resolution: {integrity: sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
meriyah@6.1.4:
|
||||||
|
resolution: {integrity: sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ==}
|
||||||
|
engines: {node: '>=18.0.0'}
|
||||||
|
|
||||||
|
oxfmt@0.54.0:
|
||||||
|
resolution: {integrity: sha512-DjnMwn7smSLF+Mc2+pRItnuPftm/dkUFpY/d4+33y9TfKrsHZo8GLhmUg9BrOIUEy94Rlom1Q11N6vuhE+e0oQ==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
hasBin: true
|
||||||
|
peerDependencies:
|
||||||
|
svelte: ^5.0.0
|
||||||
|
vite-plus: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
svelte:
|
||||||
|
optional: true
|
||||||
|
vite-plus:
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
oxlint@1.69.0:
|
||||||
|
resolution: {integrity: sha512-ypZkK/aDc5NQV8zIR6s2H2Tl3aNW8FmJ1m9+2qsaYuRenl8vgnHNCGwTHviWJdUQzglOlHFchgopdtGhSy17Rw==}
|
||||||
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
|
hasBin: true
|
||||||
|
peerDependencies:
|
||||||
|
oxlint-tsgolint: '>=0.22.1'
|
||||||
|
vite-plus: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
oxlint-tsgolint:
|
||||||
|
optional: true
|
||||||
|
vite-plus:
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
tinypool@2.1.0:
|
||||||
|
resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==}
|
||||||
|
engines: {node: ^20.0.0 || >=22.0.0}
|
||||||
|
|
||||||
|
undici-types@7.24.6:
|
||||||
|
resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==}
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
|
||||||
|
'@esbuild/aix-ppc64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/android-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/android-arm@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/android-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/darwin-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/darwin-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/freebsd-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/freebsd-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-arm@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-ia32@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-loong64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-mips64el@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-ppc64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-riscv64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-s390x@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/linux-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/netbsd-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/netbsd-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/openbsd-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/openbsd-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/openharmony-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/sunos-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/win32-arm64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/win32-ia32@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@esbuild/win32-x64@0.28.1':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-android-arm-eabi@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-android-arm64@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-darwin-arm64@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-darwin-x64@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-freebsd-x64@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm-gnueabihf@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm-musleabihf@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm64-gnu@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-arm64-musl@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-ppc64-gnu@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-riscv64-gnu@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-riscv64-musl@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-s390x-gnu@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-x64-gnu@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-linux-x64-musl@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-openharmony-arm64@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-arm64-msvc@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-ia32-msvc@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxfmt/binding-win32-x64-msvc@0.54.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-android-arm-eabi@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-android-arm64@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-darwin-arm64@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-darwin-x64@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-freebsd-x64@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm-gnueabihf@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm-musleabihf@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm64-gnu@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-arm64-musl@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-ppc64-gnu@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-riscv64-gnu@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-riscv64-musl@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-s390x-gnu@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-x64-gnu@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-linux-x64-musl@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-openharmony-arm64@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-arm64-msvc@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-ia32-msvc@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@oxlint/binding-win32-x64-msvc@1.69.0':
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
'@types/bun@1.3.14':
|
||||||
|
dependencies:
|
||||||
|
bun-types: 1.3.14
|
||||||
|
|
||||||
|
'@types/deno@2.7.0': {}
|
||||||
|
|
||||||
|
'@types/node@25.9.3':
|
||||||
|
dependencies:
|
||||||
|
undici-types: 7.24.6
|
||||||
|
|
||||||
|
astring@1.9.0: {}
|
||||||
|
|
||||||
|
bun-types@1.3.14:
|
||||||
|
dependencies:
|
||||||
|
'@types/node': 25.9.3
|
||||||
|
|
||||||
|
esbuild@0.28.1:
|
||||||
|
optionalDependencies:
|
||||||
|
'@esbuild/aix-ppc64': 0.28.1
|
||||||
|
'@esbuild/android-arm': 0.28.1
|
||||||
|
'@esbuild/android-arm64': 0.28.1
|
||||||
|
'@esbuild/android-x64': 0.28.1
|
||||||
|
'@esbuild/darwin-arm64': 0.28.1
|
||||||
|
'@esbuild/darwin-x64': 0.28.1
|
||||||
|
'@esbuild/freebsd-arm64': 0.28.1
|
||||||
|
'@esbuild/freebsd-x64': 0.28.1
|
||||||
|
'@esbuild/linux-arm': 0.28.1
|
||||||
|
'@esbuild/linux-arm64': 0.28.1
|
||||||
|
'@esbuild/linux-ia32': 0.28.1
|
||||||
|
'@esbuild/linux-loong64': 0.28.1
|
||||||
|
'@esbuild/linux-mips64el': 0.28.1
|
||||||
|
'@esbuild/linux-ppc64': 0.28.1
|
||||||
|
'@esbuild/linux-riscv64': 0.28.1
|
||||||
|
'@esbuild/linux-s390x': 0.28.1
|
||||||
|
'@esbuild/linux-x64': 0.28.1
|
||||||
|
'@esbuild/netbsd-arm64': 0.28.1
|
||||||
|
'@esbuild/netbsd-x64': 0.28.1
|
||||||
|
'@esbuild/openbsd-arm64': 0.28.1
|
||||||
|
'@esbuild/openbsd-x64': 0.28.1
|
||||||
|
'@esbuild/openharmony-arm64': 0.28.1
|
||||||
|
'@esbuild/sunos-x64': 0.28.1
|
||||||
|
'@esbuild/win32-arm64': 0.28.1
|
||||||
|
'@esbuild/win32-ia32': 0.28.1
|
||||||
|
'@esbuild/win32-x64': 0.28.1
|
||||||
|
|
||||||
|
globals@17.6.0: {}
|
||||||
|
|
||||||
|
meriyah@6.1.4: {}
|
||||||
|
|
||||||
|
oxfmt@0.54.0:
|
||||||
|
dependencies:
|
||||||
|
tinypool: 2.1.0
|
||||||
|
optionalDependencies:
|
||||||
|
'@oxfmt/binding-android-arm-eabi': 0.54.0
|
||||||
|
'@oxfmt/binding-android-arm64': 0.54.0
|
||||||
|
'@oxfmt/binding-darwin-arm64': 0.54.0
|
||||||
|
'@oxfmt/binding-darwin-x64': 0.54.0
|
||||||
|
'@oxfmt/binding-freebsd-x64': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-arm-gnueabihf': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-arm-musleabihf': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-arm64-gnu': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-arm64-musl': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-ppc64-gnu': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-riscv64-gnu': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-riscv64-musl': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-s390x-gnu': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-x64-gnu': 0.54.0
|
||||||
|
'@oxfmt/binding-linux-x64-musl': 0.54.0
|
||||||
|
'@oxfmt/binding-openharmony-arm64': 0.54.0
|
||||||
|
'@oxfmt/binding-win32-arm64-msvc': 0.54.0
|
||||||
|
'@oxfmt/binding-win32-ia32-msvc': 0.54.0
|
||||||
|
'@oxfmt/binding-win32-x64-msvc': 0.54.0
|
||||||
|
|
||||||
|
oxlint@1.69.0:
|
||||||
|
optionalDependencies:
|
||||||
|
'@oxlint/binding-android-arm-eabi': 1.69.0
|
||||||
|
'@oxlint/binding-android-arm64': 1.69.0
|
||||||
|
'@oxlint/binding-darwin-arm64': 1.69.0
|
||||||
|
'@oxlint/binding-darwin-x64': 1.69.0
|
||||||
|
'@oxlint/binding-freebsd-x64': 1.69.0
|
||||||
|
'@oxlint/binding-linux-arm-gnueabihf': 1.69.0
|
||||||
|
'@oxlint/binding-linux-arm-musleabihf': 1.69.0
|
||||||
|
'@oxlint/binding-linux-arm64-gnu': 1.69.0
|
||||||
|
'@oxlint/binding-linux-arm64-musl': 1.69.0
|
||||||
|
'@oxlint/binding-linux-ppc64-gnu': 1.69.0
|
||||||
|
'@oxlint/binding-linux-riscv64-gnu': 1.69.0
|
||||||
|
'@oxlint/binding-linux-riscv64-musl': 1.69.0
|
||||||
|
'@oxlint/binding-linux-s390x-gnu': 1.69.0
|
||||||
|
'@oxlint/binding-linux-x64-gnu': 1.69.0
|
||||||
|
'@oxlint/binding-linux-x64-musl': 1.69.0
|
||||||
|
'@oxlint/binding-openharmony-arm64': 1.69.0
|
||||||
|
'@oxlint/binding-win32-arm64-msvc': 1.69.0
|
||||||
|
'@oxlint/binding-win32-ia32-msvc': 1.69.0
|
||||||
|
'@oxlint/binding-win32-x64-msvc': 1.69.0
|
||||||
|
|
||||||
|
tinypool@2.1.0: {}
|
||||||
|
|
||||||
|
undici-types@7.24.6: {}
|
||||||
4
pnpm-workspace.yaml
Normal file
4
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
allowBuilds:
|
||||||
|
esbuild: true
|
||||||
|
|
||||||
|
minimumReleaseAge: 10080
|
||||||
@@ -30,6 +30,11 @@ classifiers = [
|
|||||||
]
|
]
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = [
|
||||||
|
"ruff>=0.14.1",
|
||||||
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Documentation = "https://github.com/yt-dlp/ejs#readme"
|
Documentation = "https://github.com/yt-dlp/ejs#readme"
|
||||||
Issues = "https://github.com/yt-dlp/ejs/issues"
|
Issues = "https://github.com/yt-dlp/ejs/issues"
|
||||||
@@ -42,9 +47,43 @@ source = "vcs"
|
|||||||
exclude = [
|
exclude = [
|
||||||
"/.github/**",
|
"/.github/**",
|
||||||
"/src/yt/solver/test/players/*",
|
"/src/yt/solver/test/players/*",
|
||||||
|
"!/src/yt/solver/test/players/.gitignore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
packages = ["yt_dlp_ejs"]
|
||||||
|
|
||||||
[tool.hatch.build.hooks.vcs]
|
[tool.hatch.build.hooks.vcs]
|
||||||
version-file = "yt_dlp_ejs/_version.py"
|
version-file = "yt_dlp_ejs/_version.py"
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel.hooks.custom]
|
[tool.hatch.build.targets.wheel.hooks.custom]
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
select = [
|
||||||
|
"C4",
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"I",
|
||||||
|
"PLC",
|
||||||
|
"PLE",
|
||||||
|
"PLW",
|
||||||
|
"PYI",
|
||||||
|
"RET",
|
||||||
|
"RUF",
|
||||||
|
"SIM",
|
||||||
|
"TD",
|
||||||
|
"TID",
|
||||||
|
"W",
|
||||||
|
]
|
||||||
|
ignore = [
|
||||||
|
"TD003",
|
||||||
|
"E402",
|
||||||
|
"E501",
|
||||||
|
"PLR09",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.ruff.lint.isort]
|
||||||
|
force-single-line = true
|
||||||
|
|
||||||
|
[tool.ruff.lint.flake8-tidy-imports]
|
||||||
|
ban-relative-imports = "all"
|
||||||
|
|||||||
248
rollup.config.js
248
rollup.config.js
@@ -1,248 +0,0 @@
|
|||||||
import { defineConfig } from "rollup";
|
|
||||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
||||||
import sucrase from "@rollup/plugin-sucrase";
|
|
||||||
import terser from "@rollup/plugin-terser";
|
|
||||||
import { createHash } from "node:crypto";
|
|
||||||
import license from "rollup-plugin-license";
|
|
||||||
import { readFileSync } from "node:fs";
|
|
||||||
import prettier from "prettier";
|
|
||||||
|
|
||||||
const pkg = JSON.parse(readFileSync("./package.json"));
|
|
||||||
|
|
||||||
const LICENSE_BANNER =
|
|
||||||
"SPDX-License-Identifier: Unlicense\n" +
|
|
||||||
"This file was automatically generated by https://github.com/yt-dlp/ejs" +
|
|
||||||
"<% if (dependencies && dependencies.length) { %>" +
|
|
||||||
"\n\nBundled Dependencies:" +
|
|
||||||
"<% _.forEach(dependencies, function (dependency) { if (!dependency.private) { %>" +
|
|
||||||
"\n\n---\nName: <%= dependency.name %>" +
|
|
||||||
"<% if (dependency.version) { %>\nVersion: <%= dependency.version %><% } %>" +
|
|
||||||
"\nLicense: <%= dependency.license %>" +
|
|
||||||
"<% if (dependency.repository && dependency.repository.url) { %>\nRepository: <%= dependency.repository.url %><% } %>" +
|
|
||||||
"<% if (dependency.homepage && dependency.homepage.url) { %>\nHomepage: <%= dependency.homepage.url %><% } %>" +
|
|
||||||
"<% if (dependency.author) { %>\nAuthor: <%= dependency.author.text() %><% } %>" +
|
|
||||||
"<% if (dependency.licenseText) { %>\n\n<%= dependency.licenseText %><% } %>" +
|
|
||||||
"\n---<% } }) %>\n<% } %>";
|
|
||||||
|
|
||||||
function printHash() {
|
|
||||||
return {
|
|
||||||
name: "hash-output-plugin",
|
|
||||||
writeBundle(_options, bundle) {
|
|
||||||
for (const [fileName, assetInfo] of Object.entries(bundle)) {
|
|
||||||
if (assetInfo.code) {
|
|
||||||
try {
|
|
||||||
const digest = createHash("sha3-512").update(assetInfo.code).digest("hex");
|
|
||||||
console.log(`SHA3-512 for ${assetInfo.fileName}: ${digest}`);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error hashing ${fileName}:`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function dynamicImportRewrite({ format = "deno" } = {}) {
|
|
||||||
return {
|
|
||||||
name: "dynamic-import-rewrite-plugin",
|
|
||||||
resolveId(source) {
|
|
||||||
if (pkg.dependencies[source]) {
|
|
||||||
if (format === "deno") {
|
|
||||||
return {
|
|
||||||
id: `npm:${source}@${pkg.dependencies[source]}`,
|
|
||||||
external: true,
|
|
||||||
};
|
|
||||||
} else if (format === "bun") {
|
|
||||||
return {
|
|
||||||
id: `${source}@${pkg.dependencies[source]}`,
|
|
||||||
external: true,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
renderDynamicImport() {
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function prettifyOutput() {
|
|
||||||
return {
|
|
||||||
name: "prettify-output",
|
|
||||||
renderChunk(code) {
|
|
||||||
return prettier.format(code, { parser: "babel", singleQuote: true });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineConfig([
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/main.ts",
|
|
||||||
output: {
|
|
||||||
name: "jsc",
|
|
||||||
globals: {
|
|
||||||
astring: "astring",
|
|
||||||
input: "input",
|
|
||||||
meriyah: "meriyah",
|
|
||||||
},
|
|
||||||
file: "dist/yt.solver.core.js",
|
|
||||||
format: "iife",
|
|
||||||
},
|
|
||||||
external: ["astring", "meriyah"],
|
|
||||||
plugins: [
|
|
||||||
nodeResolve(),
|
|
||||||
sucrase({
|
|
||||||
exclude: ["node_modules/**"],
|
|
||||||
transforms: ["typescript"],
|
|
||||||
}),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// Use terser to remove comments but do not minify
|
|
||||||
terser({
|
|
||||||
compress: false,
|
|
||||||
mangle: false,
|
|
||||||
}),
|
|
||||||
prettifyOutput(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/main.ts",
|
|
||||||
output: {
|
|
||||||
name: "jsc",
|
|
||||||
globals: {
|
|
||||||
astring: "astring",
|
|
||||||
input: "input",
|
|
||||||
meriyah: "meriyah",
|
|
||||||
},
|
|
||||||
file: "dist/yt.solver.core.min.js",
|
|
||||||
compact: true,
|
|
||||||
format: "iife",
|
|
||||||
minifyInternalExports: true,
|
|
||||||
},
|
|
||||||
external: ["astring", "meriyah"],
|
|
||||||
plugins: [
|
|
||||||
nodeResolve(),
|
|
||||||
sucrase({
|
|
||||||
exclude: ["node_modules/**"],
|
|
||||||
transforms: ["typescript"],
|
|
||||||
}),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
terser(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/lib.ts",
|
|
||||||
output: {
|
|
||||||
name: "lib",
|
|
||||||
file: "dist/yt.solver.lib.js",
|
|
||||||
format: "iife",
|
|
||||||
exports: "named",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
nodeResolve(),
|
|
||||||
sucrase({
|
|
||||||
exclude: ["node_modules/**"],
|
|
||||||
transforms: ["typescript"],
|
|
||||||
}),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// Use terser to remove comments but do not minify
|
|
||||||
terser({
|
|
||||||
compress: false,
|
|
||||||
mangle: false,
|
|
||||||
}),
|
|
||||||
prettifyOutput(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/lib.ts",
|
|
||||||
output: {
|
|
||||||
name: "lib",
|
|
||||||
file: "dist/yt.solver.lib.min.js",
|
|
||||||
compact: true,
|
|
||||||
format: "iife",
|
|
||||||
minifyInternalExports: true,
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
nodeResolve(),
|
|
||||||
sucrase({
|
|
||||||
exclude: ["node_modules/**"],
|
|
||||||
transforms: ["typescript"],
|
|
||||||
}),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
terser(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/dynamic.lib.ts",
|
|
||||||
output: {
|
|
||||||
name: "lib",
|
|
||||||
file: "dist/yt.solver.deno.lib.js",
|
|
||||||
format: "es",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
dynamicImportRewrite(),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// Use terser to remove comments but do not minify
|
|
||||||
terser({
|
|
||||||
compress: false,
|
|
||||||
mangle: false,
|
|
||||||
}),
|
|
||||||
prettifyOutput(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: "src/yt/solver/dynamic.lib.ts",
|
|
||||||
output: {
|
|
||||||
name: "lib",
|
|
||||||
file: "dist/yt.solver.bun.lib.js",
|
|
||||||
format: "es",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
dynamicImportRewrite({ format: "bun" }),
|
|
||||||
license({
|
|
||||||
banner: {
|
|
||||||
commentStyle: "ignored",
|
|
||||||
content: LICENSE_BANNER,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// Use terser to remove comments but do not minify
|
|
||||||
terser({
|
|
||||||
compress: false,
|
|
||||||
mangle: false,
|
|
||||||
}),
|
|
||||||
prettifyOutput(),
|
|
||||||
printHash(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
6
run.ts
6
run.ts
@@ -1,5 +1,5 @@
|
|||||||
import { argv, exit } from "node:process";
|
|
||||||
import { readFileSync } from "node:fs";
|
import { readFileSync } from "node:fs";
|
||||||
|
import { argv, exit } from "node:process";
|
||||||
|
|
||||||
import { isOneOf } from "./src/utils.ts";
|
import { isOneOf } from "./src/utils.ts";
|
||||||
import main from "./src/yt/solver/main.ts";
|
import main from "./src/yt/solver/main.ts";
|
||||||
@@ -7,9 +7,7 @@ import main from "./src/yt/solver/main.ts";
|
|||||||
const args = argv.slice(2);
|
const args = argv.slice(2);
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
console.error(
|
console.error(
|
||||||
`ERROR: Missing argument\nusage: ${
|
`ERROR: Missing argument\nusage: ${argv[1]} <player> [<type>:<request> ...]`,
|
||||||
argv[1]
|
|
||||||
} <player> [<type>:<request> ...]`,
|
|
||||||
);
|
);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
21
src/types.ts
21
src/types.ts
@@ -1,7 +1,16 @@
|
|||||||
export type DeepPartial<T> = T extends object
|
type DP<T> = T extends (infer U)[]
|
||||||
? Or<{
|
? DeepPartial<U>[]
|
||||||
[P in keyof T]?: DeepPartial<T[P]>;
|
: T extends object
|
||||||
}>
|
? { [P in keyof T]?: DeepPartial<T[P]> }
|
||||||
: Or<T>;
|
: T;
|
||||||
|
|
||||||
type Or<T> = T | { or: T[] };
|
type ValueOf<T> = T extends (infer U)[]
|
||||||
|
? U
|
||||||
|
: T extends object
|
||||||
|
? T[keyof T]
|
||||||
|
: never;
|
||||||
|
|
||||||
|
export type DeepPartial<T> =
|
||||||
|
| DP<T>
|
||||||
|
| { or: DP<T>[] }
|
||||||
|
| { anykey: DP<ValueOf<T>>[] };
|
||||||
|
|||||||
17
src/utils.ts
17
src/utils.ts
@@ -1,4 +1,5 @@
|
|||||||
import { type ESTree } from "meriyah";
|
import { parse, type ESTree } from "meriyah";
|
||||||
|
|
||||||
import { type DeepPartial } from "./types.ts";
|
import { type DeepPartial } from "./types.ts";
|
||||||
|
|
||||||
export function matchesStructure<T extends ESTree.Node>(
|
export function matchesStructure<T extends ESTree.Node>(
|
||||||
@@ -22,6 +23,13 @@ export function matchesStructure<T extends ESTree.Node>(
|
|||||||
// Handle `{ or: [a, b] }`
|
// Handle `{ or: [a, b] }`
|
||||||
return structure.or.some((node) => matchesStructure(obj, node));
|
return structure.or.some((node) => matchesStructure(obj, node));
|
||||||
}
|
}
|
||||||
|
if ("anykey" in structure && Array.isArray(structure.anykey)) {
|
||||||
|
// Handle `{ anykey: [a, b] }`
|
||||||
|
const haystack = Array.isArray(obj) ? obj : Object.values(obj);
|
||||||
|
return structure.anykey.every((value) =>
|
||||||
|
haystack.some((el) => matchesStructure(el, value)),
|
||||||
|
);
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(structure)) {
|
for (const [key, value] of Object.entries(structure)) {
|
||||||
if (!matchesStructure(obj[key as keyof typeof obj], value)) {
|
if (!matchesStructure(obj[key as keyof typeof obj], value)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -35,3 +43,10 @@ export function matchesStructure<T extends ESTree.Node>(
|
|||||||
export function isOneOf<T>(value: unknown, ...of: readonly T[]): value is T {
|
export function isOneOf<T>(value: unknown, ...of: readonly T[]): value is T {
|
||||||
return of.includes(value as T);
|
return of.includes(value as T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function generateArrowFunction(
|
||||||
|
data: string,
|
||||||
|
): ESTree.ArrowFunctionExpression {
|
||||||
|
return (parse(data).body[0] as ESTree.ExpressionStatement)
|
||||||
|
.expression as ESTree.ArrowFunctionExpression;
|
||||||
|
}
|
||||||
|
|||||||
26
src/yt/solver/extract.ts
Normal file
26
src/yt/solver/extract.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { argv } from "node:process";
|
||||||
|
|
||||||
|
import { generate } from "astring";
|
||||||
|
import { parse } from "meriyah";
|
||||||
|
|
||||||
|
import { getSolutions, modifyPlayer } from "./solvers.ts";
|
||||||
|
import { getIO } from "./test/io.ts";
|
||||||
|
import { downloadCached } from "./test/utils.ts";
|
||||||
|
|
||||||
|
const data = await (
|
||||||
|
argv.length > 3
|
||||||
|
? () => downloadCached(argv[2], argv[3])
|
||||||
|
: async () => {
|
||||||
|
const io = await getIO();
|
||||||
|
return await io.read(argv[2]);
|
||||||
|
}
|
||||||
|
)();
|
||||||
|
|
||||||
|
const program = parse(data);
|
||||||
|
const statements = modifyPlayer(program);
|
||||||
|
const solutionMap = getSolutions(statements);
|
||||||
|
for (const solutions of Object.values(solutionMap)) {
|
||||||
|
for (const solution of solutions) {
|
||||||
|
console.log(String.raw`${generate(solution)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import { parse } from "meriyah";
|
|
||||||
import { generate } from "astring";
|
import { generate } from "astring";
|
||||||
|
import { parse } from "meriyah";
|
||||||
|
|
||||||
export const meriyah = { parse };
|
export const lib = {
|
||||||
export const astring = { generate };
|
meriyah: { parse },
|
||||||
|
astring: { generate },
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getFromPrepared, preprocessPlayer } from "./solvers.ts";
|
|
||||||
import { isOneOf } from "../../utils.ts";
|
import { isOneOf } from "../../utils.ts";
|
||||||
|
import { getFromPrepared, preprocessPlayer } from "./solvers.ts";
|
||||||
|
|
||||||
export default function main(input: Input): Output {
|
export default function main(input: Input): Output {
|
||||||
const preprocessedPlayer =
|
const preprocessedPlayer =
|
||||||
|
|||||||
@@ -1,141 +0,0 @@
|
|||||||
import { type ESTree } from "meriyah";
|
|
||||||
import { matchesStructure } from "../../utils.ts";
|
|
||||||
import { type DeepPartial } from "../../types.ts";
|
|
||||||
|
|
||||||
const identifier: DeepPartial<ESTree.VariableDeclaration> = {
|
|
||||||
type: "VariableDeclaration",
|
|
||||||
kind: "var",
|
|
||||||
declarations: [
|
|
||||||
{
|
|
||||||
type: "VariableDeclarator",
|
|
||||||
id: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
init: {
|
|
||||||
type: "ArrayExpression",
|
|
||||||
elements: [
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
const catchBlockBody = [
|
|
||||||
{
|
|
||||||
type: "ReturnStatement",
|
|
||||||
argument: {
|
|
||||||
type: "BinaryExpression",
|
|
||||||
left: {
|
|
||||||
type: "MemberExpression",
|
|
||||||
object: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
computed: true,
|
|
||||||
property: {
|
|
||||||
type: "Literal",
|
|
||||||
},
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
right: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
operator: "+",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export function extract(
|
|
||||||
node: ESTree.Node,
|
|
||||||
): ESTree.ArrowFunctionExpression | null {
|
|
||||||
if (!matchesStructure(node, identifier)) {
|
|
||||||
// Fallback search for try { } catch { return X[12] + Y }
|
|
||||||
let name: string | undefined | null = null;
|
|
||||||
let block: ESTree.BlockStatement | null | undefined = null;
|
|
||||||
switch (node.type) {
|
|
||||||
case "ExpressionStatement": {
|
|
||||||
if (
|
|
||||||
node.expression.type === "AssignmentExpression" &&
|
|
||||||
node.expression.left.type === "Identifier" &&
|
|
||||||
node.expression.right.type === "FunctionExpression" &&
|
|
||||||
node.expression.right.params.length === 1
|
|
||||||
) {
|
|
||||||
name = node.expression.left.name;
|
|
||||||
block = node.expression.right.body;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "FunctionDeclaration": {
|
|
||||||
if (node.params.length === 1) {
|
|
||||||
name = node.id?.name;
|
|
||||||
block = node.body;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!block || !name) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const tryNode = block.body.at(-2);
|
|
||||||
if (
|
|
||||||
tryNode?.type !== "TryStatement" ||
|
|
||||||
tryNode.handler?.type !== "CatchClause"
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const catchBody = tryNode.handler!.body.body;
|
|
||||||
if (matchesStructure(catchBody, catchBlockBody)) {
|
|
||||||
return makeSolverFuncFromName(name);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.type !== "VariableDeclaration") {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const declaration = node.declarations[0];
|
|
||||||
if (
|
|
||||||
declaration.type !== "VariableDeclarator" ||
|
|
||||||
!declaration.init ||
|
|
||||||
declaration.init.type !== "ArrayExpression" ||
|
|
||||||
declaration.init.elements.length !== 1
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const [firstElement] = declaration.init.elements;
|
|
||||||
if (!firstElement || firstElement.type !== "Identifier") {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return makeSolverFuncFromName(firstElement.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeSolverFuncFromName(name: string): ESTree.ArrowFunctionExpression {
|
|
||||||
return {
|
|
||||||
type: "ArrowFunctionExpression",
|
|
||||||
params: [
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
name: "n",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
body: {
|
|
||||||
type: "CallExpression",
|
|
||||||
callee: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: name,
|
|
||||||
},
|
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
name: "n",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
async: false,
|
|
||||||
expression: false,
|
|
||||||
generator: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
144
src/yt/solver/nsig.ts
Normal file
144
src/yt/solver/nsig.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import { generate } from "astring";
|
||||||
|
import { type ESTree } from "meriyah";
|
||||||
|
|
||||||
|
import { type DeepPartial } from "../../types.ts";
|
||||||
|
import { matchesStructure, generateArrowFunction } from "../../utils.ts";
|
||||||
|
|
||||||
|
const identifier: DeepPartial<ESTree.Node> = {
|
||||||
|
or: [
|
||||||
|
{
|
||||||
|
type: "ExpressionStatement",
|
||||||
|
expression: {
|
||||||
|
type: "AssignmentExpression",
|
||||||
|
operator: "=",
|
||||||
|
left: {
|
||||||
|
or: [{ type: "Identifier" }, { type: "MemberExpression" }],
|
||||||
|
},
|
||||||
|
right: {
|
||||||
|
type: "FunctionExpression",
|
||||||
|
async: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "FunctionDeclaration",
|
||||||
|
async: false,
|
||||||
|
id: { type: "Identifier" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "VariableDeclaration",
|
||||||
|
declarations: {
|
||||||
|
anykey: [
|
||||||
|
{
|
||||||
|
type: "VariableDeclarator",
|
||||||
|
init: {
|
||||||
|
type: "FunctionExpression",
|
||||||
|
async: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
const asdasd: DeepPartial<ESTree.ExpressionStatement> = {
|
||||||
|
type: "ExpressionStatement",
|
||||||
|
expression: {
|
||||||
|
type: "CallExpression",
|
||||||
|
callee: {
|
||||||
|
type: "MemberExpression",
|
||||||
|
object: { type: "Identifier" },
|
||||||
|
property: {},
|
||||||
|
optional: false,
|
||||||
|
},
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
type: "Literal",
|
||||||
|
value: "alr",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "Literal",
|
||||||
|
value: "yes",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
optional: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export function extract(
|
||||||
|
node: ESTree.Node,
|
||||||
|
): ESTree.ArrowFunctionExpression | null {
|
||||||
|
if (!matchesStructure(node, identifier)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const options: {
|
||||||
|
name: ESTree.Expression;
|
||||||
|
statements: ESTree.Statement[];
|
||||||
|
}[] = [];
|
||||||
|
|
||||||
|
if (node.type === "FunctionDeclaration") {
|
||||||
|
if (node.id && node.body?.body) {
|
||||||
|
options.push({
|
||||||
|
name: node.id,
|
||||||
|
statements: node.body?.body,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (node.type === "ExpressionStatement") {
|
||||||
|
if (node.expression.type !== "AssignmentExpression") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const name = node.expression.left;
|
||||||
|
const body = (node.expression.right as ESTree.FunctionExpression)?.body
|
||||||
|
?.body;
|
||||||
|
if (name && body) {
|
||||||
|
options.push({
|
||||||
|
name: name,
|
||||||
|
statements: body,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (node.type === "VariableDeclaration") {
|
||||||
|
for (const declaration of node.declarations) {
|
||||||
|
const name = declaration.id;
|
||||||
|
const body = (declaration.init as ESTree.FunctionExpression)?.body?.body;
|
||||||
|
if (name && body) {
|
||||||
|
options.push({
|
||||||
|
name: name,
|
||||||
|
statements: body,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const { name, statements } of options) {
|
||||||
|
if (matchesStructure(statements, { anykey: [asdasd] })) {
|
||||||
|
return createSolver(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createSolver(
|
||||||
|
expression: ESTree.Expression,
|
||||||
|
): ESTree.ArrowFunctionExpression {
|
||||||
|
return generateArrowFunction(`
|
||||||
|
({sig, n}) => {
|
||||||
|
const url = (${generate(expression)})("https://youtube.com/watch?v=yt-dlp-wins", "s", sig ? encodeURIComponent(sig) : undefined);
|
||||||
|
url.set("n", n);
|
||||||
|
const proto = Object.getPrototypeOf(url);
|
||||||
|
const keys = Object.keys(proto).concat(Object.getOwnPropertyNames(proto));
|
||||||
|
for (const key of keys) {
|
||||||
|
if (!["constructor", "set", "get", "clone"].includes(key)) {
|
||||||
|
url[key]();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const s = url.get("s");
|
||||||
|
return {
|
||||||
|
sig: s ? decodeURIComponent(s) : null,
|
||||||
|
n: url.get("n") ?? null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
@@ -4,11 +4,8 @@ export const setupNodes = parse(`
|
|||||||
if (typeof globalThis.XMLHttpRequest === "undefined") {
|
if (typeof globalThis.XMLHttpRequest === "undefined") {
|
||||||
globalThis.XMLHttpRequest = { prototype: {} };
|
globalThis.XMLHttpRequest = { prototype: {} };
|
||||||
}
|
}
|
||||||
if (typeof globalThis.window === "undefined") {
|
|
||||||
globalThis.window = Object.create(null);
|
|
||||||
}
|
|
||||||
if (typeof URL === "undefined") {
|
if (typeof URL === "undefined") {
|
||||||
globalThis.window.location = {
|
globalThis.location = {
|
||||||
hash: "",
|
hash: "",
|
||||||
host: "www.youtube.com",
|
host: "www.youtube.com",
|
||||||
hostname: "www.youtube.com",
|
hostname: "www.youtube.com",
|
||||||
@@ -22,7 +19,7 @@ if (typeof URL === "undefined") {
|
|||||||
username: "",
|
username: "",
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
globalThis.window.location = new URL("https://www.youtube.com/watch?v=yt-dlp-wins");
|
globalThis.location = new URL("https://www.youtube.com/watch?v=yt-dlp-wins");
|
||||||
}
|
}
|
||||||
if (typeof globalThis.document === "undefined") {
|
if (typeof globalThis.document === "undefined") {
|
||||||
globalThis.document = Object.create(null);
|
globalThis.document = Object.create(null);
|
||||||
@@ -33,4 +30,7 @@ if (typeof globalThis.navigator === "undefined") {
|
|||||||
if (typeof globalThis.self === "undefined") {
|
if (typeof globalThis.self === "undefined") {
|
||||||
globalThis.self = globalThis;
|
globalThis.self = globalThis;
|
||||||
}
|
}
|
||||||
|
if (typeof globalThis.window === "undefined") {
|
||||||
|
globalThis.window = globalThis;
|
||||||
|
}
|
||||||
`).body;
|
`).body;
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
import { type ESTree } from "meriyah";
|
|
||||||
import { matchesStructure } from "../../utils.ts";
|
|
||||||
import { type DeepPartial } from "../../types.ts";
|
|
||||||
|
|
||||||
const logicalExpression: DeepPartial<ESTree.ExpressionStatement> = {
|
|
||||||
type: "ExpressionStatement",
|
|
||||||
expression: {
|
|
||||||
type: "LogicalExpression",
|
|
||||||
left: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
right: {
|
|
||||||
type: "SequenceExpression",
|
|
||||||
expressions: [
|
|
||||||
{
|
|
||||||
type: "AssignmentExpression",
|
|
||||||
left: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
operator: "=",
|
|
||||||
right: {
|
|
||||||
type: "CallExpression",
|
|
||||||
callee: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
arguments: {
|
|
||||||
or: [
|
|
||||||
[
|
|
||||||
{ type: "Literal" },
|
|
||||||
{
|
|
||||||
type: "CallExpression",
|
|
||||||
callee: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: "decodeURIComponent",
|
|
||||||
},
|
|
||||||
arguments: [{ type: "Identifier" }],
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: "CallExpression",
|
|
||||||
callee: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: "decodeURIComponent",
|
|
||||||
},
|
|
||||||
arguments: [{ type: "Identifier" }],
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "CallExpression",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
operator: "&&",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const identifier = {
|
|
||||||
or: [
|
|
||||||
{
|
|
||||||
type: "ExpressionStatement",
|
|
||||||
expression: {
|
|
||||||
type: "AssignmentExpression",
|
|
||||||
operator: "=",
|
|
||||||
left: {
|
|
||||||
type: "Identifier",
|
|
||||||
},
|
|
||||||
right: {
|
|
||||||
type: "FunctionExpression",
|
|
||||||
params: [{}, {}, {}],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "FunctionDeclaration",
|
|
||||||
params: [{}, {}, {}],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
export function extract(
|
|
||||||
node: ESTree.Node,
|
|
||||||
): ESTree.ArrowFunctionExpression | null {
|
|
||||||
if (
|
|
||||||
!matchesStructure(node, identifier as unknown as DeepPartial<ESTree.Node>)
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const block =
|
|
||||||
node.type === "ExpressionStatement" &&
|
|
||||||
node.expression.type === "AssignmentExpression" &&
|
|
||||||
node.expression.right.type === "FunctionExpression"
|
|
||||||
? node.expression.right.body
|
|
||||||
: node.type === "FunctionDeclaration"
|
|
||||||
? node.body
|
|
||||||
: null;
|
|
||||||
const relevantExpression = block?.body.at(-2);
|
|
||||||
if (!matchesStructure(relevantExpression!, logicalExpression)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
relevantExpression?.type !== "ExpressionStatement" ||
|
|
||||||
relevantExpression.expression.type !== "LogicalExpression" ||
|
|
||||||
relevantExpression.expression.right.type !== "SequenceExpression" ||
|
|
||||||
relevantExpression.expression.right.expressions[0].type !==
|
|
||||||
"AssignmentExpression"
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const call = relevantExpression.expression.right.expressions[0].right;
|
|
||||||
if (call.type !== "CallExpression" || call.callee.type !== "Identifier") {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// TODO: verify identifiers here
|
|
||||||
return {
|
|
||||||
type: "ArrowFunctionExpression",
|
|
||||||
params: [
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
name: "sig",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
body: {
|
|
||||||
type: "CallExpression",
|
|
||||||
callee: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: call.callee.name,
|
|
||||||
},
|
|
||||||
arguments:
|
|
||||||
call.arguments.length === 1
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
name: "sig",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
call.arguments[0],
|
|
||||||
{
|
|
||||||
type: "Identifier",
|
|
||||||
name: "sig",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
optional: false,
|
|
||||||
},
|
|
||||||
async: false,
|
|
||||||
expression: false,
|
|
||||||
generator: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import { getFromPrepared, preprocessPlayer } from "./solvers.ts";
|
import { getFromPrepared, preprocessPlayer } from "./solvers.ts";
|
||||||
|
import { getIO } from "./test/io.ts";
|
||||||
import { players, tests } from "./test/tests.ts";
|
import { players, tests } from "./test/tests.ts";
|
||||||
import { getCachePath } from "./test/utils.ts";
|
import { getCachePath } from "./test/utils.ts";
|
||||||
import { getIO } from "./test/io.ts";
|
|
||||||
|
|
||||||
const io = await getIO();
|
const io = await getIO();
|
||||||
|
|
||||||
for (const test of tests) {
|
for (const test of tests) {
|
||||||
for (const variant of test.variants ?? players.keys()) {
|
for (const variant of test.variants ?? players.keys()) {
|
||||||
const path = getCachePath(test.player, variant);
|
const path = getCachePath(test.player, variant);
|
||||||
await io.test(`${test.player} ${variant}`, async (assert, subtest) => {
|
await io.test(`-${test.player}-${variant}-`, async (assert, subtest) => {
|
||||||
const content = await io.read(path);
|
const content = await io.read(path);
|
||||||
const solvers = getFromPrepared(preprocessPlayer(content));
|
const solvers = getFromPrepared(preprocessPlayer(content));
|
||||||
for (const mode of ["n", "sig"] as const) {
|
for (const mode of ["n", "sig"] as const) {
|
||||||
|
|||||||
@@ -1,14 +1,46 @@
|
|||||||
import { type ESTree, parse } from "meriyah";
|
|
||||||
import { generate } from "astring";
|
import { generate } from "astring";
|
||||||
import { extract as extractSig } from "./sig.ts";
|
import { type ESTree, parse } from "meriyah";
|
||||||
import { extract as extractN } from "./n.ts";
|
|
||||||
|
import { generateArrowFunction } from "../../utils.ts";
|
||||||
|
import { extract } from "./nsig.ts";
|
||||||
import { setupNodes } from "./setup.ts";
|
import { setupNodes } from "./setup.ts";
|
||||||
|
|
||||||
export function preprocessPlayer(data: string): string {
|
export function preprocessPlayer(data: string): string {
|
||||||
const ast = parse(data);
|
const program = parse(data);
|
||||||
const body = ast.body;
|
const plainStatements = modifyPlayer(program);
|
||||||
|
const solutions = getSolutions(plainStatements);
|
||||||
|
for (const [name, options] of Object.entries(solutions)) {
|
||||||
|
plainStatements.push({
|
||||||
|
type: "ExpressionStatement",
|
||||||
|
expression: {
|
||||||
|
type: "AssignmentExpression",
|
||||||
|
operator: "=",
|
||||||
|
left: {
|
||||||
|
type: "MemberExpression",
|
||||||
|
computed: false,
|
||||||
|
object: {
|
||||||
|
type: "Identifier",
|
||||||
|
name: "_result",
|
||||||
|
},
|
||||||
|
property: {
|
||||||
|
type: "Identifier",
|
||||||
|
name: name,
|
||||||
|
},
|
||||||
|
optional: false,
|
||||||
|
},
|
||||||
|
right: multiTry(options),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const block = (() => {
|
program.body.splice(0, 0, ...setupNodes);
|
||||||
|
return generate(program);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function modifyPlayer(program: ESTree.Program) {
|
||||||
|
const body = program.body;
|
||||||
|
|
||||||
|
const block: ESTree.BlockStatement = (() => {
|
||||||
switch (body.length) {
|
switch (body.length) {
|
||||||
case 1: {
|
case 1: {
|
||||||
const func = body[0];
|
const func = body[0];
|
||||||
@@ -40,19 +72,7 @@ export function preprocessPlayer(data: string): string {
|
|||||||
throw "unexpected structure";
|
throw "unexpected structure";
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const found = {
|
block.body = block.body.filter((node: ESTree.Statement) => {
|
||||||
n: [] as ESTree.ArrowFunctionExpression[],
|
|
||||||
sig: [] as ESTree.ArrowFunctionExpression[],
|
|
||||||
};
|
|
||||||
const plainExpressions = block.body.filter((node: ESTree.Node) => {
|
|
||||||
const n = extractN(node);
|
|
||||||
if (n) {
|
|
||||||
found.n.push(n);
|
|
||||||
}
|
|
||||||
const sig = extractSig(node);
|
|
||||||
if (sig) {
|
|
||||||
found.sig.push(sig);
|
|
||||||
}
|
|
||||||
if (node.type === "ExpressionStatement") {
|
if (node.type === "ExpressionStatement") {
|
||||||
if (node.expression.type === "AssignmentExpression") {
|
if (node.expression.type === "AssignmentExpression") {
|
||||||
return true;
|
return true;
|
||||||
@@ -61,43 +81,75 @@ export function preprocessPlayer(data: string): string {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
block.body = plainExpressions;
|
|
||||||
|
|
||||||
for (const [name, options] of Object.entries(found)) {
|
return block.body;
|
||||||
// TODO: this is cringe fix plz
|
}
|
||||||
const unique = new Set(options.map((x) => JSON.stringify(x)));
|
|
||||||
if (unique.size !== 1) {
|
export function getSolutions(
|
||||||
const message = `found ${unique.size} ${name} function possibilities`;
|
statements: ESTree.Statement[],
|
||||||
throw (
|
): Record<string, ESTree.ArrowFunctionExpression[]> {
|
||||||
message +
|
const found = {
|
||||||
(unique.size ? `: ${options.map((x) => generate(x)).join(", ")}` : "")
|
n: [] as ESTree.ArrowFunctionExpression[],
|
||||||
|
sig: [] as ESTree.ArrowFunctionExpression[],
|
||||||
|
};
|
||||||
|
for (const statement of statements) {
|
||||||
|
const result = extract(statement);
|
||||||
|
if (result) {
|
||||||
|
found.n.push(
|
||||||
|
makeSolver(result, {
|
||||||
|
type: "Identifier",
|
||||||
|
name: "n",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
found.sig.push(
|
||||||
|
makeSolver(result, {
|
||||||
|
type: "Identifier",
|
||||||
|
name: "sig",
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
plainExpressions.push({
|
|
||||||
type: "ExpressionStatement",
|
|
||||||
expression: {
|
|
||||||
type: "AssignmentExpression",
|
|
||||||
operator: "=",
|
|
||||||
left: {
|
|
||||||
type: "MemberExpression",
|
|
||||||
computed: false,
|
|
||||||
object: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: "_result",
|
|
||||||
},
|
|
||||||
property: {
|
|
||||||
type: "Identifier",
|
|
||||||
name: name,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
right: options[0],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
ast.body.splice(0, 0, ...setupNodes);
|
function makeSolver(
|
||||||
|
result: ESTree.ArrowFunctionExpression,
|
||||||
return generate(ast);
|
ident: ESTree.Identifier,
|
||||||
|
): ESTree.ArrowFunctionExpression {
|
||||||
|
return {
|
||||||
|
type: "ArrowFunctionExpression",
|
||||||
|
params: [ident],
|
||||||
|
body: {
|
||||||
|
type: "MemberExpression",
|
||||||
|
object: {
|
||||||
|
type: "CallExpression",
|
||||||
|
callee: result,
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
type: "ObjectExpression",
|
||||||
|
properties: [
|
||||||
|
{
|
||||||
|
type: "Property",
|
||||||
|
key: ident,
|
||||||
|
value: ident,
|
||||||
|
kind: "init",
|
||||||
|
computed: false,
|
||||||
|
method: false,
|
||||||
|
shorthand: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
optional: false,
|
||||||
|
},
|
||||||
|
computed: false,
|
||||||
|
property: ident,
|
||||||
|
optional: false,
|
||||||
|
},
|
||||||
|
async: false,
|
||||||
|
expression: true,
|
||||||
|
generator: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFromPrepared(code: string): {
|
export function getFromPrepared(code: string): {
|
||||||
@@ -108,3 +160,31 @@ export function getFromPrepared(code: string): {
|
|||||||
Function("_result", code)(resultObj);
|
Function("_result", code)(resultObj);
|
||||||
return resultObj;
|
return resultObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function multiTry(
|
||||||
|
generators: ESTree.ArrowFunctionExpression[],
|
||||||
|
): ESTree.ArrowFunctionExpression {
|
||||||
|
return generateArrowFunction(`
|
||||||
|
(_input) => {
|
||||||
|
const _results = new Set();
|
||||||
|
const errors = [];
|
||||||
|
for (const _generator of ${generate({
|
||||||
|
type: "ArrayExpression",
|
||||||
|
elements: generators,
|
||||||
|
} as ESTree.Node)}) {
|
||||||
|
try {
|
||||||
|
_results.add(_generator(_input));
|
||||||
|
} catch (e) {
|
||||||
|
errors.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!_results.size) {
|
||||||
|
throw \`no solutions: \${errors.join(", ")}\`;
|
||||||
|
}
|
||||||
|
if (_results.size !== 1) {
|
||||||
|
throw \`invalid solutions: \${[..._results].map(x => JSON.stringify(x)).join(", ")}\`;
|
||||||
|
}
|
||||||
|
return _results.values().next().value;
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,24 +1,13 @@
|
|||||||
import { players, tests } from "./tests.ts";
|
import { players, tests } from "./tests.ts";
|
||||||
import { getCachePath } from "./utils.ts";
|
import { downloadCached } from "./utils.ts";
|
||||||
import { getIO } from "./io.ts";
|
|
||||||
|
|
||||||
const io = await getIO();
|
|
||||||
|
|
||||||
for (const test of tests) {
|
for (const test of tests) {
|
||||||
const variants = test.variants ?? players.keys();
|
const variants = test.variants ?? players.keys();
|
||||||
for (const variant of variants) {
|
for (const variant of variants) {
|
||||||
const path = getCachePath(test.player, variant);
|
try {
|
||||||
if (await io.exists(path)) {
|
await downloadCached(test.player, variant);
|
||||||
continue;
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
}
|
}
|
||||||
const playerPath = players.get(variant);
|
|
||||||
const url = `https://www.youtube.com/s/player/${test.player}/${playerPath}`;
|
|
||||||
console.log("Requesting", url);
|
|
||||||
const response = await fetch(url);
|
|
||||||
if (!response.ok) {
|
|
||||||
console.error(`Failed to request ${variant} player for ${test.player}`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
await io.write(path, response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ export async function getIO(): Promise<IO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function _getIO(): Promise<IO> {
|
async function _getIO(): Promise<IO> {
|
||||||
if (globalThis.process?.release?.name === "node") {
|
// Old Deno requires casting to any as globalThis lacks an index signature
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
if ((globalThis as any).process?.release?.name === "node") {
|
||||||
// Assume node compatibility
|
// Assume node compatibility
|
||||||
const { access, readFile } = await import("node:fs/promises");
|
const { access, readFile } = await import("node:fs/promises");
|
||||||
const { deepStrictEqual } = await import("node:assert");
|
const { deepStrictEqual } = await import("node:assert");
|
||||||
@@ -81,8 +83,6 @@ async function _getIO(): Promise<IO> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`unsupported runtime for testing${
|
`unsupported runtime for testing${navigator.userAgent ? `: ${navigator.userAgent}` : ""}`,
|
||||||
navigator.userAgent ? `: ${navigator.userAgent}` : ""
|
|
||||||
}`,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,244 +10,103 @@ export const tests: {
|
|||||||
sig?: Step[];
|
sig?: Step[];
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
player: "3d3ba064",
|
// 20522
|
||||||
|
player: "74edf1a3",
|
||||||
n: [
|
n: [
|
||||||
{ input: "ZdZIqFPQK-Ty8wId", expected: "qmtUsIz04xxiNW" },
|
{ input: "IlLiA21ny7gqA2m4p37", expected: "9nRTxrbM1f0yHg" },
|
||||||
{ input: "4GMrWHyKI5cEvhDO", expected: "N9gmEX7YhKTSmw" },
|
{ input: "eabGFpsUKuWHXGh6FR4", expected: "izmYqDEY6kl7Sg" },
|
||||||
|
{ input: "eabGF/ps%UK=uWHXGh6FR4", expected: "LACmqlhaBpiPlgE-a" },
|
||||||
],
|
],
|
||||||
sig: [
|
sig: [
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt",
|
"NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz",
|
||||||
expected:
|
expected:
|
||||||
"ttJC2JfQdSswRAIgGBCxZyAfKyi0cjXCb3gqEctUw-NYdNmOEvaepit0zJAtIEsgOV2SXZjhSHMNy0NXNG_1kNyBf6HPuAuCduh-a7O",
|
"NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hzMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzl",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input:
|
||||||
|
"\x00\x01\x02%\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49",
|
||||||
|
expected:
|
||||||
|
"\x00\x01\x02%\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x40\x41\x42\x49\x44\x45\x46\x47\x48\x43",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
player: "5ec65609",
|
// 20523
|
||||||
n: [{ input: "0eRGgQWJGfT5rFHFj", expected: "4SvMpDQH-vBJCw" }],
|
player: "901741ab",
|
||||||
|
n: [{ input: "BQoJvGBkC2nj1ZZLK-", expected: "UMPovvBZRh-sjb" }],
|
||||||
sig: [
|
sig: [
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"AAJAJfQdSswRQIhAMG5SN7-cAFChdrE7tLA6grH0rTMICA1mmDc0HoXgW3CAiAQQ4=CspfaF_vt82XH5yewvqcuEkvzeTsbRuHssRMyJQ=I",
|
"NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz",
|
||||||
expected:
|
expected:
|
||||||
"AJfQdSswRQIhAMG5SN7-cAFChdrE7tLA6grI0rTMICA1mmDc0HoXgW3CAiAQQ4HCspfaF_vt82XH5yewvqcuEkvzeTsbRuHssRMyJQ==",
|
"wgwCHlydB9Hg7PMegXoVzaoAXXB8woPSNZqRUC3Pe7vAEiApVSCMlhwmt5ON-8MB=5RPyyzdAM9MPM-kPfjgTxEK0IAhIgRwE0jiEJA",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
player: "6742b2b9",
|
// 20524
|
||||||
n: [
|
player: "e7573094",
|
||||||
{ input: "_HPB-7GFg1VTkn9u", expected: "qUAsPryAO_ByYg" },
|
n: [{ input: "IlLiA21ny7gqA2m4p37", expected: "3KuQ3235dojTSjo4" }],
|
||||||
{ input: "K1t_fcB6phzuq2SF", expected: "Y7PcOt3VE62mog" },
|
|
||||||
],
|
|
||||||
sig: [
|
sig: [
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz",
|
||||||
expected:
|
expected:
|
||||||
"AJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHM8EjoCACIEQnz-nKN5RgG6iUTnNJC58csYPSrnS_SzricuUMJZGM",
|
"yEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyNPRt=BM8-XO5tm5hlMCSVNAiEAvpeP3CURqZJSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=g",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
player: "23ccdd25",
|
// 20525
|
||||||
n: [
|
player: "9fcf08e8",
|
||||||
// Synthetic test
|
n: [{ input: "4JRSxxN0E_fLVnxmd", expected: "xhAoMP8xPcR5wg" }],
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "orSsTqUaUO-j" },
|
|
||||||
],
|
|
||||||
sig: [
|
sig: [
|
||||||
// Synthetic test
|
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a",
|
||||||
expected:
|
expected:
|
||||||
"ZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hAU6wbTvorvVVMgIARwsSdQfJAN",
|
"\x6a\x69\x68\x67\x66\x65\x64\x63\x62\x61\x60\x5f\x5e\x5d\x5c\x5b\x5a\x59\x58\x57\x56\x55\x54\x53\x52\x51\x50\x4f\x4e\x4d\x4c\x4b\x4a\x49\x48\x47\x46\x45\x44\x43\x42\x41\x40\x3f\x3e\x3d\x3c\x3b\x3a\x39\x38\x37\x36\x35\x34\x33\x32\x31\x30\x2f\x2e\x2d\x2c\x2b\x2a\x29\x28\x27\x26\x25\x24\x23\x22\x21\x20\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18\x17\x16\x15\x14\x13\x12\x11\x10\x0f\x0e\x0d\x0c\x0b\x03\x09\x08\x07\x06\x05\x04\x0a",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
player: "3597727b",
|
// 20527
|
||||||
n: [
|
player: "21cd2156",
|
||||||
// Synthetic test
|
n: [{ input: "16EF3jx-Mr_TLuGH", expected: "OQJDc7IrlWCkfg" }],
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "PRwo5dDfisg0ejA2" },
|
|
||||||
],
|
|
||||||
sig: [
|
sig: [
|
||||||
// Synthetic test
|
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a",
|
||||||
expected:
|
expected:
|
||||||
"AAJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYuMS6SHM8Ej7CACIEQnz-nKN5RgG6iUTnNJC58csYPSroS_SzricuUMJZG",
|
"\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x00\x46\x47\x48\x49\x4a\x4b\x6a\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x4c",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// tce causes exception even in browser
|
// 20528 (tv & tv_es6 needed self.location.origin fix)
|
||||||
player: "3752a005",
|
player: "76ad2fe8",
|
||||||
variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone", "tablet"],
|
n: [{ input: "V8pdMGD0Sz_M0DRT", expected: "rBnTGCWGFpwByA" }],
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" },
|
|
||||||
],
|
|
||||||
sig: [
|
sig: [
|
||||||
// Synthetic test
|
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a",
|
||||||
expected:
|
expected:
|
||||||
"ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x46\x66\x65\x64\x63\x62\x61\x60\x5f\x5e\x67\x6a\x5b\x5a\x59\x58\x57\x56\x55\x54\x53\x52\x51\x50\x4f\x4e\x4d\x4c\x4b\x4a\x49\x48\x47\x2c\x45\x44\x43\x42\x41\x40\x3f\x3e\x3d\x3c\x3b\x3a\x39\x38\x13\x36\x35\x34\x33\x32\x31\x30\x2f\x2e\x2d\x5d\x2b\x2a\x29\x28\x27\x26\x25\x24\x23\x22\x21\x20\x1f\x1e\x1d\x1c\x1b\x1a\x19\x18\x17\x16\x15\x14\x0c\x12\x11\x10\x0f\x0e\x0d\x00\x0b\x0a\x09\x08\x07\x06\x05\x04\x03\x02\x01\x37",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// tce causes exception even in browser
|
// 20529 (tv & tv_es6 needed self.location.origin fix)
|
||||||
player: "afc7785b",
|
player: "631d3938",
|
||||||
variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone", "tablet"],
|
n: [{ input: "KBx1qz7jMhxELa8c", expected: "ttPvh7WIptsgSw" }],
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" },
|
|
||||||
],
|
|
||||||
sig: [
|
sig: [
|
||||||
// Synthetic test
|
|
||||||
{
|
{
|
||||||
input:
|
input:
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66",
|
||||||
expected:
|
expected:
|
||||||
"ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
"\x19\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x00\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63",
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// tce causes exception even in browser
|
|
||||||
player: "b9645327",
|
|
||||||
variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone", "tablet"],
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// tce causes exception even in browser
|
|
||||||
player: "035b9195",
|
|
||||||
variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone", "tablet"],
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "6740c111",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "AVsXYE0uE1k8e" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHM8EjoCACIEQnz-MKN5RgG6iUTnNJC58csYPSrnS_SzricuUMJZGn",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "f6a4f3bc",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "H1NKYFbhlqZ" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYM7S6SHM8EjoCACIEQnz-nKM5RgG6iUTnNJC58cNYPSrnS_SzricuUMJZGu",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "b66835e2",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "H1NKYFbhlqZ" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYM7S6SHM8EjoCACIEQnz-nKM5RgG6iUTnNJC58cNYPSrnS_SzricuUMJZGu",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "4f8fa943",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "JWWr7hDSRpMq5" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"AAJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHr8EjoCACIEQnz-nKN5RgG6iUTnNZC58csYPSMnS_SzricuUM",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "0004de42",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "OPd7UEsCDmCw4qD0" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA",
|
|
||||||
expected:
|
|
||||||
"ZJMUucirzS_SnrSPYsc85MJNnTUi6GgR5NCn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQ",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
player: "2b83d2e0",
|
|
||||||
n: [
|
|
||||||
// Synthetic test
|
|
||||||
{ input: "0eRGgQWJGfT5rFHFj", expected: "euHbygrCMLksxd" },
|
|
||||||
],
|
|
||||||
sig: [
|
|
||||||
// Synthetic test
|
|
||||||
{
|
|
||||||
input:
|
|
||||||
"MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJA",
|
|
||||||
expected:
|
|
||||||
"-MGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKnMznQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJ",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -257,12 +116,12 @@ export const players = new Map([
|
|||||||
["main", "player_ias.vflset/en_US/base.js"],
|
["main", "player_ias.vflset/en_US/base.js"],
|
||||||
["tcc", "player_ias_tcc.vflset/en_US/base.js"],
|
["tcc", "player_ias_tcc.vflset/en_US/base.js"],
|
||||||
["tce", "player_ias_tce.vflset/en_US/base.js"],
|
["tce", "player_ias_tce.vflset/en_US/base.js"],
|
||||||
["es5", "player_es5.vflset/en_US/base.js"],
|
|
||||||
["es6", "player_es6.vflset/en_US/base.js"],
|
["es6", "player_es6.vflset/en_US/base.js"],
|
||||||
["tv", "tv-player-ias.vflset/tv-player-ias.js"],
|
["tv", "tv-player-ias.vflset/tv-player-ias.js"],
|
||||||
["tv_es6", "tv-player-es6.vflset/tv-player-es6.js"],
|
["tv_es6", "tv-player-es6.vflset/tv-player-es6.js"],
|
||||||
["phone", "player-plasma-ias-phone-en_US.vflset/base.js"],
|
["phone", "player-plasma-ias-phone-en_US.vflset/base.js"],
|
||||||
["tablet", "player-plasma-ias-tablet-en_US.vflset/base.js"],
|
["es6_tcc", "player_es6_tcc.vflset/en_US/base.js"],
|
||||||
|
["es6_tce", "player_es6_tce.vflset/en_US/base.js"],
|
||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
export type Variant = typeof players extends Map<infer T, unknown> ? T : never;
|
export type Variant = typeof players extends Map<infer T, unknown> ? T : never;
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
import { type Variant } from "./tests.ts";
|
import { getIO } from "./io.ts";
|
||||||
|
import { players, type Variant } from "./tests.ts";
|
||||||
|
|
||||||
export function getCachePath(player: string, variant: Variant) {
|
export function getCachePath(player: string, variant: Variant) {
|
||||||
return `src/yt/solver/test/players/${player}-${variant}`;
|
return `src/yt/solver/test/players/${player}-${variant}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function downloadCached(player: string, variant: string) {
|
||||||
|
const io = await getIO();
|
||||||
|
|
||||||
|
const playerPath = players.get(variant as Variant);
|
||||||
|
if (!playerPath) {
|
||||||
|
throw `Invalid player variant: ${variant}`;
|
||||||
|
}
|
||||||
|
const path = getCachePath(player, variant as Variant);
|
||||||
|
if (!(await io.exists(path))) {
|
||||||
|
const url = `https://www.youtube.com/s/player/${player}/${playerPath}`;
|
||||||
|
console.log("Requesting", url);
|
||||||
|
const response = await fetch(url);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw `Failed to request ${variant} player for ${player}`;
|
||||||
|
}
|
||||||
|
await io.write(path, response);
|
||||||
|
}
|
||||||
|
return await io.read(path);
|
||||||
|
}
|
||||||
|
|||||||
0
test/__init__.py
Normal file
0
test/__init__.py
Normal file
24
test/test_modules.py
Normal file
24
test/test_modules.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import yt_dlp_ejs.yt.solver
|
||||||
|
|
||||||
|
BASE_PATH = Path(__file__).parent.parent
|
||||||
|
CORE_PATH = BASE_PATH / "yt_dlp_ejs/yt/solver/core.min.js"
|
||||||
|
LIB_PATH = BASE_PATH / "yt_dlp_ejs/yt/solver/lib.min.js"
|
||||||
|
|
||||||
|
|
||||||
|
class TestModules(unittest.TestCase):
|
||||||
|
def test_yt_solver(self):
|
||||||
|
self.assertEqual(
|
||||||
|
yt_dlp_ejs.yt.solver.core(),
|
||||||
|
CORE_PATH.read_text(encoding="utf-8"),
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
yt_dlp_ejs.yt.solver.lib(),
|
||||||
|
LIB_PATH.read_text(encoding="utf-8"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
from yt_dlp_ejs._version import version
|
from yt_dlp_ejs._version import version
|
||||||
from yt_dlp_ejs import yt
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = ["version"]
|
||||||
"version",
|
|
||||||
"yt"
|
|
||||||
]
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from . import solver
|
|
||||||
|
|
||||||
__all__ = ["solver"]
|
|
||||||
@@ -2,15 +2,20 @@ import importlib.resources
|
|||||||
|
|
||||||
import yt_dlp_ejs.yt.solver
|
import yt_dlp_ejs.yt.solver
|
||||||
|
|
||||||
|
|
||||||
def core() -> str:
|
def core() -> str:
|
||||||
"""
|
"""
|
||||||
Read the contents of the JavaScript core solver bundle as string.
|
Read the contents of the JavaScript core solver bundle as string.
|
||||||
"""
|
"""
|
||||||
return importlib.resources.read_text(yt_dlp_ejs.yt.solver, "core.min.js")
|
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "core.min.js").read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def lib() -> str:
|
def lib() -> str:
|
||||||
"""
|
"""
|
||||||
Read the contents of the JavaScript library solver bundle as string.
|
Read the contents of the JavaScript library solver bundle as string.
|
||||||
"""
|
"""
|
||||||
return importlib.resources.read_text(yt_dlp_ejs.yt.solver, "lib.min.js")
|
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "lib.min.js").read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user