mirror of
https://github.com/unraid/api.git
synced 2025-12-31 05:29:48 -06:00
On FAT32, `fs.stat()` updates accesstime, which means file reads are also writes, which means we can't use `usePoll` without degrading users' flash drives. To keep file reads lazy without a larger refactor, I override `getters.dynamix()` as the entrypoint to re-read the boot drive's dynamix config. Consecutive calls to `getters.dynamix()` are a common access pattern, which means we have to memoize to avoid many redundant file reads, so I used a TTL cache with a 250ms lifetime, hoping to scope config files to each request. `getters.dynamix()` is also used synchonously, so bit the bullet and switched away from async reads for simplicity, considering that most reads will be occurring from memory, even during cache misses. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a TTL memoized loader utility with exported types. * Added a public function to load Dynamix configuration at startup. * **Refactor** * Startup now uses the deterministic, cached config loader; runtime file-watch for Dynamix config removed. * Simplified config state handling and load-status reporting for more predictable startup behavior. * **Tests** * Added tests for TTL caching, eviction, keying, and conditional caching. * **Chores** * Bumped package versions and updated changelog. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
79 lines
2.0 KiB
JSON
79 lines
2.0 KiB
JSON
{
|
|
"name": "unraid-monorepo",
|
|
"private": true,
|
|
"version": "4.25.3",
|
|
"scripts": {
|
|
"build": "pnpm -r build",
|
|
"build:watch": "pnpm -r --parallel --filter '!@unraid/ui' build:watch",
|
|
"codegen": "pnpm -r codegen",
|
|
"i18n:extract": "pnpm --filter @unraid/api i18n:extract && pnpm --filter @unraid/web i18n:extract",
|
|
"dev": "pnpm -r dev",
|
|
"unraid:deploy": "pnpm -r unraid:deploy",
|
|
"test": "pnpm -r test",
|
|
"test:watch": "pnpm -r --parallel test:watch",
|
|
"lint": "pnpm -r lint",
|
|
"lint:fix": "pnpm -r lint:fix",
|
|
"type-check": "pnpm -r type-check",
|
|
"check": "manypkg check",
|
|
"sync-webgui-repo": "node web/scripts/sync-webgui-repo.js",
|
|
"preinstall": "npx check-node-version --node 22 || echo '❌ Node.js 22 required. See readme.md Prerequisites section.'",
|
|
"postinstall": "simple-git-hooks"
|
|
},
|
|
"pnpm": {
|
|
"overrides": {
|
|
"graphql": "16.11.0",
|
|
"@graphql-tools/utils": "10.9.1"
|
|
},
|
|
"peerDependencyRules": {
|
|
"allowAny": [
|
|
"vue"
|
|
]
|
|
},
|
|
"onlyBuiltDependencies": [
|
|
"@apollo/protobufjs",
|
|
"@nestjs/core",
|
|
"@parcel/watcher",
|
|
"@swc/core",
|
|
"@tailwindcss/oxide",
|
|
"@unraid/libvirt",
|
|
"core-js",
|
|
"cpu-features",
|
|
"es5-ext",
|
|
"esbuild",
|
|
"nestjs-pino",
|
|
"protobufjs",
|
|
"sharp",
|
|
"simple-git-hooks",
|
|
"ssh2",
|
|
"unrs-resolver",
|
|
"vue-demi",
|
|
"workerd"
|
|
]
|
|
},
|
|
"dependencies": {
|
|
"@manypkg/cli": "0.25.0",
|
|
"chalk": "5.6.0",
|
|
"diff": "8.0.2",
|
|
"ignore": "7.0.5"
|
|
},
|
|
"devDependencies": {
|
|
"lint-staged": "16.1.5",
|
|
"simple-git-hooks": "2.13.1"
|
|
},
|
|
"simple-git-hooks": {
|
|
"pre-commit": "pnpm lint-staged"
|
|
},
|
|
"lint-staged": {
|
|
"api/**/*.{js,ts}": [
|
|
"pnpm --filter api lint:fix"
|
|
],
|
|
"web/**/*.{js,ts,tsx,vue}": [
|
|
"pnpm --filter web lint:fix"
|
|
],
|
|
"unraid-ui/**/*.{js,ts,tsx,vue}": [
|
|
"pnpm --filter @unraid/ui lint:fix"
|
|
]
|
|
},
|
|
"packageManager": "pnpm@10.15.0"
|
|
}
|