Files
iptvnator/apps/electron-backend/project.json
4grayandClaude Opus 5 0334296f15 fix(electron-backend): make test suite and lint host-agnostic on Windows checkouts (#1176)
* fix(electron-backend): make test suite and lint host-agnostic across Windows/Linux checkouts

Windows checkouts (core.autocrlf=true) had 13 pre-existing jest failures
and 5 Windows-only lint errors in electron-backend while Linux CI was
green:

- embedded-mpv-native-source.spec: normalize CRLF after readFileSync so
  multi-line source assertions match on autocrlf checkouts
- worker-runtime-paths.spec: build expected candidate paths with
  path.join instead of hardcoded POSIX strings
- external-player-launch-context: join darwin-only paths (.app bundle
  executables, Homebrew Caskroom) with path.posix.join so simulated
  darwin platforms resolve correctly on win32 hosts (no-op on macOS)
- app.spec: build packaged-navigation fixtures with path.resolve +
  pathToFileURL; file:///tmp/... is not a valid win32 file URL
- lint target: quote the eslint glob. The unquoted ** was expanded by
  the POSIX shell on Linux (shallow match), so CI linted only a subset
  of files while Windows passed the literal pattern to ESLint and
  linted the full tree - the hosts checked different file sets
- fix the 5 errors full-tree linting surfaces: prefer-const in
  epg-worker.service and database.worker-connection, no-unsafe-finally
  in external-player-session-registry and embedded-mpv-native.service
  (rewritten as catch-swallow with identical semantics, pinned by new
  regression tests), intentional no-control-regex in the recording
  filename sanitizer; drop stale unused disable directives
- document the quoted-glob convention in CLAUDE.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: mirror the quoted-lint-glob convention into AGENTS.md

AGENTS.md already mirrors the neighbouring max-lines/baseline paragraph from
CLAUDE.md, and it requires coding conventions to stay in sync between the two
files. The quoted-glob rule landed only in CLAUDE.md, so agents bootstrapping
from AGENTS.md could reintroduce a host-dependent lint target.

Also corrects the wording in both copies: the shallow expansion happens on
macOS as well as Linux — /bin/sh has no globstar on either — and the target
still exits 0 with a broken glob, which is why this went unnoticed. Adds the
file-count check that catches it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 23:05:22 +02:00

265 lines
11 KiB
JSON

{
"name": "electron-backend",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/electron-backend/src",
"projectType": "application",
"tags": ["scope:electron", "domain:electron-main", "type:app"],
"targets": {
"build-worker": {
"executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/dist/apps/electron-backend/workers"],
"options": {
"command": "node apps/electron-backend/build-worker.js"
}
},
"build-worker-performance": {
"executor": "nx:run-commands",
"outputs": ["{workspaceRoot}/dist/apps/electron-backend/workers"],
"options": {
"command": "node apps/electron-backend/build-worker.js --performance"
}
},
"build-embedded-mpv": {
"executor": "nx:run-commands",
"cache": false,
"outputs": [
"{workspaceRoot}/apps/electron-backend/native/build/Release"
],
"options": {
"command": "node apps/electron-backend/build-embedded-mpv.js"
}
},
"build": {
"dependsOn": [
"electron-backend:build-worker",
"electron-backend:build-embedded-mpv",
{
"projects": ["web", "remote-control-web"],
"target": "build"
}
],
"executor": "nx-electron:build",
"outputs": ["{options.outputPath}"],
"inputs": [
"production",
"^production",
"{workspaceRoot}/apps/electron-backend/native/build/Release/**",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.d.cts",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.d.cts"
],
"options": {
"outputPath": "dist/apps/electron-backend",
"main": "apps/electron-backend/src/main.ts",
"tsConfig": "apps/electron-backend/tsconfig.app.json",
"assets": [
"apps/electron-backend/src/assets",
{
"glob": "**/*",
"input": "apps/electron-backend/native/build/Release",
"output": "native",
"ignore": [
".deps/**",
"obj.target/**",
"**/.deps/**",
"**/obj.target/**",
"obj/**",
"**/obj/**",
"**/*.pdb",
"**/*.iobj",
"**/*.ipdb",
"**/*.ilk",
"**/*.exp",
"**/*.lib",
"**/*.dll.a"
]
}
]
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/electron-backend/src/environments/environment.ts",
"with": "apps/electron-backend/src/environments/environment.prod.ts"
}
]
},
"electron-performance": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "apps/electron-backend/src/environments/environment.ts",
"with": "apps/electron-backend/src/environments/environment.prod.ts"
}
]
}
}
},
"build-performance": {
"dependsOn": [
"electron-backend:build-worker-performance",
"electron-backend:build-embedded-mpv",
{
"projects": ["web", "remote-control-web"],
"target": "build-performance"
}
],
"executor": "nx:run-commands",
"options": {
"command": "pnpm nx run electron-backend:build:electron-performance --excludeTaskDependencies"
}
},
"build-e2e": {
"dependsOn": [
"electron-backend:build-worker",
"electron-backend:build-embedded-mpv",
{
"projects": ["web"],
"target": "build-e2e"
},
{
"projects": ["remote-control-web"],
"target": "build-e2e"
}
],
"executor": "nx-electron:build",
"outputs": ["{options.outputPath}"],
"inputs": [
"production",
"^production",
"{workspaceRoot}/apps/electron-backend/native/build/Release/**",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.d.cts",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.d.cts"
],
"options": {
"outputPath": "dist/apps/electron-backend",
"main": "apps/electron-backend/src/main.ts",
"tsConfig": "apps/electron-backend/tsconfig.app.json",
"assets": [
"apps/electron-backend/src/assets",
{
"glob": "**/*",
"input": "apps/electron-backend/native/build/Release",
"output": "native",
"ignore": [
".deps/**",
"obj.target/**",
"**/.deps/**",
"**/obj.target/**",
"obj/**",
"**/obj/**",
"**/*.pdb",
"**/*.iobj",
"**/*.ipdb",
"**/*.ilk",
"**/*.exp",
"**/*.lib",
"**/*.dll.a"
]
}
]
}
},
"serve": {
"executor": "nx:run-commands",
"options": {
"command": "nx run electron-backend:serve-electron"
}
},
"serve-electron": {
"dependsOn": [
"electron-backend:build-worker",
"electron-backend:build-embedded-mpv"
],
"executor": "nx-electron:execute",
"options": {
"buildTarget": "electron-backend:build",
"waitUntilTargets": ["web:serve"],
"remoteDebuggingPort": 9222
}
},
"package": {
"dependsOn": [
"electron-backend:build",
"electron-backend:generate-builder-metadata"
],
"executor": "nx-electron:package",
"options": {
"name": "electron-backend",
"frontendProject": "web",
"sourcePath": "dist/apps",
"outputPath": "dist/packages",
"prepackageOnly": true
}
},
"make": {
"dependsOn": [
"electron-backend:build",
"electron-backend:generate-builder-metadata"
],
"executor": "nx-electron:make",
"options": {
"name": "electron-backend",
"frontendProject": "web",
"sourcePath": "dist/apps",
"outputPath": "dist/executables"
}
},
"generate-builder-metadata": {
"dependsOn": ["electron-backend:build"],
"executor": "nx:run-commands",
"cache": true,
"inputs": [
"{workspaceRoot}/package.json",
"{workspaceRoot}/electron-builder.json",
"{workspaceRoot}/tools/packaging/generate-electron-builder-metadata.mjs"
],
"outputs": [
"{workspaceRoot}/apps/electron-backend/src/app/options/electron-builder.metadata.generated.json",
"{workspaceRoot}/dist/apps/electron-backend/package.json"
],
"options": {
"command": "node tools/packaging/generate-electron-builder-metadata.mjs",
"cwd": "{workspaceRoot}"
}
},
"lint": {
"inputs": [
"default",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.d.cts",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.d.cts"
],
"command": "eslint \"apps/electron-backend/**/*.ts\" \"apps/electron-backend/src/app/services/embedded-mpv-frame-copy-runtime.ts\" \"apps/electron-backend/src/app/services/embedded-mpv-frame-copy-runtime/**/*.ts\""
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.preset.js",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/linux-source-archive-contract.d.cts",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.cjs",
"{workspaceRoot}/tools/embedded-mpv/runtime-probe-contract.d.cts"
],
"options": {
"jestConfig": "apps/electron-backend/jest.config.ts"
}
}
},
"tags": ["scope:electron", "domain:electron-main", "type:app"]
}