mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 03:56:15 -08:00
`nx lint electron-backend` ran `eslint apps/electron-backend/**/*.ts`
unquoted. Nx executes commands through /bin/sh, which has no `globstar`, so
`**` collapsed to `*` and the shell expanded the pattern itself — matching a
single file out of 247. Quoting hands the pattern to eslint, which expands it
recursively. Two sibling patterns were already quoted, so the breakage had
been worked around per-file rather than fixed; they are now redundant
(verified: the quoted glob alone resolves to the identical 247-file set,
including all 24 frame-copy-runtime files) and collapse into one.
That exposed five real errors the broken glob had been hiding:
- `no-unsafe-finally` x2 — `closeSession` and `disposeSession` both did
`try { ... } finally { return ...; }`. A `return` inside `finally`
discards an in-flight exception, so a failing close/dispose was
indistinguishable from a clean one. Both intentionally always complete
teardown (`shutdown()` disposes every session in turn and must not stop at
the first failure), so the fix keeps that guarantee via an explicit `catch`
and logs the reason instead of dropping it.
- `prefer-const` x2 — a write-once `timeoutId` and module-level `Database`.
The other `timeoutId` in the same file is genuinely reassigned and stays
`let`.
- `no-control-regex` — the filename sanitizer strips control characters on
purpose; disabled inline with that rationale.
The three `max-lines` violations this would also have surfaced are already
gone: #1288 split those specs.
Regression coverage for both teardown paths, each verified to fail against
the old code.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
265 lines
10 KiB
JSON
265 lines
10 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\""
|
|
},
|
|
"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"]
|
|
}
|