Skip to content

Commit

Permalink
chore: update to Node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarpl committed Nov 23, 2023
1 parent 0e91479 commit 1083304
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'

- name: Run build
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
- name: Cache node_modules
uses: actions/cache@v3
with:
Expand All @@ -47,7 +47,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['16']
node_version: ['18']
os: [ubuntu-latest] # [windows-latest, macOS-latest]
timeout-minutes: 10
steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lint-staged": "^13.2.2",
"nodemon": "^2.0.20",
"open-cli": "^7.0.1",
"pkg": "^5.8.0",
"pkg": "^5.8.1",
"rimraf": "^3.0.2",
"symlink-dir": "^5.0.1",
"ts-jest": "^26.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/input-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@
"assets": [
"../../node_modules/@sofie-automation/server-core-integration/package.json",
"../../node_modules/node-hid/build/Release/HID.node",
"../input-manager/node_modules/node-hid/build/Release/HID.node",
"../../node_modules/xkeys/node_modules/node-hid/build/Release/HID.node",
"./package.json"
],
"targets": [
"node16-win"
"node18-win"
],
"outputPath": "deploy"
}
Expand Down
14 changes: 9 additions & 5 deletions packages/input-manager/src/feedback/bitmap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SomeFeedback } from '../feedback'
import { rendererFactory } from './typeRenderers/factory'
import path from 'path'
import fs from 'fs/promises'
import { constants as fsConstants } from 'fs'
import process from 'process'

async function makeBitmapFromFeedback(
Expand Down Expand Up @@ -53,7 +54,11 @@ export async function init(): Promise<void> {

const fonts = ['roboto-condensed-regular.ttf', 'roboto-condensed-700.ttf']

const searchPaths = [path.join(process.execPath, './assets'), path.join(process.cwd(), './assets')]
const searchPaths = [
path.join(path.dirname(process.execPath), './assets'),
path.join(process.cwd(), './assets'),
process.cwd(),
]

const foundFiles = await findFiles(fonts, searchPaths)

Expand All @@ -65,18 +70,17 @@ export async function init(): Promise<void> {
async function findFiles(files: string[], paths: string[]): Promise<string[]> {
const result: string[] = []
for (const file of files) {
let foundPath: string | null = null
for (const pathOption of paths) {
try {
const pathToTest = path.join(pathOption, file)
await fs.access(pathToTest, fs.constants.O_RDONLY)
foundPath = pathToTest
await fs.access(pathToTest, fsConstants.O_RDONLY)
// File exists, we can add it to result
result.push(pathToTest)
break
} catch (e) {
// Doesn't exist or can't read
}
}
if (foundPath) result.push(foundPath)
}

return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class TextContext {
#inlinePosition = 0
#margin: TopRightBottomLeft = [0, 0, 0, 0]
#padding: TopRightBottomLeft = [0, 0, 0, 0]
fontFamily = '"RobotoCnd", Roboto, Tahoma, Verdana, Arial, "Noto Sans", "DejaVu Sans"'
fontFamily = '"RobotoCnd", "Roboto Condensed", Roboto, Tahoma, Verdana, Arial, "Noto Sans", "DejaVu Sans"'
fontSize = '14px'
lineHeight = '1'
color = '#fff'
Expand Down
Loading

0 comments on commit 1083304

Please sign in to comment.