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

chore: monorepo setup #1510

Merged
merged 4 commits into from
Jan 13, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/ban-ts-comment": "error",
"semi": "error",
"no-console": "error"
Expand Down
52 changes: 28 additions & 24 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: Deployment
name: Docs Deployment
on:
push:
branches:
- '*'
- '!docs'
- '!gh-pages'
tags:
- '*'
workflow_dispatch:
push:
branches:
- '*'
- '!docs'
- '!gh-pages'
tags:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Install Node v18
uses: actions/setup-node@master
with:
node-version: 18
- name: Install Node v18
uses: actions/setup-node@master
with:
node-version: 18

- name: Install dependencies
run: npm install
- name: Install dependencies
run: yarn install --immutable

- name: Build and deploy documentation
uses: discordjs/action-docs@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and deploy documentation
uses: discordjs/action-docs@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 31 additions & 30 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: ESLint
on:
push:
branches:
- '*'
- '!docs'
- '!develop'
- '!master'
- '!gh-pages'
pull_request:
branches:
- '*'
- '!docs'
- '!develop'
- '!master'
- '!gh-pages'
workflow_dispatch:
pull_request:
push:
branches:
- '*'
- '!docs'
- '!develop'
- '!master'
- '!gh-pages'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: ESLint (Node v16)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
test:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node v16
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Node v18
uses: actions/setup-node@v1
with:
node-version: 18

- name: Install dependencies
run: npm install
- name: Install dependencies
run: yarn install --immutable

- name: Run ESLint
run: npm run lint
- name: Build
run: yarn build

- name: Run TSC
run: npm run build:check
- name: Run ESLint
run: yarn lint

- name: Run TSC
run: yarn build:check
21 changes: 21 additions & 0 deletions .github/workflows/npm-publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node.js Package
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: yarn install --immutable
- run: yarn build
- run: cd packages/discord-player
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
38 changes: 20 additions & 18 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: Node.js Package

on:
release:
types: [created]

workflow_dispatch:
release:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:

publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: yarn install --immutable
- run: yarn build
- run: cd packages/discord-player
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
31 changes: 0 additions & 31 deletions .github/workflows/publish-dev.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ dist
yarn*.log

dev/
packages/

.DS_Store
.DS_Store
.turbo/
2 changes: 1 addition & 1 deletion .husky/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run format && npm run lint:fix
yarn format && yarn lint && git add -u
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"printWidth": 200,
"trailingComma": "none",
"singleQuote": false,
"singleQuote": true,
"tabWidth": 4,
"semi": true
}
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Hello
This document is for people who want to contribute to this project!

# Creating a new package

Run `yarn bootstrap <packageName>` to create new package.

Example:

```sh
$ yarn bootstrap example-lib
```

This will create a package `@discord-player/example-lib` under `packages` dir.

# Code Style

## Formatting
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-present Androz
Copyright (c) 2020 Androz2091

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down