Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9239e6ecc5 | ||
|
|
605af19cd8 | ||
|
|
b4921af60d | ||
|
|
32385206ad | ||
|
|
7e59ba3d5e | ||
|
|
81caaa9d6c | ||
|
|
8bb284e1d3 | ||
|
|
09243148da | ||
|
|
c7c57887cf | ||
|
|
990a924631 | ||
|
|
83caf3ef4b | ||
|
|
991f07ae51 | ||
|
|
bc05128cd4 | ||
|
|
cf0fb8a879 | ||
|
|
1f31735ee0 | ||
|
|
ff974bf343 | ||
|
|
d42bbfce17 | ||
|
|
0130303e74 | ||
|
|
66212b4e47 | ||
|
|
f10bb3ae23 | ||
|
|
af1991a4a3 | ||
|
|
9a9551130c | ||
|
|
a93f03eae4 | ||
|
|
df4b57bd41 | ||
|
|
52fc678e44 | ||
|
|
dade477b32 | ||
|
|
79f88dc3b8 | ||
|
|
136c269935 | ||
|
|
4a12f8be61 | ||
|
|
044ad9edf9 | ||
|
|
57d2c6a7e1 | ||
|
|
46f6301fdd | ||
|
|
c3f300d87d | ||
|
|
1de558dd51 | ||
|
|
2711f3db13 | ||
|
|
ff3933b335 | ||
|
|
fa737638a8 | ||
|
|
97b7c417ab | ||
|
|
58d8005d38 | ||
|
|
507ac5181f | ||
|
|
b0cdb81533 | ||
|
|
fc0367a32f | ||
|
|
48ef8eb6c0 | ||
|
|
7cd30b640c | ||
|
|
e9142c0dbc | ||
|
|
a9855fe8d3 | ||
|
|
7a1272146c | ||
|
|
db61b6f390 | ||
|
|
887c294191 | ||
|
|
2f2a6291a2 | ||
|
|
1b3353118d | ||
|
|
e03f56ac31 | ||
|
|
d571a7f75e | ||
|
|
e3b765b9bd | ||
|
|
4da313826d | ||
|
|
948ed7a7fa | ||
|
|
f7fc64ebc4 | ||
|
|
b7f51d6f5c | ||
|
|
e185eeb6d7 | ||
|
|
90d703b870 | ||
|
|
75640f21e0 |
No files matched your search
+3
-6
@@ -3,9 +3,6 @@ version = 1
|
|||||||
[[analyzers]]
|
[[analyzers]]
|
||||||
name = "javascript"
|
name = "javascript"
|
||||||
|
|
||||||
[analyzers.meta]
|
[analyzers.meta]
|
||||||
plugins = ["react"]
|
plugins = ["react"]
|
||||||
environment = ["nodejs"]
|
environment = ["nodejs"]
|
||||||
|
|
||||||
[[transformers]]
|
|
||||||
name = "prettier"
|
|
||||||
+5
-1
@@ -9,4 +9,8 @@ README.md
|
|||||||
.git
|
.git
|
||||||
dev
|
dev
|
||||||
.build
|
.build
|
||||||
e2e
|
e2e
|
||||||
|
apps/nextjs/.next
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
@@ -41,6 +41,14 @@ DB_URL='FULL_PATH_TO_YOUR_SQLITE_DB_FILE'
|
|||||||
|
|
||||||
TURBO_TELEMETRY_DISABLED=1
|
TURBO_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
# Turborepo remote cache (optional, for faster CI/local builds)
|
||||||
|
# Uncomment and fill in to enable remote caching locally.
|
||||||
|
# CI uses GitHub secrets for these values automatically.
|
||||||
|
# TURBO_API=https://your-cache-worker.workers.dev
|
||||||
|
# TURBO_TEAM=team_your_team
|
||||||
|
# TURBO_TOKEN=your-turbo-token
|
||||||
|
# TURBO_REMOTE_CACHE_SIGNATURE_KEY=your-signature-key
|
||||||
|
|
||||||
# Comma-separated paths to Docker-compatible Unix sockets.
|
# Comma-separated paths to Docker-compatible Unix sockets.
|
||||||
# Useful for connecting to multiple runtimes (Docker + Podman) simultaneously.
|
# Useful for connecting to multiple runtimes (Docker + Podman) simultaneously.
|
||||||
# When unset and no TCP hosts configured, defaults to /var/run/docker.sock.
|
# When unset and no TCP hosts configured, defaults to /var/run/docker.sock.
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ body:
|
|||||||
options:
|
options:
|
||||||
# The below comment is used to insert a new version with on-release.yml
|
# The below comment is used to insert a new version with on-release.yml
|
||||||
#NEXT_VERSION#
|
#NEXT_VERSION#
|
||||||
|
- 1.62.0
|
||||||
- 1.61.0
|
- 1.61.0
|
||||||
- 1.60.1-beta.1
|
- 1.60.1-beta.1
|
||||||
- 1.60.0
|
- 1.60.0
|
||||||
|
|||||||
@@ -15,13 +15,54 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_COLOR: 3
|
FORCE_COLOR: 3
|
||||||
|
SKIP_ENV_VALIDATION: true
|
||||||
|
TURBO_API: ${{ secrets.TURBO_API }}
|
||||||
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
|
||||||
|
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }}
|
||||||
|
TURBO_SCM_HEAD: ${{ github.sha }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
lint-format-autofix:
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed
|
||||||
|
run: |
|
||||||
|
FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx' | tr '\n' ' ')
|
||||||
|
echo "files=$FILES" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Auto-fix lint + format
|
||||||
|
if: steps.changed.outputs.files != ''
|
||||||
|
run: |
|
||||||
|
pnpm exec oxlint --fix ${{ steps.changed.outputs.files }} || true
|
||||||
|
pnpm exec oxfmt --write ${{ steps.changed.outputs.files }}
|
||||||
|
|
||||||
|
- name: Commit fixes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
|
with:
|
||||||
|
commit_message: "style: auto-fix lint and format"
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
@@ -31,31 +72,35 @@ jobs:
|
|||||||
run: cp .env.example .env
|
run: cp .env.example .env
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pnpm lint && pnpm lint:ws
|
run: pnpm turbo lint --affected && pnpm lint:ws
|
||||||
|
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: pnpm format
|
run: pnpm turbo format --affected --continue
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Typecheck
|
||||||
run: pnpm typecheck
|
run: pnpm turbo typecheck --affected
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -78,11 +123,12 @@ jobs:
|
|||||||
e2e:
|
e2e:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
id: build-docker-image
|
id: build-docker-image
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
@@ -90,8 +136,11 @@ jobs:
|
|||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
|
load: true
|
||||||
tags: homarr-e2e
|
tags: homarr-e2e
|
||||||
network: host
|
network: host
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
env:
|
env:
|
||||||
SKIP_ENV_VALIDATION: true
|
SKIP_ENV_VALIDATION: true
|
||||||
- name: Install playwright browsers
|
- name: Install playwright browsers
|
||||||
@@ -105,10 +154,12 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
- name: Copy env
|
- name: Copy env
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp .env.example .env
|
run: cp .env.example .env
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm turbo build --affected
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||||
|
"printWidth": 120,
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"sortPackageJson": true,
|
||||||
|
"ignorePatterns": ["**/*.cjs", "**/lang/**", "static-data/**", "CHANGELOG.md"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"plugins": ["eslint", "typescript", "unicorn", "oxc", "react", "import", "jsx-a11y"],
|
||||||
|
"categories": {
|
||||||
|
"correctness": "error",
|
||||||
|
"suspicious": "warn",
|
||||||
|
"pedantic": "off",
|
||||||
|
"perf": "off",
|
||||||
|
"style": "off",
|
||||||
|
"restriction": "off",
|
||||||
|
"nursery": "off"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
|
||||||
|
"typescript/consistent-type-imports": ["warn", { "prefer": "type-imports", "fixStyle": "separate-type-imports" }],
|
||||||
|
"typescript/no-non-null-assertion": "error",
|
||||||
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
||||||
|
"unicorn/no-new-array": "warn",
|
||||||
|
"unicorn/no-useless-spread": "warn",
|
||||||
|
"unicorn/no-useless-length-check": "warn",
|
||||||
|
"unicorn/no-useless-fallback-in-spread": "warn",
|
||||||
|
"jsx-a11y/prefer-tag-over-role": "warn",
|
||||||
|
"oxc/const-comparisons": "warn",
|
||||||
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
|
"react/no-children-prop": "warn",
|
||||||
|
"jsx-a11y/no-autofocus": "warn",
|
||||||
|
"jsx-a11y/img-redundant-alt": "warn",
|
||||||
|
"react/react-in-jsx-scope": "off"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"reportUnusedDisableDirectives": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["**/*.config.js", "**/*.config.mjs", "**/*.cjs", "**/lang/*.d.json.ts", ".next/**"],
|
||||||
|
"settings": {
|
||||||
|
"react": { "version": "19" }
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-2
@@ -31,6 +31,5 @@ scopeRangeRegex: "(?:const|let|var)\\s+t\\s*=\\s*(?:await\\s+)?(?:getScopedI18n|
|
|||||||
# refactorTemplates:
|
# refactorTemplates:
|
||||||
# - i18n.get("$1")
|
# - i18n.get("$1")
|
||||||
|
|
||||||
|
|
||||||
# If set to true, only enables this custom framework (will disable all built-in frameworks)
|
# If set to true, only enables this custom framework (will disable all built-in frameworks)
|
||||||
monopoly: true
|
monopoly: true
|
||||||
Vendored
+5
-15
@@ -15,9 +15,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "pnpm docker:dev",
|
"command": "pnpm docker:dev",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "lint fix",
|
"name": "lint fix",
|
||||||
@@ -25,9 +23,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "pnpm lint:fix",
|
"command": "pnpm lint:fix",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "format fix",
|
"name": "format fix",
|
||||||
@@ -35,9 +31,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "pnpm format:fix",
|
"command": "pnpm format:fix",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "db push",
|
"name": "db push",
|
||||||
@@ -69,9 +63,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "pnpm test",
|
"command": "pnpm test",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "test ui",
|
"name": "test ui",
|
||||||
@@ -79,9 +71,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"command": "pnpm test:ui",
|
"command": "pnpm test:ui",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Vendored
+3
-14
@@ -1,13 +1,6 @@
|
|||||||
{
|
{
|
||||||
"eslint.workingDirectories": [
|
|
||||||
{
|
|
||||||
"mode": "auto"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"eslint.experimental.useFlatConfig": true,
|
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||||
"js/ts.implicitProjectConfig.experimentalDecorators": true,
|
"js/ts.implicitProjectConfig.experimentalDecorators": true,
|
||||||
"prettier.configPath": "./tooling/prettier/index.mjs",
|
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"ajnart",
|
"ajnart",
|
||||||
"cqmin",
|
"cqmin",
|
||||||
@@ -34,11 +27,7 @@
|
|||||||
],
|
],
|
||||||
"i18n-ally.dirStructure": "auto",
|
"i18n-ally.dirStructure": "auto",
|
||||||
"i18n-ally.displayLanguage": "en",
|
"i18n-ally.displayLanguage": "en",
|
||||||
"i18n-ally.enabledFrameworks": [
|
"i18n-ally.enabledFrameworks": ["custom"],
|
||||||
"custom"
|
"i18n-ally.localesPaths": ["packages/translation/src/lang"],
|
||||||
],
|
"i18n-ally.keystyle": "nested"
|
||||||
"i18n-ally.localesPaths": [
|
|
||||||
"packages/translation/src/lang",
|
|
||||||
],
|
|
||||||
"i18n-ally.keystyle": "nested",
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
## [1.61.1](https://github.com/homarr-labs/homarr/compare/v1.61.0...v1.61.1) (2026-05-18)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **downloads-widget:** increase name column default width ratio ([e9142c0](https://github.com/homarr-labs/homarr/commit/e9142c0dbcaca6cd9215b5292a2d139d96919b51))
|
||||||
|
|
||||||
## [1.61.1-beta.1](https://github.com/homarr-labs/homarr/compare/v1.61.0...v1.61.1-beta.1) (2026-05-08)
|
## [1.61.1-beta.1](https://github.com/homarr-labs/homarr/compare/v1.61.0...v1.61.1-beta.1) (2026-05-08)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
import nextjsConfig from "@homarr/eslint-config/nextjs";
|
|
||||||
import reactConfig from "@homarr/eslint-config/react";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [".next/**"],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
...reactConfig,
|
|
||||||
...nextjsConfig,
|
|
||||||
{
|
|
||||||
files: ["public/sw.js"],
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
self: "readonly",
|
|
||||||
clients: "readonly",
|
|
||||||
skipWaiting: "readonly",
|
|
||||||
importScripts: "readonly",
|
|
||||||
caches: "readonly",
|
|
||||||
fetch: "readonly",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
"@typescript-eslint/no-unsafe-call": "off",
|
|
||||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@@ -6,7 +6,6 @@ import "@homarr/core/infrastructure/logs/env";
|
|||||||
import "@homarr/docker/env";
|
import "@homarr/docker/env";
|
||||||
|
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
import MillionLint from "@million/lint";
|
|
||||||
import createNextIntlPlugin from "next-intl/plugin";
|
import createNextIntlPlugin from "next-intl/plugin";
|
||||||
|
|
||||||
// Package path does not work... so we need to use relative path
|
// Package path does not work... so we need to use relative path
|
||||||
@@ -85,8 +84,4 @@ const nextConfig: NextConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip transform is used because of webpack loader, without it for example 'Tooltip.Floating' will not work and show an error
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const withMillionLint = MillionLint.next({ rsc: true, skipTransform: true, telemetry: false });
|
|
||||||
|
|
||||||
export default withNextIntl(nextConfig);
|
export default withNextIntl(nextConfig);
|
||||||
@@ -7,13 +7,12 @@
|
|||||||
"build": "pnpm with-env next build",
|
"build": "pnpm with-env next build",
|
||||||
"clean": "git clean -xdf .next .turbo node_modules",
|
"clean": "git clean -xdf .next .turbo node_modules",
|
||||||
"dev": "pnpm with-env next dev",
|
"dev": "pnpm with-env next dev",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"start": "pnpm with-env next start",
|
"start": "pnpm with-env next start",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e ../../.env --"
|
"with-env": "dotenv -e ../../.env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "catalog:",
|
"@dnd-kit/core": "catalog:",
|
||||||
"@dnd-kit/modifiers": "catalog:",
|
"@dnd-kit/modifiers": "catalog:",
|
||||||
@@ -56,7 +55,6 @@
|
|||||||
"@mantine/hooks": "catalog:",
|
"@mantine/hooks": "catalog:",
|
||||||
"@mantine/modals": "catalog:",
|
"@mantine/modals": "catalog:",
|
||||||
"@mantine/tiptap": "catalog:",
|
"@mantine/tiptap": "catalog:",
|
||||||
"@million/lint": "catalog:",
|
|
||||||
"@tabler/icons-react": "catalog:",
|
"@tabler/icons-react": "catalog:",
|
||||||
"@tanstack/react-query": "catalog:",
|
"@tanstack/react-query": "catalog:",
|
||||||
"@tanstack/react-query-devtools": "catalog:",
|
"@tanstack/react-query-devtools": "catalog:",
|
||||||
@@ -93,8 +91,6 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/chroma-js": "catalog:",
|
"@types/chroma-js": "catalog:",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
@@ -103,9 +99,7 @@
|
|||||||
"@types/react-dom": "catalog:",
|
"@types/react-dom": "catalog:",
|
||||||
"@types/swagger-ui-react": "catalog:",
|
"@types/swagger-ui-react": "catalog:",
|
||||||
"concurrently": "catalog:",
|
"concurrently": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"node-loader": "catalog:",
|
"node-loader": "catalog:",
|
||||||
"prettier": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,70 +1,27 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useCallback, useRef } from "react";
|
import { Box, Stack } from "@mantine/core";
|
||||||
import { Box, LoadingOverlay, Stack } from "@mantine/core";
|
|
||||||
|
|
||||||
import type { RouterOutputs } from "@homarr/api";
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
|
||||||
import { useCurrentLayout, useRequiredBoard } from "@homarr/boards/context";
|
import { useCurrentLayout, useRequiredBoard } from "@homarr/boards/context";
|
||||||
|
|
||||||
import { BoardCategorySection } from "~/components/board/sections/category-section";
|
import { BoardCategorySection } from "~/components/board/sections/category-section";
|
||||||
import { BoardEmptySection } from "~/components/board/sections/empty-section";
|
import { BoardEmptySection } from "~/components/board/sections/empty-section";
|
||||||
import { BoardBackgroundVideo } from "~/components/layout/background";
|
import { BoardBackgroundVideo } from "~/components/layout/background";
|
||||||
import { fullHeightWithoutHeaderAndFooter } from "~/constants";
|
|
||||||
import { useIsBoardReady } from "./_ready-context";
|
|
||||||
|
|
||||||
let boardName: string | null = null;
|
|
||||||
|
|
||||||
export const updateBoardName = (name: string | null) => {
|
|
||||||
boardName = name;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UpdateCallback = (prev: RouterOutputs["board"]["getHomeBoard"]) => RouterOutputs["board"]["getHomeBoard"];
|
|
||||||
|
|
||||||
export const useUpdateBoard = () => {
|
|
||||||
const utils = clientApi.useUtils();
|
|
||||||
|
|
||||||
const updateBoard = useCallback(
|
|
||||||
(updaterWithoutUndefined: UpdateCallback) => {
|
|
||||||
if (!boardName) {
|
|
||||||
throw new Error("Board name is not set");
|
|
||||||
}
|
|
||||||
utils.board.getBoardByName.setData({ name: boardName }, (previous) =>
|
|
||||||
previous ? updaterWithoutUndefined(previous) : previous,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
[utils],
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
updateBoard,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const ClientBoard = () => {
|
export const ClientBoard = () => {
|
||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
const currentLayoutId = useCurrentLayout();
|
const currentLayoutId = useCurrentLayout();
|
||||||
const isReady = useIsBoardReady();
|
|
||||||
|
|
||||||
const fullWidthSortedSections = board.sections
|
const fullWidthSortedSections = board.sections
|
||||||
.filter((section) => section.kind === "empty" || section.kind === "category")
|
.filter((section) => section.kind === "empty" || section.kind === "category")
|
||||||
.sort((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);
|
.sort((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);
|
||||||
|
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box h="100%" pos="relative">
|
<Box h="100%" pos="relative">
|
||||||
<BoardBackgroundVideo />
|
<BoardBackgroundVideo />
|
||||||
<LoadingOverlay
|
<Stack h="100%">
|
||||||
visible={!isReady}
|
|
||||||
transitionProps={{ duration: 500 }}
|
|
||||||
loaderProps={{ size: "lg" }}
|
|
||||||
h={fullHeightWithoutHeaderAndFooter}
|
|
||||||
/>
|
|
||||||
<Stack ref={ref} h="100%" style={{ visibility: isReady ? "visible" : "hidden" }}>
|
|
||||||
{fullWidthSortedSections.map((section) =>
|
{fullWidthSortedSections.map((section) =>
|
||||||
section.kind === "empty" ? (
|
section.kind === "empty" ? (
|
||||||
// Unique keys per layout to always reinitialize the gridstack
|
|
||||||
<BoardEmptySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
<BoardEmptySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
||||||
) : (
|
) : (
|
||||||
<BoardCategorySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
<BoardCategorySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
||||||
|
|||||||
@@ -41,13 +41,11 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(
|
|||||||
}),
|
}),
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
page: async ({ params }: { params: Promise<TParams> }) => {
|
page: async ({ params }: { params: Promise<TParams> }) => {
|
||||||
const session = await auth();
|
const resolvedParams = await params;
|
||||||
const integrations = await getIntegrationsWithPermissionsAsync(session);
|
|
||||||
|
|
||||||
const board = await getInitialBoard(await params);
|
|
||||||
const queryClient = getQueryClient();
|
const queryClient = getQueryClient();
|
||||||
|
|
||||||
// Prefetch item data
|
const [board, session] = await Promise.all([getInitialBoard(resolvedParams), auth()]);
|
||||||
|
|
||||||
const itemsMap = board.items.reduce((acc, item) => {
|
const itemsMap = board.items.reduce((acc, item) => {
|
||||||
const existing = acc.get(item.kind);
|
const existing = acc.get(item.kind);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
@@ -58,17 +56,20 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(
|
|||||||
return acc;
|
return acc;
|
||||||
}, new Map<WidgetKind, Item[]>());
|
}, new Map<WidgetKind, Item[]>());
|
||||||
|
|
||||||
for (const [kind, items] of itemsMap) {
|
const [integrations] = await Promise.all([
|
||||||
await prefetchForKindAsync(kind, queryClient, items).catch((error) => {
|
getIntegrationsWithPermissionsAsync(session),
|
||||||
logger.error(
|
...Array.from(itemsMap).map(([kind, items]) =>
|
||||||
new ErrorWithMetadata(
|
prefetchForKindAsync(kind, queryClient, items).catch((error) => {
|
||||||
"Failed to prefetch widget",
|
logger.error(
|
||||||
{ widgetKind: kind, itemCount: items.length },
|
new ErrorWithMetadata(
|
||||||
{ cause: error },
|
"Failed to prefetch widget",
|
||||||
),
|
{ widgetKind: kind, itemCount: items.length },
|
||||||
);
|
{ cause: error },
|
||||||
});
|
),
|
||||||
}
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||||
|
|||||||
@@ -1,42 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { PropsWithChildren } from "react";
|
import type { PropsWithChildren } from "react";
|
||||||
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
import { createContext, useCallback, useContext } from "react";
|
||||||
import { usePathname } from "next/navigation";
|
|
||||||
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
|
||||||
import { useRequiredBoard } from "@homarr/boards/context";
|
|
||||||
|
|
||||||
const BoardReadyContext = createContext<{
|
const BoardReadyContext = createContext<{
|
||||||
isReady: boolean;
|
|
||||||
markAsReady: (id: string) => void;
|
markAsReady: (id: string) => void;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
export const BoardReadyProvider = ({ children }: PropsWithChildren) => {
|
export const BoardReadyProvider = ({ children }: PropsWithChildren) => {
|
||||||
const pathname = usePathname();
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
const utils = clientApi.useUtils();
|
const markAsReady = useCallback((_id: string) => {}, []);
|
||||||
const board = useRequiredBoard();
|
|
||||||
const [readySections, setReadySections] = useState<string[]>([]);
|
|
||||||
|
|
||||||
// Reset sections required for ready state
|
|
||||||
useEffect(() => {
|
|
||||||
return () => {
|
|
||||||
setReadySections([]);
|
|
||||||
};
|
|
||||||
}, [pathname, utils]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setReadySections((previous) => previous.filter((id) => board.sections.some((section) => section.id === id)));
|
|
||||||
}, [board.sections.length, setReadySections]);
|
|
||||||
|
|
||||||
const markAsReady = useCallback((id: string) => {
|
|
||||||
setReadySections((previous) => (previous.includes(id) ? previous : [...previous, id]));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BoardReadyContext.Provider
|
<BoardReadyContext.Provider
|
||||||
value={{
|
value={{
|
||||||
isReady: board.sections.length === readySections.length,
|
|
||||||
markAsReady,
|
markAsReady,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -54,13 +31,3 @@ export const useMarkSectionAsReady = () => {
|
|||||||
|
|
||||||
return context.markAsReady;
|
return context.markAsReady;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useIsBoardReady = () => {
|
|
||||||
const context = useContext(BoardReadyContext);
|
|
||||||
|
|
||||||
if (!context) {
|
|
||||||
throw new Error("BoardReadyProvider is required");
|
|
||||||
}
|
|
||||||
|
|
||||||
return context.isReady;
|
|
||||||
};
|
|
||||||
@@ -8,12 +8,14 @@ import { getFirstEmptyPosition } from "./empty-position";
|
|||||||
import { getSectionElements } from "./section-elements";
|
import { getSectionElements } from "./section-elements";
|
||||||
|
|
||||||
export interface CreateItemInput {
|
export interface CreateItemInput {
|
||||||
|
id?: string;
|
||||||
kind: WidgetKind;
|
kind: WidgetKind;
|
||||||
options?: Record<string, unknown>;
|
options?: Record<string, unknown>;
|
||||||
|
integrationIds?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createItemCallback =
|
export const createItemCallback =
|
||||||
({ kind, options = {} }: CreateItemInput) =>
|
({ id, kind, options = {}, integrationIds = [] }: CreateItemInput) =>
|
||||||
(previous: Board): Board => {
|
(previous: Board): Board => {
|
||||||
const firstSection = previous.sections
|
const firstSection = previous.sections
|
||||||
.filter((section): section is EmptySection => section.kind === "empty")
|
.filter((section): section is EmptySection => section.kind === "empty")
|
||||||
@@ -23,11 +25,11 @@ export const createItemCallback =
|
|||||||
if (!firstSection) return previous;
|
if (!firstSection) return previous;
|
||||||
|
|
||||||
const widget = {
|
const widget = {
|
||||||
id: createId(),
|
id: id ?? createId(),
|
||||||
kind,
|
kind,
|
||||||
options,
|
options,
|
||||||
layouts: createItemLayouts(previous, firstSection),
|
layouts: createItemLayouts(previous, firstSection),
|
||||||
integrationIds: [],
|
integrationIds,
|
||||||
advancedOptions: {
|
advancedOptions: {
|
||||||
title: null,
|
title: null,
|
||||||
customCssClasses: [],
|
customCssClasses: [],
|
||||||
|
|||||||
@@ -2,20 +2,26 @@ import { useMemo, useState } from "react";
|
|||||||
import { Avatar, Button, Card, Center, Grid, Group, Input, Stack, Text, Tooltip } from "@mantine/core";
|
import { Avatar, Button, Card, Center, Grid, Group, Input, Stack, Text, Tooltip } from "@mantine/core";
|
||||||
import { IconSearch } from "@tabler/icons-react";
|
import { IconSearch } from "@tabler/icons-react";
|
||||||
|
|
||||||
import { objectEntries } from "@homarr/common";
|
import { clientApi } from "@homarr/api/client";
|
||||||
|
import { createId, objectEntries } from "@homarr/common";
|
||||||
import { getIconUrl, getIntegrationName } from "@homarr/definitions";
|
import { getIconUrl, getIntegrationName } from "@homarr/definitions";
|
||||||
import type { IntegrationKind, WidgetKind } from "@homarr/definitions";
|
import type { IntegrationKind, WidgetKind } from "@homarr/definitions";
|
||||||
import { createModal } from "@homarr/modals";
|
import { createModal, useModalAction } from "@homarr/modals";
|
||||||
|
import { useSettings } from "@homarr/settings";
|
||||||
import { useI18n } from "@homarr/translation/client";
|
import { useI18n } from "@homarr/translation/client";
|
||||||
import type { TablerIcon } from "@homarr/ui";
|
import type { TablerIcon } from "@homarr/ui";
|
||||||
import { widgetImports } from "@homarr/widgets";
|
import { reduceWidgetOptionsWithDefaultValues, widgetImports } from "@homarr/widgets";
|
||||||
|
import { WidgetEditModal } from "@homarr/widgets/modals";
|
||||||
|
|
||||||
import { useItemActions } from "./item-actions";
|
import { useItemActions } from "./item-actions";
|
||||||
|
|
||||||
export const ItemSelectModal = createModal<void>(({ actions }) => {
|
export const ItemSelectModal = createModal<void>(({ actions }) => {
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const { createItem } = useItemActions();
|
const { createItem, updateItemOptions, updateItemAdvancedOptions, updateItemIntegrations } = useItemActions();
|
||||||
|
const { openModal: openEditModal } = useModalAction(WidgetEditModal);
|
||||||
|
const { data: integrationData } = clientApi.integration.all.useQuery();
|
||||||
|
const settings = useSettings();
|
||||||
|
|
||||||
const items = useMemo(
|
const items = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -40,8 +46,43 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleAdd = (kind: WidgetKind) => {
|
const handleAdd = (kind: WidgetKind) => {
|
||||||
createItem({ kind });
|
const definition = widgetImports[kind].definition;
|
||||||
|
const hasIntegrationSupport = "supportedIntegrations" in definition;
|
||||||
|
|
||||||
|
const matchingIntegrations = hasIntegrationSupport
|
||||||
|
? (integrationData ?? []).filter((integration) =>
|
||||||
|
(definition.supportedIntegrations as string[]).includes(integration.kind),
|
||||||
|
)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
const integrationIds = matchingIntegrations.map((i) => i.id);
|
||||||
|
const itemId = createId();
|
||||||
|
const defaultOptions = reduceWidgetOptionsWithDefaultValues(kind, settings);
|
||||||
|
|
||||||
|
createItem({ id: itemId, kind, integrationIds });
|
||||||
actions.closeModal();
|
actions.closeModal();
|
||||||
|
|
||||||
|
openEditModal(
|
||||||
|
{
|
||||||
|
kind,
|
||||||
|
value: {
|
||||||
|
advancedOptions: { title: null, customCssClasses: [], borderColor: "" },
|
||||||
|
options: defaultOptions,
|
||||||
|
integrationIds,
|
||||||
|
},
|
||||||
|
onSuccessfulEdit: ({ options, integrationIds: newIntegrationIds, advancedOptions }) => {
|
||||||
|
updateItemOptions({ itemId, newOptions: options });
|
||||||
|
updateItemAdvancedOptions({ itemId, newAdvancedOptions: advancedOptions });
|
||||||
|
updateItemIntegrations({ itemId, newIntegrations: newIntegrationIds });
|
||||||
|
},
|
||||||
|
integrationData: matchingIntegrations,
|
||||||
|
integrationSupport: hasIntegrationSupport,
|
||||||
|
settings,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: (titleT) => `${titleT("item.edit.title")} - ${titleT(`widget.${kind}.name`)}`,
|
||||||
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useDisclosure } from "@mantine/hooks";
|
|||||||
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
||||||
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
import { clientApi } from "@homarr/api/client";
|
||||||
|
import { useSession } from "@homarr/auth/client";
|
||||||
import { useRequiredBoard } from "@homarr/boards/context";
|
import { useRequiredBoard } from "@homarr/boards/context";
|
||||||
|
|
||||||
import type { CategorySection } from "~/app/[locale]/boards/_types";
|
import type { CategorySection } from "~/app/[locale]/boards/_types";
|
||||||
@@ -10,19 +11,36 @@ import { CategoryMenu } from "./category/category-menu";
|
|||||||
import { GridStack } from "./gridstack/gridstack";
|
import { GridStack } from "./gridstack/gridstack";
|
||||||
import classes from "./item.module.css";
|
import classes from "./item.module.css";
|
||||||
|
|
||||||
|
const localStorageKey = (sectionId: string) => `homarr-section-collapsed-${sectionId}`;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
section: CategorySection;
|
section: CategorySection;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BoardCategorySection = ({ section }: Props) => {
|
export const BoardCategorySection = ({ section }: Props) => {
|
||||||
|
const { status } = useSession();
|
||||||
const { mutate } = clientApi.section.changeCollapsed.useMutation();
|
const { mutate } = clientApi.section.changeCollapsed.useMutation();
|
||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
const [opened, { toggle }] = useDisclosure(section.collapsed, {
|
|
||||||
|
const initialCollapsed =
|
||||||
|
typeof window !== "undefined"
|
||||||
|
? (localStorage.getItem(localStorageKey(section.id)) ?? String(section.collapsed)) === "true"
|
||||||
|
: section.collapsed;
|
||||||
|
|
||||||
|
const [opened, { toggle }] = useDisclosure(initialCollapsed, {
|
||||||
onOpen() {
|
onOpen() {
|
||||||
mutate({ sectionId: section.id, collapsed: true });
|
if (status === "authenticated") {
|
||||||
|
mutate({ sectionId: section.id, collapsed: true });
|
||||||
|
} else if (status === "unauthenticated") {
|
||||||
|
localStorage.setItem(localStorageKey(section.id), "true");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
mutate({ sectionId: section.id, collapsed: false });
|
if (status === "authenticated") {
|
||||||
|
mutate({ sectionId: section.id, collapsed: false });
|
||||||
|
} else if (status === "unauthenticated") {
|
||||||
|
localStorage.setItem(localStorageKey(section.id), "false");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export const BoardBackgroundVideo = () => {
|
|||||||
muted
|
muted
|
||||||
loop
|
loop
|
||||||
playsInline
|
playsInline
|
||||||
|
aria-hidden="true"
|
||||||
style={{
|
style={{
|
||||||
position: "fixed",
|
position: "fixed",
|
||||||
width: "100vw",
|
width: "100vw",
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: ["tasks.cjs"],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,20 +4,19 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./src/main.ts",
|
||||||
|
"types": "./src/main.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/main.ts"
|
".": "./src/main.ts"
|
||||||
},
|
},
|
||||||
"main": "./src/main.ts",
|
|
||||||
"types": "./src/main.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e ../../.env --"
|
"with-env": "dotenv -e ../../.env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/analytics": "workspace:^0.1.0",
|
"@homarr/analytics": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -43,14 +42,10 @@
|
|||||||
"undici": "catalog:"
|
"undici": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/node": "catalog:",
|
"@types/node": "catalog:",
|
||||||
"dotenv-cli": "catalog:",
|
"dotenv-cli": "catalog:",
|
||||||
"esbuild": "catalog:",
|
"esbuild": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"prettier": "catalog:",
|
|
||||||
"tsx": "catalog:",
|
"tsx": "catalog:",
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
},
|
},
|
||||||
"include": ["."],
|
"include": ["."],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules", "*.cjs", "*.css"]
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: ["wssServer.cjs"],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,20 +4,19 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./src/main.ts",
|
||||||
|
"types": "./src/main.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/main.ts"
|
".": "./src/main.ts"
|
||||||
},
|
},
|
||||||
"main": "./src/main.ts",
|
|
||||||
"types": "./src/main.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e ../../.env --"
|
"with-env": "dotenv -e ../../.env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -32,13 +31,9 @@
|
|||||||
"ws": "catalog:"
|
"ws": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/ws": "catalog:",
|
"@types/ws": "catalog:",
|
||||||
"esbuild": "catalog:",
|
"esbuild": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"prettier": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
},
|
},
|
||||||
"include": ["."],
|
"include": ["."],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules", "*.cjs", "*.css"]
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
"name": "homarr-prebuilt-debian",
|
"name": "homarr-prebuilt-debian",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^12.9.0"
|
"better-sqlite3": "^12.10.0"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.33.4",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.15.0",
|
"node": ">=24.15.0",
|
||||||
"pnpm": ">=10.33.4"
|
"pnpm": ">=10.33.4"
|
||||||
},
|
},
|
||||||
|
"packageManager": "pnpm@10.33.4",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"better-sqlite3"
|
"better-sqlite3"
|
||||||
|
|||||||
+6
-6
@@ -9,17 +9,17 @@ importers:
|
|||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
better-sqlite3:
|
better-sqlite3:
|
||||||
specifier: ^12.9.0
|
specifier: ^12.10.0
|
||||||
version: 12.9.0
|
version: 12.10.0
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
base64-js@1.5.1:
|
base64-js@1.5.1:
|
||||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||||
|
|
||||||
better-sqlite3@12.9.0:
|
better-sqlite3@12.10.0:
|
||||||
resolution: {integrity: sha512-wqUv4Gm3toFpHDQmaKD4QhZm3g1DjUBI0yzS4UBl6lElUmXFYdTQmmEDpAFa5o8FiFiymURypEnfVHzILKaxqQ==}
|
resolution: {integrity: sha512-CyzaZRQKyHkB2ZInfTTl2nvT33EbDpjkLEbE8/Zck3Ll6O0qqvuGdrJ45HgtH+HykRg88ITY3AdreBGN70aBSQ==}
|
||||||
engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x}
|
engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x || 26.x}
|
||||||
|
|
||||||
bindings@1.5.0:
|
bindings@1.5.0:
|
||||||
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
|
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
|
||||||
@@ -148,7 +148,7 @@ snapshots:
|
|||||||
|
|
||||||
base64-js@1.5.1: {}
|
base64-js@1.5.1: {}
|
||||||
|
|
||||||
better-sqlite3@12.9.0:
|
better-sqlite3@12.10.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
bindings: 1.5.0
|
bindings: 1.5.0
|
||||||
prebuild-install: 7.1.3
|
prebuild-install: 7.1.3
|
||||||
|
|||||||
@@ -51,4 +51,4 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql_data:
|
mysql_data:
|
||||||
postgresql_data:
|
postgresql_data:
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { chromium } from "playwright";
|
import { chromium } from "@playwright/test";
|
||||||
import { GenericContainer } from "testcontainers";
|
import { GenericContainer } from "testcontainers";
|
||||||
import { describe, expect, test } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { chromium } from "playwright";
|
import { chromium } from "@playwright/test";
|
||||||
import { describe, test } from "vitest";
|
import { describe, test } from "vitest";
|
||||||
|
|
||||||
import { OnboardingActions } from "./shared/actions/onboarding-actions";
|
import { OnboardingActions } from "./shared/actions/onboarding-actions";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createId } from "@paralleldrive/cuid2";
|
import { createId } from "@paralleldrive/cuid2";
|
||||||
import type { Page } from "playwright";
|
import type { Page } from "@playwright/test";
|
||||||
|
|
||||||
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
||||||
import type { SqliteDatabase } from "../e2e-db";
|
import type { SqliteDatabase } from "../e2e-db";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import type { Page } from "@playwright/test";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import type { Page } from "playwright";
|
|
||||||
import { expect } from "vitest";
|
import { expect } from "vitest";
|
||||||
|
|
||||||
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
||||||
|
|||||||
+15
-15
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homarr",
|
"name": "homarr",
|
||||||
"version": "1.61.1-beta.1",
|
"version": "1.61.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env CI=true turbo build",
|
"build": "cross-env CI=true turbo build",
|
||||||
@@ -17,12 +17,11 @@
|
|||||||
"db:studio": "pnpm -F db studio",
|
"db:studio": "pnpm -F db studio",
|
||||||
"dev": "pnpm -F nextjs dev",
|
"dev": "pnpm -F nextjs dev",
|
||||||
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
||||||
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
"format": "turbo format --continue",
|
||||||
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
"format:fix": "turbo format --continue -- --write",
|
||||||
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
|
"lint": "turbo lint --continue",
|
||||||
"lint:fix": "turbo lint --continue -- --fix --cache --cache-location node_modules/.cache/.eslintcache",
|
"lint:fix": "turbo lint --continue -- --fix",
|
||||||
"lint:ws": "pnpm dlx sherif@latest",
|
"lint:ws": "pnpm dlx sherif@latest",
|
||||||
"package:new": "turbo gen init",
|
|
||||||
"release": "semantic-release",
|
"release": "semantic-release",
|
||||||
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
|
"scripts:update-bug-report-template": "tsx ./scripts/update-bug-report-template.mts",
|
||||||
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
|
"scripts:update-readme-integrations": "tsx ./scripts/update-integration-list.mts",
|
||||||
@@ -33,9 +32,8 @@
|
|||||||
"typecheck": "turbo typecheck",
|
"typecheck": "turbo typecheck",
|
||||||
"with-env": "dotenv -e .env --"
|
"with-env": "dotenv -e .env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@playwright/test": "catalog:",
|
||||||
"@semantic-release/changelog": "catalog:",
|
"@semantic-release/changelog": "catalog:",
|
||||||
"@semantic-release/commit-analyzer": "catalog:",
|
"@semantic-release/commit-analyzer": "catalog:",
|
||||||
"@semantic-release/git": "catalog:",
|
"@semantic-release/git": "catalog:",
|
||||||
@@ -51,7 +49,8 @@
|
|||||||
"cross-env": "catalog:",
|
"cross-env": "catalog:",
|
||||||
"jsdom": "catalog:",
|
"jsdom": "catalog:",
|
||||||
"json5": "catalog:",
|
"json5": "catalog:",
|
||||||
"prettier": "catalog:",
|
"oxfmt": "catalog:",
|
||||||
|
"oxlint": "catalog:",
|
||||||
"semantic-release": "catalog:",
|
"semantic-release": "catalog:",
|
||||||
"testcontainers": "catalog:",
|
"testcontainers": "catalog:",
|
||||||
"turbo": "catalog:",
|
"turbo": "catalog:",
|
||||||
@@ -59,11 +58,11 @@
|
|||||||
"vite-tsconfig-paths": "catalog:",
|
"vite-tsconfig-paths": "catalog:",
|
||||||
"vitest": "catalog:"
|
"vitest": "catalog:"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.33.4",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.15.0",
|
"node": ">=24.15.0",
|
||||||
"pnpm": ">=10.33.4"
|
"pnpm": ">=10.33.4"
|
||||||
},
|
},
|
||||||
|
"packageManager": "pnpm@10.33.4",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@tree-sitter-grammars/tree-sitter-yaml",
|
"@tree-sitter-grammars/tree-sitter-yaml",
|
||||||
@@ -79,23 +78,23 @@
|
|||||||
"overrides": {
|
"overrides": {
|
||||||
"@babel/helpers@<7.26.10": ">=7.29.2",
|
"@babel/helpers@<7.26.10": ">=7.29.2",
|
||||||
"@babel/runtime@<7.26.10": ">=7.29.2",
|
"@babel/runtime@<7.26.10": ">=7.29.2",
|
||||||
"axios@>=1.0.0 <1.8.2": ">=1.16.0",
|
"axios@>=1.0.0 <1.8.2": ">=1.16.1",
|
||||||
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.6",
|
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.6",
|
||||||
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.6",
|
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.6",
|
||||||
"esbuild@<=0.24.2": ">=0.28.0",
|
"esbuild@<=0.24.2": ">=0.28.0",
|
||||||
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
||||||
"hono@<4.6.5": ">=4.12.16",
|
"hono@<4.6.5": ">=4.12.21",
|
||||||
"linkifyjs@<4.3.2": ">=4.3.2",
|
"linkifyjs@<4.3.2": ">=4.3.3",
|
||||||
"nanoid@>=4.0.0 <5.0.9": ">=5.1.11",
|
"nanoid@>=4.0.0 <5.0.9": ">=5.1.11",
|
||||||
"prismjs@<1.30.0": ">=1.30.0",
|
"prismjs@<1.30.0": ">=1.30.0",
|
||||||
"proxmox-api>undici": "7.24.6",
|
"proxmox-api>undici": "7.24.6",
|
||||||
"react-is": "^19.2.6",
|
"react-is": "^19.2.6",
|
||||||
"rollup@>=4.0.0 <4.22.4": ">=4.60.3",
|
"rollup@>=4.0.0 <4.22.4": ">=4.60.4",
|
||||||
"sha.js@<=2.4.11": ">=2.4.12",
|
"sha.js@<=2.4.11": ">=2.4.12",
|
||||||
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
|
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
|
||||||
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
|
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
|
||||||
"tmp@<=0.2.3": ">=0.2.5",
|
"tmp@<=0.2.3": ">=0.2.5",
|
||||||
"vite@>=5.0.0 <=5.4.18": ">=8.0.11"
|
"vite@>=5.0.0 <=5.4.18": ">=8.0.14"
|
||||||
},
|
},
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
||||||
@@ -104,6 +103,7 @@
|
|||||||
"allowUnusedPatches": true,
|
"allowUnusedPatches": true,
|
||||||
"ignoredBuiltDependencies": [
|
"ignoredBuiltDependencies": [
|
||||||
"@scarf/scarf",
|
"@scarf/scarf",
|
||||||
|
"@swc/core",
|
||||||
"core-js-pure",
|
"core-js-pure",
|
||||||
"protobufjs"
|
"protobufjs"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
@@ -32,10 +31,7 @@
|
|||||||
"superjson": "catalog:"
|
"superjson": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./src/index.ts",
|
||||||
|
"types": "./src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./client": "./src/client.ts",
|
"./client": "./src/client.ts",
|
||||||
@@ -12,15 +14,12 @@
|
|||||||
"./shared": "./src/shared.ts",
|
"./shared": "./src/shared.ts",
|
||||||
"./open-api": "./src/open-api.ts"
|
"./open-api": "./src/open-api.ts"
|
||||||
},
|
},
|
||||||
"main": "./index.ts",
|
|
||||||
"types": "./index.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
@@ -55,11 +54,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"prettier": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./index.ts",
|
||||||
|
"types": "./index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./index.ts",
|
".": "./index.ts",
|
||||||
"./next": "./next.ts",
|
"./next": "./next.ts",
|
||||||
@@ -14,15 +16,12 @@
|
|||||||
"./shared": "./shared.ts",
|
"./shared": "./shared.ts",
|
||||||
"./env": "./env.ts"
|
"./env": "./env.ts"
|
||||||
},
|
},
|
||||||
"main": "./index.ts",
|
|
||||||
"types": "./index.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/core": "catalog:",
|
"@auth/core": "catalog:",
|
||||||
"@auth/drizzle-adapter": "catalog:",
|
"@auth/drizzle-adapter": "catalog:",
|
||||||
@@ -41,13 +40,9 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/bcrypt": "catalog:",
|
"@types/bcrypt": "catalog:",
|
||||||
"@types/cookies": "catalog:",
|
"@types/cookies": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"prettier": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,11 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
"./context": "./src/context.tsx",
|
|
||||||
"./updater": "./src/updater.ts",
|
|
||||||
"./edit-mode": "./src/edit-mode.tsx"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -16,23 +11,24 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
"./context": "./src/context.tsx",
|
||||||
|
"./updater": "./src/updater.ts",
|
||||||
|
"./edit-mode": "./src/edit-mode.tsx"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"react": "catalog:",
|
"react": "catalog:",
|
||||||
"react-dom": "catalog:"
|
"react-dom": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,16 +11,18 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/index.ts --bundle --platform=node --outfile=cli.cjs --external:bcrypt --external:cpu-features --loader:.html=text --loader:.node=text",
|
"build": "esbuild src/index.ts --bundle --platform=node --outfile=cli.cjs --external:bcrypt --external:cpu-features --loader:.html=text --loader:.node=text",
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"run": "pnpm with-env node cli.cjs",
|
"run": "pnpm with-env node cli.cjs",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e .env --"
|
"with-env": "dotenv -e .env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@drizzle-team/brocli": "catalog:",
|
"@drizzle-team/brocli": "catalog:",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -33,11 +32,8 @@
|
|||||||
"dotenv": "catalog:"
|
"dotenv": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"esbuild": "catalog:",
|
"esbuild": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,13 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./types": "./src/types.ts",
|
|
||||||
"./server": "./src/server.ts",
|
|
||||||
"./client": "./src/client.ts",
|
|
||||||
"./env": "./env.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -18,13 +11,19 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./types": "./src/types.ts",
|
||||||
|
"./server": "./src/server.ts",
|
||||||
|
"./client": "./src/client.ts",
|
||||||
|
"./env": "./env.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@paralleldrive/cuid2": "catalog:",
|
"@paralleldrive/cuid2": "catalog:",
|
||||||
@@ -39,10 +38,7 @@
|
|||||||
"zod-validation-error": "catalog:"
|
"zod-validation-error": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,3 +5,26 @@ export const capitalize = <T extends string>(str: T) => {
|
|||||||
export const isNullOrWhitespace = (value: string | null): value is null => {
|
export const isNullOrWhitespace = (value: string | null): value is null => {
|
||||||
return value == null || value.trim() === "";
|
return value == null || value.trim() === "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const bestMatch = <TItem extends Record<string, unknown>>(
|
||||||
|
search: string,
|
||||||
|
options: TItem[],
|
||||||
|
by: (item: TItem) => string,
|
||||||
|
) => {
|
||||||
|
if (options.length === 0) return null;
|
||||||
|
|
||||||
|
const normalizedSearch = search.toLowerCase().trim();
|
||||||
|
|
||||||
|
return options.reduce<TItem | null>((best, current) => {
|
||||||
|
const currentMatchIndex = by(current).toLowerCase().indexOf(normalizedSearch);
|
||||||
|
|
||||||
|
if (currentMatchIndex === -1) return best;
|
||||||
|
if (best === null) return current;
|
||||||
|
|
||||||
|
const bestMatchIndex = by(best).toLowerCase().indexOf(normalizedSearch);
|
||||||
|
|
||||||
|
if (currentMatchIndex < bestMatchIndex) return current;
|
||||||
|
if (by(current).length < by(best).length && currentMatchIndex === bestMatchIndex) return current;
|
||||||
|
return best;
|
||||||
|
}, null);
|
||||||
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { capitalize } from "../string";
|
import { bestMatch, capitalize } from "../string";
|
||||||
|
|
||||||
const capitalizeTestCases = [
|
const capitalizeTestCases = [
|
||||||
["hello", "Hello"],
|
["hello", "Hello"],
|
||||||
@@ -12,8 +12,45 @@ const capitalizeTestCases = [
|
|||||||
|
|
||||||
describe("capitalize should capitalize the first letter of a string", () => {
|
describe("capitalize should capitalize the first letter of a string", () => {
|
||||||
capitalizeTestCases.forEach(([input, expected]) => {
|
capitalizeTestCases.forEach(([input, expected]) => {
|
||||||
it(`should capitalize ${input} to ${expected}`, () => {
|
test(`should capitalize ${input} to ${expected}`, () => {
|
||||||
expect(capitalize(input)).toEqual(expected);
|
expect(capitalize(input)).toEqual(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("bestMatch should find the best match in an array of options", () => {
|
||||||
|
test("should find exact match for 'nginx'", () => {
|
||||||
|
const options = [
|
||||||
|
{ name: "my-nginx" },
|
||||||
|
{ name: "nginx-proxy" },
|
||||||
|
{ name: "nginx" },
|
||||||
|
{ name: "redis" },
|
||||||
|
{ name: "postgres" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const result = bestMatch("nginx", options, ({ name }) => name);
|
||||||
|
|
||||||
|
expect(result).toEqual({ name: "nginx" });
|
||||||
|
});
|
||||||
|
test("should find closest match for 'nginx' when exact match is not available", () => {
|
||||||
|
const options = [{ name: "redis" }, { name: "nginx-proxy" }, { name: "my-nginx" }, { name: "postgres" }];
|
||||||
|
|
||||||
|
const result = bestMatch("nginx", options, ({ name }) => name);
|
||||||
|
|
||||||
|
expect(result).toEqual({ name: "nginx-proxy" });
|
||||||
|
});
|
||||||
|
test("should return null if no match is found", () => {
|
||||||
|
const options = [{ name: "redis" }, { name: "postgres" }];
|
||||||
|
|
||||||
|
const result = bestMatch("nginx", options, ({ name }) => name);
|
||||||
|
|
||||||
|
expect(result).toBeNull();
|
||||||
|
});
|
||||||
|
test("should return null if options array is empty", () => {
|
||||||
|
const options: { name: string }[] = [];
|
||||||
|
|
||||||
|
const result = bestMatch("nginx", options, ({ name }) => name);
|
||||||
|
|
||||||
|
expect(result).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, test } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
import { getPortFromUrl } from "../url";
|
import { getPortFromUrl, isAbsoluteUrl } from "../url.js";
|
||||||
|
|
||||||
describe("getPortFromUrl", () => {
|
describe("getPortFromUrl", () => {
|
||||||
test.each([
|
test.each([
|
||||||
@@ -38,3 +38,21 @@ describe("getPortFromUrl", () => {
|
|||||||
expect(act).toThrowError("Unsupported protocol: ftp:");
|
expect(act).toThrowError("Unsupported protocol: ftp:");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("isAbsoluteUrl", () => {
|
||||||
|
test.each([
|
||||||
|
["http://example.com", true],
|
||||||
|
["https://example.com", true],
|
||||||
|
["ftp://example.com", true],
|
||||||
|
["file:///path/to/file", true],
|
||||||
|
["mailto:johndoe@example.com", true],
|
||||||
|
["/relative/path", false],
|
||||||
|
["relative/path", false],
|
||||||
|
])("should return %s for URL: %s", (urlString, expected) => {
|
||||||
|
// Act
|
||||||
|
const result = isAbsoluteUrl(urlString);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(result).toBe(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -38,3 +38,9 @@ export const getPortFromUrl = (url: URL): number => {
|
|||||||
|
|
||||||
throw new Error(`Unsupported protocol: ${url.protocol}`);
|
throw new Error(`Unsupported protocol: ${url.protocol}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const absoluteUrlRegex = /^[a-z]+:(\/\/)?/;
|
||||||
|
|
||||||
|
export const isAbsoluteUrl = (urlOrPath: string): boolean => {
|
||||||
|
return absoluteUrlRegex.test(urlOrPath.toLowerCase());
|
||||||
|
};
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,6 +4,13 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"typesVersions": {
|
||||||
|
"*": {
|
||||||
|
"*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
"./infrastructure/redis": "./src/infrastructure/redis/client.ts",
|
"./infrastructure/redis": "./src/infrastructure/redis/client.ts",
|
||||||
"./infrastructure/env": "./src/infrastructure/env/index.ts",
|
"./infrastructure/env": "./src/infrastructure/env/index.ts",
|
||||||
@@ -22,20 +29,12 @@
|
|||||||
"./infrastructure/http": "./src/infrastructure/http/index.ts",
|
"./infrastructure/http": "./src/infrastructure/http/index.ts",
|
||||||
"./infrastructure/http/timeout": "./src/infrastructure/http/timeout.ts"
|
"./infrastructure/http/timeout": "./src/infrastructure/http/timeout.ts"
|
||||||
},
|
},
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"*": [
|
|
||||||
"src/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@t3-oss/env-nextjs": "catalog:",
|
"@t3-oss/env-nextjs": "catalog:",
|
||||||
"better-sqlite3": "catalog:",
|
"better-sqlite3": "catalog:",
|
||||||
@@ -49,12 +48,9 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/better-sqlite3": "catalog:",
|
"@types/better-sqlite3": "catalog:",
|
||||||
"@types/pg": "catalog:",
|
"@types/pg": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./publisher": "./src/publisher.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,21 +11,21 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./publisher": "./src/publisher.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/redis": "workspace:^0.1.0"
|
"@homarr/redis": "workspace:^0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,11 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./expressions": "./src/expressions.ts",
|
|
||||||
"./logger": "./src/logger.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -16,13 +11,17 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./expressions": "./src/expressions.ts",
|
||||||
|
"./logger": "./src/logger.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^",
|
"@homarr/core": "workspace:^",
|
||||||
@@ -30,10 +29,7 @@
|
|||||||
"croner": "catalog:"
|
"croner": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./job-manager": "./src/job-manager.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,13 +11,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./job-manager": "./src/job-manager.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/analytics": "workspace:^0.1.0",
|
"@homarr/analytics": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -43,10 +42,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { createId, objectKeys } from "@homarr/common";
|
import { createId, objectKeys } from "@homarr/common";
|
||||||
import {
|
import {
|
||||||
createDocumentationLink,
|
createDocumentationLink,
|
||||||
|
credentialsAdminGroup,
|
||||||
everyoneGroup,
|
everyoneGroup,
|
||||||
getIntegrationDefaultUrl,
|
getIntegrationDefaultUrl,
|
||||||
getIntegrationName,
|
getIntegrationName,
|
||||||
@@ -11,12 +12,24 @@ import { defaultServerSettings, defaultServerSettingsKeys } from "@homarr/server
|
|||||||
|
|
||||||
import type { Database } from "..";
|
import type { Database } from "..";
|
||||||
import { eq } from "..";
|
import { eq } from "..";
|
||||||
|
import { getMaxGroupPositionAsync } from "../queries";
|
||||||
import {
|
import {
|
||||||
getServerSettingByKeyAsync,
|
getServerSettingByKeyAsync,
|
||||||
insertServerSettingByKeyAsync,
|
insertServerSettingByKeyAsync,
|
||||||
updateServerSettingByKeyAsync,
|
updateServerSettingByKeyAsync,
|
||||||
} from "../queries/server-setting";
|
} from "../queries/server-setting";
|
||||||
import { groups, integrations, onboarding, searchEngines } from "../schema";
|
import {
|
||||||
|
boards,
|
||||||
|
groupMembers,
|
||||||
|
groupPermissions,
|
||||||
|
groups,
|
||||||
|
integrations,
|
||||||
|
layouts,
|
||||||
|
onboarding,
|
||||||
|
searchEngines,
|
||||||
|
sections,
|
||||||
|
users,
|
||||||
|
} from "../schema";
|
||||||
import type { Integration } from "../schema";
|
import type { Integration } from "../schema";
|
||||||
|
|
||||||
export const seedDataAsync = async (db: Database) => {
|
export const seedDataAsync = async (db: Database) => {
|
||||||
@@ -25,6 +38,10 @@ export const seedDataAsync = async (db: Database) => {
|
|||||||
await seedServerSettingsAsync(db);
|
await seedServerSettingsAsync(db);
|
||||||
await seedDefaultSearchEnginesAsync(db);
|
await seedDefaultSearchEnginesAsync(db);
|
||||||
await seedDefaultIntegrationsAsync(db);
|
await seedDefaultIntegrationsAsync(db);
|
||||||
|
|
||||||
|
if (process.env.DEMO_MODE === "true") {
|
||||||
|
await seedDemoUserAsync(db);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const seedEveryoneGroupAsync = async (db: Database) => {
|
const seedEveryoneGroupAsync = async (db: Database) => {
|
||||||
@@ -191,3 +208,72 @@ const seedDefaultIntegrationsAsync = async (db: Database) => {
|
|||||||
|
|
||||||
console.log(`Created ${createdCount} default integrations through seeding process`);
|
console.log(`Created ${createdCount} default integrations through seeding process`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const seedDemoUserAsync = async (db: Database) => {
|
||||||
|
const existingUser = await db.query.users.findFirst({
|
||||||
|
where: eq(users.name, "demo"),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (existingUser) {
|
||||||
|
console.log("Skipping seeding of demo user as it already exists");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const userId = createId();
|
||||||
|
|
||||||
|
await db.insert(users).values({
|
||||||
|
id: userId,
|
||||||
|
name: "demo",
|
||||||
|
email: "demo@example.com",
|
||||||
|
password: "$2b$10$c5AaQb0oj32/bui5Z55PyOb7pY.iEkXYqgdD8MjS9LjSjLMeOkZu2",
|
||||||
|
});
|
||||||
|
|
||||||
|
const maxPosition = await getMaxGroupPositionAsync(db);
|
||||||
|
const groupId = createId();
|
||||||
|
await db.insert(groups).values({
|
||||||
|
id: groupId,
|
||||||
|
name: credentialsAdminGroup,
|
||||||
|
ownerId: userId,
|
||||||
|
position: maxPosition + 1,
|
||||||
|
});
|
||||||
|
await db.insert(groupPermissions).values({
|
||||||
|
groupId,
|
||||||
|
permission: "admin",
|
||||||
|
});
|
||||||
|
await db.insert(groupMembers).values({
|
||||||
|
groupId,
|
||||||
|
userId,
|
||||||
|
});
|
||||||
|
|
||||||
|
await db.update(onboarding).set({
|
||||||
|
step: "finish",
|
||||||
|
previousStep: "settings",
|
||||||
|
});
|
||||||
|
|
||||||
|
const boardId = createId();
|
||||||
|
await db.insert(boards).values({
|
||||||
|
id: boardId,
|
||||||
|
name: "default",
|
||||||
|
isPublic: false,
|
||||||
|
creatorId: userId,
|
||||||
|
});
|
||||||
|
await db.insert(sections).values({
|
||||||
|
id: createId(),
|
||||||
|
kind: "empty",
|
||||||
|
xOffset: 0,
|
||||||
|
yOffset: 0,
|
||||||
|
boardId,
|
||||||
|
});
|
||||||
|
await db.insert(layouts).values({
|
||||||
|
id: createId(),
|
||||||
|
name: "Base",
|
||||||
|
columnCount: 12,
|
||||||
|
breakpoint: 0,
|
||||||
|
boardId,
|
||||||
|
});
|
||||||
|
await db.update(users).set({ homeBoardId: boardId }).where(eq(users.id, userId));
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"Your instance has enabled demo mode. Homarr therefore created example data for your demo. You can disable demo mode anytime by setting the env 'DEMO_MODE' to 'false' or unset it.",
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"main": "./index.ts",
|
||||||
|
"types": "./index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./index.ts",
|
".": "./index.ts",
|
||||||
"./collection": "./collection.ts",
|
"./collection": "./collection.ts",
|
||||||
@@ -12,16 +14,14 @@
|
|||||||
"./queries": "./queries/index.ts",
|
"./queries": "./queries/index.ts",
|
||||||
"./validationSchemas": "./validationSchemas.ts"
|
"./validationSchemas": "./validationSchemas.ts"
|
||||||
},
|
},
|
||||||
"main": "./index.ts",
|
|
||||||
"types": "./index.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run build:sqlite && pnpm run build:mysql && pnpm run build:postgresql",
|
"build": "pnpm run build:sqlite && pnpm run build:mysql && pnpm run build:postgresql",
|
||||||
"build:mysql": "esbuild migrations/mysql/migrate.ts --bundle --platform=node --outfile=migrations/mysql/migrate.cjs",
|
"build:mysql": "esbuild migrations/mysql/migrate.ts --bundle --platform=node --outfile=migrations/mysql/migrate.cjs",
|
||||||
"build:postgresql": "esbuild migrations/postgresql/migrate.ts --bundle --platform=node --outfile=migrations/postgresql/migrate.cjs",
|
"build:postgresql": "esbuild migrations/postgresql/migrate.ts --bundle --platform=node --outfile=migrations/postgresql/migrate.cjs",
|
||||||
"build:sqlite": "esbuild migrations/sqlite/migrate.ts --bundle --platform=node --outfile=migrations/sqlite/migrate.cjs",
|
"build:sqlite": "esbuild migrations/sqlite/migrate.ts --bundle --platform=node --outfile=migrations/sqlite/migrate.cjs",
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"migration:custom": "pnpm with-env tsx ./migrations/custom/run-custom.ts",
|
"migration:custom": "pnpm with-env tsx ./migrations/custom/run-custom.ts",
|
||||||
"migration:mysql:drop": "pnpm with-env drizzle-kit drop --config ./configs/mysql.config.ts",
|
"migration:mysql:drop": "pnpm with-env drizzle-kit drop --config ./configs/mysql.config.ts",
|
||||||
"migration:mysql:generate": "pnpm with-env drizzle-kit generate --config ./configs/mysql.config.ts",
|
"migration:mysql:generate": "pnpm with-env drizzle-kit generate --config ./configs/mysql.config.ts",
|
||||||
@@ -42,7 +42,6 @@
|
|||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"with-env": "dotenv -e ../../.env --"
|
"with-env": "dotenv -e ../../.env --"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/core": "catalog:",
|
"@auth/core": "catalog:",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
@@ -63,15 +62,11 @@
|
|||||||
"superjson": "catalog:"
|
"superjson": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/better-sqlite3": "catalog:",
|
"@types/better-sqlite3": "catalog:",
|
||||||
"@types/pg": "catalog:",
|
"@types/pg": "catalog:",
|
||||||
"dotenv-cli": "catalog:",
|
"dotenv-cli": "catalog:",
|
||||||
"esbuild": "catalog:",
|
"esbuild": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"prettier": "catalog:",
|
|
||||||
"tsx": "catalog:",
|
"tsx": "catalog:",
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,24 +11,23 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"postinstall": "tsx ./src/docs/codegen.ts",
|
"postinstall": "tsx ./src/docs/codegen.ts",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"fast-xml-parser": "catalog:",
|
"fast-xml-parser": "catalog:",
|
||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"tsx": "catalog:",
|
"tsx": "catalog:",
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,11 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./shared": "./src/shared.ts",
|
|
||||||
"./env": "./src/env.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -16,24 +11,25 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./shared": "./src/shared.ts",
|
||||||
|
"./env": "./src/env.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"dockerode": "catalog:"
|
"dockerode": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/dockerode": "catalog:",
|
"@types/dockerode": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./types": "./src/types.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,13 +11,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./types": "./src/types.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
@@ -31,10 +30,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -35,10 +34,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./local": "./src/local.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,23 +11,23 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./local": "./src/local.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/db": "workspace:^0.1.0"
|
"@homarr/db": "workspace:^0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./src/index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
@@ -28,11 +27,8 @@
|
|||||||
"bcrypt": "catalog:"
|
"bcrypt": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/bcrypt": "catalog:",
|
"@types/bcrypt": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,12 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./test-connection": "./src/base/test-connection/index.ts",
|
|
||||||
"./client": "./src/client.ts",
|
|
||||||
"./types": "./src/types.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -17,13 +11,18 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./test-connection": "./src/base/test-connection/index.ts",
|
||||||
|
"./client": "./src/client.ts",
|
||||||
|
"./types": "./src/types.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ctrl/deluge": "catalog:",
|
"@ctrl/deluge": "catalog:",
|
||||||
"@ctrl/qbittorrent": "catalog:",
|
"@ctrl/qbittorrent": "catalog:",
|
||||||
@@ -52,12 +51,9 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/node-unifi": "catalog:",
|
"@types/node-unifi": "catalog:",
|
||||||
"@types/xml2js": "catalog:",
|
"@types/xml2js": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { isAbsoluteUrl } from "@homarr/common";
|
||||||
import { ResponseError } from "@homarr/common/server";
|
import { ResponseError } from "@homarr/common/server";
|
||||||
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/http";
|
||||||
import { ImageProxy } from "@homarr/image-proxy";
|
import { ImageProxy } from "@homarr/image-proxy";
|
||||||
@@ -85,10 +86,10 @@ export class TracearrIntegration extends Integration {
|
|||||||
data: await Promise.all(
|
data: await Promise.all(
|
||||||
json.data.map(async (stream) => {
|
json.data.map(async (stream) => {
|
||||||
if (stream.userAvatarUrl) {
|
if (stream.userAvatarUrl) {
|
||||||
stream.userAvatarUrl = await this.proxyImageAsync(imageProxy, stream.userAvatarUrl, stream.id, "avatar");
|
stream.userAvatarUrl = await this.proxyImageAsync(imageProxy, stream.userAvatarUrl);
|
||||||
}
|
}
|
||||||
if (stream.posterUrl) {
|
if (stream.posterUrl) {
|
||||||
stream.posterUrl = await this.proxyImageAsync(imageProxy, stream.posterUrl, stream.id, "poster");
|
stream.posterUrl = await this.proxyImageAsync(imageProxy, stream.posterUrl);
|
||||||
}
|
}
|
||||||
return stream;
|
return stream;
|
||||||
}),
|
}),
|
||||||
@@ -120,12 +121,7 @@ export class TracearrIntegration extends Integration {
|
|||||||
...json,
|
...json,
|
||||||
data: await Promise.all(
|
data: await Promise.all(
|
||||||
json.data.map(async (violation) => {
|
json.data.map(async (violation) => {
|
||||||
violation.user.avatarUrl = await this.proxyImageAsync(
|
violation.user.avatarUrl = await this.proxyImageAsync(imageProxy, violation.user.avatarUrl);
|
||||||
imageProxy,
|
|
||||||
violation.user.avatarUrl,
|
|
||||||
violation.user.id,
|
|
||||||
"avatar",
|
|
||||||
);
|
|
||||||
return violation;
|
return violation;
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
@@ -156,12 +152,7 @@ export class TracearrIntegration extends Integration {
|
|||||||
...json,
|
...json,
|
||||||
data: await Promise.all(
|
data: await Promise.all(
|
||||||
json.data.map(async (session) => {
|
json.data.map(async (session) => {
|
||||||
session.user.avatarUrl = await this.proxyImageAsync(
|
session.user.avatarUrl = await this.proxyImageAsync(imageProxy, session.user.avatarUrl);
|
||||||
imageProxy,
|
|
||||||
session.user.avatarUrl,
|
|
||||||
session.user.id,
|
|
||||||
"avatar",
|
|
||||||
);
|
|
||||||
return session;
|
return session;
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
@@ -194,23 +185,12 @@ export class TracearrIntegration extends Integration {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private async proxyImageAsync(
|
private async proxyImageAsync(imageProxy: ImageProxy, urlOrPath: string | null | undefined): Promise<string | null> {
|
||||||
imageProxy: ImageProxy,
|
if (!urlOrPath) return null;
|
||||||
url: string | null | undefined,
|
|
||||||
uniqueId: string,
|
|
||||||
discriminator: string,
|
|
||||||
): Promise<string | null> {
|
|
||||||
if (!url) return null;
|
|
||||||
try {
|
try {
|
||||||
// ImageProxy doesn't support fallback urls so we need to remove them
|
// ImageProxy doesn't support fallback urls so we need to remove them
|
||||||
const cleanUrl = url.replace(/&fallback=[^&]+/, "").replace(/\?fallback=[^&]+&?/, "?");
|
const cleanUrl = urlOrPath.replace(/&fallback=[^&]+/, "").replace(/\?fallback=[^&]+&?/, "?");
|
||||||
// Build the full URL, then inject _uid as the FIRST query param.
|
const fullUrl = isAbsoluteUrl(urlOrPath) ? cleanUrl : this.url(cleanUrl as `/${string}`).toString();
|
||||||
// This is critical because ImageProxy uses bcrypt which truncates at 72 bytes.
|
|
||||||
// Without this, all long avatar/poster URLs from the same session hash identically
|
|
||||||
// since they share the same first 72+ bytes.
|
|
||||||
const baseUrl = this.url(cleanUrl as `/${string}`).toString();
|
|
||||||
const prefix = `_uid=${discriminator}_${uniqueId}&`;
|
|
||||||
const fullUrl = baseUrl.includes("?") ? baseUrl.replace("?", `?${prefix}`) : `${baseUrl}?${prefix}`;
|
|
||||||
|
|
||||||
return await imageProxy.createImageAsync(fullUrl, this.getAuthHeaders());
|
return await imageProxy.createImageAsync(fullUrl, this.getAuthHeaders());
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
@@ -42,10 +41,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
import reactConfig from "@homarr/eslint-config/react";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig, ...reactConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
@@ -29,10 +28,7 @@
|
|||||||
"react": "catalog:"
|
"react": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./styles.css": "./src/styles.css"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,23 +11,23 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./styles.css": "./src/styles.css"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@mantine/notifications": "catalog:",
|
"@mantine/notifications": "catalog:",
|
||||||
"@tabler/icons-react": "catalog:"
|
"@tabler/icons-react": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,13 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./analyse": "./src/analyse/index.ts",
|
|
||||||
"./components": "./src/components/index.ts",
|
|
||||||
"./import": "./src/import/index.ts",
|
|
||||||
"./shared": "./src/shared.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -18,13 +11,19 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./analyse": "./src/analyse/index.ts",
|
||||||
|
"./components": "./src/components/index.ts",
|
||||||
|
"./import": "./src/import/index.ts",
|
||||||
|
"./shared": "./src/shared.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
@@ -48,11 +47,8 @@
|
|||||||
"zod-form-data": "catalog:"
|
"zod-form-data": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/adm-zip": "catalog:",
|
"@types/adm-zip": "catalog:",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,22 +11,21 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,22 +11,21 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0"
|
"@homarr/core": "workspace:^0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/common": "workspace:^",
|
"@homarr/common": "workspace:^",
|
||||||
"@homarr/core": "workspace:^",
|
"@homarr/core": "workspace:^",
|
||||||
@@ -30,10 +29,7 @@
|
|||||||
"superjson": "catalog:"
|
"superjson": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
"./*": "./src/*.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,13 +11,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
"./*": "./src/*.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@extractus/feed-extractor": "catalog:",
|
"@extractus/feed-extractor": "catalog:",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
@@ -37,10 +36,7 @@
|
|||||||
"zod": "catalog:"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ import dayjs from "dayjs";
|
|||||||
import type { ContainerInfo, ContainerStats } from "dockerode";
|
import type { ContainerInfo, ContainerStats } from "dockerode";
|
||||||
import type Dockerode from "dockerode";
|
import type Dockerode from "dockerode";
|
||||||
|
|
||||||
|
import { bestMatch } from "@homarr/common";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
||||||
import { db, like, or } from "@homarr/db";
|
import { db, like, or } from "@homarr/db";
|
||||||
@@ -82,12 +83,7 @@ async function getContainersWithStatsAsync() {
|
|||||||
name: container.Names[0]?.split("/")[1] ?? "Unknown",
|
name: container.Names[0]?.split("/")[1] ?? "Unknown",
|
||||||
host: container.instance,
|
host: container.instance,
|
||||||
state: container.State as ContainerState,
|
state: container.State as ContainerState,
|
||||||
iconUrl:
|
iconUrl: bestMatch(extractImage(container), dbIcons, (icon) => icon.name)?.url ?? null,
|
||||||
dbIcons.find((icon) => {
|
|
||||||
const extractedImage = extractImage(container);
|
|
||||||
if (!extractedImage) return false;
|
|
||||||
return icon.name.toLowerCase().includes(extractedImage.toLowerCase());
|
|
||||||
})?.url ?? null,
|
|
||||||
cpuUsage,
|
cpuUsage,
|
||||||
memoryUsage,
|
memoryUsage,
|
||||||
image: container.Image,
|
image: container.Image,
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig];
|
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -14,22 +11,21 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/definitions": "workspace:^0.1.0",
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0"
|
"@homarr/translation": "workspace:^0.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
ignores: [],
|
|
||||||
},
|
|
||||||
...baseConfig,
|
|
||||||
];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./creator": "./src/creator.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,13 +11,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./creator": "./src/creator.ts"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
@@ -31,10 +30,7 @@
|
|||||||
"react-dom": "catalog:"
|
"react-dom": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import baseConfig from "@homarr/eslint-config/base";
|
|
||||||
import reactConfig from "@homarr/eslint-config/react";
|
|
||||||
|
|
||||||
/** @type {import('typescript-eslint').Config} */
|
|
||||||
export default [...baseConfig, ...reactConfig];
|
|
||||||
@@ -4,10 +4,6 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
|
||||||
".": "./index.ts",
|
|
||||||
"./styles.css": "./src/styles.css"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
"typesVersions": {
|
||||||
"*": {
|
"*": {
|
||||||
"*": [
|
"*": [
|
||||||
@@ -15,13 +11,16 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": "./index.ts",
|
||||||
|
"./styles.css": "./src/styles.css"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "oxfmt --check .",
|
||||||
"lint": "eslint",
|
"lint": "oxlint",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -44,10 +43,7 @@
|
|||||||
"use-deep-compare-effect": "catalog:"
|
"use-deep-compare-effect": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "catalog:",
|
|
||||||
"typescript": "catalog:"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user