Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: cleanup platform support #306

Merged
merged 20 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ cache/
src/proto/youtube.ts
coverage/
node_modules/
dist/
dist/
src/proto/generated/
8 changes: 1 addition & 7 deletions .github/labeler_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ version: 1
labels:
- label: "breaking-change"
title: "^refactor!:.*"

- label: "enhancement"
title: "^feat:.*"

- label: "bug"
title: "^fix:.*"


- label: "github"
files:
- ".github/.*"
Expand Down
20 changes: 0 additions & 20 deletions .github/release.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: srvaroa/labeler@master
with:
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Lint
name: lint

on: [push, pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
eslint:
name: Lint
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3

- name: npm install and lint
run: |
npm install
npm run lint
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm run lint
26 changes: 0 additions & 26 deletions .github/workflows/node.js.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: release-please

on:
push:
branches:
- main

jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: youtubei.js
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "16.x"
- name: Build for Deno
run: |
npm ci
npm run build:deno
if: ${{ steps.release.outputs.release_created }}
- name: Move Deno files
run: |
mkdir build
mv deno build/deno
cp deno.ts build/deno.ts
cp {LICENSE,README.md} build
if: ${{ steps.release.outputs.release_created }}
- name: Push to the Deno branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: deno
FOLDER: ./build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SKIP_EMPTY_COMMITS: true
MESSAGE: "chore: ${{ steps.release.outputs.tag_name }} release"
TAG: ${{ steps.release.outputs.tag_name }}-deno
if: ${{ steps.release.outputs.release_created }}
- name: Remove Deno folder
run: rm -rf build
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
- name: Publish package to npmjs
run: |
npm ci
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
4 changes: 1 addition & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ jobs:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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.'
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.'
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'
days-before-stale: 60
days-before-close: 4
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ tmp/
dist/
bundle/*.js.*
bundle/*.js
bundle/*.cjs
bundle/*.cjs.*
deno/

# MacOS
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ yarn add youtubei.js@latest
npm install github:LuanRT/YouTube.js
```

**TODO:** Deno install instructions (esm.sh possibly?)
**TODO:** Deno install instructions (deno.land)

## Usage
Create an InnerTube instance:
Expand Down
11 changes: 0 additions & 11 deletions browser.ts

This file was deleted.

2 changes: 1 addition & 1 deletion bundle/browser.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from '../dist/browser';
export * from '../dist/src/platform/lib.js';
1 change: 1 addition & 0 deletions bundle/node.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../dist/src/platform/lib.js';
3 changes: 3 additions & 0 deletions deno.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './deno/src/platform/deno.ts';
import Innertube from './deno/src/platform/deno.ts';
export default Innertube;
28 changes: 0 additions & 28 deletions index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


module.exports = {
export default {
projects: [
{
displayName: 'node',
Expand Down
Loading