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

chore: prep write migration to labs #356

Merged
merged 2 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/lms/app/lib/actions/get-analytics.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use server';

import { db } from '@/app/lib/db';
import { Course, Purchase } from '@prisma/client';

import { Course, Purchase } from '.prisma/client';
import { db } from '@/app/lib/db';

type PurchaseWithCourse = Purchase & {
course: Course;
Expand Down
4 changes: 2 additions & 2 deletions apps/lms/app/lib/actions/get-chapter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Attachment, Chapter } from '@prisma/client';

import { checkSubscription } from '@/app/lib/actions/check-subscription';
import { db } from '@/app/lib/db';

import { Attachment, Chapter } from '.prisma/client';

interface GetChapterProps {
userId: string;
courseId: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/lms/app/lib/actions/get-courses.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Category, Course } from '@prisma/client';

import { checkSubscription } from '@/app/lib/actions/check-subscription';
import { getProgress } from '@/app/lib/actions/get-progress';
import { db } from '@/app/lib/db';

import { Category, Course } from '.prisma/client';

type CourseWithProgressWithCategory = Course & {
category: Category | null;
chapters: { id: string }[];
Expand Down
4 changes: 2 additions & 2 deletions apps/lms/app/lib/actions/get-dashboard-courses.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Category, Chapter, Course } from '@prisma/client';

import { checkSubscription } from '@/app/lib/actions/check-subscription';
import { getProgress } from '@/app/lib/actions/get-progress';
import { db } from '@/app/lib/db';

import { Category, Chapter, Course } from '.prisma/client';

type CourseWithProgressWithCategory = Course & {
category: Category;
chapters: Chapter[];
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/lib/db.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createClient } from '@libsql/client';
import { PrismaLibSQL } from '@prisma/adapter-libsql';

import { PrismaClient } from '.prisma/client';
import { PrismaClient } from '@prisma/client';

declare global {
// eslint-disable-next-line no-var
Expand Down
4 changes: 2 additions & 2 deletions apps/lms/app/lib/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Icons } from '@/app/ui/icons';
import { User } from '@prisma/client';

import { User } from '.prisma/client';
import { Icons } from '@/app/ui/icons';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type RadixIconProps = React.SVGProps<SVGSVGElement>;
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/learn/courses/course-mobile-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Chapter, Course, UserProgress } from '@prisma/client';
import { Sheet, SheetContent, SheetTrigger } from '@ui/components/ui/sheet';

import { Icons } from '@/app/ui/icons';

import { CourseSidebar } from './course-sidebar';
import { Chapter, Course, UserProgress } from '.prisma/client';

interface CourseMobileSidebarProps {
course: Course & {
Expand Down
3 changes: 2 additions & 1 deletion apps/lms/app/ui/learn/courses/course-navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Chapter, Course, UserProgress } from '@prisma/client';

import { NavbarRoutes } from '@/app/config/navbar-routes';
import { getCurrentUser } from '@/app/lib/session';

import { UserAccountNav } from '../../user-account-nav';
import { CourseMobileSidebar } from './course-mobile-sidebar';
import { Chapter, Course, UserProgress } from '.prisma/client';

interface CourseNavbarProps {
course: Course & {
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/learn/courses/course-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { redirect } from 'next/navigation';
import { Chapter, Course, UserProgress } from '@prisma/client';
import { Logo } from '@ui/index';

import { db } from '@/app/lib/db';
Expand All @@ -7,7 +8,6 @@ import { FreeCounter } from '@/app/ui/free-counter';
import { CourseProgress } from '@/app/ui/learn/courses/course-progress';

import { CourseSidebarItem } from './course-sidebar-item';
import { Chapter, Course, UserProgress } from '.prisma/client';

interface CourseSidebarProps {
course: Course & {
Expand Down
4 changes: 2 additions & 2 deletions apps/lms/app/ui/learn/courses/courses-list.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CourseCard } from '@/app/ui/learn/courses/course-card';
import { Category, Course } from '@prisma/client';

import { Category, Course } from '.prisma/client';
import { CourseCard } from '@/app/ui/learn/courses/course-card';

type CourseWithProgressWithCategory = Course & {
category: Category | null;
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/learn/dashboard/categories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { Suspense } from 'react';
import { Category } from '@prisma/client';

import { CategoryItemSkeleton } from '../../skeletons';
import { CategoryItem } from './category-item';
import { Category } from '.prisma/client';

interface CategoriesProps {
items: Category[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { Chapter } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import {
Form,
Expand All @@ -21,8 +22,6 @@ import { Icons } from '@/app/ui/icons';
import { Preview } from '@/app/ui/preview';
import { QuillEditor } from '@/app/ui/quill-editor';

import { Chapter } from '.prisma/client';

interface ChapterDescriptionFormProps {
initialData: Chapter;
courseId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import MuxPlayer from '@mux/mux-player-react';
import { Chapter, MuxData } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import { toast } from '@ui/index';
import axios from 'axios';
Expand All @@ -11,8 +12,6 @@ import * as z from 'zod';
import { Icons } from '@/app/ui/icons';
import { FileUpload } from '@/app/ui/learn/teacher/file-upload';

import { Chapter, MuxData } from '.prisma/client';

interface ChapterVideoFormProps {
initialData: Chapter & { muxData?: MuxData | null };
courseId: string;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/attachment-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { Attachment, Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import { toast } from '@ui/index';
import axios from 'axios';
Expand All @@ -10,8 +11,6 @@ import * as z from 'zod';
import { Icons } from '@/app/ui/icons';
import { FileUpload } from '@/app/ui/learn/teacher/file-upload';

import { Attachment, Course } from '.prisma/client';

interface AttachmentFormProps {
initialData: Course & { attachments: Attachment[] };
courseId: string;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/category-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import { Combobox } from '@ui/components/ui/combobox';
import {
Expand All @@ -20,8 +21,6 @@ import * as z from 'zod';

import { Icons } from '@/app/ui/icons';

import { Course } from '.prisma/client';

interface CategoryFormProps {
initialData: Course;
courseId: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/learn/teacher/courses/chapters-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { Chapter, Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import {
Form,
Expand All @@ -21,7 +22,6 @@ import * as z from 'zod';
import { Icons } from '@/app/ui/icons';

import { ChaptersList } from './chapters-list';
import { Chapter, Course } from '.prisma/client';

interface ChaptersFormProps {
initialData: Course & { chapters: Chapter[] };
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/chapters-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import {
Droppable,
DropResult,
} from '@hello-pangea/dnd';
import { Chapter } from '@prisma/client';
import { Badge } from '@ui/components/ui/badge';
import { cn } from '@ui/index';

import { Icons } from '@/app/ui/icons';

import { Chapter } from '.prisma/client';

interface ChaptersListProps {
items: Chapter[];
onReorder: (updateData: { id: string; position: number }[]) => void;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/description-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import {
Form,
Expand All @@ -21,8 +22,6 @@ import { Icons } from '@/app/ui/icons';
import { Preview } from '@/app/ui/preview';
import { QuillEditor } from '@/app/ui/quill-editor';

import { Course } from '.prisma/client';

interface DescriptionFormProps {
initialData: Course;
courseId: string;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/image-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
import { Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import { toast } from '@ui/index';
import axios from 'axios';
Expand All @@ -11,8 +12,6 @@ import * as z from 'zod';
import { Icons } from '@/app/ui/icons';
import { FileUpload } from '@/app/ui/learn/teacher/file-upload';

import { Course } from '.prisma/client';

interface ImageFormProps {
initialData: Course;
courseId: string;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/preview-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { Course } from '@prisma/client';
import {
Button,
cn,
Expand All @@ -21,8 +22,6 @@ import * as z from 'zod';

import { Icons } from '@/app/ui/icons';

import { Course } from '.prisma/client';

interface PreviewFormProps {
initialData: Course;
courseId: string;
Expand Down
3 changes: 1 addition & 2 deletions apps/lms/app/ui/learn/teacher/courses/price-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useState } from 'react';
import { useRouter } from 'next/navigation';
import { COURSE_DEFAULT_PRICE } from '@/constants';
import { zodResolver } from '@hookform/resolvers/zod';
import { Course } from '@prisma/client';
import { Button } from '@ui/components/ui/button';
import {
Form,
Expand All @@ -19,8 +20,6 @@ import * as z from 'zod';

import { Icons } from '@/app/ui/icons';

import { Course } from '.prisma/client';

interface PriceFormProps {
initialData: Course;
courseId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import Link from 'next/link';
import { Course } from '@prisma/client';
import { ColumnDef } from '@tanstack/react-table';
import { Badge } from '@ui/components/ui/badge';
import { Button } from '@ui/components/ui/button';
Expand All @@ -14,8 +15,6 @@ import { cn } from '@ui/index';

import { Icons } from '@/app/ui/icons';

import { Course } from '.prisma/client';

export const teacherCourseListColumns: ColumnDef<Course>[] = [
{
accessorKey: 'title',
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/user-avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { User } from '@prisma/client';
import { Avatar, AvatarFallback, AvatarImage, AvatarProps } from '@ui/index';

import { Icons } from './icons';
import { User } from '.prisma/client';

interface UserAvatarProps extends AvatarProps {
user: Pick<User, 'image' | 'name'>;
Expand Down
2 changes: 1 addition & 1 deletion apps/lms/app/ui/user-name-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as React from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { User } from '@prisma/client';
import {
buttonVariants,
Card,
Expand All @@ -22,7 +23,6 @@ import * as z from 'zod';
import { userNameSchema } from '@/app/lib/validations/user';

import { Icons } from './icons';
import { User } from '.prisma/client';

interface UserNameFormProps extends React.HTMLAttributes<HTMLFormElement> {
user: Pick<User, 'id' | 'name'>;
Expand Down
1 change: 0 additions & 1 deletion apps/lms/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ datasource db {
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "fullTextIndex", "driverAdapters"]
output = "../node_modules/.prisma/client"
}

model User {
Expand Down
36 changes: 0 additions & 36 deletions apps/write/.env.example

This file was deleted.

4 changes: 0 additions & 4 deletions apps/write/.eslintrc.js

This file was deleted.

9 changes: 0 additions & 9 deletions apps/write/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion apps/write/.nvmrc

This file was deleted.

3 changes: 0 additions & 3 deletions apps/write/.prettierignore

This file was deleted.

Loading
Loading