Skip to content

Commit

Permalink
Update dependencies; auto-format imports (kriasoft#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya authored Mar 8, 2021
1 parent 6c81f2d commit 8e5d6f4
Show file tree
Hide file tree
Showing 55 changed files with 590 additions and 1,820 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "7.20.0-pnpify",
"version": "7.21.0-pnpify",
"main": "./lib/api.js",
"type": "commonjs"
}
7 changes: 5 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
packageExtensions:
babel-plugin-relay@*:
dependencies:
"@babel/runtime": ^7.13.2
"@babel/runtime": ^7.13.9
html-webpack-plugin@*:
dependencies:
loader-utils: ^2.0.0
relay-compiler@*:
dependencies:
relay-compiler-language-typescript: ^13.0.6
Expand All @@ -19,4 +22,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-push.cjs
spec: "https://yarnplugins.com/push"

yarnPath: .yarn/releases/yarn-2.4.0.cjs
yarnPath: .yarn/releases/yarn-2.4.1.cjs
3 changes: 1 addition & 2 deletions api/auth/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import type { Identity, User } from "db";
import { Request } from "express";
import type { User, Identity } from "db";

import db from "../db";
import { newUserId } from "../utils";

Expand Down
3 changes: 1 addition & 2 deletions api/auth/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { IdentityProvider } from "db/types";
import { Request, Response } from "express";
import { OAuth2Client } from "google-auth-library";
import { IdentityProvider } from "db/types";

import env from "../env";
import connect from "./connect";
import response from "./response";
Expand Down
2 changes: 1 addition & 1 deletion api/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { Router, Request, Response, NextFunction } from "express";
import { NextFunction, Request, Response, Router } from "express";
import * as google from "./google";

export const auth = Router();
Expand Down
5 changes: 2 additions & 3 deletions api/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
*/

import DataLoader from "dataloader";
import type { Identity, User } from "db";
import { Request } from "express";
import type { User, Identity } from "db";

import db from "./db";
import { ForbiddenError, UnauthorizedError } from "./error";
import { mapTo, mapToMany } from "./utils";
import { UnauthorizedError, ForbiddenError } from "./error";

export class Context {
private readonly req: Request;
Expand Down
4 changes: 2 additions & 2 deletions api/enums/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { mapValues } from "lodash";
import { GraphQLEnumType } from "graphql";
import { IdentityProvider } from "db/types";
import { GraphQLEnumType } from "graphql";
import { mapValues } from "lodash";

export const IdentityProviderType = new GraphQLEnumType({
name: "IdentityProvider",
Expand Down
2 changes: 1 addition & 1 deletion api/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { cleanEnv, str, num, bool, url } from "envalid";
import { bool, cleanEnv, num, str, url } from "envalid";

const appName = process.env.APP_NAME?.replace(/^W/g, "");

Expand Down
7 changes: 3 additions & 4 deletions api/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import moment from "moment-timezone";
import { QueryBuilder } from "knex";
import {
GraphQLFieldConfig,
GraphQLInt,
GraphQLNonNull,
GraphQLString,
} from "graphql";

import type { Knex } from "knex";
import moment from "moment-timezone";
import { Context } from "./context";

/**
Expand Down Expand Up @@ -44,7 +43,7 @@ export function dateField<TSource>(
}

export const countField: GraphQLFieldConfig<
{ query: QueryBuilder },
{ query: Knex.QueryBuilder },
Context
> = {
type: new GraphQLNonNull(GraphQLInt),
Expand Down
9 changes: 4 additions & 5 deletions api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { Router, Request } from "express";
import { Request, Router } from "express";
import { graphqlHTTP } from "express-graphql";
import { express as voyager } from "graphql-voyager/middleware";

import env from "./env";
import { auth } from "./auth";
import { session } from "./session";
import { schema } from "./schema";
import { Context } from "./context";
import env from "./env";
import { schema } from "./schema";
import { session } from "./session";

export const api = Router();

Expand Down
5 changes: 2 additions & 3 deletions api/mutations/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { GraphQLFieldConfig, GraphQLObjectType, GraphQLString } from "graphql";
import type { User } from "db";

import db from "../db";
import { GraphQLFieldConfig, GraphQLObjectType, GraphQLString } from "graphql";
import { Context } from "../context";
import db from "../db";
import { UserType } from "../types";

interface SignInArgs {
Expand Down
15 changes: 7 additions & 8 deletions api/mutations/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { mutationWithClientMutationId } from "graphql-relay";
import type { User } from "db";
import {
GraphQLNonNull,
GraphQLID,
GraphQLString,
GraphQLBoolean,
GraphQLID,
GraphQLList,
GraphQLNonNull,
GraphQLString,
} from "graphql";
import type { User } from "db";

import db from "../db";
import { mutationWithClientMutationId } from "graphql-relay";
import { Context } from "../context";
import db from "../db";
import { UserType } from "../types";
import { validate, fromGlobalId } from "../utils";
import { fromGlobalId, validate } from "../utils";

export const updateUser = mutationWithClientMutationId({
name: "UpdateUser",
Expand Down
4 changes: 2 additions & 2 deletions api/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

/* eslint-disable @typescript-eslint/no-var-requires */

import { nodeDefinitions, fromGlobalId } from "graphql-relay";
import { assignType, getType } from "./utils";
import { fromGlobalId, nodeDefinitions } from "graphql-relay";
import { Context } from "./context";
import { assignType, getType } from "./utils";

export const { nodeInterface, nodeField, nodesField } = nodeDefinitions(
(globalId, context: Context) => {
Expand Down
10 changes: 5 additions & 5 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"compression": "^1.7.4",
"cookie": "^0.4.1",
"cookie-parser": "^1.4.5",
"core-js": "^3.9.0",
"core-js": "^3.9.1",
"cors": "^2.8.5",
"cross-spawn": "^7.0.3",
"dataloader": "^2.0.0",
Expand All @@ -40,7 +40,7 @@
"graphql-voyager": "^1.0.0-rc.31",
"handlebars": "^4.7.7",
"jsonwebtoken": "^8.5.1",
"knex": "^0.21.18",
"knex": "^0.95.1",
"lodash": "^4.17.21",
"moment-timezone": "^0.5.33",
"nanoid": "^3.1.20",
Expand All @@ -53,8 +53,8 @@
},
"devDependencies": {
"@babel/cli": "^7.13.0",
"@babel/core": "^7.13.1",
"@babel/register": "^7.13.0",
"@babel/core": "^7.13.8",
"@babel/register": "^7.13.8",
"@types/cookie": "^0.4.0",
"@types/cross-spawn": "^6.0.2",
"@types/express": "^4.17.11",
Expand All @@ -65,7 +65,7 @@
"@types/lodash": "^4.14.168",
"@types/minimist": "^1.2.1",
"@types/moment-timezone": "^0.5.30",
"@types/node": "^14.14.31",
"@types/node": "^14.14.32",
"@types/uuid": "^8.3.0",
"@types/validator": "^13.1.3",
"del-cli": "^3.0.1",
Expand Down
11 changes: 5 additions & 6 deletions api/queries/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { GraphQLNonNull, GraphQLString, GraphQLFieldConfig } from "graphql";
import type { User } from "db";
import { GraphQLFieldConfig, GraphQLNonNull, GraphQLString } from "graphql";
import {
connectionDefinitions,
forwardConnectionArgs,
connectionFromArraySlice,
cursorToOffset,
forwardConnectionArgs,
} from "graphql-relay";
import type { User } from "db";

import db from "../db";
import { Context } from "../context";
import { UserType } from "../types";
import db from "../db";
import { countField } from "../fields";
import { UserType } from "../types";

export const me: GraphQLFieldConfig<unknown, Context> = {
type: UserType,
Expand Down
7 changes: 3 additions & 4 deletions api/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/

import fs from "fs";
import path from "path";
import { GraphQLObjectType, GraphQLSchema, printSchema } from "graphql";
import { noop } from "lodash";
import { printSchema, GraphQLSchema, GraphQLObjectType } from "graphql";

import * as queries from "./queries";
import path from "path";
import * as mutations from "./mutations";
import { nodeField, nodesField } from "./node";
import * as queries from "./queries";

export const schema = new GraphQLSchema({
query: new GraphQLObjectType({
Expand Down
5 changes: 2 additions & 3 deletions api/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
*/

import cookie from "cookie";
import jwt from "jsonwebtoken";
import { RequestHandler, Request, Response } from "express";
import type { User } from "db";

import { Request, RequestHandler, Response } from "express";
import jwt from "jsonwebtoken";
import db from "./db";
import env from "./env";

Expand Down
15 changes: 7 additions & 8 deletions api/types/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { globalIdField } from "graphql-relay";
import type { Identity } from "db";
import {
GraphQLObjectType,
GraphQLNonNull,
GraphQLString,
GraphQLBoolean,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
GraphQLString,
} from "graphql";
import type { Identity } from "db";

import { dateField } from "../fields";
import { IdentityProviderType } from "../enums";
import { globalIdField } from "graphql-relay";
import { Context } from "../context";
import { IdentityProviderType } from "../enums";
import { dateField } from "../fields";

export const IdentityType = new GraphQLObjectType<Identity, Context>({
name: "Identity",
Expand Down
15 changes: 7 additions & 8 deletions api/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { globalIdField } from "graphql-relay";
import type { User } from "db";
import {
GraphQLObjectType,
GraphQLNonNull,
GraphQLString,
GraphQLBoolean,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
GraphQLString,
} from "graphql";
import type { User } from "db";

import { nodeInterface } from "../node";
import { globalIdField } from "graphql-relay";
import { Context } from "../context";
import { dateField } from "../fields";
import { nodeInterface } from "../node";
import { IdentityType } from "./identity";
import { Context } from "../context";

export const UserType = new GraphQLObjectType<User, Context>({
name: "User",
Expand Down
4 changes: 2 additions & 2 deletions api/utils/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* @copyright 2016-present Kriasoft (https://git.io/Jt7GM)
*/

import { fromGlobalId } from "graphql-relay";
import type { IsEmailOptions, IsLengthOptions, IsURLOptions } from "validator";
import isEmail from "validator/lib/isEmail";
import isLength from "validator/lib/isLength";
import isURL from "validator/lib/isURL";
import textTrim from "validator/lib/trim";
import { fromGlobalId } from "graphql-relay";
import type { IsEmailOptions, IsLengthOptions, IsURLOptions } from "validator";

/* eslint-disable @typescript-eslint/no-explicit-any */

Expand Down
2 changes: 1 addition & 1 deletion db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"cross-spawn": "^7.0.3",
"env": "workspace:*",
"faker": "^5.4.0",
"knex": "^0.21.18",
"knex": "^0.95.1",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"nanoid": "^3.1.20",
Expand Down
2 changes: 1 addition & 1 deletion env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "index.cjs",
"type": "commonjs",
"dependencies": {
"@babel/core": "^7.13.1",
"@babel/core": "^7.13.8",
"dotenv": "^8.2.0",
"minimist": "^1.2.5"
}
Expand Down
Loading

0 comments on commit 8e5d6f4

Please sign in to comment.