1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-23 19:02:37 +01:00

🐛 remove relative @paths

This commit is contained in:
Flam3rboy 2021-03-27 21:52:02 +01:00
parent b346ff857d
commit 0baef5015a
10 changed files with 107 additions and 25 deletions

17
.expo/README.md Normal file
View File

@ -0,0 +1,17 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.
> What does the "packager-info.json" file contain?
The "packager-info.json" file contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
> What does the "settings.json" file contain?
The "settings.json" file contains the server configuration that is used to serve the application manifest.
> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.

8
.expo/settings.json Normal file
View File

@ -0,0 +1,8 @@
{
"hostType": "lan",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null,
"https": false
}

11
jsconfig.json Normal file
View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@util/*": ["./src/util/*"],
"@middlewares/*": ["./src/middlewares/*"],
"@schema/*": ["./src/schema/*"]
}
},
"include": ["src"]
}

47
package-lock.json generated
View File

@ -36,6 +36,7 @@
"@types/multer": "^1.4.5",
"@types/node": "^14.14.22",
"@types/node-fetch": "^2.5.7",
"@zerollup/ts-transform-paths": "^1.7.18",
"0x": "^4.10.2",
"node-fetch": "^2.6.1",
"ts-node": "^9.1.1",
@ -195,6 +196,30 @@
"resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz",
"integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ=="
},
"node_modules/@zerollup/ts-helpers": {
"version": "1.7.18",
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
"dev": true,
"dependencies": {
"resolve": "^1.12.0"
},
"peerDependencies": {
"typescript": ">=3.7.2"
}
},
"node_modules/@zerollup/ts-transform-paths": {
"version": "1.7.18",
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
"dev": true,
"dependencies": {
"@zerollup/ts-helpers": "^1.7.18"
},
"peerDependencies": {
"typescript": ">=3.7.2"
}
},
"node_modules/0x": {
"version": "4.10.2",
"resolved": "https://registry.npmjs.org/0x/-/0x-4.10.2.tgz",
@ -2369,7 +2394,7 @@
},
"node_modules/fosscord-server-util": {
"version": "1.0.0",
"resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#18498d6515e43eb764eb26c9ec3a35ce515c4257",
"resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#f22b6d3f0b530058b538c33670a5600e5d3b4abd",
"license": "ISC",
"dependencies": {
"jsonwebtoken": "^8.5.1",
@ -6440,6 +6465,24 @@
"resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz",
"integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ=="
},
"@zerollup/ts-helpers": {
"version": "1.7.18",
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
"dev": true,
"requires": {
"resolve": "^1.12.0"
}
},
"@zerollup/ts-transform-paths": {
"version": "1.7.18",
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
"dev": true,
"requires": {
"@zerollup/ts-helpers": "^1.7.18"
}
},
"0x": {
"version": "4.10.2",
"resolved": "https://registry.npmjs.org/0x/-/0x-4.10.2.tgz",
@ -8331,7 +8374,7 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fosscord-server-util": {
"version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#18498d6515e43eb764eb26c9ec3a35ce515c4257",
"version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#f22b6d3f0b530058b538c33670a5600e5d3b4abd",
"from": "fosscord-server-util@github:fosscord/fosscord-server-util",
"requires": {
"jsonwebtoken": "^8.5.1",

View File

@ -47,6 +47,7 @@
"@types/multer": "^1.4.5",
"@types/node": "^14.14.22",
"@types/node-fetch": "^2.5.7",
"@zerollup/ts-transform-paths": "^1.7.18",
"0x": "^4.10.2",
"node-fetch": "^2.6.1",
"ts-node": "^9.1.1",

View File

@ -1,11 +1,11 @@
import { Router, Request, Response } from "express";
import { HTTPError } from "lambert-server";
import { check } from "@util/instanceOf";
import { random } from "@util/RandomInviteID";
import { emitEvent } from "@util/Event";
import { check } from "../../../../../util/instanceOf";
import { random } from "../../../../../util/RandomInviteID";
import { emitEvent } from "../../../../../util/Event";
import { InviteCreateSchema } from "@schema/Invite";
import { InviteCreateSchema } from "../../../../../schema/Invite";
import { getPermission, ChannelModel, InviteModel, InviteCreateEvent } from "fosscord-server-util";

View File

@ -1,9 +1,9 @@
import { Router } from "express";
import { ChannelModel, getPermission, MessageDeleteBulkEvent, MessageModel } from "fosscord-server-util";
import { HTTPError } from "lambert-server";
import Config from "@util/Config";
import { emitEvent } from "@util/Event";
import { check } from "@util/instanceOf";
import Config from "../../../../../../util/Config";
import { emitEvent } from "../../../../../../util/Event";
import { check } from "../../../../../../util/instanceOf";
const router: Router = Router();

View File

@ -1,11 +1,11 @@
import { Router } from "express";
import { ChannelModel, ChannelType, getPermission, Message, MessageCreateEvent, MessageModel, Snowflake } from "fosscord-server-util";
import { HTTPError } from "lambert-server";
import { MessageCreateSchema } from "@schema/Message";
import { check, instanceOf, Length } from "@util/instanceOf";
import { PublicUserProjection } from "@util/User";
import { MessageCreateSchema } from "../../../../../../schema/Message";
import { check, instanceOf, Length } from "../../../../../../util/instanceOf";
import { PublicUserProjection } from "../../../../../../util/User";
import multer from "multer";
import { emitEvent } from "@util/Event";
import { emitEvent } from "../../../../../../util/Event";
const router: Router = Router();
export default router;
@ -111,6 +111,7 @@ router.post("/", check(MessageCreateSchema), async (req, res) => {
// TODO: should it be checked if the message exists?
}
// TODO: properly build message object
const message: Message = {
id: Snowflake.generate(),
channel_id,
@ -118,6 +119,13 @@ router.post("/", check(MessageCreateSchema), async (req, res) => {
author_id: req.user_id,
content: req.body,
timestamp: new Date(),
mention_channels_ids: [],
mention_role_ids: [],
mention_user_ids: [],
attachments: [],
embeds: [],
reactions: [],
type: 0,
};
await new MessageModel(message).save();

View File

@ -1,12 +1,12 @@
import { Request, Response, Router } from "express";
import { BanModel, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel } from "fosscord-server-util";
import { HTTPError } from "lambert-server";
import { getIpAdress } from "@middlewares/GlobalRateLimit";
import { BanCreateSchema } from "@schema/Ban";
import { emitEvent } from "@util/Event";
import { check } from "@util/instanceOf";
import { removeMember } from "@util/Member";
import { getPublicUser } from "@util/User";
import { getIpAdress } from "../../../../../middlewares/GlobalRateLimit";
import { BanCreateSchema } from "../../../../../schema/Ban";
import { emitEvent } from "../../../../../util/Event";
import { check } from "../../../../../util/instanceOf";
import { removeMember } from "../../../../../util/Member";
import { getPublicUser } from "../../../../../util/User";
const router: Router = Router();

View File

@ -43,12 +43,6 @@
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"baseUrl": "./src" /* Base directory to resolve non-absolute module names. */,
"paths": {
"@util/*": ["util/*"],
"@middlewares/*": ["middlewares/*"],
"@schema/*": ["schema/*"]
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"types": ["node"] /* Type declaration files to be included in compilation. */,