clean turbo config and cache github actions (#1805)

* refactor: turbo scripts

refactor dev and build scripts

remove cleanup

* fix e2e script

* cache playwright

* cache pnpm

* fix docker env in vite

* fixup! refactor: turbo scripts

* chore: add comment
This commit is contained in:
Alex Christoffer Rasmussen
2025-10-07 12:10:24 +02:00
parent 750927dc8d
commit fc7ed6bd20
30 changed files with 266 additions and 227 deletions
+2 -1
View File
@@ -1 +1,2 @@
"ONTIME_VERSION.js" "ONTIME_VERSION.js"
dist/
+13 -1
View File
@@ -13,8 +13,20 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v4
- name: Get pnpm store directory
run: echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
@@ -11,8 +11,20 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v4
- name: Get pnpm store directory
run: echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
+14 -3
View File
@@ -13,15 +13,26 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v4
- name: Get pnpm store directory
run: echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Build project packages - name: Build project packages
run: pnpm turbo @getontime/resolver#build run: pnpm build:resolver
- name: Publish to NPM - name: Publish to NPM
run: pnpm publish --access public --no-git-checks run: pnpm publish --access public --no-git-checks
+44 -36
View File
@@ -16,47 +16,33 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v4
- name: Get pnpm store directory
run: echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
# Run code quality per package # Run code quality
- name: React - Run linter + TypeScript checks - name: Run linter
if: always()
run: pnpm lint && tsc --noEmit
working-directory: ./apps/client
- name: Server - Run linter + TypeScript checks
if: always()
run: pnpm lint && tsc --noEmit
working-directory: ./apps/server
- name: Utils - Run linter + TypeScript checks
if: always()
run: pnpm lint && tsc --noEmit
working-directory: ./packages/utils
- name: Types - Run linter
if: always()
run: pnpm lint run: pnpm lint
working-directory: ./packages/types
- name: Run TypeScript checks
run: pnpm typecheck
# We choose to run tests separately # We choose to run tests separately
- name: React - Run unit tests - name: Run unit tests
if: always() if: always()
run: pnpm test:pipeline run: pnpm test
working-directory: ./apps/client
- name: Server - Run unit tests
if: always()
run: pnpm test:pipeline
working-directory: ./apps/server
- name: Utils - Run unit tests
if: always()
run: pnpm test:pipeline
working-directory: ./packages/utils
e2e-test: e2e-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -64,14 +50,36 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup pnpm - name: Setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v4
- name: Get pnpm store directory
run: echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Build client - name: Get installed Playwright version
run: pnpm build:local run: echo "PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --parseable | cut -s -d '@' -f3 | cut -d '/' -f1)" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
restore-keys: |
${{ runner.os }}-playwright-
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install Playwright Browsers - name: Install Playwright Browsers
run: npx playwright install --with-deps run: npx playwright install --with-deps
+2
View File
@@ -9,3 +9,5 @@ playwright-report
**/*.yml **/*.yml
**/*.json **/*.json
!tsconfig.common.json !tsconfig.common.json
!turbo.json
!package.json
+9 -9
View File
@@ -21,7 +21,7 @@ Locally, we would need to run both the React client and the node.js server in de
From the project root, run the following commands From the project root, run the following commands
- __Install the project dependencies__ by running `pnpm i` - __Install the project dependencies__ by running `pnpm i`
- __Run dev mode__ by running `pnpm turbo dev` - __Run dev mode__ by running `pnpm dev` or `pnpm dev:electron` to get the electron window
### Debugging backend ### Debugging backend
@@ -30,10 +30,10 @@ The previous command will start the development servers for both the client, ser
Typically in dev mode we prefer to start these in separate terminals to help with error tracking and debugging. Typically in dev mode we prefer to start these in separate terminals to help with error tracking and debugging.
We do that by creating two terminals an running We do that by creating two terminals an running
- __Run the React UI__ by running `pnpm turbo dev --filter=ontime-ui` - __Run the React UI__ by running `pnpm dev --filter=ontime-ui`
- __Run the nodejs server__ by running `pnpm turbo dev --filter=ontime-server` - __Run the nodejs server__ by running `pnpm dev --filter=ontime-server`
- If you need to set breakpoints and inspect the code execution, enable Node.js inspect mode by running `pnpm turbo dev:inspect --filter=ontime-server`. - If you need to set breakpoints and inspect the code execution, enable Node.js inspect mode by running `pnpm dev:inspect --filter=ontime-server`.
## TESTING ## TESTING
@@ -46,7 +46,7 @@ Generally we have 2 types of tests.
Unit tests are contained in mostly all the apps and packages (client, server and utils) Unit tests are contained in mostly all the apps and packages (client, server and utils)
You can run unit tests by running `pnpm turbo test:pipeline` from the project root. You can run unit tests by running `pnpm test:pipeline` from the project root.
This will run all tests and close test runner. This will run all tests and close test runner.
Alternatively you can navigate to an app or project and run `pnpm test` to run those tests in watch mode Alternatively you can navigate to an app or project and run `pnpm test` to run those tests in watch mode
@@ -66,7 +66,7 @@ start the webserver with `pnpm dev:server`
Some other useful commands Some other useful commands
- `pnpm e2e --ui` open playwright UI - `pnpm e2e:ui` open playwright UI
- `pnpm e2e --headed` run tests with a visible browser window - `pnpm e2e --headed` run tests with a visible browser window
## CREATE AN INSTALLABLE FILE (Windows | MacOS | Linux) ## CREATE AN INSTALLABLE FILE (Windows | MacOS | Linux)
@@ -77,13 +77,13 @@ You can generate a distribution for your OS by running the following steps.
From the project root, run the following commands From the project root, run the following commands
- __Install the project dependencies__ by running `pnpm i` - __Install the project dependencies__ by running `pnpm i`
- __Build the UI and server__ by running `pnpm turbo run build:electron` - __Build the UI and server__ by running `pnpm build`
- __Create the package__ by running `pnpm turbo run dist-win`, `pnpm turbo run dist-mac` or `pnpm turbo run dist-linux` - __Create the package__ by running `pnpm dist-win`, `pnpm dist-mac` or `pnpm dist-linux`
The build distribution assets will be at `.apps/electron/dist` The build distribution assets will be at `.apps/electron/dist`
Note: The MacOS build will only work in CI, locally it will fail due to notarisation issues. Note: The MacOS build will only work in CI, locally it will fail due to notarisation issues.
Use the `pnpm turbo run dist-mac:local` command to build a MacOS distribution locally and skip the notary process. Use the `pnpm dist-mac:local` command to build a MacOS distribution locally and skip the notary process.
## DOCKER ## DOCKER
+36 -37
View File
@@ -1,37 +1,36 @@
FROM node:22-bullseye AS builder FROM node:22-bullseye AS builder
ENV PNPM_HOME="/pnpm" ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH" ENV PATH="$PNPM_HOME:$PATH"
RUN npm install -g pnpm@10.11.0 RUN npm install -g pnpm@10.11.0
COPY . /app COPY . /app
WORKDIR /app WORKDIR /app
RUN pnpm --filter=ontime-ui --filter=ontime-server --filter=ontime-utils install --config.dedupe-peer-dependents=false --frozen-lockfile RUN pnpm --filter=ontime-ui --filter=ontime-server --filter=ontime-utils --filter=ontime-types install --config.dedupe-peer-dependents=false --frozen-lockfile
RUN pnpm --filter=ontime-ui --filter=ontime-server run build:docker RUN pnpm run build:docker
FROM node:22-alpine FROM node:22-alpine
# Set environment variables # Set environment variables
# Environment Variable to signal that we are running production # Environment Variable to signal that we are running production
ENV NODE_ENV=docker ENV NODE_ENV=docker
# Ontime Data path # Ontime Data path
ENV ONTIME_DATA=/data/ ENV ONTIME_DATA=/data/
WORKDIR /app/ WORKDIR /app/
# Prepare UI # Prepare UI
COPY --from=builder /app/apps/client/build ./client/ COPY --from=builder /app/apps/client/build ./client/
# Prepare Backend # Prepare Backend
COPY --from=builder /app/apps/server/dist/ ./server/ COPY --from=builder /app/apps/server/dist/ ./server/
COPY --from=builder /app/apps/server/src/external/ ./external/ COPY --from=builder /app/apps/server/src/external/ ./external/
COPY --from=builder /app/apps/server/src/user/ ./user/ COPY --from=builder /app/apps/server/src/user/ ./user/
COPY --from=builder /app/apps/server/src/html/ ./html/ COPY --from=builder /app/apps/server/src/html/ ./html/
# Export default ports # Export default ports
EXPOSE 4001/tcp 8888/udp 9999/udp EXPOSE 4001/tcp 8888/udp 9999/udp
CMD ["node", "server/docker.cjs"] CMD ["node", "server/docker.cjs"]
# Build and run commands # Build and run commands
# !!! Note that this command needs pre-build versions of the UI and server apps # docker buildx build . -t getontime/ontime
# docker buildx build . -t getontime/ontime # docker run -p 4001:4001 -p 8888:8888/udp -p 9999:9999/udp -v ./ontime-db:/data/ getontime/ontime
# docker run -p 4001:4001 -p 8888:8888/udp -p 9999:9999/udp -v ./ontime-db:/data/ getontime/ontime
+3 -6
View File
@@ -37,15 +37,12 @@
"addversion": "node -p \"'export const ONTIME_VERSION = ' + JSON.stringify(require('../../package.json').version) + ';'\" > src/ONTIME_VERSION.js", "addversion": "node -p \"'export const ONTIME_VERSION = ' + JSON.stringify(require('../../package.json').version) + ';'\" > src/ONTIME_VERSION.js",
"postinstall": "pnpm addversion", "postinstall": "pnpm addversion",
"dev": "cross-env BROWSER=none vite", "dev": "cross-env BROWSER=none vite",
"build": "vite build", "dev:electron": "pnpm dev",
"build:local": "cross-env NODE_ENV=local vite build",
"build:electron": "cross-env NODE_ENV=local vite build",
"build:docker": "cross-env VITE_IS_DOCKER=true vite build",
"build:localdocker": "cross-env NODE_ENV=local vite build",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"typecheck": "tsc --noEmit",
"build": "vite build",
"test": "vitest", "test": "vitest",
"test:pipeline": "vitest run", "test:pipeline": "vitest run",
"cleanup": "rm -rf .turbo && rm -rf node_modules && rm -rf build",
"analyse": "npx vite-bundle-visualizer" "analyse": "npx vite-bundle-visualizer"
}, },
"browserslist": { "browserslist": {
+3 -3
View File
@@ -17,11 +17,11 @@ export const buyMeACoffeeUrl = 'https://buymeacoffee.com/cpvalente';
// resolve environment // resolve environment
export const appVersion = version; export const appVersion = version;
export const isProduction = import.meta.env.MODE === 'production'; export const isDocker = import.meta.env.IS_DOCKER; // this env is made available by the vite.config.js define function
export const isDev = !isProduction; export const isProduction = import.meta.env.PROD;
export const isDev = import.meta.env.DEV;
export const currentHostName = window.location.hostname; export const currentHostName = window.location.hostname;
export const isLocalhost = currentHostName === 'localhost' || currentHostName === '127.0.0.1'; export const isLocalhost = currentHostName === 'localhost' || currentHostName === '127.0.0.1';
export const isDockerImage = Boolean(import.meta.env.VITE_IS_DOCKER);
export const isOntimeCloud = currentHostName.includes('cloud.getontime.no'); export const isOntimeCloud = currentHostName.includes('cloud.getontime.no');
// resolve entrypoint URLs // resolve entrypoint URLs
@@ -4,7 +4,7 @@ import { MessageTag } from 'ontime-types';
import useScrollIntoView from '../../../../common/hooks/useScrollIntoView'; import useScrollIntoView from '../../../../common/hooks/useScrollIntoView';
import { usePing } from '../../../../common/hooks/useSocket'; import { usePing } from '../../../../common/hooks/useSocket';
import { sendSocket } from '../../../../common/utils/socket'; import { sendSocket } from '../../../../common/utils/socket';
import { isDockerImage } from '../../../../externals'; import { isDocker } from '../../../../externals';
import type { PanelBaseProps } from '../../panel-list/PanelList'; import type { PanelBaseProps } from '../../panel-list/PanelList';
import * as Panel from '../../panel-utils/PanelUtils'; import * as Panel from '../../panel-utils/PanelUtils';
@@ -18,7 +18,7 @@ export default function NetworkLogPanel({ location }: PanelBaseProps) {
return ( return (
<> <>
<Panel.Header>Network</Panel.Header> <Panel.Header>Network</Panel.Header>
{isDockerImage && ( {isDocker && (
<Panel.Section> <Panel.Section>
<OntimeCloudStats /> <OntimeCloudStats />
</Panel.Section> </Panel.Section>
+5 -2
View File
@@ -8,14 +8,17 @@ import svgrPlugin from 'vite-plugin-svgr';
import { ONTIME_VERSION } from './src/ONTIME_VERSION'; import { ONTIME_VERSION } from './src/ONTIME_VERSION';
const sentryAuthToken = process.env.SENTRY_AUTH_TOKEN; const sentryAuthToken = process.env.SENTRY_AUTH_TOKEN;
const isDev = process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'development';
export default defineConfig({ export default defineConfig({
base: './', // Ontime cloud: we use relative paths to allow them to reference a dynamic base set at runtime base: './', // Ontime cloud: we use relative paths to allow them to reference a dynamic base set at runtime
define: {
// we pass along the NODE_ENV here in case it is a docker build
'import.meta.env.IS_DOCKER': process.env.NODE_ENV === 'docker',
},
plugins: [ plugins: [
react(), react(),
svgrPlugin(), svgrPlugin(),
!isDev && sentryAuthToken &&
sentryVitePlugin({ sentryVitePlugin({
org: 'get-ontime', org: 'get-ontime',
project: 'ontime', project: 'ontime',
+2 -4
View File
@@ -21,14 +21,12 @@
"wait-on": "^7.2.0" "wait-on": "^7.2.0"
}, },
"scripts": { "scripts": {
"postinstall": "", "dev:electron": "wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"dev": "wait-on http://localhost:3000 && cross-env NODE_ENV=development electron .",
"dist-win": "electron-builder --publish=never --x64 --win", "dist-win": "electron-builder --publish=never --x64 --win",
"dist-mac": "electron-builder --publish=never --mac", "dist-mac": "electron-builder --publish=never --mac",
"dist-mac:local": "electron-builder --publish=never --mac -c.mac.identity=null", "dist-mac:local": "electron-builder --publish=never --mac -c.mac.identity=null",
"dist-linux": "electron-builder --publish=never --x64 --linux", "dist-linux": "electron-builder --publish=never --x64 --linux"
"cleanup": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
}, },
"build": { "build": {
"productName": "ontime-prerelease", "productName": "ontime-prerelease",
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
+1
View File
@@ -8,6 +8,7 @@
"description": "shared typings for ontime", "description": "shared typings for ontime",
"scripts": { "scripts": {
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"typecheck": "tsc --noEmit",
"prebuild": "pnpm rimraf ./dist", "prebuild": "pnpm rimraf ./dist",
"build": "tsup && pnpm rimraf ./dist/index.js", "build": "tsup && pnpm rimraf ./dist/index.js",
"postbuild": "pnpm rimraf ./dist/index.d.ts" "postbuild": "pnpm rimraf ./dist/index.d.ts"
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
-10
View File
@@ -1,10 +0,0 @@
import * as esbuild from 'esbuild';
import { esbuildCommon } from './esbuildCommon.js';
await esbuild.build({
...esbuildCommon,
entryPoints: ['src/app.ts'],
minify: false,
dropLabels: [],
outfile: 'dist/index.cjs',
});
-8
View File
@@ -1,8 +0,0 @@
import * as esbuild from 'esbuild';
import { esbuildCommon } from './esbuildCommon.js';
await esbuild.build({
...esbuildCommon,
entryPoints: ['src/index.ts'],
outfile: 'dist/docker.cjs',
});
-8
View File
@@ -1,8 +0,0 @@
import * as esbuild from 'esbuild';
import { esbuildCommon } from './esbuildCommon.js';
await esbuild.build({
...esbuildCommon,
entryPoints: ['src/app.ts'],
outfile: 'dist/index.cjs',
});
+16
View File
@@ -0,0 +1,16 @@
import * as esbuild from 'esbuild';
const isDocker = process.env.NODE_ENV === 'docker';
await esbuild.build({
logLevel: 'error',
platform: 'node',
target: ['node20'],
format: 'cjs',
bundle: true,
minify: true,
legalComments: 'external',
dropLabels: ['DEV'],
entryPoints: isDocker ? ['src/index.ts'] : ['src/app.ts'],
outfile: isDocker ? 'dist/docker.cjs' : 'dist/index.cjs',
});
-10
View File
@@ -1,10 +0,0 @@
export const esbuildCommon = {
logLevel: 'error',
platform: 'node',
target: ['node20'],
format: 'cjs',
bundle: true,
minify: true,
legalComments: 'external',
dropLabels: ['DEV'],
};
+9 -10
View File
@@ -48,19 +48,18 @@
"scripts": { "scripts": {
"addversion": "node -p \"'export const ONTIME_VERSION = ' + JSON.stringify(require('../../package.json').version) + ';'\" > src/ONTIME_VERSION.js", "addversion": "node -p \"'export const ONTIME_VERSION = ' + JSON.stringify(require('../../package.json').version) + ';'\" > src/ONTIME_VERSION.js",
"postinstall": "pnpm addversion", "postinstall": "pnpm addversion",
"dev": "cross-env NODE_ENV=development tsx watch ./src/index.ts", "dev": "cross-env NODE_ENV=development tsx watch ./src/index.ts",
"dev:electron": "pnpm dev",
"dev:inspect": "cross-env NODE_ENV=development tsx watch --inspect ./src/index.ts", "dev:inspect": "cross-env NODE_ENV=development tsx watch --inspect ./src/index.ts",
"dev:test": "cross-env IS_TEST=true tsx ./src/index.ts",
"prebuild": "tsx ./scripts/bundleCss.ts && tsx ./scripts/bundleTranslation.ts",
"build": "node esbuild.electron.js",
"build:electron": "node esbuild.electron.js",
"build:local": "node esbuild.dev.js",
"build:docker": "node esbuild.docker.js",
"build:localdocker": "cross-env NODE_ENV=local node esbuild.docker.js",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"test": "cross-env IS_TEST=true vitest",
"test:pipeline": "cross-env IS_TEST=true vitest run",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"cleanup": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
"prebuild": "tsx ./scripts/bundleCss.ts && tsx ./scripts/bundleTranslation.ts",
"build": "node esbuild.js",
"test": "cross-env IS_TEST=true vitest",
"test:pipeline": "cross-env IS_TEST=true vitest run"
} }
} }
+10 -10
View File
@@ -22,19 +22,19 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "turbo run dev", "dev": "turbo run dev",
"dev:electron": "turbo run dev:electron",
"lint": "turbo run lint", "lint": "turbo run lint",
"typecheck": "turbo run typecheck",
"build": "turbo run build", "build": "turbo run build",
"build:local": "turbo run build:local", "build:docker": "cross-env NODE_ENV=docker turbo run build --filter=ontime-server --filter=ontime-ui",
"build:electron": "turbo run build:electron",
"build:localdocker": "turbo run build:localdocker",
"dist-win": "turbo run dist-win", "dist-win": "turbo run dist-win",
"dist-mac": "turbo run dist-mac", "dist-mac": "turbo run dist-mac",
"dist-linux": "turbo run dist-linux", "dist-linux": "turbo run dist-linux",
"e2e": "pnpm clear-temp && cross-env DEBUG=pw:webserver npx playwright test -c playwright.config.ts", "e2e": "turbo run build --filter=ontime-ui && pnpm clear-temp && cross-env DEBUG=pw:webserver npx playwright test -c playwright.config.ts",
"e2e:ui": "cross-env DEBUG=pw:webserver npx playwright test --ui -c playwright.config.ts", "e2e:ui": "cross-env NODE_ENV=development cross-env DEBUG=pw:webserver npx playwright test --ui -c playwright.config.ts",
"e2e:i": "npx playwright codegen", "e2e:i": "npx playwright codegen",
"cleanup": "pnpm rimraf node_modules && rimraf **/node_modules && rimraf **/**/node_modules", "clear-temp": "rimraf e2e/tests/fixtures/tmp",
"clear-temp": "rm -rf e2e/tests/fixtures/tmp" "test": "turbo run test:pipeline"
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.51.1", "@playwright/test": "^1.51.1",
@@ -46,9 +46,9 @@
"eslint-config-prettier": "catalog:", "eslint-config-prettier": "catalog:",
"eslint-plugin-playwright": "^1.5.2", "eslint-plugin-playwright": "^1.5.2",
"prettier": "catalog:", "prettier": "catalog:",
"turbo": "^2.3.3", "turbo": "2.5.8",
"typescript": "catalog:", "typescript": "catalog:",
"rimraf": "catalog:" "rimraf": "catalog:"
}, },
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" "packageManager": "pnpm@10.18.0+sha512.e804f889f1cecc40d572db084eec3e4881739f8dec69c0ff10d2d1beff9a4e309383ba27b5b750059d7f4c149535b6cd0d2cb1ed3aeb739239a4284a68f40cfa"
} }
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
+1 -1
View File
@@ -7,8 +7,8 @@
"private": true, "private": true,
"description": "shared typings for ontime", "description": "shared typings for ontime",
"scripts": { "scripts": {
"cleanup": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"typecheck": "tsc --noEmit",
"build": "tsc" "build": "tsc"
}, },
"keywords": [], "keywords": [],
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
+1 -2
View File
@@ -7,8 +7,7 @@
"scripts": { "scripts": {
"lint": "eslint . --quiet", "lint": "eslint . --quiet",
"test": "vitest", "test": "vitest",
"test:pipeline": "vitest run", "test:pipeline": "vitest run"
"cleanup": "rm -rf .turbo && rm -rf node_modules"
}, },
"dependencies": { "dependencies": {
"deepmerge-ts": "^7.0.3", "deepmerge-ts": "^7.0.3",
+16 -7
View File
@@ -1,6 +1,8 @@
import type { PlaywrightTestConfig } from '@playwright/test'; import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test'; import { devices } from '@playwright/test';
const isDevMode = process.env.NODE_ENV === 'development';
/** /**
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
@@ -15,18 +17,25 @@ const config: PlaywrightTestConfig = {
retries: process.env.CI ? 2 : 0, retries: process.env.CI ? 2 : 0,
workers: 1, workers: 1,
reporter: 'html', reporter: 'html',
webServer: { webServer: isDevMode
command: 'turbo run dev --filter=ontime-server', ? {
port: 4001, command: 'turbo run dev',
reuseExistingServer: true, port: 3000,
timeout: 60 * 1000, reuseExistingServer: true,
}, timeout: 60 * 1000,
}
: {
command: 'turbo run dev --filter=ontime-server',
port: 4001,
reuseExistingServer: true,
timeout: 60 * 1000,
},
use: { use: {
screenshot: 'only-on-failure', screenshot: 'only-on-failure',
video: 'retain-on-failure', video: 'retain-on-failure',
viewport: { width: 1920, height: 1080 }, viewport: { width: 1920, height: 1080 },
actionTimeout: 5000, actionTimeout: 5000,
baseURL: 'http://localhost:4001', baseURL: isDevMode ? 'http://localhost:3000' : 'http://localhost:4001',
ignoreHTTPSErrors: true, ignoreHTTPSErrors: true,
trace: 'on-first-retry', trace: 'on-first-retry',
launchOptions: { launchOptions: {
+29 -29
View File
@@ -75,8 +75,8 @@ importers:
specifier: 'catalog:' specifier: 'catalog:'
version: 6.0.1 version: 6.0.1
turbo: turbo:
specifier: ^2.3.3 specifier: 2.5.8
version: 2.5.6 version: 2.5.8
typescript: typescript:
specifier: 'catalog:' specifier: 'catalog:'
version: 5.5.3 version: 5.5.3
@@ -4890,38 +4890,38 @@ packages:
engines: {node: '>=18.0.0'} engines: {node: '>=18.0.0'}
hasBin: true hasBin: true
turbo-darwin-64@2.5.6: turbo-darwin-64@2.5.8:
resolution: {integrity: sha512-3C1xEdo4aFwMJAPvtlPqz1Sw/+cddWIOmsalHFMrsqqydcptwBfu26WW2cDm3u93bUzMbBJ8k3zNKFqxJ9ei2A==} resolution: {integrity: sha512-Dh5bCACiHO8rUXZLpKw+m3FiHtAp2CkanSyJre+SInEvEr5kIxjGvCK/8MFX8SFRjQuhjtvpIvYYZJB4AGCxNQ==}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
turbo-darwin-arm64@2.5.6: turbo-darwin-arm64@2.5.8:
resolution: {integrity: sha512-LyiG+rD7JhMfYwLqB6k3LZQtYn8CQQUePbpA8mF/hMLPAekXdJo1g0bUPw8RZLwQXUIU/3BU7tXENvhSGz5DPA==} resolution: {integrity: sha512-f1H/tQC9px7+hmXn6Kx/w8Jd/FneIUnvLlcI/7RGHunxfOkKJKvsoiNzySkoHQ8uq1pJnhJ0xNGTlYM48ZaJOQ==}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
turbo-linux-64@2.5.6: turbo-linux-64@2.5.8:
resolution: {integrity: sha512-GOcUTT0xiT/pSnHL4YD6Yr3HreUhU8pUcGqcI2ksIF9b2/r/kRHwGFcsHgpG3+vtZF/kwsP0MV8FTlTObxsYIA==} resolution: {integrity: sha512-hMyvc7w7yadBlZBGl/bnR6O+dJTx3XkTeyTTH4zEjERO6ChEs0SrN8jTFj1lueNXKIHh1SnALmy6VctKMGnWfw==}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
turbo-linux-arm64@2.5.6: turbo-linux-arm64@2.5.8:
resolution: {integrity: sha512-10Tm15bruJEA3m0V7iZcnQBpObGBcOgUcO+sY7/2vk1bweW34LMhkWi8svjV9iDF68+KJDThnYDlYE/bc7/zzQ==} resolution: {integrity: sha512-LQELGa7bAqV2f+3rTMRPnj5G/OHAe2U+0N9BwsZvfMvHSUbsQ3bBMWdSQaYNicok7wOZcHjz2TkESn1hYK6xIQ==}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
turbo-windows-64@2.5.6: turbo-windows-64@2.5.8:
resolution: {integrity: sha512-FyRsVpgaj76It0ludwZsNN40ytHN+17E4PFJyeliBEbxrGTc5BexlXVpufB7XlAaoaZVxbS6KT8RofLfDRyEPg==} resolution: {integrity: sha512-3YdcaW34TrN1AWwqgYL9gUqmZsMT4T7g8Y5Azz+uwwEJW+4sgcJkIi9pYFyU4ZBSjBvkfuPZkGgfStir5BBDJQ==}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
turbo-windows-arm64@2.5.6: turbo-windows-arm64@2.5.8:
resolution: {integrity: sha512-j/tWu8cMeQ7HPpKri6jvKtyXg9K1gRyhdK4tKrrchH8GNHscPX/F71zax58yYtLRWTiK04zNzPcUJuoS0+v/+Q==} resolution: {integrity: sha512-eFC5XzLmgXJfnAK3UMTmVECCwuBcORrWdewoiXBnUm934DY6QN8YowC/srhNnROMpaKaqNeRpoB5FxCww3eteQ==}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
turbo@2.5.6: turbo@2.5.8:
resolution: {integrity: sha512-gxToHmi9oTBNB05UjUsrWf0OyN5ZXtD0apOarC1KIx232Vp3WimRNy3810QzeNSgyD5rsaIDXlxlbnOzlouo+w==} resolution: {integrity: sha512-5c9Fdsr9qfpT3hA0EyYSFRZj1dVVsb6KIWubA9JBYZ/9ZEAijgUEae0BBR/Xl/wekt4w65/lYLTFaP3JmwSO8w==}
hasBin: true hasBin: true
type-check@0.4.0: type-check@0.4.0:
@@ -10369,32 +10369,32 @@ snapshots:
optionalDependencies: optionalDependencies:
fsevents: 2.3.3 fsevents: 2.3.3
turbo-darwin-64@2.5.6: turbo-darwin-64@2.5.8:
optional: true optional: true
turbo-darwin-arm64@2.5.6: turbo-darwin-arm64@2.5.8:
optional: true optional: true
turbo-linux-64@2.5.6: turbo-linux-64@2.5.8:
optional: true optional: true
turbo-linux-arm64@2.5.6: turbo-linux-arm64@2.5.8:
optional: true optional: true
turbo-windows-64@2.5.6: turbo-windows-64@2.5.8:
optional: true optional: true
turbo-windows-arm64@2.5.6: turbo-windows-arm64@2.5.8:
optional: true optional: true
turbo@2.5.6: turbo@2.5.8:
optionalDependencies: optionalDependencies:
turbo-darwin-64: 2.5.6 turbo-darwin-64: 2.5.8
turbo-darwin-arm64: 2.5.6 turbo-darwin-arm64: 2.5.8
turbo-linux-64: 2.5.6 turbo-linux-64: 2.5.8
turbo-linux-arm64: 2.5.6 turbo-linux-arm64: 2.5.8
turbo-windows-64: 2.5.6 turbo-windows-64: 2.5.8
turbo-windows-arm64: 2.5.6 turbo-windows-arm64: 2.5.8
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
+27 -27
View File
@@ -1,12 +1,21 @@
{ {
"$schema": "https://turbo.build/schema.json", "$schema": "https://turbo.build/schema.json",
"globalEnv": ["NODE_ENV", "GITHUB_TOKEN", "APPLEID", "APPLEIDPASS", "TEAMID", "CSC_KEY_PASSWORD", "CSC_LINK"], "globalEnv": [
"NODE_ENV",
"GITHUB_TOKEN",
"APPLEID",
"APPLEIDPASS",
"TEAMID",
"CSC_KEY_PASSWORD",
"CSC_LINK",
"SENTRY_AUTH_TOKEN"
],
"tasks": { "tasks": {
"dev": { "dev": {
"cache": false, "cache": false,
"persistent": true "persistent": true
}, },
"dev:server": { "dev:electron": {
"cache": false, "cache": false,
"persistent": true "persistent": true
}, },
@@ -14,45 +23,36 @@
"cache": false, "cache": false,
"persistent": true "persistent": true
}, },
"dev:test": {
"cache": false
},
"test": {}, "test": {},
"test:pipeline": {}, "test:pipeline": {},
"lint": { "lint": {
"cache": false "dependsOn": ["^lint"]
}, },
"typecheck": { "typecheck": {
"cache": false "dependsOn": ["^typecheck"]
}, },
"build": { "build": {
"dependsOn": [ "dependsOn": ["^build"],
"^build" "outputs": ["dist/**", "build/**"]
],
"env": ["SENTRY_AUTH_TOKEN"]
},
"build:local": {},
"build:electron": {
"env": ["SENTRY_AUTH_TOKEN"]
},
"build:localdocker": {},
"e2e": {
"dependsOn": [
"^build"
]
}, },
"dist-win": { "dist-win": {
"dependsOn": ["build"] "dependsOn": ["build"],
"outputs": ["dist/**"]
}, },
"dist-mac": { "dist-mac": {
"dependsOn": ["build"] "dependsOn": ["build"],
"outputs": ["dist/**"]
}, },
"dist-mac:local": { "dist-mac:local": {
"dependsOn": ["build"] "dependsOn": ["build"],
"outputs": ["dist/**"]
}, },
"dist-linux": { "dist-linux": {
"dependsOn": ["build"] "dependsOn": ["build"],
}, "outputs": ["dist/**"]
"cleanup": {} }
} }
} }