diff --git a/.gitignore b/.gitignore index 4a5888eb0..251deeb6c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,10 @@ e2e/tests/fixtures/tmp/* build/ dist/ +# bundled assets +translations.json +override.css + # working stuff **/TODO.md diff --git a/apps/electron/package.json b/apps/electron/package.json index 8243c5af1..0437e1ada 100644 --- a/apps/electron/package.json +++ b/apps/electron/package.json @@ -121,7 +121,8 @@ "from": "../server/src/user/", "to": "extraResources/user/", "filter": [ - "**/*" + "**/*", + "*{.ts}" ] } ] diff --git a/apps/server/scripts/bundleCss.ts b/apps/server/scripts/bundleCss.ts index 6b227e306..db16db31b 100644 --- a/apps/server/scripts/bundleCss.ts +++ b/apps/server/scripts/bundleCss.ts @@ -1,8 +1,8 @@ -import { existsSync } from 'fs'; import { writeFile } from 'node:fs/promises'; -import { defaultCss } from '../src/user/styles/bundledCss'; import path from 'path'; +import { defaultCss } from '../src/user/styles/bundledCss'; + /** * Script to write contents of bundledCss to override.css */ @@ -11,10 +11,6 @@ async function bundleCss() { const stylesDir = path.resolve(process.cwd(), 'src', 'user', 'styles'); const cssFile = path.resolve(stylesDir, 'override.css'); - if (!existsSync(cssFile)) { - throw new Error('File does not exist'); - } - await writeFile(cssFile, defaultCss, { encoding: 'utf8' }); } catch (error) { console.error('Failed writing to CSS file: ', error); diff --git a/apps/server/scripts/bundleTranslation.ts b/apps/server/scripts/bundleTranslation.ts index d30422379..343c443e5 100644 --- a/apps/server/scripts/bundleTranslation.ts +++ b/apps/server/scripts/bundleTranslation.ts @@ -1,8 +1,8 @@ -import { existsSync } from 'fs'; import { writeFile } from 'node:fs/promises'; -import { defaultTranslation } from '../src/user/translations/bundledTranslation'; import path from 'path'; +import { defaultTranslation } from '../src/user/translations/bundledTranslations.js'; + /** * Script to write contents of default translation to translation.json */ @@ -11,10 +11,6 @@ async function bundleTranslation() { const translationDir = path.resolve(process.cwd(), 'src', 'user', 'translations'); const translationsFile = path.resolve(translationDir, 'translations.json'); - if (!existsSync(translationsFile)) { - throw new Error('File does not exist'); - } - await writeFile(translationsFile, defaultTranslation, { encoding: 'utf8' }); } catch (error) { console.error('Failed writing to translations file: ', error); diff --git a/apps/server/src/setup/index.ts b/apps/server/src/setup/index.ts index dc0cb615c..9bcf54b5f 100644 --- a/apps/server/src/setup/index.ts +++ b/apps/server/src/setup/index.ts @@ -53,6 +53,8 @@ export function getAppDataPath(): string { * │ │ ├─ override.css * │ ├─ logo/ * │ │ ├─ logo.png + * │ ├─ translations/ + * │ │ ├─ translations.json */ /** resolve file URL in both CJS and ESM (build and dev) */ diff --git a/apps/server/src/user/styles/override.css b/apps/server/src/user/styles/override.css deleted file mode 100644 index a235a8268..000000000 --- a/apps/server/src/user/styles/override.css +++ /dev/null @@ -1,66 +0,0 @@ - -/** - * This CSS file allows user customisation of the UI - * We expose some CSS properties to facilitate this (see below in :root) - * In the cases where this is missing, you can add your selectors here - */ - -:root { - /** Background colour for the views */ - --background-color-override: #ececec; - - /** Main text colour for the views */ - --color-override: #101010; - - /** Text colour for the views */ - --secondary-color-override: #404040; - - /** Accent text colour, used on active elements */ - --accent-color-override: #fa5656; - - /** Label text colour, used on active elements */ - --label-color-override: #6c6c6c; - - /** Timer text colour */ - --timer-color-override: #202020; - --timer-warning-color-override: #ffbc56; - --timer-danger-color-override: #e69000; - --timer-overtime-color-override: #fa5656; - --timer-pending-color-override: #578AF4; - - /** Background for card elements on background */ - --card-background-color-override: #fff; - - /** Font used for all text in views */ - --font-family-override: 'Open Sans'; - - /** Colour used for external message and aux timer in /timer */ - --external-color-override: #161616; - - /** View specific features: /backstage */ - /** ---- Background highlight for blink behaviour */ - --card-background-color-blink-override: #339e4e; - /** ---- Colour used for progress bar background */ - --timer-progress-bg-override: #fff; - /** ---- Colour used for progress bar progress */ - --timer-progress-override: #202020; - - /** View specific features: /op */ - --operator-customfield-font-size-override: 1.25rem; - --operator-running-bg-override: #339e4e; - - /** View specific features: /studio */ - --studio-active: #101010; - --studio-idle: #cfcfcf; - --studio-active-label: #101010; - --studio-idle-label: #595959; - --studio-overtime: #101010; -} - -/** - * You can inspect the page in your browser and add the selectors here. - * In the below example, we change the colour of the overlay message in the stage-timer view. - */ -.stage-timer > .message-overlay--active > div { - color: red; -}