From 2b698e785a4d7bbde34c2e3f5acce9be5b0538b7 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Wed, 25 May 2022 23:48:42 +0000 Subject: [PATCH] PR-448199: Moving Server to src directory. --- .vscode/settings.json | 3 +++ {@types => src/@types}/custom.d.ts | 0 {GraphQL => src/GraphQL}/resolvers/index.ts | 0 {GraphQL => src/GraphQL}/schema/Test.gql | 0 {GraphQL => src/GraphQL}/schema/index.ts | 0 {GraphQL => src/GraphQL}/server.ts | 2 +- {controllers => src/controllers}/controllerGraphQL/index.ts | 0 index.ts => src/index.ts | 2 +- {models => src/models}/index.ts | 0 {routes => src/routes}/index.ts | 0 {tests => src/tests}/server/index.test.ts | 0 webpack.config.dev.ts | 2 +- webpack.config.ts | 2 +- 13 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json rename {@types => src/@types}/custom.d.ts (100%) rename {GraphQL => src/GraphQL}/resolvers/index.ts (100%) rename {GraphQL => src/GraphQL}/schema/Test.gql (100%) rename {GraphQL => src/GraphQL}/schema/index.ts (100%) rename {GraphQL => src/GraphQL}/server.ts (94%) rename {controllers => src/controllers}/controllerGraphQL/index.ts (100%) rename index.ts => src/index.ts (98%) rename {models => src/models}/index.ts (100%) rename {routes => src/routes}/index.ts (100%) rename {tests => src/tests}/server/index.test.ts (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..55712c1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} \ No newline at end of file diff --git a/@types/custom.d.ts b/src/@types/custom.d.ts similarity index 100% rename from @types/custom.d.ts rename to src/@types/custom.d.ts diff --git a/GraphQL/resolvers/index.ts b/src/GraphQL/resolvers/index.ts similarity index 100% rename from GraphQL/resolvers/index.ts rename to src/GraphQL/resolvers/index.ts diff --git a/GraphQL/schema/Test.gql b/src/GraphQL/schema/Test.gql similarity index 100% rename from GraphQL/schema/Test.gql rename to src/GraphQL/schema/Test.gql diff --git a/GraphQL/schema/index.ts b/src/GraphQL/schema/index.ts similarity index 100% rename from GraphQL/schema/index.ts rename to src/GraphQL/schema/index.ts diff --git a/GraphQL/server.ts b/src/GraphQL/server.ts similarity index 94% rename from GraphQL/server.ts rename to src/GraphQL/server.ts index fa8fcd7..32751ea 100644 --- a/GraphQL/server.ts +++ b/src/GraphQL/server.ts @@ -1,7 +1,7 @@ 'use strict'; import express from 'express'; //express import { graphqlHTTP } from 'express-graphql'; -import { config } from '../config'; +import { config } from '../../config'; import schema from './schema'; const server = express.Router();//Router de Express diff --git a/controllers/controllerGraphQL/index.ts b/src/controllers/controllerGraphQL/index.ts similarity index 100% rename from controllers/controllerGraphQL/index.ts rename to src/controllers/controllerGraphQL/index.ts diff --git a/index.ts b/src/index.ts similarity index 98% rename from index.ts rename to src/index.ts index 88293c0..34385d9 100644 --- a/index.ts +++ b/src/index.ts @@ -8,7 +8,7 @@ import { useServer } from 'graphql-ws/lib/use/ws'; import { execute, subscribe } from 'graphql'; import GraphQLserver from './GraphQL/server';// Server of GraphQL, import schema from './GraphQL/schema'; -import { config } from './config'; +import { config } from '../config'; import apiRouter from './routes'; diff --git a/models/index.ts b/src/models/index.ts similarity index 100% rename from models/index.ts rename to src/models/index.ts diff --git a/routes/index.ts b/src/routes/index.ts similarity index 100% rename from routes/index.ts rename to src/routes/index.ts diff --git a/tests/server/index.test.ts b/src/tests/server/index.test.ts similarity index 100% rename from tests/server/index.test.ts rename to src/tests/server/index.test.ts diff --git a/webpack.config.dev.ts b/webpack.config.dev.ts index 282c98f..034aeb3 100644 --- a/webpack.config.dev.ts +++ b/webpack.config.dev.ts @@ -13,7 +13,7 @@ const resolvePath = (...args) => path.resolve(ROOT_DIR, ...args); const BUILD_DIR = resolvePath('build'); const config = { - entry: './index.ts', + entry: './src/index.ts', target: 'node', watch: true, externals: [nodeExternals()], diff --git a/webpack.config.ts b/webpack.config.ts index ad384f9..cdd00b5 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -13,7 +13,7 @@ const resolvePath = (...args) => path.resolve(ROOT_DIR, ...args); const BUILD_DIR = resolvePath('build'); const config = { - entry: './index.ts', + entry: './src/index.ts', target: 'node', externals: [nodeExternals()], output: {