Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.0-alpha.107 #1112

Merged
merged 24 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
46cb3d4
chore: upgrade storybook@^7.6.8
ascariandrea Jan 12, 2024
198b4cb
chore: upgrade vitest@^1.2.0
ascariandrea Jan 12, 2024
4a70580
chore: upgrade react-admin@@^4.16.6
ascariandrea Jan 12, 2024
e1b13cc
chore: upgrade prettier@^3.2.1
ascariandrea Jan 13, 2024
0b23be9
fix(ui): no margin for media masonry list
ascariandrea Jan 13, 2024
fd1a88f
fix(api): proper mocks ordering
ascariandrea Jan 14, 2024
5a573c7
feat(backend): convert to esm module (#1115)
ascariandrea Jan 14, 2024
4b7e043
fix(backend): jwt provider error handling
ascariandrea Jan 15, 2024
e96b9de
feat(shared): convert module to ESM (#1117)
ascariandrea Jan 15, 2024
3f6a103
feat(test): convert module to ESM (#1118)
ascariandrea Jan 15, 2024
8bc26da
feat(ui): convert module to ESM (#1116)
ascariandrea Jan 16, 2024
f35f846
chore: upgrade @mui@^5.15.5
ascariandrea Jan 17, 2024
426a869
feat: upgrade react-query to @tanstack/react-query@^5 (#1119)
ascariandrea Jan 17, 2024
990fe30
chore: parallelize actions for web, admin-web and api workflows (#1120)
ascariandrea Jan 17, 2024
582326d
chore: upgrade @storybook@^7.6.9
ascariandrea Jan 17, 2024
a1e1fda
chore: increate dependabot pr requests limit to 10
ascariandrea Jan 17, 2024
fe385e5
chore: upgrade @types
ascariandrea Jan 17, 2024
8e0305a
chore: upgrade prettier@^3.2.4 and @typescript-eslint@^6.19.0
ascariandrea Jan 17, 2024
da57086
chore: upgrade vitest@^1.2.1 and vite-tsconfig-paths@^4.3.1
ascariandrea Jan 18, 2024
3f13082
chore: upgrade terser@^5.27.0
ascariandrea Jan 18, 2024
27084c3
chore: upgrade sass@^1.70.0
ascariandrea Jan 18, 2024
8faa25e
chore: upgrade @storybook@^7.6.10
ascariandrea Jan 18, 2024
d9b8b94
chore: upgrade supertest@^6.3.4
ascariandrea Jan 19, 2024
af40797
chore: upgrade react-admin@^4.16.6
ascariandrea Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 0
open-pull-requests-limit: 10
target-branch: "daily"
versioning-strategy: increase
allow:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/admin-web-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

build:
runs-on: ubuntu-latest
needs: [install, build-packages, lint]
needs: [install, build-packages]

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/api-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: yarn api lint

build:
needs: [install, build-packages, lint]
needs: [install, build-packages]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -71,7 +71,7 @@ jobs:

test:
runs-on: ubuntu-latest
needs: [install, build-packages, lint, build]
needs: [install, build-packages]
services:
pg-db-test:
image: postgres:14
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

docker_build:
if: ${{ github.head_ref == 'release/alpha' }}
needs: [install, build-packages, lint]
needs: [install, build-packages, lint, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/web-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- uses: actions/cache@v3
with:
path: |
packages/**/lib
services/**/build
key: web-build

Expand Down
4 changes: 1 addition & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
. "$(dirname "$0")/_/husky.sh"

docker compose up -d --remove-orphans db-test
yarn lint && yarn build && yarn vitest run

. "./scripts/healthcheck.sh"
yarn lint && yarn build && yarn vitest run && . "./scripts/healthcheck.sh"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ services:
volumes:
- ./.eslintrc.js:/app/.eslintrc.js
- ./tsconfig.json:/app/tsconfig.json
- ./packages/@liexp:/app/packages/@liexp:cached
- ./packages/@liexp/core:/app/packages/@liexp/core:cached
- ./packages/@liexp/shared:/app/packages/@liexp/shared:cached
- ./packages/@liexp/ui:/app/packages/@liexp/ui:cached
- ./services/web:/app/services/web:cached
working_dir: /app/services/web
command: yarn watch:server
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@types/prettier": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-v8": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@vitest/coverage-v8": "^1.2.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.0",
Expand All @@ -63,10 +63,10 @@
"is-ci": "^3.0.1",
"lint-staged": "^14.0.1",
"pm2": "^5.3.0",
"prettier": "^3.1.1",
"terser": "^5.26.0",
"prettier": "^3.2.4",
"terser": "^5.27.0",
"typescript": "^5.3.3",
"vitest": "^1.1.3",
"vitest": "^1.2.1",
"webpack": "^5.89.0"
},
"packageManager": "[email protected]",
Expand Down
9 changes: 9 additions & 0 deletions packages/@liexp/backend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
extends: ["../../../.eslintrc.js"],
parserOptions: {
sourceType: "module",
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
settings: {},
};
9 changes: 0 additions & 9 deletions packages/@liexp/backend/.eslintrc.js

This file was deleted.

12 changes: 6 additions & 6 deletions packages/@liexp/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.1.0",
"author": "Andrea Ascari <[email protected]>",
"license": "MIT",
"main": "lib/index.js",
"files": [
"lib",
"assets"
],
"type": "module",
"module": "lib/index.js",
"exports": {
"./lib/*": "./lib/*"
},
"private": true,
"scripts": {
"clean": "rm -rf lib",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@types/uuid": "^9.0.7",
"date-fns": "^2.30.0",
"exifreader": "^4.20.0",
"prettier": "^3.1.1",
"prettier": "^3.2.4",
"puppeteer-core": "^21.7.0",
"puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2",
Expand Down
28 changes: 14 additions & 14 deletions packages/@liexp/backend/src/context/server.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type * as logger from "@liexp/core/lib/logger";
import { type HTTPProvider } from "@liexp/shared/lib/providers/http/http.provider";
import { type URLMetadataClient } from "../providers/URLMetadata.provider";
import { type FFMPEGProvider } from "../providers/ffmpeg.provider";
import { type FSClient } from "../providers/fs/fs.provider";
import { type GeocodeProvider } from "../providers/geocode/geocode.provider";
import { type IGProvider } from "../providers/ig/ig.provider";
import { type ImgProcClient } from "../providers/imgproc/imgproc.provider";
import { type JWTProvider } from "../providers/jwt/jwt.provider";
import { type DatabaseClient } from "../providers/orm";
import { type PuppeteerProvider } from "../providers/puppeteer.provider";
import { type SpaceProvider } from "../providers/space";
import { type TGBotProvider } from "../providers/tg/tg.provider";
import { type WikipediaProvider } from "../providers/wikipedia/wikipedia.provider";
import type * as logger from "@liexp/core/lib/logger/index.js";
import { type HTTPProvider } from "@liexp/shared/lib/providers/http/http.provider.js";
import { type URLMetadataClient } from "../providers/URLMetadata.provider.js";
import { type FFMPEGProvider } from "../providers/ffmpeg.provider.js";
import { type FSClient } from "../providers/fs/fs.provider.js";
import { type GeocodeProvider } from "../providers/geocode/geocode.provider.js";
import { type IGProvider } from "../providers/ig/ig.provider.js";
import { type ImgProcClient } from "../providers/imgproc/imgproc.provider.js";
import { type JWTProvider } from "../providers/jwt/jwt.provider.js";
import { type DatabaseClient } from "../providers/orm/index.js";
import { type PuppeteerProvider } from "../providers/puppeteer.provider.js";
import { type SpaceProvider } from "../providers/space/index.js";
import { type TGBotProvider } from "../providers/tg/tg.provider.js";
import { type WikipediaProvider } from "../providers/wikipedia/wikipedia.provider.js";

export interface ServerContext {
db: DatabaseClient;
Expand Down
1 change: 1 addition & 0 deletions packages/@liexp/backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as Providers from "./providers/index.js";
4 changes: 2 additions & 2 deletions packages/@liexp/backend/src/providers/URLMetadata.provider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type AxiosInstance } from "axios";
import domino from "domino";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import { type Metadata, metadataRuleSets } from "page-metadata-parser";

metadataRuleSets.date = {
Expand Down
4 changes: 2 additions & 2 deletions packages/@liexp/backend/src/providers/ffmpeg.provider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Stream } from "stream";
import { GetLogger } from "@liexp/core/lib/logger";
import { GetLogger } from "@liexp/core/lib/logger/index.js";
import ffmpeg from "fluent-ffmpeg";
import * as TE from "fp-ts/TaskEither";
import * as TE from "fp-ts/lib/TaskEither.js";

const ffmpegLogger = GetLogger("ffmpeg");

Expand Down
10 changes: 5 additions & 5 deletions packages/@liexp/backend/src/providers/fs/fs.provider.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import fs from "fs";
import path from "path";
import { fp } from "@liexp/core/lib/fp";
import * as logger from "@liexp/core/lib/logger";
import { fp } from "@liexp/core/lib/fp/index.js";
import * as logger from "@liexp/core/lib/logger/index.js";
import {
distanceFromNow,
differenceInHours,
} from "@liexp/shared/lib/utils/date.utils";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
} from "@liexp/shared/lib/utils/date.utils.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import { IOError } from "ts-io-error";

const fsLogger = logger.GetLogger("fs");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type HTTPProvider } from "@liexp/shared/lib/providers/http/http.provider";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
import { type HTTPProvider } from "@liexp/shared/lib/providers/http/http.provider.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import { IOError } from "ts-io-error";

interface GeocodeSearch {
Expand Down
4 changes: 2 additions & 2 deletions packages/@liexp/backend/src/providers/ig/ig.provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Logger } from "@liexp/core/lib/logger";
import * as TE from "fp-ts/TaskEither";
import { type Logger } from "@liexp/core/lib/logger/index.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import {
IgApiClient,
IgLoginTwoFactorRequiredError,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fp, pipe } from "@liexp/core/lib/fp";
import type * as logger from "@liexp/core/lib/logger";
import { fp, pipe } from "@liexp/core/lib/fp/index.js";
import type * as logger from "@liexp/core/lib/logger/index.js";
import type ExifReader from "exifreader";
import type { load } from "exifreader";
import * as TE from "fp-ts/TaskEither";
import * as TE from "fp-ts/lib/TaskEither.js";
import type sharp from "sharp";
import { IOError } from "ts-io-error";

Expand Down Expand Up @@ -63,7 +63,10 @@ export const MakeImgProcClient = ({
run: (f) => TE.tryCatch(async () => await f(client), toError(logger)),
readExif: (file, opts) => {
return pipe(
fp.TE.tryCatch(() => exifR.load(file, {...opts, async: true }), toError(logger)),
fp.TE.tryCatch(
() => exifR.load(file, { ...opts, async: true }),
toError(logger),
),
);
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/@liexp/backend/src/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as JWTProvider from "./jwt/jwt.provider";
import * as TGProvider from "./tg/tg.provider";
import * as JWTProvider from "./jwt/jwt.provider.js";
import * as TGProvider from "./tg/tg.provider.js";

const providers = {
JWTProvider,
Expand Down
38 changes: 20 additions & 18 deletions packages/@liexp/backend/src/providers/jwt/jwt.provider.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type * as logger from "@liexp/core/lib/logger";
import { User } from "@liexp/shared/lib/io/http/User";
import { fromValidationErrors } from "@liexp/shared/lib/providers/http/http.provider";
import * as IO from "fp-ts/IO";
import * as IOE from "fp-ts/IOEither";
import { pipe } from "fp-ts/function";
import * as jwt from "jsonwebtoken";
import type * as logger from "@liexp/core/lib/logger/index.js";
import { User } from "@liexp/shared/lib/io/http/User.js";
import { fromValidationErrors } from "@liexp/shared/lib/providers/http/http.provider.js";
import * as IO from "fp-ts/lib/IO.js";
import * as IOE from "fp-ts/lib/IOEither.js";
import { pipe } from "fp-ts/lib/function.js";
import jwt from "jsonwebtoken";
import { IOError } from "ts-io-error";

export class JWTError extends IOError {}
Expand All @@ -14,17 +14,19 @@ export const toError =
(override?: Partial<JWTError>) =>
(e: unknown): JWTError => {
l.error.log("An error occurred %O", e);
if (e instanceof jwt.JsonWebTokenError) {
return {
status: override?.status ?? 401,
name: "JWTClient",
message: e.message,
details: {
kind: "ClientError",
status: "401",
meta: [e.stack],
},
};
if (e) {
if (e instanceof jwt.JsonWebTokenError) {
return {
status: override?.status ?? 401,
name: "JWTClient",
message: e.message,
details: {
kind: "ClientError",
status: "401",
meta: [e.stack],
},
};
}
}

return {
Expand Down
6 changes: 3 additions & 3 deletions packages/@liexp/backend/src/providers/ner/ner.provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Logger } from "@liexp/core/lib/logger";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
import { type Logger } from "@liexp/core/lib/logger/index.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import { type IOError } from "ts-io-error";
import model from "wink-eng-lite-web-model";
import winkNLP, { type CustomEntityExample, type Detail } from "wink-nlp";
Expand Down
14 changes: 7 additions & 7 deletions packages/@liexp/backend/src/providers/orm/database.provider.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// import { EOL } from "os";
import { escapePostgresIdentifier } from "@databases/escape-identifier";
import { type FormatConfig, type SQLQuery } from "@databases/sql";
import * as logger from "@liexp/core/lib/logger";
import * as O from "fp-ts/Option";
import type * as Reader from "fp-ts/Reader";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
import * as logger from "@liexp/core/lib/logger/index.js";
import * as O from "fp-ts/lib/Option.js";
import type * as Reader from "fp-ts/lib/Reader.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import { IOError } from "ts-io-error";
import {
type DataSource,
Expand All @@ -20,8 +20,8 @@ import {
type SaveOptions,
type UpdateResult,
} from "typeorm";
import { type PostgresConnectionOptions } from "typeorm/driver/postgres/PostgresConnectionOptions";
import { type QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
import { type PostgresConnectionOptions } from "typeorm/driver/postgres/PostgresConnectionOptions.js";
import { type QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity.js";

export class DBError extends IOError {}

Expand Down
6 changes: 2 additions & 4 deletions packages/@liexp/backend/src/providers/orm/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import * as Utils from "./utils";
export * from "./database.provider";

export { Utils };
export * as Utils from "./utils.js";
export * from "./database.provider.js";
10 changes: 5 additions & 5 deletions packages/@liexp/backend/src/providers/puppeteer.provider.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable import/default */
import * as fs from "fs";
import * as logger from "@liexp/core/lib/logger";
import type * as error from "@liexp/shared/lib/io/http/Error";
import * as E from "fp-ts/Either";
import * as TE from "fp-ts/TaskEither";
import { pipe } from "fp-ts/function";
import * as logger from "@liexp/core/lib/logger/index.js";
import type * as error from "@liexp/shared/lib/io/http/Error/index.js";
import * as E from "fp-ts/lib/Either.js";
import * as TE from "fp-ts/lib/TaskEither.js";
import { pipe } from "fp-ts/lib/function.js";
import * as puppeteer from "puppeteer-core";
import { addExtra, type VanillaPuppeteer } from "puppeteer-extra";
import puppeteerStealth from "puppeteer-extra-plugin-stealth";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as logger from "@liexp/core/lib/logger";
import * as E from "fp-ts/Either";
import * as logger from "@liexp/core/lib/logger/index.js";
import * as E from "fp-ts/lib/Either.js";
// eslint-disable-next-line no-restricted-imports
import { GetLocalSpaceProvider } from "../local-space.provider";
import { GetLocalSpaceProvider } from "../local-space.provider.js";
vi.mock("axios");

const baseURL = "http://localhost:4010";
Expand Down
4 changes: 2 additions & 2 deletions packages/@liexp/backend/src/providers/space/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * as S3Provider from "./s3.provider";
export * as SpaceProvider from "./space.provider";
export * as S3Provider from "./s3.provider.js";
export * as SpaceProvider from "./space.provider.js";
Loading