Skip to content

Commit

Permalink
chore(release): automatic release v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
homarr-releases[bot] committed Sep 6, 2024
2 parents b24b1cc + 8c20553 commit bd1ff01
Show file tree
Hide file tree
Showing 71 changed files with 3,617 additions and 658 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deployment-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
default: true
description: Send notifications
push-image:
type: boolean
required: false
default: true
description: Push Docker Image

permissions:
contents: write
Expand Down Expand Up @@ -93,9 +98,9 @@ jobs:
id: buildPushAction
uses: docker/build-push-action@v6
with:
platforms: linux/amd64 # we currently do't build for linux/arm64 as it's really slow and we'll move to a self hosted runner for that or use the official github runner, once it's available
platforms: linux/amd64,linux/arm64
context: .
push: true
push: ${{ github.events.inputs.push-image && 'true' || 'false' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
network: host
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.17.0-alpine AS base
FROM --platform=linux/amd64 node:20.17.0-alpine AS base

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / Deploy docker image (20)

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

FROM base AS builder
RUN apk add --no-cache libc6-compat
Expand Down
18 changes: 9 additions & 9 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"build": "pnpm with-env next build",
"clean": "git clean -xdf .next .turbo node_modules",
"dev": "pnpm with-env next dev",
"lint": "eslint",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"start": "pnpm with-env next start",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/analytics": "workspace:^0.1.0",
"@homarr/api": "workspace:^0.1.0",
Expand Down Expand Up @@ -40,10 +41,10 @@
"@mantine/tiptap": "^7.12.2",
"@million/lint": "1.0.0-rc.84",
"@t3-oss/env-nextjs": "^0.11.1",
"@tanstack/react-query": "^5.53.1",
"@tanstack/react-query-devtools": "^5.53.1",
"@tanstack/react-query-next-experimental": "5.53.1",
"@tabler/icons-react": "^3.14.0",
"@tanstack/react-query": "^5.55.0",
"@tanstack/react-query-devtools": "^5.55.0",
"@tanstack/react-query-next-experimental": "5.55.0",
"@trpc/client": "next",
"@trpc/next": "next",
"@trpc/react-query": "next",
Expand All @@ -59,14 +60,14 @@
"glob": "^11.0.0",
"jotai": "^2.9.3",
"mantine-react-table": "2.0.0-beta.6",
"next": "^14.2.7",
"next": "^14.2.8",
"postcss-preset-mantine": "^1.17.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-simple-code-editor": "^0.14.1",
"sass": "^1.77.8",
"sass": "^1.78.0",
"superjson": "2.2.1",
"swagger-ui-react": "^5.17.14",
"use-deep-compare-effect": "^1.8.1"
Expand All @@ -76,7 +77,7 @@
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/chroma-js": "2.4.4",
"@types/node": "^20.16.2",
"@types/node": "^20.16.5",
"@types/prismjs": "^1.26.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
Expand All @@ -86,6 +87,5 @@
"node-loader": "^2.0.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4"
},
"prettier": "@homarr/prettier-config"
}
}
89 changes: 89 additions & 0 deletions apps/nextjs/src/app/[locale]/_client-providers/mantine.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
"use client";

import { useState } from "react";
import type { PropsWithChildren } from "react";
import type { MantineColorScheme, MantineColorSchemeManager } from "@mantine/core";
import { createTheme, isMantineColorScheme, MantineProvider } from "@mantine/core";

import { clientApi } from "@homarr/api/client";
import { useSession } from "@homarr/auth/client";

export const CustomMantineProvider = ({ children }: PropsWithChildren) => {
const manager = useColorSchemeManager();

return (
<MantineProvider
defaultColorScheme="auto"
colorSchemeManager={manager}
theme={createTheme({
primaryColor: "red",
autoContrast: true,
})}
>
{children}
</MantineProvider>
);
};

function useColorSchemeManager(): MantineColorSchemeManager {
const key = "homarr-color-scheme";
const { data: session } = useSession();
const [sessionColorScheme, setSessionColorScheme] = useState<MantineColorScheme | undefined>(
session?.user.colorScheme,
);
const { mutate: mutateColorScheme } = clientApi.user.changeColorScheme.useMutation({
onSuccess: (_, variables) => {
setSessionColorScheme(variables.colorScheme);
},
});

let handleStorageEvent: (event: StorageEvent) => void;

return {
get: (defaultValue) => {
if (typeof window === "undefined") {
return defaultValue;
}

if (sessionColorScheme) {
return sessionColorScheme;
}

try {
return (window.localStorage.getItem(key) as MantineColorScheme | undefined) ?? defaultValue;
} catch {
return defaultValue;
}
},

set: (value) => {
try {
if (session) {
mutateColorScheme({ colorScheme: value });
}
window.localStorage.setItem(key, value);
} catch (error) {
console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.", error);
}
},

subscribe: (onUpdate) => {
handleStorageEvent = (event) => {
if (session) return; // Ignore updates when session is available as we are using session color scheme
if (event.storageArea === window.localStorage && event.key === key && isMantineColorScheme(event.newValue)) {
onUpdate(event.newValue);
}
};

window.addEventListener("storage", handleStorageEvent);
},

unsubscribe: () => {
window.removeEventListener("storage", handleStorageEvent);
},

clear: () => {
window.localStorage.removeItem(key);
},
};
}
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { AppRouter } from "@homarr/api";
import { clientApi } from "@homarr/api/client";

const wsClient = createWSClient({
url: "ws://localhost:3001",
url: typeof window === "undefined" ? "ws://localhost:3001" : `ws://${window.location.hostname}:3001`,
});

export function TRPCReactProvider(props: PropsWithChildren) {
Expand Down
28 changes: 9 additions & 19 deletions apps/nextjs/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import type { Metadata, Viewport } from "next";
import { Inter } from "next/font/google";

import "@homarr/ui/styles.css";
import "@homarr/notifications/styles.css";
import "@homarr/spotlight/styles.css";
import "@homarr/ui/styles.css";
import "~/styles/scroll-area.scss";

import { ColorSchemeScript, createTheme, MantineProvider } from "@mantine/core";

import { env } from "@homarr/auth/env.mjs";
import { auth } from "@homarr/auth/next";
import { ModalProvider } from "@homarr/modals";
import { Notifications } from "@homarr/notifications";

import { Analytics } from "~/components/layout/analytics";
import { JotaiProvider } from "./_client-providers/jotai";
import { CustomMantineProvider } from "./_client-providers/mantine";
import { NextInternationalProvider } from "./_client-providers/next-international";
import { AuthProvider } from "./_client-providers/session";
import { TRPCReactProvider } from "./_client-providers/trpc";
Expand Down Expand Up @@ -51,34 +50,25 @@ export const viewport: Viewport = {
],
};

export default function Layout(props: { children: React.ReactNode; params: { locale: string } }) {
const colorScheme = "dark";
export default async function Layout(props: { children: React.ReactNode; params: { locale: string } }) {
const session = await auth();
const colorScheme = session?.user.colorScheme;

const StackedProvider = composeWrappers([
async (innerProps) => {
const session = await auth();
(innerProps) => {
return <AuthProvider session={session} logoutUrl={env.AUTH_LOGOUT_REDIRECT_URL} {...innerProps} />;
},
(innerProps) => <JotaiProvider {...innerProps} />,
(innerProps) => <TRPCReactProvider {...innerProps} />,
(innerProps) => <NextInternationalProvider {...innerProps} locale={props.params.locale} />,
(innerProps) => (
<MantineProvider
{...innerProps}
defaultColorScheme="dark"
theme={createTheme({
primaryColor: "red",
autoContrast: true,
})}
/>
),
(innerProps) => <CustomMantineProvider {...innerProps} />,
(innerProps) => <ModalProvider {...innerProps} />,
]);

return (
<html lang="en" suppressHydrationWarning>
// Instead of ColorSchemScript we use data-mantine-color-scheme to prevent flickering
<html lang="en" data-mantine-color-scheme={colorScheme} suppressHydrationWarning>
<head>
<ColorSchemeScript defaultColorScheme={colorScheme} />
<Analytics />
</head>
<body className={["font-sans", fontSans.variable].join(" ")}>
Expand Down
10 changes: 10 additions & 0 deletions apps/nextjs/src/app/[locale]/manage/tools/logs/client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use client";

import dynamic from "next/dynamic";

export const ClientSideTerminalComponent = dynamic(
() => import("./terminal").then(({ TerminalComponent }) => TerminalComponent),
{
ssr: false,
},
);
7 changes: 1 addition & 6 deletions apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import { getScopedI18n } from "@homarr/translation/server";

import "@xterm/xterm/css/xterm.css";

import dynamic from "next/dynamic";

import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
import { fullHeightWithoutHeaderAndFooter } from "~/constants";
import { createMetaTitle } from "~/metadata";
import { ClientSideTerminalComponent } from "./client";

export async function generateMetadata() {
const t = await getScopedI18n("management");
Expand All @@ -18,10 +17,6 @@ export async function generateMetadata() {
};
}

const ClientSideTerminalComponent = dynamic(() => import("./terminal"), {
ssr: false,
});

export default function LogsManagementPage() {
return (
<>
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/src/app/[locale]/manage/tools/logs/terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { clientApi } from "@homarr/api/client";

import classes from "./terminal.module.css";

export default function TerminalComponent() {
export const TerminalComponent = () => {
const ref = useRef<HTMLDivElement>(null);

const terminalRef = useRef<Terminal>();
Expand Down Expand Up @@ -54,4 +54,4 @@ export default function TerminalComponent() {
};
}, []);
return <Box ref={ref} id="terminal" className={classes.outerTerminal} h="100%"></Box>;
}
};
20 changes: 10 additions & 10 deletions apps/tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@
"name": "@homarr/tasks",
"version": "0.1.0",
"private": true,
"license": "MIT",
"type": "module",
"exports": {
".": "./src/index.ts"
},
"main": "./src/main.ts",
"types": "./src/main.ts",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "pnpm with-env tsx ./src/main.ts",
"build": "esbuild src/main.ts --bundle --platform=node --outfile=tasks.cjs",
"clean": "rm -rf .turbo node_modules",
"lint": "eslint",
"dev": "pnpm with-env tsx ./src/main.ts",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"@homarr/analytics": "workspace:^0.1.0",
"@homarr/common": "workspace:^0.1.0",
"@homarr/cron-job-runner": "workspace:^0.1.0",
"@homarr/cron-jobs": "workspace:^0.1.0",
"@homarr/cron-jobs-core": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/icons": "workspace:^0.1.0",
Expand All @@ -30,11 +34,8 @@
"@homarr/redis": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/cron-jobs-core": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"dayjs": "^1.11.13",
"@homarr/cron-jobs": "workspace:^0.1.0",
"@homarr/cron-job-runner": "workspace:^0.1.0",
"dotenv": "^16.4.5",
"superjson": "2.2.1",
"undici": "6.19.8"
Expand All @@ -43,12 +44,11 @@
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/node": "^20.16.2",
"@types/node": "^20.16.5",
"dotenv-cli": "^7.4.2",
"eslint": "^9.9.1",
"prettier": "^3.3.3",
"tsx": "4.13.3",
"typescript": "^5.5.4"
},
"prettier": "@homarr/prettier-config"
}
}
Loading

0 comments on commit bd1ff01

Please sign in to comment.