Fixed some imports and build

This commit is contained in:
cdricms
2025-02-10 09:42:24 +01:00
parent 27b73dbcab
commit bcb563fa1c
9 changed files with 110 additions and 25 deletions

View File

@@ -11,11 +11,11 @@ WORKDIR /app
# Install dependencies based on the preferred package manager # Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN \ RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \ elif [ -f package-lock.json ]; then npm ci --force; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
fi fi
# Rebuild the source code only when needed # Rebuild the source code only when needed
@@ -30,11 +30,11 @@ COPY . .
# ENV NEXT_TELEMETRY_DISABLED=1 # ENV NEXT_TELEMETRY_DISABLED=1
RUN \ RUN \
if [ -f yarn.lock ]; then yarn run build; \ if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \ elif [ -f package-lock.json ]; then npm run build; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
fi fi
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM base AS runner FROM base AS runner

View File

@@ -1,5 +1,4 @@
"use server"; export const dynamic = "force-dynamic"; // Prevents static rendering
import Features, { FeatureItem } from "@/components/features"; import Features, { FeatureItem } from "@/components/features";
import Gallery from "@/components/gallery"; import Gallery from "@/components/gallery";
import Hero from "@/components/hero"; import Hero from "@/components/hero";

View File

@@ -3,8 +3,8 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea"; import { Textarea } from "@/components/ui/textarea";
import { ApiResponse } from "@/hooks/use-api";
import { API_URL } from "@/lib/constants"; import { API_URL } from "@/lib/constants";
import { ApiResponse } from "@/types/types";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
interface FormData { interface FormData {

View File

@@ -3,12 +3,10 @@ import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { useEffect, useState } from "react"; import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import useLogin from "@/hooks/use-login"; import useLogin from "@/hooks/use-login";
import { Loader2 } from "lucide-react"; import { Loader2 } from "lucide-react";
import { API_URL } from "@/lib/constants";
import { ApiResponse } from "@/hooks/use-api";
export function LoginForm({ export function LoginForm({
className, className,

View File

@@ -243,20 +243,20 @@ const Planning: React.FC<{
event={eventSelected} event={eventSelected}
onStartDateChange={(date) => { onStartDateChange={(date) => {
setEventSelected((ev) => { setEventSelected((ev) => {
if (ev) if (ev && date)
return { return {
...ev, ...ev,
start: date, start: format(date, "YYYY-MM-DD HH:MM"),
}; };
return ev; return ev;
}); });
}} }}
onEndDateChange={(date) => { onEndDateChange={(date) => {
setEventSelected((ev) => { setEventSelected((ev) => {
if (ev) if (ev && date)
return { return {
...ev, ...ev,
end: date, end: format(date, "YYYY-MM-DD HH:MM"),
}; };
return ev; return ev;
}); });

View File

@@ -1,8 +1,8 @@
"use client"; "use client";
import { API_URL } from "@/lib/constants"; import { API_URL } from "@/lib/constants";
import { ApiResponse } from "@/types/types";
import { getCookie } from "cookies-next"; import { getCookie } from "cookies-next";
import { useState, useRef, useCallback } from "react"; import { useState, useRef, useCallback } from "react";
import { ApiResponse, useApi } from "./use-api";
interface UseFileUploadReturn { interface UseFileUploadReturn {
progress: number; progress: number;

View File

@@ -1,9 +1,7 @@
"use client"; "use client";
import { setCookie } from "cookies-next"; import { setCookie } from "cookies-next";
import useApiMutation, { ApiResponse } from "./use-api"; import useApiMutation from "./use-api";
import { useEffect, useState } from "react";
import { API_URL } from "@/lib/constants";
export interface LoginArgs { export interface LoginArgs {
email: string; email: string;

View File

@@ -1,5 +1,5 @@
import { NextRequest, NextResponse } from "next/server"; import { NextRequest, NextResponse } from "next/server";
import { ApiResponse } from "./hooks/use-api"; import { ApiResponse } from "./types/types";
import { API_URL } from "./lib/constants"; import { API_URL } from "./lib/constants";
import IUser from "./interfaces/IUser"; import IUser from "./interfaces/IUser";

View File

@@ -7189,6 +7189,96 @@
"funding": { "funding": {
"url": "https://github.com/sponsors/colinhacks" "url": "https://github.com/sponsors/colinhacks"
} }
},
"node_modules/@next/swc-darwin-arm64": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.4.tgz",
"integrity": "sha512-wBEMBs+np+R5ozN1F8Y8d/Dycns2COhRnkxRc+rvnbXke5uZBHkUGFgWxfTXn5rx7OLijuUhyfB+gC/ap58dDw==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.4.tgz",
"integrity": "sha512-7sgf5rM7Z81V9w48F02Zz6DgEJulavC0jadab4ZsJ+K2sxMNK0/BtF8J8J3CxnsJN3DGcIdC260wEKssKTukUw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.4.tgz",
"integrity": "sha512-JaZlIMNaJenfd55kjaLWMfok+vWBlcRxqnRoZrhFQrhM1uAehP3R0+Aoe+bZOogqlZvAz53nY/k3ZyuKDtT2zQ==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.4.tgz",
"integrity": "sha512-7EBBjNoyTO2ipMDgCiORpwwOf5tIueFntKjcN3NK+GAQD7OzFJe84p7a2eQUeWdpzZvhVXuAtIen8QcH71ZCOQ==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.4.tgz",
"integrity": "sha512-JgFCiV4libQavwII+kncMCl30st0JVxpPOtzWcAI2jtum4HjYaclobKhj+JsRu5tFqMtA5CJIa0MvYyuu9xjjQ==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "15.1.4",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.4.tgz",
"integrity": "sha512-xxsJy9wzq7FR5SqPCUqdgSXiNXrMuidgckBa8nH9HtjjxsilgcN6VgXF6tZ3uEWuVEadotQJI8/9EQ6guTC4Yw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
} }
} }
} }