refactor: use consistent import ordering

- global modules
- NPM modules (defaults first, then expansions)
- local modules
pull/239/head
Josh Moore 1 year ago
parent 5832a696a8
commit 5d06745ceb

@ -1,6 +1,8 @@
import { UserConfiguration, UserConfigTypeChecker } from 'ass';
import fs from 'fs-extra';
import { path } from '@tycrek/joint';
import { UserConfiguration, UserConfigTypeChecker } from 'ass';
import { log } from './log';
const FILEPATH = path.join('.ass-data/userconfig.json');

@ -1,14 +1,16 @@
import express, { Request, Response, NextFunction, RequestHandler, json as BodyParserJson } from 'express';
import { ServerConfiguration } from 'ass';
import fs from 'fs-extra';
import tailwindcss from 'tailwindcss';
import session from 'express-session';
import MemoryStore from 'memorystore';
import fs from 'fs-extra';
import express, { Request, Response, NextFunction, RequestHandler, json as BodyParserJson } from 'express';
import { path, isProd } from '@tycrek/joint';
import { epcss } from '@tycrek/express-postcss';
import tailwindcss from 'tailwindcss';
import { log } from './log';
import { ensureFiles } from './data';
import { UserConfig } from './UserConfig';
import { ServerConfiguration } from 'ass';
import { MySql } from './sql/mysql';
import { buildFrontendRouter } from './routers/_frontend';

@ -1,8 +1,10 @@
import { AssFile, AssUser, NID, FilesSchema, UsersSchema } from 'ass';
import fs from 'fs-extra';
import { path } from '@tycrek/joint';
import { nanoid } from './generators';
import { log } from './log';
import { AssFile, AssUser, NID, FilesSchema, UsersSchema } from 'ass';
import { nanoid } from './generators';
import { UserConfig } from './UserConfig';
import { MySql } from './sql/mysql';

@ -1,6 +1,6 @@
import fs from 'fs-extra';
import { randomBytes, getRandomValues } from 'crypto';
import cryptoRandomString from 'crypto-random-string';
import { randomBytes, getRandomValues } from 'crypto';
import { path } from '@tycrek/joint';
type Length = { length: number, gfyLength?: number };

@ -3,8 +3,9 @@ import sharp from 'sharp';
import Vibrant from 'node-vibrant';
import ffmpeg from 'ffmpeg-static';
import { exec } from 'child_process';
import { removeLocation } from '@xoi/gps-metadata-remover';
import { isProd } from '@tycrek/joint';
import { removeLocation } from '@xoi/gps-metadata-remover';
//@ts-ignore
import shell from 'any-shell-escape';

@ -1,7 +1,8 @@
import { path } from '@tycrek/joint';
import { Router } from 'express';
import { UserConfig } from '../UserConfig';
import { path } from '@tycrek/joint';
import { App } from '../app';
import { UserConfig } from '../UserConfig';
/**
* Builds a basic router for loading a page with frontend JS

@ -1,10 +1,12 @@
import { Router, json as BodyParserJson, RequestHandler } from 'express';
import { AssUser, AssUserNewReq } from 'ass';
import * as bcrypt from 'bcrypt'
import { log } from '../log';
import { UserConfig } from '../UserConfig';
import { Router, json as BodyParserJson, RequestHandler } from 'express';
import * as data from '../data';
import { AssUser, AssUserNewReq } from 'ass';
import { log } from '../log';
import { nanoid } from '../generators';
import { UserConfig } from '../UserConfig';
import { MySql } from '../sql/mysql';
/**

@ -1,15 +1,17 @@
import { BusBoyFile, AssFile } from 'ass';
import fs from 'fs-extra';
import bb from 'express-busboy';
import { Router } from 'express';
import crypto from 'crypto';
import { log } from '../log';
import { UserConfig } from '../UserConfig';
import { random } from '../generators';
import { BusBoyFile, AssFile } from 'ass';
import { getFileS3, uploadFileS3 } from '../s3';
import { Router } from 'express';
import { Readable } from 'stream';
import * as data from '../data';
import { log } from '../log';
import { App } from '../app';
import { random } from '../generators';
import { UserConfig } from '../UserConfig';
import { getFileS3, uploadFileS3 } from '../s3';
const router = Router({ caseSensitive: true });

@ -1,5 +1,3 @@
import { UserConfig } from './UserConfig';
import { log } from './log';
import {
S3Client,
S3ClientConfig,
@ -14,6 +12,9 @@ import {
AbortMultipartUploadCommand,
} from "@aws-sdk/client-s3";
import { log } from './log';
import { UserConfig } from './UserConfig';
const NYR = 'S3 not ready';
/**

@ -1,7 +1,9 @@
import { AssFile, AssUser, NID, UploadToken } from 'ass';
import mysql, { Pool } from 'mysql2/promise';
import { UserConfig } from '../UserConfig';
import { log } from '../log';
import { AssFile, AssUser, NID, UploadToken } from 'ass';
import { UserConfig } from '../UserConfig';
type TableNamesType = 'assfiles' | 'assusers' | 'asstokens';

Loading…
Cancel
Save