Skip to content

Commit

Permalink
TypeScript import sort
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Sep 12, 2019
1 parent e6d233a commit 2551752
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 88 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"editor.insertSpaces": true,
"editor.minimap.enabled": false,
"sort-imports.on-save": false,
"tslint.jsEnable": false
"tslint.jsEnable": false,
"importSorter.importStringConfiguration.quoteMark": "double",
"importSorter.importStringConfiguration.trailingComma": "multiLine",
"importSorter.sortConfiguration.importMembers.order": "lowercaseLast"
}
11 changes: 4 additions & 7 deletions src/http/opds2-create-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,21 @@
// ==LICENSE-END==

import * as fs from "fs";
import * as moment from "moment";
import { JSON as TAJSON } from "ta-json-x";

import {
initGlobalConverters_OPDS,
} from "@r2-opds-js/opds/init-globals";
import { initGlobalConverters_OPDS } from "@r2-opds-js/opds/init-globals";
import { OPDSFeed } from "@r2-opds-js/opds/opds2/opds2";
import { OPDSLink } from "@r2-opds-js/opds/opds2/opds2-link";
import { OPDSMetadata } from "@r2-opds-js/opds/opds2/opds2-metadata";
import { OPDSPublication } from "@r2-opds-js/opds/opds2/opds2-publication";
import {
initGlobalConverters_GENERIC,
initGlobalConverters_SHARED,
initGlobalConverters_GENERIC, initGlobalConverters_SHARED,
} from "@r2-shared-js/init-globals";
import { Metadata } from "@r2-shared-js/models/metadata";
import { Publication } from "@r2-shared-js/models/publication";
import { PublicationParsePromise } from "@r2-shared-js/parser/publication-parser";
import { isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import * as moment from "moment";
import { JSON as TAJSON } from "ta-json-x";

initGlobalConverters_OPDS();
initGlobalConverters_SHARED();
Expand Down
4 changes: 1 addition & 3 deletions src/http/request-ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

import * as express from "express";

import {
mediaOverlayURLParam,
} from "@r2-shared-js/parser/epub";
import { mediaOverlayURLParam } from "@r2-shared-js/parser/epub";

// export const _lcpPass64 = "lcpPass64";
export const _pathBase64 = "pathBase64";
Expand Down
6 changes: 3 additions & 3 deletions src/http/server-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as debug_ from "debug";
import * as express from "express";
import * as mime from "mime-types";
import * as path from "path";

import { Publication } from "@r2-shared-js/models/publication";
Expand All @@ -13,9 +16,6 @@ import { Transformers } from "@r2-shared-js/transform/transformer";
import { parseRangeHeader } from "@r2-utils-js/_utils/http/RangeUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { IStreamAndLength, IZip } from "@r2-utils-js/_utils/zip/zip";
import * as debug_ from "debug";
import * as express from "express";
import * as mime from "mime-types";

import { IRequestPayloadExtension, IRequestQueryParams, _asset, _pathBase64 } from "./request-ext";
import { Server } from "./server";
Expand Down
11 changes: 4 additions & 7 deletions src/http/server-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as debug_ from "debug";
import * as filehound from "filehound";
import * as fs from "fs";
import * as path from "path";

import { setLcpNativePluginPath } from "@r2-lcp-js/parser/epub/lcp";
import { initGlobalConverters_OPDS } from "@r2-opds-js/opds/init-globals";
import {
initGlobalConverters_OPDS,
} from "@r2-opds-js/opds/init-globals";
import {
initGlobalConverters_GENERIC,
initGlobalConverters_SHARED,
initGlobalConverters_GENERIC, initGlobalConverters_SHARED,
} from "@r2-shared-js/init-globals";
import { EPUBis, isEPUBlication } from "@r2-shared-js/parser/epub";
import * as debug_ from "debug";
import * as filehound from "filehound";

import { MAX_PREFETCH_LINKS, Server } from "./server";

Expand Down
22 changes: 8 additions & 14 deletions src/http/server-manifestjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,25 @@
// ==LICENSE-END==

import * as crypto from "crypto";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as DotProp from "dot-prop";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import * as path from "path";
import { JSON as TAJSON } from "ta-json-x";

import { Publication } from "@r2-shared-js/models/publication";
import { Link } from "@r2-shared-js/models/publication-link";
import {
getAllMediaOverlays,
mediaOverlayURLParam,
mediaOverlayURLPath,
getAllMediaOverlays, mediaOverlayURLParam, mediaOverlayURLPath,
} from "@r2-shared-js/parser/epub";
import { encodeURIComponent_RFC3986, isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import { sortObject, traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as DotProp from "dot-prop";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import { JSON as TAJSON } from "ta-json-x";

import { jsonSchemaValidate } from "../utils/json-schema-validate";
import {
IRequestPayloadExtension,
IRequestQueryParams,
_jsonPath,
_pathBase64,
_show,
IRequestPayloadExtension, IRequestQueryParams, _jsonPath, _pathBase64, _show,
} from "./request-ext";
import { Server } from "./server";

Expand Down
15 changes: 6 additions & 9 deletions src/http/server-mediaoverlays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,19 @@
// ==LICENSE-END==

import * as crypto from "crypto";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import * as path from "path";
import { JSON as TAJSON } from "ta-json-x";

import { Publication } from "@r2-shared-js/models/publication";
import {
getAllMediaOverlays,
getMediaOverlay,
mediaOverlayURLParam,
mediaOverlayURLPath,
getAllMediaOverlays, getMediaOverlay, mediaOverlayURLParam, mediaOverlayURLPath,
} from "@r2-shared-js/parser/epub";
import { encodeURIComponent_RFC3986, isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import { sortObject, traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import { JSON as TAJSON } from "ta-json-x";

import { IRequestPayloadExtension, IRequestQueryParams, _pathBase64, _show } from "./request-ext";
import { Server } from "./server";
Expand Down
11 changes: 6 additions & 5 deletions src/http/server-opds-browse-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { encodeURIComponent_RFC3986, ensureAbsolute } from "@r2-utils-js/_utils/http/UrlUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";
import * as debug_ from "debug";
import * as express from "express";
import * as morgan from "morgan";
import * as request from "request";
import * as requestPromise from "request-promise-native";
import * as xmldom from "xmldom";

import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { encodeURIComponent_RFC3986, ensureAbsolute } from "@r2-utils-js/_utils/http/UrlUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";

import { IRequestPayloadExtension, _urlEncoded } from "./request-ext";
import { Server } from "./server";
import { trailingSlashRedirect } from "./server-trailing-slash-redirect";
Expand Down
11 changes: 6 additions & 5 deletions src/http/server-opds-browse-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { encodeURIComponent_RFC3986, ensureAbsolute } from "@r2-utils-js/_utils/http/UrlUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";
import * as debug_ from "debug";
import * as express from "express";
import * as morgan from "morgan";
import * as request from "request";
import * as requestPromise from "request-promise-native";
import * as xmldom from "xmldom";

import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { encodeURIComponent_RFC3986, ensureAbsolute } from "@r2-utils-js/_utils/http/UrlUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";

import { IRequestPayloadExtension, _urlEncoded } from "./request-ext";
import { Server } from "./server";
import { trailingSlashRedirect } from "./server-trailing-slash-redirect";
Expand Down
26 changes: 15 additions & 11 deletions src/http/server-opds-convert-v1-to-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,32 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as path from "path";

import { convertOpds1ToOpds2, convertOpds1ToOpds2_EntryToPublication } from "@r2-opds-js/opds/converter";
import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { OPDSFeed } from "@r2-opds-js/opds/opds2/opds2";
import { OPDSPublication } from "@r2-opds-js/opds/opds2/opds2-publication";
import { encodeURIComponent_RFC3986, ensureAbsolute, isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import { traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as DotProp from "dot-prop";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import * as morgan from "morgan";
import * as path from "path";
import * as request from "request";
import * as requestPromise from "request-promise-native";
import { JSON as TAJSON } from "ta-json-x";
import * as xmldom from "xmldom";

import {
convertOpds1ToOpds2, convertOpds1ToOpds2_EntryToPublication,
} from "@r2-opds-js/opds/converter";
import { OPDS } from "@r2-opds-js/opds/opds1/opds";
import { Entry } from "@r2-opds-js/opds/opds1/opds-entry";
import { OPDSFeed } from "@r2-opds-js/opds/opds2/opds2";
import { OPDSPublication } from "@r2-opds-js/opds/opds2/opds2-publication";
import {
encodeURIComponent_RFC3986, ensureAbsolute, isHTTP,
} from "@r2-utils-js/_utils/http/UrlUtils";
import { traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";
import { streamToBufferPromise } from "@r2-utils-js/_utils/stream/BufferUtils";
import { XML } from "@r2-utils-js/_utils/xml-js-mapper";

import { jsonSchemaValidate } from "../utils/json-schema-validate";
import { IRequestPayloadExtension, _urlEncoded } from "./request-ext";
import { Server } from "./server";
Expand Down
10 changes: 5 additions & 5 deletions src/http/server-opds-local-feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
// ==LICENSE-END==

import * as crypto from "crypto";
import * as path from "path";

import { OPDSLink } from "@r2-opds-js/opds/opds2/opds2-link";
import { isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import { sortObject, traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";
import * as css2json from "css2json";
import * as debug_ from "debug";
import * as DotProp from "dot-prop";
import * as express from "express";
import * as jsonMarkup from "json-markup";
import * as path from "path";
import { JSON as TAJSON } from "ta-json-x";

import { OPDSLink } from "@r2-opds-js/opds/opds2/opds2-link";
import { isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import { sortObject, traverseJsonObjects } from "@r2-utils-js/_utils/JsonUtils";

import { jsonSchemaValidate } from "../utils/json-schema-validate";
import { IRequestPayloadExtension, IRequestQueryParams, _jsonPath, _show } from "./request-ext";
import { Server } from "./server";
Expand Down
6 changes: 3 additions & 3 deletions src/http/server-pub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as debug_ from "debug";
import * as express from "express";
import * as morgan from "morgan";
import * as path from "path";
import * as querystring from "querystring";

import { encodeURIComponent_RFC3986, isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import * as debug_ from "debug";
import * as express from "express";
import * as morgan from "morgan";

import { IRequestPayloadExtension, _pathBase64 } from "./request-ext";
import { Server } from "./server";
Expand Down
4 changes: 2 additions & 2 deletions src/http/server-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as express from "express";
import { html as beautifyHtml } from "js-beautify";
import * as path from "path";

import { encodeURIComponent_RFC3986, isHTTP } from "@r2-utils-js/_utils/http/UrlUtils";
import * as express from "express";
import { html as beautifyHtml } from "js-beautify";

import { _jsonPath, _show, _urlEncoded } from "./request-ext";
import { Server } from "./server";
Expand Down
1 change: 0 additions & 1 deletion src/http/server-secure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// ==LICENSE-END==

import * as crypto from "crypto";

import * as debug_ from "debug";
import * as express from "express";

Expand Down
3 changes: 2 additions & 1 deletion src/http/server-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import { encodeURIComponent_RFC3986 } from "@r2-utils-js/_utils/http/UrlUtils";
import * as debug_ from "debug";
import * as express from "express";
import * as morgan from "morgan";

import { encodeURIComponent_RFC3986 } from "@r2-utils-js/_utils/http/UrlUtils";

import { IRequestPayloadExtension, _urlEncoded } from "./request-ext";
import { Server } from "./server";
import { trailingSlashRedirect } from "./server-trailing-slash-redirect";
Expand Down
9 changes: 5 additions & 4 deletions src/http/server-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
// ==LICENSE-END==

import * as crypto from "crypto";
import * as fs from "fs";
import * as path from "path";

import * as css2json from "css2json";
import * as debug_ from "debug";
import * as express from "express";
import * as fs from "fs";
import * as jsonMarkup from "json-markup";
import * as path from "path";

import { IRequestPayloadExtension, IRequestQueryParams, _jsonPath, _show, _urlEncoded } from "./request-ext";
import {
IRequestPayloadExtension, IRequestQueryParams, _jsonPath, _show, _urlEncoded,
} from "./request-ext";
import { Server } from "./server";

const debug = debug_("r2:streamer#http/server-version");
Expand Down
8 changes: 4 additions & 4 deletions src/http/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
// ==LICENSE-END==

import * as child_process from "child_process";
import * as debug_ from "debug";
import * as express from "express";
import * as fs from "fs";
import * as http from "http";
import * as https from "https";
import * as path from "path";
import { JSON as TAJSON } from "ta-json-x";
import { tmpNameSync } from "tmp";

import { OPDSFeed } from "@r2-opds-js/opds/opds2/opds2";
import { Publication } from "@r2-shared-js/models/publication";
import { PublicationParsePromise } from "@r2-shared-js/parser/publication-parser";
import { encodeURIComponent_RFC3986 } from "@r2-utils-js/_utils/http/UrlUtils";
import * as debug_ from "debug";
import * as express from "express";
import { JSON as TAJSON } from "ta-json-x";
import { tmpNameSync } from "tmp";

import { CertificateData, generateSelfSignedData } from "../utils/self-signed";
import { _jsonPath, _show } from "./request-ext";
Expand Down
5 changes: 2 additions & 3 deletions src/utils/json-schema-validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
// ==LICENSE-END==

import * as fs from "fs";
import * as path from "path";

import * as Ajv from "ajv";
import * as debug_ from "debug";
import * as fs from "fs";
import * as path from "path";

const debug = debug_("r2:streamer#utils/json-schema-validate");

Expand Down

0 comments on commit 2551752

Please sign in to comment.