Skip to content

Commit

Permalink
fest!: remove frontend package (#311)
Browse files Browse the repository at this point in the history
* feat: remove frontend package

* refactor: use date as string

* refactor: remove item chat type
  • Loading branch information
pyphilia authored Nov 3, 2023
1 parent 1eda066 commit 5e63c75
Show file tree
Hide file tree
Showing 38 changed files with 155 additions and 509 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:

- name: set up node
uses: actions/setup-node@v4
with:
node-version: 18.15

- name: Yarn Install and Cache
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1
Expand Down
14 changes: 2 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,16 @@
},
"exports": {
".": "./dist/index.js",
"./frontend": "./dist/frontend/index.js",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"frontend": [
"dist/frontend/index.d.ts"
]
}
},
"files": [
"dist"
],
"dependencies": {
"@aws-sdk/client-s3": "3.427.0",
"@fastify/secure-session": "6.1.0",
"@graasp/etherpad-api": "2.1.1",
"date-fns": "2.30.0",
"fastify": "4.18.0",
"immutable": "4.3.4",
"fastify": "4.24.3",
"js-cookie": "3.0.5",
"uuid": "9.0.1",
"validator": "13.11.0"
Expand All @@ -62,7 +52,7 @@
"@commitlint/config-conventional": "18.1.0",
"@trivago/prettier-plugin-sort-imports": "4.2.1",
"@types/eslint": "8.44.6",
"@types/jest": "29.5.6",
"@types/jest": "29.5.7",
"@types/js-cookie": "3.0.5",
"@types/jsdom": "21.1.4",
"@types/uuid": "9.0.6",
Expand Down
3 changes: 0 additions & 3 deletions src/frontend/index.ts

This file was deleted.

155 changes: 0 additions & 155 deletions src/frontend/types.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/frontend/ui.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/services/action/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Action {
extra: { [key: string]: unknown };
// TODO: cannot import geoip
geolocation?: unknown;
createdAt: Date;
createdAt: string;
}

export interface ActionData {
Expand Down
4 changes: 2 additions & 2 deletions src/services/app/interfaces/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export interface App {
url: string;
extra: AppExtra;
publisher: Publisher;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
}
2 changes: 1 addition & 1 deletion src/services/app/interfaces/appAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export type AppAction = {
member: Member;
type: string;
data: object;
createdAt: Date;
createdAt: string;
};
4 changes: 2 additions & 2 deletions src/services/app/interfaces/appData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export type AppData<T extends Data = Data> = {
type: string;
visibility: `${AppDataVisibility}` | AppDataVisibility;
data: T;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
};
4 changes: 2 additions & 2 deletions src/services/app/interfaces/appSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export type AppSetting<T extends Data = Data> = {
creator?: Member | null;
name: string;
data: T;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
};
4 changes: 2 additions & 2 deletions src/services/app/interfaces/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export interface Publisher {
id: UUID;
name: string;
origins: string[];
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
}
2 changes: 1 addition & 1 deletion src/services/categories/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export type ItemCategory = {
id: UUID;
item: DiscriminatedItem;
category: Category;
createdAt: Date;
createdAt: string;
creator: Member;
};
25 changes: 6 additions & 19 deletions src/services/chat/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,23 @@ export type ChatMessage = {
id: UUID;
item: DiscriminatedItem;
creator: Member | null;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
body: string;
};

/**
* All messages linked to an item
*/
export type ItemChat = {
id: UUID;
messages: ChatMessage[];
};

// type of the exported chat message
// contains the additional "creatorName" key with the plain text name of the user
export type ExportedChatMessage = {
id: UUID;
chatId: UUID;
creator: Member | null;
creatorName: string;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
body: string;
};

export type ExportedItemChat = {
id: UUID;
messages: ExportedChatMessage[];
};

/**
* Type of the "body" prop when sending a new message
*/
Expand Down Expand Up @@ -66,8 +53,8 @@ export type ChatMention = {
id: UUID;
message: ChatMessage;
member: Member;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
status: MentionStatus;
};

Expand Down
2 changes: 1 addition & 1 deletion src/services/etherpad/interfaces/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type EtherpadCookie = {
options: {
domain: string;
path: string;
expires: Date;
expires: string;
signed: boolean;
httpOnly: boolean;
};
Expand Down
2 changes: 1 addition & 1 deletion src/services/flag/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type ItemFlag = {
type: `${FlagType}` | FlagType;
item: DiscriminatedItem;
creator: Member;
createdAt: Date;
createdAt: string;
};

export enum FlagType {
Expand Down
4 changes: 2 additions & 2 deletions src/services/invitation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export type Invitation = {
name?: string;
creator?: Member | null;
item: DiscriminatedItem;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
};
2 changes: 1 addition & 1 deletion src/services/item-favorite/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { UUID } from '@/types';
export type ItemFavorite = {
id: UUID;
item: DiscriminatedItem;
createdAt: Date;
createdAt: string;
};
2 changes: 1 addition & 1 deletion src/services/item-like/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { UUID } from '@/types';
export type ItemLike = {
id: UUID;
item: DiscriminatedItem;
createdAt: Date;
createdAt: string;
};
8 changes: 4 additions & 4 deletions src/services/item-login/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export interface ItemLoginSchema {
id: UUID;
item: DiscriminatedItem;
type: `${ItemLoginSchemaType}` | ItemLoginSchemaType;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
}

export type ItemLogin = {
id: UUID;
member: Member;
itemLoginSchema: ItemLoginSchema;
password?: string;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
};
4 changes: 2 additions & 2 deletions src/services/item-memberships/interfaces/item-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export interface ItemMembership {
item: DiscriminatedItem;
permission: PermissionLevel;
creator?: Member | null;
createdAt: Date;
updatedAt: Date;
createdAt: string;
updatedAt: string;
}
Loading

0 comments on commit 5e63c75

Please sign in to comment.