Skip to content

Commit

Permalink
fix: imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Dec 20, 2024
1 parent 2165ffd commit 1aa3fd7
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions apps/client/app/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useEffect } from 'react';
import { Outlet, useLocation } from 'react-router';
import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react';

import Header from '~/app/components/header';
import Alert from '~/app/components/alert';
import Breadcrumbs from '~/app/components/breadcrumbs';
import Header from '~/components/header';

Check failure on line 5 in apps/client/app/components/app.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/components/header"
import Alert from '~/components/alert';

Check failure on line 6 in apps/client/app/components/app.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/components/alert"
import Breadcrumbs from '~/components/breadcrumbs';

Check failure on line 7 in apps/client/app/components/app.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/components/breadcrumbs"

// Create a GrowthBook instance
const growthbook = new GrowthBook({
Expand Down
2 changes: 1 addition & 1 deletion apps/client/app/components/post-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import { Link } from 'react-router';

import { db } from '~/app/services/db';
import { db } from '~/services/db';

Check failure on line 4 in apps/client/app/components/post-preview.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/services/db"

interface IAuthor {
userId: string;
Expand Down
14 changes: 7 additions & 7 deletions apps/client/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { RouterProvider } from 'react-router/dom';

import './index.css';

const App = lazy(() => import('~/app/components/app'));
const Home = lazy(() => import('~/app/pages/index'));
const NoMatch = lazy(() => import('~/app/pages/[all]'));
const App = lazy(() => import('~/components/app'));

Check failure on line 8 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/components/app"
const Home = lazy(() => import('~/pages/index'));

Check failure on line 9 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/pages/index"
const NoMatch = lazy(() => import('~/pages/[all]'));

Check failure on line 10 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/pages/[all]"

const NewPost = lazy(() => import('~/app/pages/posts/new'));
const BlogPost = lazy(() => import('~/app/pages/posts/[postId]'));
const EditPost = lazy(() => import('~/app/pages/posts/[postId]/edit'));
const UserInfo = lazy(() => import('~/app/pages/users/[user-name]'));
const NewPost = lazy(() => import('~/pages/posts/new'));

Check failure on line 12 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/pages/posts/new"
const BlogPost = lazy(() => import('~/pages/posts/[postId]'));

Check failure on line 13 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/pages/posts/[postId]"
const EditPost = lazy(() => import('~/pages/posts/[postId]/edit'));

Check failure on line 14 in apps/client/app/index.tsx

View workflow job for this annotation

GitHub Actions / lint (22)

Missing file extension for "~/pages/posts/[postId]/edit"
const UserInfo = lazy(() => import('~/pages/users/[user-name]'));

const root = createRoot(document.getElementById('app')!);

Expand Down
10 changes: 5 additions & 5 deletions apps/client/app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { Fragment } from 'react';
import { useLiveQuery } from 'dexie-react-hooks';
import { useFeature } from '@growthbook/growthbook-react';

import Search from '~/app/components/search';
import Search from '~/components/search';

import { db } from '~/app/services/db';
import { timestampToLocaleString } from '~/app/services/timestamp-to-locale-string';
import type { IBlogPost } from '~/app/components/post-preview';
import PostPreview from '~/app/components/post-preview';
import { db } from '~/services/db';
import { timestampToLocaleString } from '~/services/timestamp-to-locale-string';
import type { IBlogPost } from '~/components/post-preview';
import PostPreview from '~/components/post-preview';

function handleDeleteStory(id: string) {
db.posts.delete(id);
Expand Down
4 changes: 2 additions & 2 deletions apps/client/app/pages/posts/[postId]/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useState } from 'react';
import { redirect, useParams } from 'react-router';
import { useLiveQuery } from 'dexie-react-hooks';

import { db } from '~/app/services/db';
import type { IBlogPost } from '~/app/components/post-preview';
import { db } from '~/services/db';
import type { IBlogPost } from '~/components/post-preview';

interface IBlogPostProps {
post: IBlogPost;
Expand Down
4 changes: 2 additions & 2 deletions apps/client/app/pages/posts/[postId]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useNavigate, useParams } from 'react-router';
import { useLiveQuery } from 'dexie-react-hooks';

import { db } from '~/app/services/db';
import type { IBlogPost } from '~/app/components/post-preview';
import { db } from '~/services/db';
import type { IBlogPost } from '~/components/post-preview';

function Post({ heading, text }: IBlogPost) {
const navigate = useNavigate();
Expand Down
4 changes: 2 additions & 2 deletions apps/client/app/pages/posts/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useState } from 'react';
import { useNavigate } from 'react-router';
import { v4 as uuidv4 } from 'uuid';

import { Input } from '~/app/components/input';
import { db } from '~/app/services/db';
import { Input } from '~/components/input';
import { db } from '~/services/db';

function getRandomInt(max: number) {
return Math.floor(Math.random() * max);
Expand Down
4 changes: 2 additions & 2 deletions apps/client/app/pages/users/[user-name].tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useParams } from 'react-router';
import { useLiveQuery } from 'dexie-react-hooks';

import { db } from '~/app/services/db';
import type { IUser } from '~/app/components/post-preview';
import { db } from '~/services/db';
import type { IUser } from '~/components/post-preview';

function Info({ name }: IUser) {
return (
Expand Down
2 changes: 1 addition & 1 deletion index.html → apps/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="./apps/client/index.tsx"></script>
<script type="module" src="./app/index.tsx"></script>
</body>
</html>
File renamed without changes.
2 changes: 1 addition & 1 deletion vite.config.ts → apps/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineConfig({
alias: [
{
find: '~/',
replacement: '/apps/client/',
replacement: '/apps/client/app',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "vite serve",
"build": "vite build",
"build": "nx g client build",
"preview": "vite preview",
"typecheck": "tsc -b",
"test": "vitest",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"rootDir": "./",
"moduleResolution": "Node",
"paths": {
"~/*": ["./apps/client/*"]
"~/*": ["./apps/client/app/*"]
},
"resolveJsonModule": true,
"allowJs": false,
Expand All @@ -22,5 +22,5 @@
"noImplicitAny": true,
"skipLibCheck": true
},
"include": ["apps/client", "vite-env.d.ts"]
"include": ["apps/client", "apps/client/vite-env.d.ts"]
}

0 comments on commit 1aa3fd7

Please sign in to comment.