Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

850 feature request migrate to vite #882

Merged
merged 48 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d9754a0
upgrade to vite
rphlmr Mar 22, 2024
41ef61c
add required config for tailwind
rphlmr Mar 22, 2024
0d02f98
removing all barrel imports from components folder
DonKoko Mar 22, 2024
400a18b
automatic linting fixes
DonKoko Mar 22, 2024
fa7bf50
changing db barrel + automatic linting fixes
DonKoko Mar 22, 2024
3ddba8c
remove barrels from hooks folder
DonKoko Mar 22, 2024
3a7aeee
removing barrels from integrations folder
DonKoko Mar 22, 2024
2a9a1ba
remove barrels from modules folder and all subfolders
DonKoko Mar 22, 2024
3a9ed8a
automatic linting fixes
DonKoko Mar 22, 2024
99323fd
remove barrel imports from utils folder
DonKoko Mar 22, 2024
cf526fd
automatic linting fixes
DonKoko Mar 22, 2024
7c727b3
Merge pull request #876 from Shelf-nu/remove-barrel-imports
DonKoko Mar 22, 2024
8cbdb42
Merge branch 'main' into 850/vite
rphlmr Mar 22, 2024
243d99b
Merge branch '850-feature-request-migrate-to-vite' into 850/vite
DonKoko Mar 22, 2024
f7b4409
fix doc
rphlmr Mar 22, 2024
e9c7a6f
fix merge conflict
rphlmr Mar 22, 2024
38aee0c
fix type error
rphlmr Mar 22, 2024
8ea6613
migrate css imports
rphlmr Mar 22, 2024
6b37e0d
Remove deprecated LiveReload
rphlmr Mar 22, 2024
da653f2
Remove "use client"
rphlmr Mar 22, 2024
652fbac
update for esm support
rphlmr Mar 22, 2024
eab75d8
update custom server
rphlmr Mar 22, 2024
0a8a56d
fix vite dev reload on navigate
rphlmr Mar 22, 2024
ca8b3ec
remove css bundle
rphlmr Mar 25, 2024
add9a8d
fix unit test
rphlmr Mar 25, 2024
01420c2
fix scan device name
rphlmr Mar 25, 2024
852f8f1
vite: stabilize dev env
rphlmr Mar 25, 2024
0b8b704
migrate remix type definition
rphlmr Mar 25, 2024
a2f86b7
fix vite build issue
rphlmr Mar 25, 2024
f4244ec
migrate production build
rphlmr Mar 25, 2024
de4bef6
Merge branch 'main' into 850-feature-request-migrate-to-vite
DonKoko Mar 25, 2024
517cc30
prevent routes with a `?t=` params to be catched by the dev server
rphlmr Mar 25, 2024
a10abc2
Merge branch '850-feature-request-migrate-to-vite' into 850/vite
rphlmr Mar 25, 2024
6db8d79
serve new Remix build (vite)
rphlmr Mar 25, 2024
36a9eab
merging main and fixing conflicts
DonKoko Mar 26, 2024
58e22c8
Merge branch '850-feature-request-migrate-to-vite' into 850/vite
DonKoko Mar 26, 2024
8ec00b7
fix serve public files in dev
rphlmr Mar 26, 2024
456aad7
remove useless code
rphlmr Mar 26, 2024
989e56e
Merge pull request #874 from rphlmr/850/vite
DonKoko Mar 26, 2024
87fd6e8
Fix map crash
rphlmr Mar 27, 2024
8d1b852
merging main and fixing conflicts
rphlmr Apr 2, 2024
5deeb24
fix qr actions dropdown display on mobile
rphlmr Apr 2, 2024
1428441
excludes new Remix 2.9.0 single fetch .data responses
rphlmr Apr 2, 2024
664f8bb
update with main and fix conflicts
DonKoko Apr 5, 2024
0f015e7
re-install packages
DonKoko Apr 5, 2024
d9dacbd
update with main and fix conflicts
rphlmr Apr 9, 2024
19de0ec
fix email image attachment
rphlmr Apr 9, 2024
df2234c
merge with main and fix conflicts
DonKoko Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ FROM base AS release
COPY --from=build /src/node_modules /src/node_modules
COPY --from=build /src/app/database /src/app/database
COPY --from=build /src/build /src/build
COPY --from=build /src/public /src/public
COPY --from=build /src/package.json /src/package.json
COPY --from=build /src/start.sh /src/start.sh
RUN chmod +x /src/start.sh
Expand Down
1 change: 0 additions & 1 deletion Dockerfile.image
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ FROM base AS release
COPY --from=build /src/node_modules /src/node_modules
COPY --from=build /src/app/database /src/app/database
COPY --from=build /src/build /src/build
COPY --from=build /src/public /src/public
COPY --from=build /src/package.json /src/package.json
COPY --from=build /src/docker-entrypoint.sh /src/docker-entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion app/atoms/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ChangeEvent } from "react";
import { atom } from "jotai";
import { verifyAccept } from "~/utils";
import { verifyAccept } from "~/utils/verify-file-accept";

export const fileErrorAtom = atom<string | undefined>(undefined);

Expand Down
7 changes: 4 additions & 3 deletions app/components/assets/actions-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import {
PenIcon,
UserIcon,
UserXIcon,
} from "~/components/icons";
} from "~/components/icons/library";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "~/components/shared/dropdown";
import type { loader } from "~/routes/_layout+/assets.$assetId";
import { tw } from "~/utils/tw-classes";
import { tw } from "~/utils/tw";
import { DeleteAsset } from "./delete-asset";
import { Button } from "../shared";
import { Button } from "../shared/button";

const ConditionalActionsDropdown = () => {
const { asset } = useLoaderData<typeof loader>();
Expand Down Expand Up @@ -84,6 +84,7 @@ const ConditionalActionsDropdown = () => {
__html: `@media (max-width: 640px) {
[data-radix-popper-content-wrapper] {
transform: none !important;
will-change: auto !important;
}
}`,
}} // is a hack to fix the dropdown menu not being in the right place on mobile
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/asset-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Asset } from "@prisma/client";

import { useFetcher } from "@remix-run/react";
import type { action } from "~/routes/api+/asset.refresh-main-image";
import { tw } from "~/utils";
import { tw } from "~/utils/tw";

export const AssetImage = ({
asset,
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/asset-status-badge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SVGProps } from "react";
import { AssetStatus } from "@prisma/client";
import { Badge } from "../shared";
import { Badge } from "../shared/badge";
import {
Tooltip,
TooltipContent,
Expand Down
15 changes: 8 additions & 7 deletions app/components/assets/custom-fields-inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ import type { Zorm } from "react-zorm";
import type { z } from "zod";
import type { ShelfAssetCustomFieldValueType } from "~/modules/asset/types";
import type { loader } from "~/routes/_layout+/assets.$assetId_.edit";
import { isFormProcessing, tw } from "~/utils";
import { getCustomFieldDisplayValue } from "~/utils/custom-fields";
import { isFormProcessing } from "~/utils/form";
import { tw } from "~/utils/tw";
import { zodFieldIsRequired } from "~/utils/zod";
import { Calendar } from "../forms/calendar-input";
import FormRow from "../forms/form-row";
import Input from "../forms/input";
import {
Select,
SelectContent,
SelectTrigger,
SelectValue,
SelectItem,
} from "../forms";
import { Calendar } from "../forms/calendar-input";
import FormRow from "../forms/form-row";
import Input from "../forms/input";
} from "../forms/select";
import { Switch } from "../forms/switch";
import { SearchIcon } from "../icons";
import { Button } from "../shared";
import { SearchIcon } from "../icons/library";
import { Button } from "../shared/button";

export default function AssetCustomFields({
zo,
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/delete-asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "~/components/shared/modal";
import { TrashIcon } from "../icons";
import { TrashIcon } from "../icons/library";

export const DeleteAsset = ({
asset,
Expand Down
7 changes: 4 additions & 3 deletions app/components/assets/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ import { z } from "zod";
import { updateDynamicTitleAtom } from "~/atoms/dynamic-title-atom";
import { fileErrorAtom, validateFileAtom } from "~/atoms/file";
import type { loader } from "~/routes/_layout+/assets.$assetId_.edit";
import { isFormProcessing, tw } from "~/utils";

import type { CustomFieldZodSchema } from "~/utils/custom-fields";
import { mergedSchema } from "~/utils/custom-fields";
import { isFormProcessing } from "~/utils/form";
import { tw } from "~/utils/tw";

import { zodFieldIsRequired } from "~/utils/zod";
import AssetCustomFields from "./custom-fields-inputs";
import DynamicSelect from "../dynamic-select/dynamic-select";
import FormRow from "../forms/form-row";
import Input from "../forms/input";
import { AbsolutePositionedHeaderActions } from "../layout/header/absolute-positioned-header-actions";
import { Button } from "../shared";
import { Button } from "../shared/button";
import { ButtonGroup } from "../shared/button-group";
import { Card } from "../shared/card";
import { Image } from "../shared/image";
Expand Down
5 changes: 3 additions & 2 deletions app/components/assets/import-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import type { ChangeEvent } from "react";
import { useRef, useState } from "react";
import { useFetcher } from "@remix-run/react";
import type { action } from "~/routes/_layout+/assets.import";
import { isFormProcessing, tw } from "~/utils";
import { isFormProcessing } from "~/utils/form";
import { tw } from "~/utils/tw";
import Input from "../forms/input";
import { CrispButton } from "../marketing/crisp";
import { Button } from "../shared";
import { Button } from "../shared/button";
import {
AlertDialog,
AlertDialogCancel,
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/notes/actions-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HorizontalDotsIcon } from "~/components/icons";
import { HorizontalDotsIcon } from "~/components/icons/library";
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/notes/delete-note.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useFetcher, useParams } from "@remix-run/react";
import { TrashIcon } from "~/components/icons";
import { TrashIcon } from "~/components/icons/library";
import { Button } from "~/components/shared/button";

import {
Expand Down
2 changes: 0 additions & 2 deletions app/components/assets/notes/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useLoaderData, useFetcher } from "@remix-run/react";
import { MarkdownViewer } from "~/components/markdown/markdown-viewer";
import { useUserData } from "~/hooks";
import { useUserData } from "~/hooks/use-user-data";
import type { loader } from "~/routes/_layout+/assets.$assetId";
import { isFormProcessing } from "~/utils";
import { isFormProcessing } from "~/utils/form";
import { NewNote } from "./new";
import type { NoteWithDate } from "./note";
import { Note } from "./note";
Expand Down
7 changes: 5 additions & 2 deletions app/components/assets/notes/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { atom, useAtom } from "jotai";
import { useZorm } from "react-zorm";
import { z } from "zod";
import Input from "~/components/forms/input";
import { MarkdownEditor, clearMarkdownAtom } from "~/components/markdown";
import { Button } from "~/components/shared";
import {
MarkdownEditor,
clearMarkdownAtom,
} from "~/components/markdown/markdown-editor";
import { Button } from "~/components/shared/button";

export const NewNoteSchema = z.object({
content: z.string().min(3, "Content is required"),
Expand Down
2 changes: 1 addition & 1 deletion app/components/assets/notes/note.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Note as NoteType } from "@prisma/client";
import { MarkdownViewer } from "~/components/markdown";
import { MarkdownViewer } from "~/components/markdown/markdown-viewer";
import { Switch } from "~/components/shared/switch";
import { Tag } from "~/components/shared/tag";
import { useUserIsSelfService } from "~/hooks/user-user-is-self-service";
Expand Down
6 changes: 3 additions & 3 deletions app/components/booking/actions-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useSubmit } from "@remix-run/react";
import { ChevronRight } from "~/components/icons";
import { ChevronRight } from "~/components/icons/library";
import {
DropdownMenu,
DropdownMenuContent,
Expand All @@ -10,9 +10,9 @@ import {
import { useBookingStatus } from "~/hooks/use-booking-status";
import { useUserIsSelfService } from "~/hooks/user-user-is-self-service";
import type { BookingWithCustodians } from "~/routes/_layout+/bookings";
import { tw } from "~/utils";
import { tw } from "~/utils/tw";
import { DeleteBooking } from "./delete-booking";
import { Button } from "../shared";
import { Button } from "../shared/button";

interface Props {
booking: BookingWithCustodians;
Expand Down
4 changes: 2 additions & 2 deletions app/components/booking/asset-row-actions-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Asset } from "@prisma/client";

import { VerticalDotsIcon } from "~/components/icons";
import { VerticalDotsIcon } from "~/components/icons/library";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuTrigger,
} from "~/components/shared/dropdown";
import { tw } from "~/utils";
import { tw } from "~/utils/tw";
import { RemoveAssetFromBooking } from "./remove-asset-from-booking";

interface Props {
Expand Down
3 changes: 2 additions & 1 deletion app/components/booking/availability-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { Booking } from "@prisma/client";
import { BookingStatus } from "@prisma/client";
import { Link, useLoaderData } from "@remix-run/react";
import type { AssetWithBooking } from "~/routes/_layout+/bookings.$bookingId.add-assets";
import { SERVER_URL, tw } from "~/utils";
import { SERVER_URL } from "~/utils/env";
import { tw } from "~/utils/tw";
import {
Tooltip,
TooltipContent,
Expand Down
2 changes: 1 addition & 1 deletion app/components/booking/availability-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
} from "../forms";
} from "../forms/select";

export function AvailabilitySelect() {
const [searchParams, setSearchParams] = useSearchParams();
Expand Down
3 changes: 2 additions & 1 deletion app/components/booking/booking-assets-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { AvailabilityLabel } from "./availability-label";
import { AssetImage } from "../assets/asset-image";
import { AssetStatusBadge } from "../assets/asset-status-badge";
import { List } from "../list";
import { Badge, Button } from "../shared";
import { Badge } from "../shared/badge";
import { Button } from "../shared/button";
import { ControlledActionButton } from "../shared/controlled-action-button";
import TextualDivider from "../shared/textual-divider";
import { Td, Th } from "../table";
Expand Down
5 changes: 3 additions & 2 deletions app/components/booking/delete-booking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "~/components/shared/modal";
import { isFormProcessing, tw } from "~/utils";
import { TrashIcon } from "../icons";
import { isFormProcessing } from "~/utils/form";
import { tw } from "~/utils/tw";
import { TrashIcon } from "../icons/library";

export const DeleteBooking = ({
booking,
Expand Down
7 changes: 4 additions & 3 deletions app/components/booking/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import {
import { useBookingStatus } from "~/hooks/use-booking-status";
import { useUserIsSelfService } from "~/hooks/user-user-is-self-service";
import type { BookingWithCustodians } from "~/routes/_layout+/bookings";
import { isFormProcessing, tw } from "~/utils";
import type { BookingFormData } from ".";
import { isFormProcessing } from "~/utils/form";
import { tw } from "~/utils/tw";
import { ActionsDropdown } from "./actions-dropdown";
import type { BookingFormData } from "./page-content";
import CustodianUserSelect from "../custody/custodian-user-select";
import FormRow from "../forms/form-row";
import Input from "../forms/input";
import { AbsolutePositionedHeaderActions } from "../layout/header/absolute-positioned-header-actions";
import { Button } from "../shared";
import { Button } from "../shared/button";
import { Card } from "../shared/card";
import { ControlledActionButton } from "../shared/controlled-action-button";

Expand Down
1 change: 0 additions & 1 deletion app/components/booking/index.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions app/components/booking/remove-asset-from-booking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
} from "~/components/shared/modal";
import { useBookingStatus } from "~/hooks/use-booking-status";
import type { BookingWithCustodians } from "~/routes/_layout+/bookings";
import { tw } from "~/utils";
import { TrashIcon } from "../icons";
import { tw } from "~/utils/tw";
import { TrashIcon } from "../icons/library";

export const RemoveAssetFromBooking = ({ asset }: { asset: Asset }) => {
const { booking } = useLoaderData<{ booking: BookingWithCustodians }>();
Expand Down
4 changes: 2 additions & 2 deletions app/components/booking/status-filter.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useNavigation, useSearchParams } from "@remix-run/react";
import { isFormProcessing } from "~/utils";
import { isFormProcessing } from "~/utils/form";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "../forms";
} from "../forms/select";

export function StatusFilter({
statusItems,
Expand Down
2 changes: 1 addition & 1 deletion app/components/category/category-select-no-categories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "../shared";
import { Button } from "../shared/button";

export const CategorySelectNoCategories = () => (
<div>
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions app/components/category/delete-category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
AlertDialogTitle,
AlertDialogTrigger,
} from "~/components/shared/modal";
import { isFormProcessing } from "~/utils";
import { TrashIcon } from "../icons";
import { isFormProcessing } from "~/utils/form";
import { TrashIcon } from "../icons/library";

export const DeleteCategory = ({
category,
Expand Down
8 changes: 4 additions & 4 deletions app/components/custody/custodian-user-select.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { useLoaderData } from "@remix-run/react";
import type { loader } from "~/routes/_layout+/assets.$assetId.give-custody";
import { tw } from "~/utils";
import { tw } from "~/utils/tw";
import {
Select,
SelectTrigger,
SelectValue,
SelectContent,
SelectItem,
} from "../forms";
import { UserIcon } from "../icons";
import { Button } from "../shared";
} from "../forms/select";
import { UserIcon } from "../icons/library";
import { Button } from "../shared/button";

/** Custodian select that works only for with users and doesnt support team members
* This is used for something like bookings where the custodian can only be a team member
Expand Down
2 changes: 1 addition & 1 deletion app/components/custom-fields/actions-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CustomField } from "@prisma/client";
import { VerticalDotsIcon } from "~/components/icons";
import { VerticalDotsIcon } from "~/components/icons/library";
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
4 changes: 2 additions & 2 deletions app/components/custom-fields/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { updateDynamicTitleAtom } from "~/atoms/dynamic-title-atom";
import { useOrganizationId } from "~/hooks/use-organization-id";
import type { action as editCustomFieldsAction } from "~/routes/_layout+/settings.custom-fields.$fieldId_.edit";
import type { action as newCustomFieldsAction } from "~/routes/_layout+/settings.custom-fields.new";
import { isFormProcessing } from "~/utils";
import { FIELD_TYPE_NAME } from "~/utils/custom-fields";
import { isFormProcessing } from "~/utils/form";
import { getValidationErrors } from "~/utils/http";
import { zodFieldIsRequired } from "~/utils/zod";
import FormRow from "../forms/form-row";
Expand All @@ -24,7 +24,7 @@ import {
SelectValue,
} from "../forms/select";
import { Switch } from "../forms/switch";
import { Button } from "../shared";
import { Button } from "../shared/button";
import { Card } from "../shared/card";
import { Spinner } from "../shared/spinner";

Expand Down
4 changes: 2 additions & 2 deletions app/components/dashboard/announcement-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useLoaderData } from "@remix-run/react";
import type { loader } from "~/routes/_layout+/dashboard";
import { StarsIcon } from "../icons";
import { MarkdownViewer } from "../markdown";
import { StarsIcon } from "../icons/library";
import { MarkdownViewer } from "../markdown/markdown-viewer";
import { Button } from "../shared/button";

export default function AnnouncementBar() {
Expand Down
3 changes: 2 additions & 1 deletion app/components/dashboard/assets-by-category-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { ClientOnly } from "remix-utils/client-only";
import type { loader } from "~/routes/_layout+/dashboard";
import { EmptyState } from "./empty-state";
import FallbackLoading from "./fallback-loading";
import { Badge, Button } from "../shared";
import { Badge } from "../shared/badge";
import { Button } from "../shared/button";
import { InfoTooltip } from "../shared/info-tooltip";

export default function AssetsByCategoryChart() {
Expand Down
Loading
Loading