From 09f4175f737c28967e4201ea95863a0e661f62c8 Mon Sep 17 00:00:00 2001 From: mytlogos Date: Thu, 16 Dec 2021 08:37:19 +0100 Subject: [PATCH] refactor: rename server bin to src --- .gitignore | 16 ++++++++-------- jest.config.ts | 2 +- package.json | 2 +- packages/server/package.json | 2 +- packages/server/{bin => src}/api/apiTools.ts | 0 packages/server/{bin => src}/api/crawler.ts | 0 packages/server/{bin => src}/api/episode.ts | 0 packages/server/{bin => src}/api/externalUser.ts | 0 packages/server/{bin => src}/api/hooks.ts | 0 packages/server/{bin => src}/api/index.ts | 0 packages/server/{bin => src}/api/jobs.ts | 0 packages/server/{bin => src}/api/list.ts | 0 packages/server/{bin => src}/api/medium.ts | 0 packages/server/{bin => src}/api/news.ts | 0 packages/server/{bin => src}/api/part.ts | 0 packages/server/{bin => src}/api/process.ts | 0 packages/server/{bin => src}/api/user.ts | 0 packages/server/{bin => src}/app.ts | 0 .../server/{bin => src}/deviceVerificator.ts | 0 packages/server/{bin => src}/errors.ts | 0 .../server/{bin => src}/misc/executeFailures.ts | 0 .../server/{bin => src}/misc/fillSystemEvents.ts | 0 packages/server/{bin => src}/misc/migrate.ts | 0 .../{bin => src}/misc/openapi/exportOpenApi.ts | 0 .../server/{bin => src}/misc/openapi/generate.ts | 2 +- .../{bin => src}/misc/openapi/transformer.ts | 6 +++--- .../server/{bin => src}/misc/openapi/types.ts | 0 .../openapi/validateMiddleware.ts.handlebars | 0 .../misc/openapi/webclient.ts.handlebars | 0 .../moduleDeclaration/cloudscraper.d.ts | 0 .../moduleDeclaration/feedparser-promised.d.ts | 0 .../moduleDeclaration/stringify-stream.d.ts | 0 packages/server/{bin => src}/startServer.ts | 0 packages/server/{bin => src}/timer.ts | 0 packages/server/{bin => src}/tunnel.ts | 0 packages/server/{bin => src}/types.ts | 0 packages/server/{bin => src}/update.js | 0 packages/server/{bin => src}/updgradeToHttps.ts | 0 packages/server/tsconfig.json | 6 +++--- packages/website/src/Httpclient.ts | 2 +- 40 files changed, 19 insertions(+), 19 deletions(-) rename packages/server/{bin => src}/api/apiTools.ts (100%) rename packages/server/{bin => src}/api/crawler.ts (100%) rename packages/server/{bin => src}/api/episode.ts (100%) rename packages/server/{bin => src}/api/externalUser.ts (100%) rename packages/server/{bin => src}/api/hooks.ts (100%) rename packages/server/{bin => src}/api/index.ts (100%) rename packages/server/{bin => src}/api/jobs.ts (100%) rename packages/server/{bin => src}/api/list.ts (100%) rename packages/server/{bin => src}/api/medium.ts (100%) rename packages/server/{bin => src}/api/news.ts (100%) rename packages/server/{bin => src}/api/part.ts (100%) rename packages/server/{bin => src}/api/process.ts (100%) rename packages/server/{bin => src}/api/user.ts (100%) rename packages/server/{bin => src}/app.ts (100%) rename packages/server/{bin => src}/deviceVerificator.ts (100%) rename packages/server/{bin => src}/errors.ts (100%) rename packages/server/{bin => src}/misc/executeFailures.ts (100%) rename packages/server/{bin => src}/misc/fillSystemEvents.ts (100%) rename packages/server/{bin => src}/misc/migrate.ts (100%) rename packages/server/{bin => src}/misc/openapi/exportOpenApi.ts (100%) rename packages/server/{bin => src}/misc/openapi/generate.ts (99%) rename packages/server/{bin => src}/misc/openapi/transformer.ts (99%) rename packages/server/{bin => src}/misc/openapi/types.ts (100%) rename packages/server/{bin => src}/misc/openapi/validateMiddleware.ts.handlebars (100%) rename packages/server/{bin => src}/misc/openapi/webclient.ts.handlebars (100%) rename packages/server/{bin => src}/moduleDeclaration/cloudscraper.d.ts (100%) rename packages/server/{bin => src}/moduleDeclaration/feedparser-promised.d.ts (100%) rename packages/server/{bin => src}/moduleDeclaration/stringify-stream.d.ts (100%) rename packages/server/{bin => src}/startServer.ts (100%) rename packages/server/{bin => src}/timer.ts (100%) rename packages/server/{bin => src}/tunnel.ts (100%) rename packages/server/{bin => src}/types.ts (100%) rename packages/server/{bin => src}/update.js (100%) rename packages/server/{bin => src}/updgradeToHttps.ts (100%) diff --git a/.gitignore b/.gitignore index af921079..f792231f 100644 --- a/.gitignore +++ b/.gitignore @@ -87,14 +87,14 @@ typings/ ### Example user template # IntelliJ project filessrc/ -packages/server/bin/externals/direct/webnovelTocResponse 04.19.json -packages/server/bin/externals/direct/wwSearchResponse.json +packages/server/src/externals/direct/webnovelTocResponse 04.19.json +packages/server/src/externals/direct/wwSearchResponse.json packages/**/*.vue.js packages/**/*.vue.js.map *.bat *.gz *.json -packages/server/bin/ignore/ +packages/server/src/ignore/ dist/ # vscode project files @@ -113,9 +113,9 @@ checkReleases.* *.html *.xml -packages/server/bin/misc/fixJobs.ts -packages/server/bin/validateMiddleware.ts -packages/server/bin/database/schema.ts -packages/server/bin/misc/openapi/validateMiddleware.ts -packages/server/bin/misc/openapi/webclient.ts +packages/server/src/misc/fixJobs.ts +packages/server/src/validateMiddleware.ts +packages/server/src/database/schema.ts +packages/server/src/misc/openapi/validateMiddleware.ts +packages/server/src/misc/openapi/webclient.ts tsconfig.tsbuildinfo \ No newline at end of file diff --git a/jest.config.ts b/jest.config.ts index 81a2ce3a..336e36ed 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -119,7 +119,7 @@ export default { // A list of paths to directories that Jest should use to search for files in roots: [ "packages/core/src/test/", - //"packages/server/bin/test/", // TODO: requires test files + //"packages/server/src/test/", // TODO: requires test files "packages/scraper/src/test/", // "packages/website/src/test/", // TODO: requires test files ], diff --git a/package.json b/package.json index 97a9e2d8..9e92a5fa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "npm run lint:server && npm run lint:website", "commit": "npx git-cz", "generate:api": "node dist/server/misc/openapi/generate.js", - "lint:server": "eslint -c packages/server/.eslintrc.js packages/server/bin/", + "lint:server": "eslint -c packages/server/.eslintrc.js packages/server/src/", "lint:website": "eslint packages/website/", "lintfix": "eslint --fix 'packages/**/*.{js,ts,vue}'", "migrate": "node dist/server/misc/migrate.js", diff --git a/packages/server/package.json b/packages/server/package.json index 36681502..c8990229 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "build": "tsc -p ./", - "lint": "eslint -c ./.eslintrc.js bin/", + "lint": "eslint -c ./.eslintrc.js src/", "start": "node ./dist/startServer.js", "test": " LOG_LEVEL=error jest", "migrate": "node ../dist/misc/migrate.js", diff --git a/packages/server/bin/api/apiTools.ts b/packages/server/src/api/apiTools.ts similarity index 100% rename from packages/server/bin/api/apiTools.ts rename to packages/server/src/api/apiTools.ts diff --git a/packages/server/bin/api/crawler.ts b/packages/server/src/api/crawler.ts similarity index 100% rename from packages/server/bin/api/crawler.ts rename to packages/server/src/api/crawler.ts diff --git a/packages/server/bin/api/episode.ts b/packages/server/src/api/episode.ts similarity index 100% rename from packages/server/bin/api/episode.ts rename to packages/server/src/api/episode.ts diff --git a/packages/server/bin/api/externalUser.ts b/packages/server/src/api/externalUser.ts similarity index 100% rename from packages/server/bin/api/externalUser.ts rename to packages/server/src/api/externalUser.ts diff --git a/packages/server/bin/api/hooks.ts b/packages/server/src/api/hooks.ts similarity index 100% rename from packages/server/bin/api/hooks.ts rename to packages/server/src/api/hooks.ts diff --git a/packages/server/bin/api/index.ts b/packages/server/src/api/index.ts similarity index 100% rename from packages/server/bin/api/index.ts rename to packages/server/src/api/index.ts diff --git a/packages/server/bin/api/jobs.ts b/packages/server/src/api/jobs.ts similarity index 100% rename from packages/server/bin/api/jobs.ts rename to packages/server/src/api/jobs.ts diff --git a/packages/server/bin/api/list.ts b/packages/server/src/api/list.ts similarity index 100% rename from packages/server/bin/api/list.ts rename to packages/server/src/api/list.ts diff --git a/packages/server/bin/api/medium.ts b/packages/server/src/api/medium.ts similarity index 100% rename from packages/server/bin/api/medium.ts rename to packages/server/src/api/medium.ts diff --git a/packages/server/bin/api/news.ts b/packages/server/src/api/news.ts similarity index 100% rename from packages/server/bin/api/news.ts rename to packages/server/src/api/news.ts diff --git a/packages/server/bin/api/part.ts b/packages/server/src/api/part.ts similarity index 100% rename from packages/server/bin/api/part.ts rename to packages/server/src/api/part.ts diff --git a/packages/server/bin/api/process.ts b/packages/server/src/api/process.ts similarity index 100% rename from packages/server/bin/api/process.ts rename to packages/server/src/api/process.ts diff --git a/packages/server/bin/api/user.ts b/packages/server/src/api/user.ts similarity index 100% rename from packages/server/bin/api/user.ts rename to packages/server/src/api/user.ts diff --git a/packages/server/bin/app.ts b/packages/server/src/app.ts similarity index 100% rename from packages/server/bin/app.ts rename to packages/server/src/app.ts diff --git a/packages/server/bin/deviceVerificator.ts b/packages/server/src/deviceVerificator.ts similarity index 100% rename from packages/server/bin/deviceVerificator.ts rename to packages/server/src/deviceVerificator.ts diff --git a/packages/server/bin/errors.ts b/packages/server/src/errors.ts similarity index 100% rename from packages/server/bin/errors.ts rename to packages/server/src/errors.ts diff --git a/packages/server/bin/misc/executeFailures.ts b/packages/server/src/misc/executeFailures.ts similarity index 100% rename from packages/server/bin/misc/executeFailures.ts rename to packages/server/src/misc/executeFailures.ts diff --git a/packages/server/bin/misc/fillSystemEvents.ts b/packages/server/src/misc/fillSystemEvents.ts similarity index 100% rename from packages/server/bin/misc/fillSystemEvents.ts rename to packages/server/src/misc/fillSystemEvents.ts diff --git a/packages/server/bin/misc/migrate.ts b/packages/server/src/misc/migrate.ts similarity index 100% rename from packages/server/bin/misc/migrate.ts rename to packages/server/src/misc/migrate.ts diff --git a/packages/server/bin/misc/openapi/exportOpenApi.ts b/packages/server/src/misc/openapi/exportOpenApi.ts similarity index 100% rename from packages/server/bin/misc/openapi/exportOpenApi.ts rename to packages/server/src/misc/openapi/exportOpenApi.ts diff --git a/packages/server/bin/misc/openapi/generate.ts b/packages/server/src/misc/openapi/generate.ts similarity index 99% rename from packages/server/bin/misc/openapi/generate.ts rename to packages/server/src/misc/openapi/generate.ts index fea1ff6c..40f1d727 100644 --- a/packages/server/bin/misc/openapi/generate.ts +++ b/packages/server/src/misc/openapi/generate.ts @@ -177,7 +177,7 @@ function main() { // @ts-expect-error GenerateOpenApi(argv.middleware); } else { - GenerateOpenApi("./packages/server/bin/api.ts"); + GenerateOpenApi("./packages/server/src/api.ts"); } } diff --git a/packages/server/bin/misc/openapi/transformer.ts b/packages/server/src/misc/openapi/transformer.ts similarity index 99% rename from packages/server/bin/misc/openapi/transformer.ts rename to packages/server/src/misc/openapi/transformer.ts index 6e58aaa9..ad55bf86 100644 --- a/packages/server/bin/misc/openapi/transformer.ts +++ b/packages/server/src/misc/openapi/transformer.ts @@ -58,7 +58,7 @@ export function resolveReference(root: OpenApiObject, reference: ReferenceObject export async function generateWebClient(data: Readonly, target?: string): Promise { const rootDir = findAbsoluteProjectDirPath(__dirname); - const templateDir = join(rootDir, "src", "server", "bin", "misc", "openapi"); + const templateDir = join(rootDir, "src", "server", "src", "misc", "openapi"); if (!target) { target = join(templateDir, "webclient.ts"); @@ -372,8 +372,8 @@ class TSRequestValidatorGenerator extends TSTemplateGenerator { public constructor(data: Readonly) { super( data, - "./packages/server/bin/misc/openapi/validateMiddleware.ts.handlebars", - "./packages/server/bin/misc/openapi/validateMiddleware.ts", + "./packages/server/src/misc/openapi/validateMiddleware.ts.handlebars", + "./packages/server/src/misc/openapi/validateMiddleware.ts", ); this.addHandler(); } diff --git a/packages/server/bin/misc/openapi/types.ts b/packages/server/src/misc/openapi/types.ts similarity index 100% rename from packages/server/bin/misc/openapi/types.ts rename to packages/server/src/misc/openapi/types.ts diff --git a/packages/server/bin/misc/openapi/validateMiddleware.ts.handlebars b/packages/server/src/misc/openapi/validateMiddleware.ts.handlebars similarity index 100% rename from packages/server/bin/misc/openapi/validateMiddleware.ts.handlebars rename to packages/server/src/misc/openapi/validateMiddleware.ts.handlebars diff --git a/packages/server/bin/misc/openapi/webclient.ts.handlebars b/packages/server/src/misc/openapi/webclient.ts.handlebars similarity index 100% rename from packages/server/bin/misc/openapi/webclient.ts.handlebars rename to packages/server/src/misc/openapi/webclient.ts.handlebars diff --git a/packages/server/bin/moduleDeclaration/cloudscraper.d.ts b/packages/server/src/moduleDeclaration/cloudscraper.d.ts similarity index 100% rename from packages/server/bin/moduleDeclaration/cloudscraper.d.ts rename to packages/server/src/moduleDeclaration/cloudscraper.d.ts diff --git a/packages/server/bin/moduleDeclaration/feedparser-promised.d.ts b/packages/server/src/moduleDeclaration/feedparser-promised.d.ts similarity index 100% rename from packages/server/bin/moduleDeclaration/feedparser-promised.d.ts rename to packages/server/src/moduleDeclaration/feedparser-promised.d.ts diff --git a/packages/server/bin/moduleDeclaration/stringify-stream.d.ts b/packages/server/src/moduleDeclaration/stringify-stream.d.ts similarity index 100% rename from packages/server/bin/moduleDeclaration/stringify-stream.d.ts rename to packages/server/src/moduleDeclaration/stringify-stream.d.ts diff --git a/packages/server/bin/startServer.ts b/packages/server/src/startServer.ts similarity index 100% rename from packages/server/bin/startServer.ts rename to packages/server/src/startServer.ts diff --git a/packages/server/bin/timer.ts b/packages/server/src/timer.ts similarity index 100% rename from packages/server/bin/timer.ts rename to packages/server/src/timer.ts diff --git a/packages/server/bin/tunnel.ts b/packages/server/src/tunnel.ts similarity index 100% rename from packages/server/bin/tunnel.ts rename to packages/server/src/tunnel.ts diff --git a/packages/server/bin/types.ts b/packages/server/src/types.ts similarity index 100% rename from packages/server/bin/types.ts rename to packages/server/src/types.ts diff --git a/packages/server/bin/update.js b/packages/server/src/update.js similarity index 100% rename from packages/server/bin/update.js rename to packages/server/src/update.js diff --git a/packages/server/bin/updgradeToHttps.ts b/packages/server/src/updgradeToHttps.ts similarity index 100% rename from packages/server/bin/updgradeToHttps.ts rename to packages/server/src/updgradeToHttps.ts diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 51a562ea..1acb57a7 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -18,7 +18,7 @@ "outDir": "./dist/", "paths": { "@/*": [ - "./bin/*" + "./src/*" ] }, "types": [ @@ -29,8 +29,8 @@ "node_modules" ], "include": [ - "./bin/**/*.ts", - "./bin/**/*.js" + "./src/**/*.ts", + "./src/**/*.js" // "tests/**/*.ts", // "tests/**/*.tsx" ] diff --git a/packages/website/src/Httpclient.ts b/packages/website/src/Httpclient.ts index aed34f2b..09859254 100644 --- a/packages/website/src/Httpclient.ts +++ b/packages/website/src/Httpclient.ts @@ -27,7 +27,7 @@ import { JobHistoryItem, } from "./siteTypes"; import { AddPart, AppEvent, AppEventFilter, EmptyPromise, JobStatSummary } from "enterprise-core/src/types"; -import { HookTest } from "enterprise-server/bin/types"; +import { HookTest } from "enterprise-server/src/types"; import { CustomHook } from "enterprise-core/dist/types"; /**