Skip to content

Commit

Permalink
feat: migrated plugin back
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Nov 15, 2023
1 parent b41ff48 commit 6ed9a9b
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 121 deletions.
10 changes: 3 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": "tsc --noEmit"
},
"engines": {
"node": "16.x"
"node": "18.x"
},
"dependencies": {
"@middy/core": "^4.7.0",
Expand All @@ -24,7 +24,6 @@
"@middy/http-json-body-parser": "^4.7.0",
"@middy/http-response-serializer": "^4.7.0",
"@middy/validator": "^4.2.7",
"@oboku/plugin-back": "0.10.0",
"@oboku/shared": "^0.8.0",
"abort-controller": "^3.0.0",
"axios": "^1.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/serverless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const serverlessConfiguration: AWS = {
],
provider: {
name: "aws",
runtime: "nodejs16.x",
runtime: "nodejs18.x",
timeout: 30, // 30 seconds
apiGateway: {
minimumCompressionSize: 1024,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/dropbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@oboku/shared"
import { PromiseReturnType } from "../../types"
import { createThrottler } from "../helpers"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "@oboku/plugin-back"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "src/plugins/plugin-back"

const extractIdFromResourceId = (resourceId: string) =>
resourceId.replace(`dropbox-`, ``)
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/google/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { configure } from "./configure"
import { createThrottler } from "../helpers"
import path from "path"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "@oboku/plugin-back"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "src/plugins/plugin-back"

export { configure }

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/link/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DataSourcePlugin } from "@oboku/plugin-back"
import request from "request"
import { DataSourcePlugin } from "src/plugins/plugin-back"

export type UriLinkData = { uri?: string }

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/nhentai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { dataSourceHelpers } from "@oboku/shared"
import { load } from "cheerio"
import { BASE_URI } from "./constants"
import axios from "axios"
import { DataSourcePlugin } from "@oboku/plugin-back"
import { DataSourcePlugin } from "src/plugins/plugin-back"

export const plugin: DataSourcePlugin = {
type: `NHENTAI`,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { dataSource as dropboxDataSource } from "../dataSources/dropbox"
import { dataSource as urlDataSource } from "../dataSources/link"
import { plugin as nhentaiPlugin } from "../dataSources/nhentai"
import { plugin as imhentai } from "../../plugins/plugin-imhentai-back"
import { DataSourcePlugin } from "@oboku/plugin-back"
import { DataSourcePlugin } from "src/plugins/plugin-back"

export const plugins: DataSourcePlugin[] = [
googleDataSource,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/libs/dataSources/sync.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BookDocType, GoogleDriveDataSourceData } from "@oboku/shared"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "@oboku/plugin-back"
import { createHelpers } from "./helpers"
import { difference, uniq } from "ramda"
import { Logger } from "@libs/logger"
import { DataSourcePlugin, SynchronizeAbleDataSource } from "src/plugins/plugin-back"

const logger = Logger.namespace("sync")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { expect, it } from "vitest"

it(`should test`, () => {
expect(true).toBe(true)
})
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
PLUGIN_IMHENTAI_TYPE
} from "@oboku/shared"
import { plugin } from "./index"
import { expect, it } from "vitest"

it(`should retrieve metadata`, async () => {
const link: LinkDocType = {
Expand Down
10 changes: 3 additions & 7 deletions packages/api/src/plugins/plugin-imhentai-back/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import {
DataSourcePlugin,
dataSourceHelpers,
cheerio,
fetch
} from "@oboku/plugin-back"
import {
PLUGIN_IMHENTAI_UNIQUE_RESOURCE_IDENTIFIER,
PLUGIN_IMHENTAI_BASE_URI,
PLUGIN_IMHENTAI_TYPE
PLUGIN_IMHENTAI_TYPE,
dataSourceHelpers
} from "@oboku/shared"
import { DataSourcePlugin, cheerio } from "../plugin-back"

export const plugin: DataSourcePlugin = {
type: PLUGIN_IMHENTAI_TYPE,
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-back/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/plugin-back/babel.config.js

This file was deleted.

34 changes: 0 additions & 34 deletions packages/plugin-back/package.json

This file was deleted.

24 changes: 0 additions & 24 deletions packages/plugin-back/tsconfig.json

This file was deleted.

33 changes: 0 additions & 33 deletions packages/plugin-back/vite.config.js

This file was deleted.

1 comment on commit 6ed9a9b

@vercel
Copy link

@vercel vercel bot commented on 6ed9a9b Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

oboku – ./packages/web

oboku.vercel.app
oboku-mbret.vercel.app
oboku-git-master-mbret.vercel.app
app.oboku.me

Please sign in to comment.