Skip to content

Commit

Permalink
Merge pull request #187 from mbret/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
mbret authored Nov 12, 2024
2 parents 19c2c43 + c98b523 commit 29ea8cf
Show file tree
Hide file tree
Showing 27 changed files with 4,448 additions and 5,496 deletions.
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: [mbret]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
9,680 changes: 4,304 additions & 5,376 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"postinstall": "npx ts-node scripts/installSharp.ts --project scripts/tsconfig.json --platform darwin"
},
"devDependencies": {
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-replace": "^6.0.1",
"@types/crypto-js": "^4.1.1",
"@types/node": "^20",
"@types/react": "^18.0.28",
Expand All @@ -42,7 +42,6 @@
"lerna": "^8.1.4",
"prettier": "^3.3.2",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-node-externals": "^7.1.3",
"typescript": "^5.5.4",
"vercel": "^37.2.1",
"vite": "^5.0.0",
Expand All @@ -54,10 +53,10 @@
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"@aws-sdk/client-lambda": "^3.606.0",
"@aws-sdk/client-s3": "^3.637.0",
"@aws-sdk/client-sqs": "^3.637.0",
"@aws-sdk/client-ssm": "^3.637.0",
"@aws-sdk/client-lambda": "^3.689.0",
"@aws-sdk/client-s3": "^3.689.0",
"@aws-sdk/client-sqs": "^3.689.0",
"@aws-sdk/client-ssm": "^3.687.0",
"@emotion/cache": "^11.11.0",
"arg": "^5.0.2",
"npm-force-resolutions": "^0.0.10",
Expand Down
14 changes: 7 additions & 7 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
},
"dependencies": {
"node-unrar-js": "^2.0.2",
"@middy/core": "^5.4.6",
"@middy/http-cors": "^5.4.6",
"@middy/http-error-handler": "^5.4.6",
"@middy/http-header-normalizer": "^5.4.6",
"@middy/http-json-body-parser": "^5.4.6",
"@middy/http-response-serializer": "^5.4.6",
"@middy/validator": "^5.4.6",
"@middy/core": "^5.5.1",
"@middy/http-cors": "^5.5.1",
"@middy/http-error-handler": "^5.5.1",
"@middy/http-header-normalizer": "^5.5.1",
"@middy/http-json-body-parser": "^5.5.1",
"@middy/http-response-serializer": "^5.5.1",
"@middy/validator": "^5.5.1",
"@oboku/shared": "^0.8.0",
"@supabase/supabase-js": "^2.39.7",
"abort-controller": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"next": "^14.1.3",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^6.0.0",
"@mui/icons-material": "^6.1.6",
"@mui/lab": "^6.0.0-beta.8",
"@mui/material": "^6.0.0",
"@mui/material-nextjs": "^6.0.1",
Expand Down
15 changes: 6 additions & 9 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
"name": "@oboku/shared",
"version": "0.8.0",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/oboku-shared.umd.cjs",
"module": "./dist/oboku-shared.js",
"types": "./src/index.ts",
"main": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/oboku-shared.js",
"require": "./dist/oboku-shared.umd.cjs"
}
".": "./src/index.ts"
},
"license": "MIT",
"files": [
"/dist"
"/src"
],
"scripts": {
"start": "vite build --watch --mode development",
"build": "tsc && vite build",
"build": "tsc",
"test": "vitest run"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/shared/src/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ export const extractDirectivesFromName = (
direction: "rtl" | "ltr" | undefined
isbn?: string | undefined
series: boolean | undefined
year?: string
year?: string | undefined
ignoreMetadata?: string | undefined
isWebtoon: boolean
metadataTitle?: string
metadataTitle?: string | undefined
} => {
let isNotACollection = false
let tags: string[] = []
let isIgnored = false
let direction = undefined
let year = undefined
let isbn = undefined
let direction: "rtl" | "ltr" | undefined = undefined
let year: string | undefined = undefined
let isbn: string | undefined = undefined
let series: boolean | undefined = undefined
let ignoreMetadata: string | undefined = undefined
let metadataTitle: string | undefined = undefined
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ export * from "./utils/intersection"
export * from "./utils/groupBy"
export * from "./utils/mergeWith"
export * from "./collections"

console.log("ASDASDASDASD")
5 changes: 3 additions & 2 deletions packages/shared/src/utils/difference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type List<T> = ArrayLike<T>

export function difference<T>(
array: List<T> | null | undefined,
...values: Array<List<T>>
...values: Array<List<T> | undefined | null>
): T[] {
// If the first array is undefined or null, return an empty array
if (!array) {
Expand All @@ -13,11 +13,12 @@ export function difference<T>(
const valuesSet = values.flat()

// Filter the first array, keeping only the elements not in any of the subsequent arrays
const finalArray = []
const finalArray: T[] = []

for (let i = 0; i < array.length; i++) {
// @ts-ignore
if (!valuesSet.includes(array[i])) {
// @ts-ignore
finalArray.push(array[i])
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/utils/groupBy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "vitest"
import { it, expect } from "vitest"
import { groupBy } from "./groupBy" // Adjust the import path as needed

it("should group numbers by Math.floor", () => {
Expand Down Expand Up @@ -84,7 +84,7 @@ it("should handle arrays with mixed types correctly", () => {
})

it("should group using a complex iteratee function", () => {
const result = groupBy(["apple", "banana", "pear"], (x) => x[0])
const result = groupBy(["apple", "banana", "pear"], (x) => x[0] ?? ``)
expect(result).toEqual({
a: ["apple"],
b: ["banana"],
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/utils/groupBy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type ValueIteratee<T> = ((value: T) => string | number) | keyof T

interface Dictionary<T> {
[index: string]: T
}
Expand Down
4 changes: 4 additions & 0 deletions packages/shared/src/utils/mergeWith.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const customizer = (objValue: any, srcValue: any) => {
if (typeof objValue === "number" && typeof srcValue === "number") {
return objValue + srcValue // custom merge for numbers
}

return undefined
}

it("should merge simple objects from source to destination", () => {
Expand Down Expand Up @@ -77,6 +79,8 @@ it("should use customizer to merge dates", () => {
if (objValue instanceof Date && srcValue instanceof Date) {
return new Date(Math.max(objValue.getTime(), srcValue.getTime()))
}

return undefined
}

const obj1 = { date: new Date("2023-01-01") }
Expand Down
24 changes: 16 additions & 8 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"compilerOptions": {
"outDir": "dist",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"module": "ESNext",
"target": "ESNext",
"allowJs": true,
"skipLibCheck": true,
"moduleResolution": "node",
"noEmit": true,
"moduleResolution": "Bundler",
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"noUncheckedIndexedAccess": true
"downlevelIteration": true,
"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"noUncheckedIndexedAccess": true,
"useUnknownInCatchVariables": true
},
"include": ["src"]
}
33 changes: 1 addition & 32 deletions packages/shared/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
import { defineConfig } from "vite"
import dts from "vite-plugin-dts"
import { resolve } from "path"
import externals from "rollup-plugin-node-externals"

export default defineConfig(({ mode }) => ({
build: {
minify: false,
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, `src/index.ts`),
name: `oboku-shared`,
fileName: `oboku-shared`
},
emptyOutDir: mode !== "development",
sourcemap: true
},
plugins: [
{
enforce: "pre",
...externals({
peerDeps: true,
deps: true,
devDeps: true,
/**
* We are letting cryptojs being bundled here because it bugs when
* letting consumer package include it
*/
exclude: "cryptojs"
})
},
dts()
]
}))
export default defineConfig({})
36 changes: 18 additions & 18 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^6.0.1",
"@mui/icons-material": "^6.1.6",
"@mui/lab": "^6.0.0-beta.8",
"@mui/material": "^6.0.1",
"@mui/utils": "^6.0.1",
"@mui/styles": "^6.0.1",
"react-virtuoso": "^4.7.13",
"@oboku/shared": "0.8.0",
"@prose-reader/core": "1.110.0",
"@prose-reader/enhancer-gestures": "1.110.0",
"@prose-reader/shared": "1.110.0",
"@prose-reader/streamer": "1.110.0",
"@prose-reader/core": "^1.112.0",
"@prose-reader/enhancer-gestures": "^1.112.0",
"@prose-reader/shared": "^1.112.0",
"@prose-reader/streamer": "^1.112.0",
"@sentry/react": "^8.27.0",
"@tanstack/react-virtual": "^3.8.4",
"gesturx": "^1.8.2",
"buffer": "^6.0.3",
"crypto-js": "^4.2.0",
"date-fns": "^3.3.1",
"date-fns": "^4.1.0",
"dropbox": "^10.34.0",
"firebase": "^10.12.4",
"@fontsource/roboto": "^5.0.14",
Expand All @@ -43,18 +43,18 @@
"screenfull": "^6.0.2",
"uuid": "^10.0.0",
"web-vitals": "^4.2.3",
"workbox-background-sync": "^7.0.0",
"workbox-broadcast-update": "^7.0.0",
"workbox-cacheable-response": "^7.0.0",
"workbox-core": "^7.0.0",
"workbox-expiration": "^7.0.0",
"workbox-google-analytics": "^7.0.0",
"workbox-navigation-preload": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-range-requests": "^7.0.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0",
"workbox-streams": "^7.0.0",
"workbox-background-sync": "^7.3.0",
"workbox-broadcast-update": "^7.3.0",
"workbox-cacheable-response": "^7.3.0",
"workbox-core": "^7.3.0",
"workbox-expiration": "^7.3.0",
"workbox-google-analytics": "^7.3.0",
"workbox-navigation-preload": "^7.3.0",
"workbox-precaching": "^7.3.0",
"workbox-range-requests": "^7.3.0",
"workbox-routing": "^7.3.0",
"workbox-strategies": "^7.3.0",
"workbox-streams": "^7.3.0",
"xmldoc": "^1.2.0",
"yup": "^1.3.2",
"libarchive.js": "^2.0.2"
Expand Down
7 changes: 4 additions & 3 deletions packages/web/src/books/details/MetadataSourcePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ListItemText,
ListSubheader,
Stack,
Typography,
Typography
} from "@mui/material"
import {
Google,
Expand Down Expand Up @@ -50,8 +50,9 @@ export const MetadataSourcePane: FC<{ bookId: string }> = ({ bookId }) => {
const metadata = book?.metadata?.find((item) => item.type === type)

const numberOfProperties = metadata
? Object.keys(metadata).filter((key) => metadata[key] !== undefined)
.length
? Object.keys(metadata).filter(
(key) => metadata[key as keyof typeof metadata] !== undefined
).length
: 0

return (
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/collections/lists/CollectionListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export const CollectionListItem = memo(
width="100%"
direction="row"
alignItems="center"
{...(id !== COLLECTION_EMPTY_ID && {
onClick: (e) => {
onClick={(e) => {
if (id !== COLLECTION_EMPTY_ID) {
e.stopPropagation()
openActionDrawer()
}
})}
}}
>
<ListItemText
primary={title ?? `\u00a0`}
Expand Down
5 changes: 5 additions & 0 deletions packages/web/src/dataSources/reports/useSyncReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export const useSyncReports = () =>
added: 0,
updated: 0,
deleted: 0
},
datasource: {
added: 0,
updated: 0,
deleted: 0
}
}
)
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/http/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class HttpClient {
xhr.responseType = responseType

Object.keys(headers).forEach((key) => {
// @ts-expect-error
xhr.setRequestHeader(key, headers[key])
})

Expand Down
Loading

0 comments on commit 29ea8cf

Please sign in to comment.