Skip to content

Commit

Permalink
organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ledyba committed Jul 23, 2021
1 parent 7630734 commit 18cd2c7
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 17 deletions.
3 changes: 2 additions & 1 deletion server/src/controller/both/EntityController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Shelf from '../../shelf/Shelf';
import {FastifyReply, FastifyRequest, RequestGenericInterface} from 'fastify';

import Shelf from '../../shelf/Shelf';

export interface EntityControllerInterface extends RequestGenericInterface {
Params: {
id: string,
Expand Down
2 changes: 1 addition & 1 deletion server/src/controller/both/MomentBodyController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {FastifyReply, FastifyRequest} from 'fastify';
import MomentRenderer from '../../renderer/MomentRenderer';
import Shelf from '../../shelf/Shelf';
import {parseMomentPath} from '../../shelf/Moment';
import dayjs from "dayjs";
import dayjs from 'dayjs';

export default class MomentBodyController {
private readonly shelf: Shelf;
Expand Down
1 change: 1 addition & 0 deletions server/src/controller/omote/IndexController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {FastifyReply, FastifyRequest} from 'fastify';
import Handlebars from 'handlebars';

import Asset from 'lib/asset';

export default class IndexController {
Expand Down
2 changes: 2 additions & 0 deletions server/src/controller/omote/MomentController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Handlebars from 'handlebars';
import {FastifyReply, FastifyRequest} from 'fastify';

import Asset from 'lib/asset';

import Shelf from '../../shelf/Shelf';
import { parseMomentPath } from '../../shelf/Moment';

Expand Down
2 changes: 1 addition & 1 deletion server/src/controller/omote/RandomSelectionController.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {FastifyReply, FastifyRequest, RequestGenericInterface} from 'fastify';
import dayjs from 'dayjs';

import * as protocol from 'lib/protocol';

import Shelf from '../../shelf/Shelf';
import {formatMomentPath, formatMomentTime, MomentSummary} from '../../shelf/Moment';
import dayjs from "dayjs";

export interface RandomSelectionControllerInterface extends RequestGenericInterface {
Querystring: {
Expand Down
1 change: 0 additions & 1 deletion server/src/controller/ura/DeleteController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dayjs from 'dayjs';
import { FastifyReply, FastifyRequest } from 'fastify';

import * as protocol from 'lib/protocol';
Expand Down
2 changes: 2 additions & 0 deletions server/src/controller/ura/EditController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {FastifyReply, FastifyRequest} from 'fastify';

import Asset from 'lib/asset';

import EditorTemplate from './lib/EditorTemplate';
import Shelf from '../../shelf/Shelf';
import {parseMomentPath, formatMomentTime} from '../../shelf/Moment';
Expand Down
3 changes: 2 additions & 1 deletion server/src/controller/ura/IndexController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {FastifyReply, FastifyRequest} from 'fastify';
import Handlebars from 'handlebars';

import Asset from 'lib/asset';

import UraTemplate from './lib/UraTemplate';

export default class IndexController {
Expand Down
4 changes: 3 additions & 1 deletion server/src/controller/ura/MomentListController.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {FastifyReply, FastifyRequest, RequestGenericInterface} from 'fastify';
import dayjs from 'dayjs';

import Asset from 'lib/asset';

import UraTemplate from './lib/UraTemplate';
import Shelf from '../../shelf/Shelf';
import dayjs from "dayjs";
import {formatMomentPath} from '../../shelf/Moment';

export interface MomentListControllerInterface extends RequestGenericInterface {
Expand Down
2 changes: 2 additions & 0 deletions server/src/controller/ura/NewController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {FastifyReply, FastifyRequest} from 'fastify';

import Asset from 'lib/asset';

import EditorTemplate from './lib/EditorTemplate';

export default class NewController {
Expand Down
3 changes: 2 additions & 1 deletion server/src/controller/ura/UploadController.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Shelf from '../../shelf/Shelf';
import {FastifyReply, FastifyRequest} from 'fastify';

import Shelf from '../../shelf/Shelf';

export default class UploadController {
private readonly shelf: Shelf;
constructor(shelf: Shelf) {
Expand Down
3 changes: 2 additions & 1 deletion server/src/controller/ura/lib/EditorTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UraTemplate from './UraTemplate';
import Asset from 'lib/asset';

import UraTemplate from './UraTemplate';

type EditorData = {
title: string;
author: string;
Expand Down
4 changes: 3 additions & 1 deletion server/src/controller/ura/lib/UraTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Handlebars, {Template} from 'handlebars';
import dayjs from 'dayjs';

import Asset from 'lib/asset';

import Config from '../../../Config';
import dayjs from "dayjs";

const kCompileOption: CompileOptions = {
preventIndent: true,
Expand Down
1 change: 1 addition & 0 deletions server/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Asset from 'lib/asset';

import Server from './Server';
import Shelf from './shelf/Shelf';
import Repo from './repo/Repo';
Expand Down
4 changes: 2 additions & 2 deletions server/src/repo/Pool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as genericPool from 'generic-pool';
import {Client, Result, ResultIterator} from 'ts-postgres';
import {Value} from 'ts-postgres/src/types';
import { Client, ResultIterator } from 'ts-postgres';
import { Value } from 'ts-postgres/src/types';

export default class Pool {
private pool: genericPool.Pool<Client>
Expand Down
9 changes: 5 additions & 4 deletions server/src/repo/Repo.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Pool from './Pool';
import {Entity} from '../shelf/Entity';
import dayjs from 'dayjs';
import NodeCache from 'node-cache';
import { ResultRow } from 'ts-postgres';

import Pool from './Pool';
import { Entity } from '../shelf/Entity';
import Config from '../Config';
import { Moment, MomentSummary } from '../shelf/Moment';
import NodeCache from 'node-cache';
import {ResultRow} from "ts-postgres";

export default class Repo {
private readonly pool: Pool;
Expand Down
4 changes: 3 additions & 1 deletion server/src/shelf/Shelf.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import path from 'path';
import * as os from 'os';
import * as fs from 'fs/promises';
import dayjs from 'dayjs';

import * as protocol from 'lib/protocol';
import * as fml from 'lib/fml';
import { probe } from 'lib/media/probe';
import { resizeImage, makeImageIcon, makeVideoIcon, makeAudioIcon } from 'lib/media/convert';

import Repo from '../repo/Repo';
import Storage from '../storage/Storage';
import { Entity, ImageEntity, VideoEntity, AudioEntity } from './Entity';
import {Moment, MomentSummary, formatMomentTime, parseMomentTime} from './Moment';
import dayjs from "dayjs";

class Shelf {
readonly storagePath: string;
Expand Down
3 changes: 2 additions & 1 deletion server/src/storage/Storage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import path from 'path';
import md5sum from 'lib/md5sum';
import * as fs from 'fs/promises';

import md5sum from 'lib/md5sum';

function storedPathOf(hash: string): string {
const dir01 = hash.slice(0,2);
const dir02 = hash.slice(2,4);
Expand Down

0 comments on commit 18cd2c7

Please sign in to comment.