From 5e49fa53dcc039fbdef2589a35dae2954ca2c361 Mon Sep 17 00:00:00 2001 From: Martin Kapal Date: Tue, 3 Jun 2025 23:20:27 +0200 Subject: [PATCH 1/2] Add a CI pipeline --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..95c9d98 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + build-and-test: + name: 'Build & Test' + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: 'yarn' + + - name: Install + uses: borales/actions-yarn@v5 + with: + cmd: install + + - name: Check Code Format + uses: borales/actions-yarn@v5 + with: + cmd: format:check + + - name: Lint + uses: borales/actions-yarn@v5 + with: + cmd: lint + + - name: Build + uses: borales/actions-yarn@v5 + with: + cmd: build From f9b52fe3b22933559bafb0d74adc97864755a89f Mon Sep 17 00:00:00 2001 From: Martin Kapal Date: Tue, 3 Jun 2025 23:23:29 +0200 Subject: [PATCH 2/2] Format code --- README.md | 14 ++++---------- examples/env.ts | 8 ++++---- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 21a2043..988ae54 100644 --- a/README.md +++ b/README.md @@ -899,9 +899,9 @@ You can show different buttons to each connection by wrapping a sub-tree in a `C You don't need to specify the button's UCID in the scope - the correct UCID will be injected automatically. ```tsx -import { - Button, - ConnectionScopeProvider, +import { + Button, + ConnectionScopeProvider, useConnectionScope, } from 'react-node-insim'; @@ -956,7 +956,6 @@ function UserNameButton() { } ``` - ### Global scope You can show the same set of buttons to all connections wrapping a sub-tree in a `GlobalScopeProvider`. @@ -969,12 +968,7 @@ import { Button, GlobalScopeProvider } from 'react-node-insim'; function App() { return ( - diff --git a/examples/env.ts b/examples/env.ts index 6dbd9cb..31d5916 100644 --- a/examples/env.ts +++ b/examples/env.ts @@ -1,8 +1,8 @@ -import dotenv from "dotenv"; -import fs from "fs"; -import path from "path"; +import dotenv from 'dotenv'; +import fs from 'fs'; +import path from 'path'; -const dotenvPath = path.resolve(".env"); +const dotenvPath = path.resolve('.env'); [`${dotenvPath}.local`, dotenvPath].forEach((dotenvFile) => { if (fs.existsSync(dotenvFile)) {