Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
z1glr committed Feb 25, 2024
2 parents 948945a + e2fc32f commit f5d27e9
Show file tree
Hide file tree
Showing 52 changed files with 6,471 additions and 3,586 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
out
dist
dist
casparcg-templates
license-generator.ts
license-reporter.config.ts
31 changes: 29 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,42 @@
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": [
"src/server/tsconfig.json",
"src/client/tsconfig.json",
"src/templates/tsconfig.json"
]
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked"
],
"rules": {
"semi": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"quotes": ["error"],
"quote-props": ["error", "as-needed"]
"quote-props": ["error", "as-needed"],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["snake_case"]
},
{
"selector": "typeLike",
"format": ["PascalCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
},
{
"selector": "import",
"format": ["PascalCase", "snake_case", "camelCase"],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
}
]
}
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
node_modules
out
dist
dist
client/*.js
casparcg-templates/JohnCG/*.js
*.map
client/webfonts/bahnschrift.ttf
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\server\\src\\main.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"program": "${workspaceFolder}\\src\\server\\main.ts",
"preLaunchTask": "tsc: build - server",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
Expand Down
33 changes: 26 additions & 7 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,33 @@
"tasks": [
{
"type": "npm",
"script": "build",
"group": {
"kind": "build",
"isDefault": true
},
"script": "build-release",
"group": "build",
"problemMatcher": [],
"label": "npm: build",
"detail": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./build.ps1"
"label": "build release"
},
{
"type": "npm",
"script": "watch-client",
"group": "build",
"problemMatcher": [],
"label": "watch-client"
},
{
"type": "npm",
"script": "watch-templates",
"group": "build",
"problemMatcher": [],
"label": "watch-templates"
},
{
"type": "typescript",
"tsconfig": "src/server/tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": "build",
"label": "tsc: build - server"
}
]
}
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@ Generate lyric-graphics and play them out through CasparCG.
## roadmap
- implement other sequence-items than song
- client: information about connection (active / reconnecting / ...)
- use async / await
- companion integration (buttons for song parts -> send name to casparcg)
- try to get the template and client to use the settings file (CSS has default values, send song data overwrites them)
- check client -> server slide_number out of range
- client: check response-texts, if they are still correct
- create message log / show error messages
- write installation instruction
- write installation instruction (including Bahnschrift-Font installation)
- client communication with osc over websocket?
- client: don't use ifames, include html directly / alternatively: clone iframes instead of creating new ones
- add support for NodeCG
- look into document fragments
- add CLI output to server
- add CLI output to server
- CasparCG: split text and image in two layers: enables text without background
- create dummy-sequence-items for unsupported ones
- disable buttons, when no sequence is loaded
- implement all countdown modes
- countdown: save in server wether it is finished
- add option to change template-directory
- make sequence-comments another design in client
- client-messages: create message-log, group same
- build-script in node / integrate with license-generator
- command-comment: define commands / names which get loaded straigth from the start and can be shown anytime
- song: transmit template in server->client message instead of hardcoding it into the client
- fix "Buffer() is deprecated"
- generate background-image-b64 only if needed
48 changes: 35 additions & 13 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,51 @@
$package_json = Get-Content -Raw package.json | ConvertFrom-Json
$build_name = "JohnCG_" + $package_json.version

# name of the executabe
$node_exec_name = $build_name + ".exe"
$node_exec_name = "node.exe" # overwritten until there is a solution for packaging `sharp`

# clear the dist directory
Remove-Item -Path .\Dist\* -Recurse
New-Item -Type Directory .\Dist\build
New-Item -Type Directory .\Dist\$build_name
Remove-Item -Path .\dist -Recurse
New-Item -Type Directory .\dist\build
New-Item -Type Directory .\dist\$build_name

# bundle the files
yarn esbuild server/src/main.ts --bundle --platform=node --outfile=dist/build/main.js
npm run build-server
npm run build-client
npm run build-templates

# create sea-prep.blob
node --experimental-sea-config .\sea-config.json
# node --experimental-sea-config .\sea-config.json

# get the node executable
node -e "require('fs').copyFileSync(process.execPath, 'dist/build/$build_name.exe')"

# remove the signature from the node executable
& 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe' remove /s dist/build/$build_name.exe
node -e "require('fs').copyFileSync(process.execPath, 'dist/build/$node_exec_name')"

# modify the node executable
yarn postject dist/build/$build_name.exe NODE_SEA_BLOB dist/build/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
# disabled until there is a solution for packaging `sharp`
# # remove the signature from the node executable
# & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe' remove /s dist/build/$node_exec_name
# # modify the node executable
# npx postject dist/build/$node_exec_name NODE_SEA_BLOB dist/build/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2

# copy the files in the output
Copy-Item -Path .\config.json,.\casparcg-template,.\client -Destination .\dist\$build_name -Exclude .eslintrc -Recurse
Copy-Item -Path .\dist\build\$build_name.exe .\dist\$build_name -Recurse
Copy-Item -Path .\config.json -Destination .\dist\$build_name -Exclude .eslintrc
Copy-Item -Path .\casparcg-templates -Destination .\dist\$build_name -Exclude .eslintrc,*.map -Recurse
Copy-Item -Path .\client -Destination .\dist\$build_name -Exclude .eslintrc,*.map,bahnschrift.ttf -Recurse
Copy-Item -Path .\dist\build\$node_exec_name .\dist\$build_name -Recurse

Copy-Item -Path .\node_modules\@img -Destination .\dist\$build_name\node_modules\@img\ -Recurse
Copy-Item -Path .\dist\build\main.js -Destination .\dist\$build_name\main.js

# create a batch file, that starts node with the main.js
New-Item -Path .\dist\$build_name\$build_name.bat -Value "node.exe main.js`npause"

# create and copy the licenses
npx esbuild license-generator.ts --platform=node --bundle --minify --outfile=.\dist\build\license-generator.js
npx license-reporter
node .\dist\build\license-generator.js

Copy-Item -Path .\dist\build\licenses -Destination .\dist\$build_name\ -Recurse
# Copy-Item -Path .\LICENSE -Destination .\dist\$build_name\LICENSE

# pack the files in a .tar.gz-file
tar -cvzf .\dist\$build_name.tar.gz --directory=dist $build_name
10 changes: 0 additions & 10 deletions casparcg-template/.eslintrc

This file was deleted.

Loading

0 comments on commit f5d27e9

Please sign in to comment.