Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/mqtt-5.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hlxid committed Jan 7, 2024
2 parents 740cb49 + 9ac7a7d commit 3d3f5e3
Show file tree
Hide file tree
Showing 33 changed files with 4,251 additions and 16,168 deletions.
73 changes: 36 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.8.1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.1
with:
node-version: "18"

Expand All @@ -31,16 +31,16 @@ jobs:
tar cvzf compilation-results.tar.gz --exclude "node_modules" **/*.js **/*.js.map **/*.d.ts **/*.d.ts.map **/*.tsbuildinfo **/*.ttf
- name: Upload compilation results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: compilation-results
path: compilation-results.tar.gz
name: compilation-results
path: compilation-results.tar.gz

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.8.1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.1
with:
node-version: "18"

Expand All @@ -60,19 +60,19 @@ jobs:
# You may check for other NodeCG runtime errors in the output (these
# may not fail the run).
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, windows-2019]
matrix:
os: [ubuntu-22.04, ubuntu-20.04, windows-2019]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/setup-node@v3.8.1
- uses: actions/setup-node@v4.0.1
with:
node-version: "18"

- name: Download NodeCG
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: nodecg/nodecg
repository: nodecg/nodecg

- name: Get NodeCG commit hash
id: nodecgHash
Expand All @@ -83,15 +83,15 @@ jobs:
id: cache-nodecg-deps
uses: actions/cache@v3
with:
path: 'node_modules'
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-deps
path: "node_modules"
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-deps

- name: Cache NodeCG compilation outputs
id: cache-nodecg-build
uses: actions/cache@v3
with:
path: 'build'
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-build
path: "build"
key: ${{ runner.os }}-${{ env.NODECG_HASH }}-nodecg-build

- name: Install NodeCG dependencies
# Only get dependencies if we didn't get them from the cache
Expand All @@ -117,21 +117,20 @@ jobs:
# We need to escape backslashes to get valid json. Replaces each "\" with "\\"
echo '{"bundles": {"paths": ["'${GITHUB_WORKSPACE//\\/\\\\}'\\nodecg-io","'${GITHUB_WORKSPACE//\\/\\\\}'\\nodecg-io\\services","'${GITHUB_WORKSPACE//\\/\\\\}'\\nodecg-io\\samples"]}}' > ./cfg/nodecg.json
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: "nodecg-io"

- name: Install system dependencies
if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-20.04')
run: sudo apt update && sudo apt-get -y install libusb-1.0-0-dev libasound2-dev libudev-dev

- name: Temp patch \#1030 (ubuntu 22.04) – Removing midi services / samples
working-directory: ./nodecg-io
if: matrix.os == 'ubuntu-22.04'
run: |
sudo rm -rf ./services/nodecg-io-midi-*
sudo rm -rf ./samples/midi-*
sudo rm -rf ./services/nodecg-io-midi-*
sudo rm -rf ./samples/midi-*
- name: Install node native development files
shell: bash
Expand Down Expand Up @@ -170,19 +169,19 @@ jobs:
if: startsWith(github.repository, 'codeoverflow-org') && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && github.ref_type != 'tag'
# Only publish anything if we're sure this version compiles (obviously) and all tests pass.
needs:
- build
- tests
- nodecg
- build
- tests
- nodecg
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.8.1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.1
with:
node-version: "18"
node-version: "18"

- name: Download compilation results # From the build step
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: compilation-results
name: compilation-results

- name: Extract compilation results
run: tar xvf compilation-results.tar.gz
Expand All @@ -195,19 +194,19 @@ jobs:
# to also reference the published tarball.
- name: Patch twitch-auth dependency to use published current tarball
run: |
# Get current version as it is needed for the tarball file name
TWITCH_AUTH_VERSION=$(cat utils/nodecg-io-twitch-auth/package.json | jq .version -r)
# Get current version as it is needed for the tarball file name
TWITCH_AUTH_VERSION=$(cat utils/nodecg-io-twitch-auth/package.json | jq .version -r)
# Find usages in all package.json files and replace with the corresponding tarball url
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print # Print found files for debug purposes
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print0 | \
xargs -0 sed -i "s/\"nodecg-io-twitch-auth\": \".*\"/\"nodecg-io-twitch-auth\": \"https:\/\/codeoverflow-org.github.io\/nodecg-io-publish\/nodecg-io-twitch-auth-${TWITCH_AUTH_VERSION}.tgz\"/g"
# Find usages in all package.json files and replace with the corresponding tarball url
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print # Print found files for debug purposes
find . -name 'package.json' -exec grep -q -E '"nodecg-io-twitch-auth": ".+"' {} \; -print0 | \
xargs -0 sed -i "s/\"nodecg-io-twitch-auth\": \".*\"/\"nodecg-io-twitch-auth\": \"https:\/\/codeoverflow-org.github.io\/nodecg-io-publish\/nodecg-io-twitch-auth-${TWITCH_AUTH_VERSION}.tgz\"/g"
- name: Create npm tarballs
run: npm pack --workspaces

- name: Clone publish repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: codeoverflow-org/nodecg-io-publish
ssh-key: ${{ secrets.PUBLISH_SSH_KEY }}
Expand Down Expand Up @@ -238,7 +237,7 @@ jobs:
done;
- name: Publish
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Publish codeoverflow-org/nodecg-io@${{ github.sha }}
commit_user_name: codeoverflow-org
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
if: startsWith(github.repository, 'codeoverflow-org') && github.actor != 'dependabot[bot]'
steps:
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.10.8

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Checkout docs
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: codeoverflow-org/nodecg-io-docs
path: docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3.8.1
- uses: actions/setup-node@v4.0.1
with:
node-version: "18"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dist/
# Configuration of prettier and ESLint
!.eslintrc.js
!.prettierrc.js
.eslintcache

# Configuration of jest
!jest.config.js
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run format-pre-commit
npx lint-staged
5 changes: 2 additions & 3 deletions nodecg-io-core/dashboard/bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export function renderInstanceSelector(): void {
return;
}

const currentInstance = config.data.bundles[bundle]?.find(
(dep) => dep.serviceType === serviceType,
)?.serviceInstance;
const currentInstance = config.data.bundles[bundle]?.find((dep) => dep.serviceType === serviceType)
?.serviceInstance;

let index = 0;
for (let i = 0; i < selectBundleInstance.options.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions nodecg-io-core/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"watch": "npm run -- --watch"
},
"devDependencies": {
"monaco-editor": "^0.40.0",
"monaco-editor": "^0.45.0",
"nodecg-io-esbuild": "^1.0.0",
"@nodecg/types": "^2.1.11",
"typescript": "^5.2.2"
},
"dependencies": {
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"nodecg-io-core": "^0.3.0",
"events": "^3.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion nodecg-io-core/dashboard/panel.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
5 changes: 4 additions & 1 deletion nodecg-io-core/extension/utils/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import NodeCG from "@nodecg/types";

export class Logger {
constructor(private name: string, private nodecg: NodeCG.ServerAPI) {}
constructor(
private name: string,
private nodecg: NodeCG.ServerAPI,
) {}
trace(...args: any[]): void {
this.nodecg.log.trace(`[${this.name}] ${args[0]}`, ...args.slice(1));
}
Expand Down
2 changes: 1 addition & 1 deletion nodecg-io-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"dependencies": {
"hash-wasm": "^4.9.0",
"ajv": "^8.12.0",
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"tslib": "^2.6.2"
}
}
Loading

0 comments on commit 3d3f5e3

Please sign in to comment.