diff --git a/api-prox/.gitignore b/api-prox/.gitignore index 0bc119a..488ed52 100644 --- a/api-prox/.gitignore +++ b/api-prox/.gitignore @@ -1,5 +1,6 @@ # prod dist/ +*.js # dev .yarn/ diff --git a/api-prox/LICENSE b/api-prox/LICENSE new file mode 100644 index 0000000..8a14d97 --- /dev/null +++ b/api-prox/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Kentai Radiquum + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/api-prox/deno.json b/api-prox/deno.json index ec4576c..1dd3db4 100644 --- a/api-prox/deno.json +++ b/api-prox/deno.json @@ -4,10 +4,15 @@ }, "tasks": { "deno-run": "deno run --sloppy-imports --allow-net deno.ts", - "deno-dev": "deno run --sloppy-imports --unstable-hmr --allow-net deno.ts" + "deno-dev": "deno run --sloppy-imports --unstable-hmr --allow-net deno.ts", + "deno-deploy": "./node_modules/.bin/tsc && deployctl deploy" }, "compilerOptions": { "jsx": "precompile", "jsxImportSource": "hono/jsx" + }, + "deploy": { + "include": ["dist", "deno.json"], + "entrypoint": "dist/deno.js" } } \ No newline at end of file diff --git a/api-prox/deno.ts b/api-prox/deno.ts index 5c8ad12..107e7ac 100644 --- a/api-prox/deno.ts +++ b/api-prox/deno.ts @@ -1,3 +1,3 @@ -import app from "./src/index.ts"; +import app from "./src/index.js"; Deno.serve({ port: 7001 }, app.fetch); diff --git a/api-prox/src/hooks/enabledHooks.ts b/api-prox/src/hooks/enabledHooks.ts index f99b0d6..73ccea6 100644 --- a/api-prox/src/hooks/enabledHooks.ts +++ b/api-prox/src/hooks/enabledHooks.ts @@ -1,5 +1,5 @@ -import { Hook } from "."; -import thirdPartyReleaseRatingHook from "./show3rdPartyReleaseRating.js"; // Импортирует .ts как .js +import { Hook } from "./index.js"; +import thirdPartyReleaseRatingHook from "./show3rdPartyReleaseRating.js"; export const enabledHooks: Hook[] = [thirdPartyReleaseRatingHook]; export default enabledHooks; diff --git a/api-prox/src/hooks/index.ts b/api-prox/src/hooks/index.ts index c6bf2bc..b6951b7 100644 --- a/api-prox/src/hooks/index.ts +++ b/api-prox/src/hooks/index.ts @@ -1,4 +1,4 @@ -import { enabledHooks } from "./enabledHooks"; +import { enabledHooks } from "./enabledHooks.js"; export type Hook = { title: string; diff --git a/api-prox/src/hooks/show3rdPartyReleaseRating.ts b/api-prox/src/hooks/show3rdPartyReleaseRating.ts index 03719ba..1bcebf4 100644 --- a/api-prox/src/hooks/show3rdPartyReleaseRating.ts +++ b/api-prox/src/hooks/show3rdPartyReleaseRating.ts @@ -1,6 +1,6 @@ // хук добавляет рейтинг Shikimori и MAL в поле note релиза -import { InfoLogger } from "../utils/logger"; -import { tryCatch } from "../utils/tryCatch"; +import { InfoLogger } from "../utils/logger.js"; +import { tryCatch } from "../utils/tryCatch.js"; const title = "show3rdPartyReleaseRating.ts"; const description = "Добавление рейтингов от Shikimori и MAL на страницу релиза"; diff --git a/api-prox/tsconfig.json b/api-prox/tsconfig.json index 684391a..3715ee9 100644 --- a/api-prox/tsconfig.json +++ b/api-prox/tsconfig.json @@ -3,8 +3,6 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "noEmit": true, "esModuleInterop": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -16,6 +14,6 @@ "jsxImportSource": "hono/jsx", "outDir": "./dist" }, - "include": ["src/**/*.ts", "src/**/*.json"], + "include": ["src/**/*.ts", "deno.ts"], "exclude": ["node_modules"] }