Skip to content

Commit 2ccbe2c

Browse files
WykerdLuanRT
andauthored
refactor!: cleanup platform support (#306)
* refactor!: cleanup platform support * chore: lint * fix: web platform * feat: provide UniversalCache Provide UniversalCache as a wrapper around Platform.shim.Cache. * fix: invalid import * refactor: remove isolated-vm support * fix: type info * refactor: cleanup exports * fix: mark jintr as external dependency In the bundled CJS node build, mark jintr as external. * chore: add additional exports web exports provide a way to select web implementation manually without relying on the bundler to select it correctly from the "exports" field web points to src/platform/web.js web.bundle points to bundle/browser.js web.bundle.browser points to bundle/browser.min.js agnostic exports provide users of the library to provide their own platform implementation without first importing the default one. agnostic points to src/platform/lib.ts * fix: toDash on web * revert: eval is synchronous * fix: use serializeDOM in FormatUtils * ci: automate releases with `release-please` * chore: clean up workflow files * ci: fix NPM publish action --------- Co-authored-by: LuanRT <luan.lrt4@gmail.com>
1 parent a69e43b commit 2ccbe2c

File tree

504 files changed

+11293
-6388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

504 files changed

+11293
-6388
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ cache/
55
src/proto/youtube.ts
66
coverage/
77
node_modules/
8-
dist/
8+
dist/
9+
src/proto/generated/

.github/labeler_config.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ version: 1
22
labels:
33
- label: "breaking-change"
44
title: "^refactor!:.*"
5-
6-
- label: "enhancement"
7-
title: "^feat:.*"
8-
9-
- label: "bug"
10-
title: "^fix:.*"
11-
5+
126
- label: "github"
137
files:
148
- ".github/.*"

.github/release.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/labeler.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ on:
55

66
jobs:
77
build:
8-
98
runs-on: ubuntu-latest
10-
119
steps:
1210
- uses: srvaroa/labeler@master
1311
with:

.github/workflows/lint.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Lint
1+
name: lint
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
48

59
jobs:
6-
eslint:
7-
name: Lint
10+
lint:
811
runs-on: ubuntu-latest
912
steps:
10-
- uses: actions/checkout@v3
11-
12-
- uses: actions/setup-node@v3
13-
14-
- name: npm install and lint
15-
run: |
16-
npm install
17-
npm run lint
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 16
17+
- run: npm ci
18+
- run: npm run lint

.github/workflows/node.js.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: google-github-actions/release-please-action@v3
16+
id: release
17+
with:
18+
release-type: node
19+
package-name: youtubei.js
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: "16.x"
25+
- name: Build for Deno
26+
run: |
27+
npm ci
28+
npm run build:deno
29+
if: ${{ steps.release.outputs.release_created }}
30+
- name: Move Deno files
31+
run: |
32+
mkdir build
33+
mv deno build/deno
34+
cp deno.ts build/deno.ts
35+
cp {LICENSE,README.md} build
36+
if: ${{ steps.release.outputs.release_created }}
37+
- name: Push to the Deno branch
38+
uses: s0/git-publish-subdir-action@develop
39+
env:
40+
REPO: self
41+
BRANCH: deno
42+
FOLDER: ./build
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
SKIP_EMPTY_COMMITS: true
45+
MESSAGE: "chore: ${{ steps.release.outputs.tag_name }} release"
46+
TAG: ${{ steps.release.outputs.tag_name }}-deno
47+
if: ${{ steps.release.outputs.release_created }}
48+
- name: Remove Deno folder
49+
run: rm -rf build
50+
if: ${{ steps.release.outputs.release_created }}
51+
- uses: actions/setup-node@v3
52+
with:
53+
node-version: "16.x"
54+
registry-url: "https://registry.npmjs.org"
55+
if: ${{ steps.release.outputs.release_created }}
56+
- name: Publish package to npmjs
57+
run: |
58+
npm ci
59+
npm publish
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
if: ${{ steps.release.outputs.release_created }}

.github/workflows/stale.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ jobs:
1111
- uses: actions/stale@v3
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
14-
stale-issue-message: 'This issue has been automatically marked as stale because it has not had
15-
recent activity. It will be closed if no further activity occurs. Thank you
16-
for your contributions.'
14+
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
1715
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. Remove the stale label or comment or this will be closed in 2 days'
1816
days-before-stale: 60
1917
days-before-close: 4

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 16
17+
- run: npm ci
18+
- run: npm run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ tmp/
6666
dist/
6767
bundle/*.js.*
6868
bundle/*.js
69+
bundle/*.cjs
70+
bundle/*.cjs.*
71+
deno/
6972

7073
# MacOS
7174
.DS_Store

0 commit comments

Comments
 (0)