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

feat: add skip button plugin #2

Merged
merged 6 commits into from
Apr 30, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"env": {
"browser": true,
"es2021": true,
"jest/globals": true
"es2021": true
},
"plugins": [
"jest"
],
"extends": [
"eslint:recommended",
"plugin:jest/recommended"
"eslint:recommended"
],
"overrides": [
{
"files": [
"plugins/**/test/**"
],
"plugins": [
"vitest"
],
"extends": [
"plugin:vitest/recommended"
],
"rules": {
"complexity": "off",
"max-lines-per-function": "off",
Expand All @@ -26,7 +27,9 @@
}
},
{
"files": ["scripts/**/*.js"],
"files": [
"scripts/**/*.js"
],
"env": {
"browser": false,
"node": true
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Github Page

on:
push:
branches:
- main

jobs:
github-page:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Install dependencies
env :
CI: true
run: |
npm pkg delete scripts.prepare
npm ci

- name: Run build Github Page
run: |
npm run github:page

- name: Deploy GitHub Page 🚀
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
folder: dist
force: false
clean-exclude: pr-preview/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Install dependencies
if: github.event.action != 'closed'
env:
CI: true
run: |
npm pkg delete scripts.prepare
npm ci

- name: Run build
if: github.event.action != 'closed'
run: |
npm run github:page

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: dist
preview-branch: gh-pages
umbrella-dir: pr-preview
7 changes: 7 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ jobs:
- name: Run JS and CSS linters
run: |
npm run eslint && npm run stylelint

- name: Run unit tests
run: |
npm test

- name: Report Coverage
uses: davelosert/vitest-coverage-report-action@v2
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
coverage
node_modules
scripts
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm install
Open your terminal and execute the following command:

```bash
npm run create:plugin
npm run create
```

After running the command, you will be prompted to enter the name of your plugin. A new plugin
Expand Down
10 changes: 0 additions & 10 deletions jest.config.js

This file was deleted.

Loading
Loading