Skip to content

Commit

Permalink
chore: update remix 1.5.1
Browse files Browse the repository at this point in the history
* chore: update remix to 1.5.1

* refactor: rewrite remix imports
  • Loading branch information
antoinechalifour authored Jun 6, 2022
1 parent f6f0dda commit 713fcd1
Show file tree
Hide file tree
Showing 42 changed files with 175 additions and 363 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DATABASE_URL=postgresql://user:password@localhost:6060/todolistmanager-dev
BASE_URL=http://localhost:3000
SESSION_SECRET=session-secret
NODE_ENV=development
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ ENV NODE_ENV=${NODE_ENV}

COPY package.json yarn.lock ./

# --ignore-script options to prevent Remix from launching its setup script
# which requires @remix-run/dev which is a dev dependency...
RUN yarn install --production --ignore-scripts
# ... so we manually copy the one generated from the building container
COPY --from=builder /usr/src/app/node_modules/@remix-run ./node_modules/@remix-run
COPY --from=builder /usr/src/app/node_modules/remix ./node_modules/remix
RUN yarn install --production

# dev dependnecies are required for generating the prisma client,
# so we copy the one generated in the builder container
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: yarn remix setup && yarn prisma:migrate && node dist/src/main.js
web: yarn prisma:migrate && node dist/src/main.js
2 changes: 1 addition & 1 deletion app/authentication/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AuthenticationErrorDto } from "shared/client";
import { Form, Link, useActionData, useLoaderData, useTransition } from "remix";
import { Form, Link, useActionData, useLoaderData, useTransition } from "@remix-run/react";
import { UpdateIcon } from "@radix-ui/react-icons";
import { FloatingLabelInput } from "front/ui/FloatingLabelInput";
import { ButtonPrimary } from "front/ui/Button";
Expand Down
2 changes: 1 addition & 1 deletion app/authentication/RegisterForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AuthenticationErrorDto } from "shared/client";
import { Form, Link, useActionData, useLoaderData, useTransition } from "remix";
import { Form, Link, useActionData, useLoaderData, useTransition } from "@remix-run/react";
import { UpdateIcon } from "@radix-ui/react-icons";
import { FloatingLabelInput } from "front/ui/FloatingLabelInput";
import { ButtonPrimary } from "front/ui/Button";
Expand Down
2 changes: 1 addition & 1 deletion app/authentication/ResetPasswordForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLocation } from "remix";
import { useLocation } from "@remix-run/react";
import { useFetcher } from "@remix-run/react";
import { FloatingLabelInput } from "front/ui/FloatingLabelInput";
import { ButtonPrimary } from "front/ui/Button";
Expand Down
4 changes: 2 additions & 2 deletions app/authentication/VerifyAccountError.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ThrownResponse } from "remix";
import { useCatch } from "remix";
import type { ThrownResponse } from "@remix-run/react";
import { useCatch } from "@remix-run/react";
import { CrossCircledIcon } from "@radix-ui/react-icons";
import { InfoPageTemplate } from "front/authentication/InfoPageTemplate";

Expand Down
2 changes: 1 addition & 1 deletion app/authentication/useVerifyAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNavigate } from "remix";
import { useNavigate } from "@remix-run/react";
import { useEffect } from "react";

export function useVerifyAccount() {
Expand Down
2 changes: 1 addition & 1 deletion app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hydrate } from "react-dom";
import { RemixBrowser } from "remix";
import { RemixBrowser } from "@remix-run/react";

hydrate(<RemixBrowser />, document);
2 changes: 1 addition & 1 deletion app/homepage/TodoListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TodoListSummaryDto } from "shared/client";

import { Link } from "remix";
import { Link } from "@remix-run/react";
import { useFetcher } from "@remix-run/react";
import classNames from "classnames";
import { displayDate } from "front/Date";
Expand Down
2 changes: 1 addition & 1 deletion app/homepage/TodoLists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EmptyMessage } from "front/ui/EmptyMessage";
import { PageTitle } from "front/ui/PageTitle";
import { TodoListItem } from "front/homepage/TodoListItem";
import { AddTodoListForm } from "front/homepage/AddTodoListForm";
import { useLoaderData } from "remix";
import { useLoaderData } from "@remix-run/react";

export const TodoLists = () => {
const { todoLists } = useLoaderData<TodoListsSummaryDto>();
Expand Down
5 changes: 3 additions & 2 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { LinksFunction, LoaderFunction } from "remix";
import type { LinksFunction, LoaderFunction } from "@remix-run/node";

import {
Link,
Links,
Expand All @@ -10,7 +11,7 @@ import {
useCatch,
useLoaderData,
useLocation,
} from "remix";
} from "@remix-run/react";

import * as React from "react";

Expand Down
2 changes: 1 addition & 1 deletion app/routes/forgot-password.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction, MetaFunction } from "remix";
import type { ActionFunction, MetaFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";
import { ForgotPasswordForm } from "front/authentication/ForgotPasswordForm";

Expand Down
2 changes: 1 addition & 1 deletion app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction, LoaderFunction, MetaFunction } from "remix";
import type { ActionFunction, LoaderFunction, MetaFunction } from "@remix-run/node";
import type { TodoListsSummaryDto } from "shared/client";
import type { RemixAppContext } from "web";

Expand Down
4 changes: 2 additions & 2 deletions app/routes/l/$todoListId.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { MetaFunction, ActionFunction, LoaderFunction } from "remix";
import type { ActionFunction, LoaderFunction, MetaFunction } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import type { TodoListDetailsDto, TodoListPageDto } from "shared/client";
import type { RemixAppContext } from "web";

import { useLoaderData } from "remix";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { RecoilRoot } from "recoil";
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/archive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = async (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/order.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/rename.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = async (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/share.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/todo.$todoId.archive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = async (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/todo.$todoId.rename.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/todo.$todoId.tag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/todo.$todoId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = async (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/l/$todoListId/todo.$todoId.untag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction } from "remix";
import type { ActionFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const action: ActionFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/login.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActionFunction, LoaderFunction, MetaFunction } from "remix";
import type { ActionFunction, LoaderFunction, MetaFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

import { LoginForm } from "front/authentication/LoginForm";
Expand Down
2 changes: 1 addition & 1 deletion app/routes/logout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoaderFunction } from "remix";
import type { LoaderFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

export const loader: LoaderFunction = (args) =>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/register.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MetaFunction, ActionFunction, LoaderFunction } from "remix";
import type { ActionFunction, LoaderFunction, MetaFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";
import { RegisterForm } from "front/authentication/RegisterForm";

Expand Down
4 changes: 2 additions & 2 deletions app/routes/reset-password.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ActionFunction, MetaFunction } from "remix";
import type { ActionFunction, MetaFunction } from "@remix-run/node";
import { useCatch } from "@remix-run/react";
import type { RemixAppContext } from "web";

import { useCatch } from "remix";
import { ResetPasswordForm } from "front/authentication/ResetPasswordForm";
import { PageTitle } from "front/ui/PageTitle";

Expand Down
2 changes: 1 addition & 1 deletion app/routes/verify-account.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoaderFunction, MetaFunction } from "remix";
import type { LoaderFunction, MetaFunction } from "@remix-run/node";
import type { RemixAppContext } from "web";

import { VerifyAccount } from "front/authentication/VerifyAccount";
Expand Down
2 changes: 1 addition & 1 deletion app/routes/welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MetaFunction } from "remix";
import type { MetaFunction } from "@remix-run/node";

import { Welcome } from "front/authentication/Welcome";

Expand Down
2 changes: 1 addition & 1 deletion app/todolist/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
import type { MutableSnapshot } from "recoil";
import type { TodoDto } from "shared/client";
import { useCallback, useEffect } from "react";
import { useLoaderData, useNavigate } from "remix";
import { useLoaderData, useNavigate } from "@remix-run/react";
import { atom, selector, useRecoilState, useRecoilValue } from "recoil";

const RECOIL_KEYS = {
Expand Down
2 changes: 1 addition & 1 deletion app/ui/RootLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { Link } from "remix";
import { Link } from "@remix-run/react";

export const RootLayout = ({
children,
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"license": "",
"scripts": {
"start": "nest start",
"postinstall": "remix setup node",
"build": "run-p build:front build:nest",
"test": "jest --runInBand",
"dev": "run-s dev:migrate dev:start",
Expand Down Expand Up @@ -48,10 +47,9 @@
"@radix-ui/react-icons": "1.1.1",
"@radix-ui/react-popover": "^0.1.6",
"@radix-ui/react-tooltip": "^0.1.7",
"@remix-run/dev": "1.3.5",
"@remix-run/express": "1.4.1",
"@remix-run/node": "1.4.1",
"@remix-run/react": "1.4.1",
"@remix-run/express": "1.5.1",
"@remix-run/node": "1.5.1",
"@remix-run/react": "1.5.1",
"@sendgrid/mail": "^7.7.0",
"bcrypt": "5.0.1",
"class-transformer": "0.5.1",
Expand All @@ -67,14 +65,14 @@
"react-dom": "17.0.2",
"recoil": "^0.7.3",
"reflect-metadata": "0.1.13",
"remix": "1.4.1",
"reset.css": "2.0.2",
"rxjs": "7.5.5",
"uuid": "8.3.2"
},
"devDependencies": {
"@nestjs/cli": "8.2.5",
"@remix-run/eslint-config": "1.4.3",
"@remix-run/dev": "1.5.1",
"@remix-run/eslint-config": "1.5.1",
"@testing-library/cypress": "8.0.2",
"@types/bcrypt": "5.0.0",
"@types/express": "4.17.13",
Expand Down
2 changes: 1 addition & 1 deletion src/web/ApplicationModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import { SessionIdStorageStrategy } from "remix";
import { SessionIdStorageStrategy } from "@remix-run/node";
import { DynamicModule, Module } from "@nestjs/common";
import { EventEmitterModule } from "@nestjs/event-emitter";
import { ServeStaticModule } from "@nestjs/serve-static";
Expand Down
2 changes: 1 addition & 1 deletion src/web/authenticator/Authenticated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DataFunctionArgs } from "@remix-run/node";
import { redirect } from "remix";
import { redirect } from "@remix-run/node";
import { Inject } from "@nestjs/common";
import { AUTHENTICATOR } from "../../keys";
import { SessionAuthenticator } from "./SessionAuthenticator";
Expand Down
2 changes: 1 addition & 1 deletion src/web/authenticator/SessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createCookieSessionStorage,
Session,
SessionIdStorageStrategy,
} from "remix";
} from "@remix-run/node";
import { SESSION_CONFIG } from "../../keys";

@Injectable({ scope: Scope.REQUEST })
Expand Down
2 changes: 1 addition & 1 deletion src/web/remix/Loaders.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Inject, Injectable } from "@nestjs/common";
import { json, redirect } from "remix";
import { json, redirect } from "@remix-run/node";
import {
AuthenticationApplicationService,
Authenticator,
Expand Down
2 changes: 1 addition & 1 deletion src/web/remix/decorators/MapErrorThrowing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { json } from "remix";
import { json } from "@remix-run/node";

type ErrorCasting<T extends Error> = {
is(err: unknown): err is T;
Expand Down
2 changes: 1 addition & 1 deletion src/web/remix/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionFunction, LoaderFunction } from "remix";
import { ActionFunction, LoaderFunction } from "@remix-run/node";

export type MakeRemixContext<Actions, Loaders> = {
actions: {
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "dist", "test", "**/*spec.ts", "app"]
"exclude": ["node_modules", "dist", "test", "**/*spec.ts", "app"],
"compilerOptions": {
"noEmit": false
}
}
11 changes: 5 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
"authentication": ["./src/authentication"],
"todo-list-manager": ["./src/todo-list-manager"]
},

// Remix takes care of building everything in `remix build`.
// "noEmit": true,

// Nest specifics
"skipLibCheck": true,
"incremental": true,
"outDir": "./dist",
"module": "CommonJS",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
"emitDecoratorMetadata": true,
"allowJs": false,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"noEmit": true
}
}
Loading

0 comments on commit 713fcd1

Please sign in to comment.