Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sawaYch committed Apr 2, 2024
0 parents commit f6ff3d9
Show file tree
Hide file tree
Showing 79 changed files with 12,563 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/changeset-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js

const { exec } = require("child_process");

// This script is used by the `release.yml` workflow to update the version of the packages being released.
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
// So we also run `npm install`, which does this update.
// This is a workaround until this is handled automatically by `changeset version`.
// See https://github.com/changesets/changesets/issues/421.
exec("npx changeset version")
exec("npm install")
32 changes: 32 additions & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code Check
on:
push:
workflow_call:

jobs:
code-check:
name: Code Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Restore project deps
run: npm ci

- name: Lint check
run: npm run lint

- name: Code format check
run: npm run format

- name: Build
run: npm run build

- name: Typescript check
run: npm run typecheck
54 changes: 54 additions & 0 deletions .github/workflows/publish-source-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
tags:
- 'v*'
name: Publish
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Restore project deps
run: npm ci

- name: Build the package next-youtube-livechat
run: cd packages/next-youtube-livechat && npm run build

- name: Lint check
run: npm run lint

- name: Code format check
run: npm run format

- name: Typescript check
run: npm run typecheck

- run: cd packages/next-youtube-livechat && npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_ENV: 'production'

github-release:
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm i -g github-release-from-changelog
- run: github-release-from-changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: 'production'
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release next-youtube-livechat

on:
workflow_dispatch: {}

jobs:
release:
name: Create a PR for release workflow
if: ${{ github.repository_owner == 'sawaYch' }}
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
packages: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Restore project deps
run: npm ci

- name: Build the package next-youtube-livechat
run: cd packages/next-youtube-livechat && npm run build

- name: Lint check
run: npm run lint

- name: Code format check
run: npm run format

- name: Typescript check
run: npm run typecheck

- name: Create Version PR or Publish to NPM
id: changesets
uses: changesets/action@v1.4.7
with:
commit: "chore(release): version packages"
title: "chore(release): version packages"
version: node .github/changeset-version.js
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_ENV: "production"
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist


# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem
37 changes: 37 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
src

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem
Empty file added .npmrc
Empty file.
21 changes: 21 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"trailingComma": "es5",
"semi": true,
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true,
"importOrder": [
"^@core/(.*)$",
"^@server/(.*)$",
"^@ui/(.*)$",
"^[./]",
"^@/components/(.*)$",
"^@/lib/(.*)$"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": [
"prettier-plugin-tailwindcss",
"@trivago/prettier-plugin-sort-imports"
]
}
Loading

0 comments on commit f6ff3d9

Please sign in to comment.