Skip to content

Commit 69c568c

Browse files
committed
refactor: standardize ESM import paths and optimize shared package entry points
1 parent b82f0fe commit 69c568c

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

apps/backend/src/routes/cards.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as cardService from '../services/cardService.js'
22
import { handleDbError } from '../utils/error.util.js';
3-
import { hashIp } from '../utils/refreshToken';
4-
import { createCardSchema ,updateCardSchema, addPlatformLinkSchema} from '../validations/card.validation';
3+
import { hashIp } from '../utils/refreshToken.js';
4+
import { createCardSchema ,updateCardSchema, addPlatformLinkSchema} from '../validations/card.validation.js';
55

6-
import type { CardResponse, UpdateCardBody,UpdatedCardResponse } from '../services/cardService';
7-
import type { Card } from '@devcard/shared/src/types.js';
6+
import type { CardResponse, UpdateCardBody, UpdatedCardResponse } from '../services/cardService';
7+
import type { Card } from '@devcard/shared';
88
import type { CardVisibility } from '@prisma/client';
99
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
1010

apps/backend/src/routes/follow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPlatform, getProfileUrl, getWebViewUrl } from '@devcard/shared/src/platforms.js';
1+
import { getPlatform, getProfileUrl, getWebViewUrl } from '@devcard/shared';
22

33
import { decrypt } from '../utils/encryption.js';
44
import { getErrorMessage } from '../utils/error.util.js';

apps/backend/src/routes/profiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Prisma } from '@prisma/client';
22

3-
import * as profileService from '../services/profileService';
3+
import * as profileService from '../services/profileService.js';
44
import { updateProfileSchema, createLinkSchema, reorderLinksSchema } from '../utils/validators.js';
55

66
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';

apps/backend/src/routes/team.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import QRCode from 'qrcode'
44
import {generateUniqueSlug} from '../utils/slug.js'
55
import { createTeamScehma,inviteMembers,updateTeam } from '../validations/team.validation.js';
66

7-
import type {PlatformLink, PublicProfile} from '@devcard/shared/src/types.js'
8-
import type { FastifyInstance } from 'fastify';
7+
import type {PlatformLink, PublicProfile} from '@devcard/shared'
8+
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
99

1010
type TeamMember = PublicProfile & {
1111
teamRole: TeamRole

apps/backend/src/services/cardService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type Card, CardVisibility, type Prisma } from '@prisma/client';
22
import QRCode from 'qrcode';
33

4-
import { generateUniqueSlug } from '../utils/slug';
4+
import { generateUniqueSlug } from '../utils/slug.js';
55

66
import type { CreateCardBody } from '../routes/cards';
77
import type { FastifyInstance } from 'fastify';

apps/backend/src/services/profileService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FastifyInstance } from 'fastify'
2-
import { getProfileUrl } from '@devcard/shared/src/platforms.js'
2+
import { getProfileUrl } from '@devcard/shared'
33
import { getErrorMessage } from '../utils/error.util.js'
44

55
export async function getOwnProfile(app: FastifyInstance, userId: string) {

apps/backend/src/utils/validators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPlatform } from '@devcard/shared/src/platforms';
1+
import { getPlatform } from '@devcard/shared';
22
import { z } from 'zod';
33

44
export const updateProfileSchema = z.object({

0 commit comments

Comments
 (0)