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

refactor: scrap infrastructure package 🗑️ #382

Merged
merged 3 commits into from
Jul 19, 2024
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
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/_profile.companies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ListCompaniesWhere,
} from '@oyster/core/employment';
import { listCompanies } from '@oyster/core/employment.server';
import { track } from '@oyster/infrastructure/mixpanel';
import { track } from '@oyster/core/mixpanel';
import {
cx,
Dashboard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import dayjs from 'dayjs';
import React, { type PropsWithChildren } from 'react';
import { BookOpen, Calendar, Globe, Home, Link, MapPin } from 'react-feather';

import { type MixpanelEvent } from '@oyster/infrastructure/mixpanel';
import { type MixpanelEvent } from '@oyster/core/mixpanel';
import {
cx,
getButtonCn,
Expand Down
6 changes: 1 addition & 5 deletions apps/member-profile/app/routes/_profile.home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ import {
} from 'react-feather';
import { match } from 'ts-pattern';

import { getIpAddress, setMixpanelProfile, track } from '@oyster/core/mixpanel';
import { db } from '@oyster/db';
import {
getIpAddress,
setMixpanelProfile,
track,
} from '@oyster/infrastructure/mixpanel';
import {
type ActivationRequirement,
StudentActiveStatus,
Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/_profile.points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { Award, Plus } from 'react-feather';
import { match } from 'ts-pattern';
import { z } from 'zod';

import { track } from '@oyster/core/mixpanel';
import { db } from '@oyster/db';
import { track } from '@oyster/infrastructure/mixpanel';
import { type CompletedActivity } from '@oyster/types';
import {
Button,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@remix-run/react';
import { type z } from 'zod';

import { track } from '@oyster/infrastructure/mixpanel';
import { track } from '@oyster/core/mixpanel';
import { Student } from '@oyster/types';
import {
Button,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { json, type LoaderFunctionArgs } from '@remix-run/node';
import { useLoaderData } from '@remix-run/react';
import dayjs from 'dayjs';

import { getPresignedURL } from '@oyster/core/object-storage';
import { type ResourceType } from '@oyster/core/resources';
import { listResources } from '@oyster/core/resources.server';
import { getPresignedURL } from '@oyster/infrastructure/object-storage';

import { getDateRange, Recap } from '@/routes/_profile.recap.$date';
import { Resource } from '@/shared/components/resource';
Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/_profile.recap.$date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import dayjs from 'dayjs';
import { type PropsWithChildren } from 'react';

import { listCompanyReviews } from '@oyster/core/employment.server';
import { track } from '@oyster/core/mixpanel';
import { listResources } from '@oyster/core/resources.server';
import { listSlackMessages } from '@oyster/core/slack.server';
import { track } from '@oyster/infrastructure/mixpanel';
import { Divider, Text } from '@oyster/ui';
import { iife } from '@oyster/utils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
useSearchParams,
} from '@remix-run/react';

import { track } from '@oyster/core/mixpanel';
import { AddResourceInput } from '@oyster/core/resources';
import { addResource } from '@oyster/core/resources.server';
import { track } from '@oyster/infrastructure/mixpanel';
import {
Button,
Divider,
Expand Down
4 changes: 2 additions & 2 deletions apps/member-profile/app/routes/_profile.resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import dayjs from 'dayjs';
import { Plus } from 'react-feather';

import { isMemberAdmin } from '@oyster/core/admin.server';
import { track } from '@oyster/core/mixpanel';
import { getPresignedURL } from '@oyster/core/object-storage';
import {
ListResourcesOrderBy,
ListResourcesWhere,
type ResourceType,
} from '@oyster/core/resources';
import { listResources, listTags } from '@oyster/core/resources.server';
import { track } from '@oyster/infrastructure/mixpanel';
import { getPresignedURL } from '@oyster/infrastructure/object-storage';
import {
Dashboard,
ExistingSearchParams,
Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/_public.login.oauth.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type LoaderFunctionArgs, redirect } from '@remix-run/node';
import jwt from 'jsonwebtoken';

import { track } from '@oyster/infrastructure/mixpanel';
import { track } from '@oyster/core/mixpanel';
import { toTitleCase } from '@oyster/utils';

import { Route } from '@/shared/constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
useLoaderData,
} from '@remix-run/react';

import { track } from '@oyster/infrastructure/mixpanel';
import { track } from '@oyster/core/mixpanel';
import { Button, Form, getErrors, validateForm } from '@oyster/ui';

import { verifyOneTimeCode } from '@/member-profile.server';
Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/api.mixpanel.track.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type ActionFunctionArgs, json } from '@remix-run/node';

import { track } from '@oyster/infrastructure/mixpanel';
import { track } from '@oyster/core/mixpanel';

import { getSession, user } from '@/shared/session.server';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ActionFunctionArgs, json } from '@remix-run/node';

import { track } from '@oyster/core/mixpanel';
import { upvoteResource } from '@oyster/core/resources.server';
import { track } from '@oyster/infrastructure/mixpanel';

import { ensureUserAuthenticated, user } from '@/shared/session.server';

Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/api.resources.$id.view.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type ActionFunctionArgs, json } from '@remix-run/node';

import { track } from '@oyster/core/mixpanel';
import { viewResource } from '@oyster/core/resources.server';
import { track } from '@oyster/infrastructure/mixpanel';

import { ensureUserAuthenticated, user } from '@/shared/session.server';

Expand Down
2 changes: 1 addition & 1 deletion apps/member-profile/app/routes/api.tags.add.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type ActionFunctionArgs, json } from '@remix-run/node';

import { track } from '@oyster/core/mixpanel';
import { CreateTagInput } from '@oyster/core/resources';
import { createTag } from '@oyster/core/resources.server';
import { track } from '@oyster/infrastructure/mixpanel';
import { validateForm } from '@oyster/ui';

import { ensureUserAuthenticated, user } from '@/shared/session.server';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { useFetcher } from '@remix-run/react';

import {
type MixpanelEvent,
type TrackInput,
} from '@oyster/infrastructure/mixpanel';
import { type MixpanelEvent, type TrackInput } from '@oyster/core/mixpanel';

export function useMixpanelTracker() {
const fetcher = useFetcher();
Expand Down
1 change: 0 additions & 1 deletion apps/member-profile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@aws-sdk/s3-request-presigner": "^3.577.0",
"@oyster/core": "*",
"@oyster/db": "*",
"@oyster/infrastructure": "*",
"@oyster/types": "*",
"@oyster/ui": "*",
"@oyster/utils": "*",
Expand Down
8 changes: 7 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"./admin.server": "./src/modules/admin/index.server.ts",
"./employment": "./src/modules/employment/index.ts",
"./employment.server": "./src/modules/employment/index.server.ts",
"./mixpanel": "./src/modules/mixpanel/index.ts",
"./object-storage": "./src/modules/object-storage/index.ts",
"./resources": "./src/modules/resource/index.ts",
"./resources.server": "./src/modules/resource/index.server.ts",
"./resume-books": "./src/modules/resume-book/index.ts",
Expand All @@ -30,10 +32,11 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.576.0",
"@aws-sdk/s3-request-presigner": "^3.577.0",
"@mailchimp/mailchimp_marketing": "^3.0.78",
"@oyster/db": "*",
"@oyster/email-templates": "*",
"@oyster/infrastructure": "*",
"@oyster/types": "*",
"@oyster/utils": "*",
"@react-email/render": "^0.0.6",
Expand All @@ -43,10 +46,13 @@
"dedent": "^0.7.0",
"googleapis": "^126.0.1",
"ioredis": "^5.3.2",
"is-ip": "^5.0.1",
"jsonwebtoken": "^9.0.2",
"mixpanel": "^0.18.0",
"nanoid": "^3.0.0",
"nodemailer": "^6.9.13",
"postmark": "^3.0.15",
"ua-parser-js": "^1.0.36",
"zod": "^3.20.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
StudentAttendedOnboardingEmail,
StudentRemovedEmail,
} from '@oyster/email-templates';
import { getObject } from '@oyster/infrastructure/object-storage';

import { getObject } from '@/modules/object-storage';
import { ENVIRONMENT } from '@/shared/env';
import {
getNodemailerTransporter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { db } from '@oyster/db';
import { putObject } from '@oyster/infrastructure/object-storage';
import { id } from '@oyster/utils';

import { job } from '@/infrastructure/bull/use-cases/job';
import { putObject } from '@/modules/object-storage';
import { type AddResourceInput } from '@/modules/resource/resource.types';

export async function addResource(input: AddResourceInput) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import dayjs from 'dayjs';
import { match } from 'ts-pattern';

import { db, point } from '@oyster/db';
import {
getPresignedURL,
putObject,
} from '@oyster/infrastructure/object-storage';
import { FORMATTED_RACE } from '@oyster/types';
import { iife } from '@oyster/utils';

import { job } from '@/infrastructure/bull/use-cases/job';
import { createAirtableRecord } from '@/modules/airtable/use-cases/create-airtable-record';
import { updateAirtableRecord } from '@/modules/airtable/use-cases/update-airtable-record';
import { type DegreeType } from '@/modules/education/education.types';
import { getPresignedURL, putObject } from '@/modules/object-storage';
import { getResumeBookSubmission } from '@/modules/resume-book/queries/get-resume-book-submission';
import { type SubmitResumeInput } from '@/modules/resume-book/resume-book.types';

Expand Down
7 changes: 0 additions & 7 deletions packages/infrastructure/.eslintrc.cjs

This file was deleted.

31 changes: 0 additions & 31 deletions packages/infrastructure/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/infrastructure/tsconfig.json

This file was deleted.