Merge branch 'master' into patch-1

This commit is contained in:
trulow
2024-09-27 16:34:49 -07:00
committed by GitHub
30 changed files with 12948 additions and 16806 deletions

0
.npmrc Normal file
View File

8
.vscode/tasks.json vendored
View File

@@ -16,7 +16,7 @@
{
"type": "shell",
"label": "Start shared",
"command": "yarn start",
"command": "pnpm start",
"options": {
"cwd": "${cwd}/shared",
"shell": {
@@ -29,7 +29,7 @@
{
"type": "shell",
"label": "Start backend",
"command": "yarn start:dev",
"command": "pnpm start:dev",
"options": {
"cwd": "${cwd}/backend",
"shell": {
@@ -42,7 +42,7 @@
{
"type": "shell",
"label": "Start frontend",
"command": "yarn watch",
"command": "pnpm watch",
"options": {
"cwd": "${cwd}/frontend",
"shell": {
@@ -55,7 +55,7 @@
{
"type": "shell",
"label": "Start postgres",
"command": "yarn devdb:start",
"command": "pnpm devdb:start",
"options": {
"cwd": "${cwd}",
"shell": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +0,0 @@
undecided:
- root-workspace-0b6124
- "@skala/web-backend"

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,4 +0,0 @@
undecided:
- picsur-backend
- picsur-frontend
- picsur-shared

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,4 +0,0 @@
undecided:
- root-workspace-0b6124
- picsur-backend
- picsur-frontend

View File

@@ -1,9 +0,0 @@
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: '@yarnpkg/plugin-version'
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
yarnPath: .yarn/releases/yarn-berry.cjs

View File

@@ -11,35 +11,36 @@
"prebuild": "rimraf dist",
"build": "nest build",
"start": "nest start --exec \"node --experimental-loader=extensionless\"",
"start:dev": "yarn clean && nest start --watch --exec \"node --experimental-loader=extensionless\"",
"start:dev": "pnpm clean && nest start --watch --exec \"node --experimental-loader=extensionless\"",
"start:debug": "nest start --debug --watch --exec \"node --experimental-loader=extensionless\"",
"start:prod": "node --experimental-loader=extensionless dist/main",
"typeorm": "typeorm-ts-node-esm",
"migrate": "PICSUR_PRODUCTION=\"true\" yarn typeorm migration:generate -d ./src/datasource.ts",
"migrate": "PICSUR_PRODUCTION=\"true\" pnpm typeorm migration:generate -d ./src/datasource.ts",
"format": "prettier --write \"src/**/*.ts\"",
"clean": "rimraf dist",
"purge": "rm -rf dist && rm -rf node_modules"
},
"dependencies": {
"@fastify/helmet": "^11.1.1",
"@fastify/multipart": "^8.0.0",
"@fastify/reply-from": "^9.4.0",
"@fastify/static": "^6.12.0",
"@nestjs/common": "^10.2.10",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.10",
"@fastify/multipart": "^8.3.0",
"@fastify/reply-from": "^9.8.0",
"@fastify/static": "^7.0.4",
"@nestjs/common": "^10.3.10",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.3.10",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.2",
"@nestjs/platform-fastify": "^10.2.10",
"@nestjs/schedule": "^4.0.0",
"@nestjs/serve-static": "^4.0.0",
"@nestjs/throttler": "^5.0.1",
"@nestjs/typeorm": "^10.0.1",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-fastify": "^10.3.10",
"@nestjs/schedule": "^4.1.0",
"@nestjs/serve-static": "^4.0.2",
"@nestjs/throttler": "^6.0.0",
"@nestjs/typeorm": "^10.0.2",
"bcrypt": "^5.1.1",
"bmp-img": "^1.2.1",
"bmp-img": "^1.3.0",
"cors": "^2.8.5",
"extensionless": "^1.7.3",
"file-type": "^18.7.0",
"extensionless": "^1.9.9",
"fastify": "^4.28.1",
"file-type": "^19.4.0",
"is-docker": "^3.0.0",
"ms": "2.1.3",
"node-fetch": "^3.3.2",
@@ -49,37 +50,37 @@
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"passport-strategy": "^1.0.0",
"pg": "^8.11.3",
"picsur-shared": "*",
"posix.js": "^0.1.1",
"qoi-img": "^2.1.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^5.0.5",
"pg": "^8.12.0",
"picsur-shared": "workspace:^",
"posix.js": "^0.1.2",
"qoi-img": "^2.2.0",
"reflect-metadata": "^0.2.2",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"sharp": "^0.32.6",
"sharp": "^0.33.4",
"stream-parser": "^0.3.1",
"thunks": "^4.9.6",
"typeorm": "0.3.17",
"zod": "^3.22.4"
"typeorm": "^0.3.20",
"zod": "^3.23.8"
},
"devDependencies": {
"@nestjs/cli": "^10.2.1",
"@nestjs/schematics": "^10.0.3",
"@nestjs/testing": "^10.2.10",
"@nestjs/cli": "^10.4.2",
"@nestjs/schematics": "^10.1.3",
"@nestjs/testing": "^10.3.10",
"@types/bcrypt": "^5.0.2",
"@types/cors": "^2.8.17",
"@types/ms": "^0.7.34",
"@types/multer": "^1.4.11",
"@types/node": "^20.10.0",
"@types/passport-jwt": "^3.0.13",
"@types/node": "^22.1.0",
"@types/passport-jwt": "^4.0.1",
"@types/passport-local": "^1.0.38",
"@types/passport-strategy": "^0.2.38",
"@types/sharp": "^0.32.0",
"@types/supertest": "^2.0.16",
"prettier": "^3.1.0",
"@types/supertest": "^6.0.2",
"prettier": "^3.3.3",
"source-map-support": "^0.5.21",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.2"
"typescript": "~5.5.4"
}
}

View File

@@ -14,8 +14,7 @@ export class HostConfigService {
constructor(private readonly configService: ConfigService) {
this.logger.log('Production: ' + this.isProduction());
this.logger.log('Verbose: ' + this.isVerbose());
this.logger.log('Host: ' + this.getHost());
this.logger.log('Port: ' + this.getPort());
this.logger.log('Location: http://' + this.getHost() + ":" + this.getPort());
if (this.isDemo()) {
this.logger.log('Running in demo mode');

View File

@@ -1,19 +1,19 @@
import { Injectable } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { FastifyRequest } from 'fastify';
import { Strategy } from 'passport-strategy';
import { EUser } from 'picsur-shared/dist/entities/user.entity';
import { EUserBackend2EUser } from '../../../models/transformers/user.transformer';
import { GuestService } from '../guest.service';
import { ReqType } from './reqtype';
class GuestPassportStrategy extends Strategy {
// Will be overridden by the nest implementation
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async validate(req: ReqType): Promise<any> {
async validate(req: FastifyRequest): Promise<any> {
return undefined;
}
override async authenticate(req: ReqType) {
override async authenticate(req: any) {
const user = await this.validate(req);
this.success(user);
}

View File

@@ -1,11 +0,0 @@
import { Request } from 'express';
import { ParamsDictionary } from 'express-serve-static-core';
import { ParsedQs } from 'qs';
export type ReqType = Request<
ParamsDictionary,
any,
any,
ParsedQs,
Record<string, any>
>;

View File

@@ -9,60 +9,63 @@
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0",
"build": "ng build",
"build": "pnpm clean && ng build",
"watch": "ng build --watch --configuration development",
"purge": "rm -rf dist && rm -rf node_modules && rm -rf .angular"
"clean": "rimraf dist && rimraf .angular",
"purge": "pnpm clean && rimraf node_modules"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^17.0.0",
"@angular-devkit/build-angular": "^17.0.3",
"@angular/animations": "^17.0.4",
"@angular/cdk": "^17.0.1",
"@angular/cli": "^17.0.3",
"@angular/common": "^17.0.4",
"@angular/compiler": "^17.0.4",
"@angular/compiler-cli": "^17.0.4",
"@angular/core": "^17.0.4",
"@angular/forms": "^17.0.4",
"@angular/material": "^17.0.1",
"@angular/platform-browser": "^17.0.4",
"@angular/platform-browser-dynamic": "^17.0.4",
"@angular/router": "^17.0.4",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@fontsource/roboto": "^5.0.8",
"@ng-web-apis/common": "^3.0.6",
"@ng-web-apis/resize-observer": "^3.0.6",
"@angular-builders/custom-webpack": "^18.0.0",
"@angular-devkit/build-angular": "^18.1.3",
"@angular/animations": "^18.1.3",
"@angular/cdk": "^18.1.3",
"@angular/cli": "^18.1.3",
"@angular/common": "^18.1.3",
"@angular/compiler": "^18.1.3",
"@angular/compiler-cli": "^18.1.3",
"@angular/core": "^18.1.3",
"@angular/forms": "^18.1.3",
"@angular/material": "^18.1.3",
"@angular/platform-browser": "^18.1.3",
"@angular/platform-browser-dynamic": "^18.1.3",
"@angular/router": "^18.1.3",
"@babel/cli": "^7.24.8",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@fontsource/roboto": "^5.0.14",
"@ng-web-apis/common": "^4.2.1",
"@ng-web-apis/resize-observer": "^4.2.1",
"@ngui/common": "^1.0.0",
"@popperjs/core": "^2.11.8",
"@types/ackee-tracker": "^5.0.4",
"@types/node": "^20.10.0",
"@types/node": "^22.1.0",
"@types/resize-observer-browser": "^0.1.11",
"@types/validator": "^13.11.7",
"@types/validator": "^13.12.0",
"ackee-tracker": "^5.1.0",
"axios": "^1.6.2",
"axios": "^1.7.3",
"babel-loader": "^9.1.3",
"bootstrap": "^5.3.2",
"browserslist": "^4.22.1",
"caniuse-lite": "^1.0.30001565",
"bootstrap": "^5.3.3",
"browserslist": "^4.23.3",
"caniuse-lite": "^1.0.30001647",
"fuse.js": "^7.0.0",
"material-icons": "^1.13.12",
"moment": "^2.29.4",
"moment": "^2.30.1",
"ng-mat-select-infinite-scroll": "^4.0.0",
"ngx-auto-unsubscribe-decorator": "^1.1.0",
"ngx-dropzone": "^3.1.0",
"ngx-moment": "^6.0.2",
"picsur-shared": "*",
"reflect-metadata": "^0.1.13",
"picsur-shared": "workspace:^",
"reflect-metadata": "^0.2.2",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"typescript": "^5.3.2",
"webpack-bundle-analyzer": "^4.10.1",
"zod": "^3.22.4",
"zone.js": "^0.14.2"
"tslib": "^2.6.3",
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-bundle-analyzer": "^4.10.2",
"zod": "^3.23.8",
"@leteu/jwt-decoder": "^1.0.4",
"zone.js": "^0.14.8"
},
"dependencies": {
"@leteu/jwt-decoder": "^1.0.4"
}
}

View File

@@ -1,8 +1,7 @@
import { Directive, ElementRef, Inject } from '@angular/core';
import {
RESIZE_OPTION_BOX,
ResizeObserverService,
boxExtractor,
WA_RESIZE_OPTION_BOX
} from '@ng-web-apis/resize-observer';
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe-decorator';
import { Observable, map } from 'rxjs';
@@ -12,9 +11,9 @@ import { Observable, map } from 'rxjs';
providers: [
ResizeObserverService,
{
provide: RESIZE_OPTION_BOX,
provide: WA_RESIZE_OPTION_BOX,
deps: [ElementRef],
useFactory: boxExtractor,
useValue: "border-box",
},
],
})

View File

@@ -1,5 +1,5 @@
// Include bootstrap-grid.scss from node_modules
@use '../../../node_modules/bootstrap/scss/bootstrap-grid.scss' with (
@use '../../node_modules/bootstrap/scss/bootstrap-grid.scss' with (
$grid-breakpoints: (
xs: 0,
sm: 576px,

View File

@@ -1,4 +1,4 @@
@use '../../../node_modules/bootstrap/scss/bootstrap-grid.scss' as bs;
@use '../../node_modules/bootstrap/scss/bootstrap-grid.scss' as bs;
// Fabs
.fab-wrapper {

View File

@@ -9,13 +9,13 @@
$foreground: map.get($theme, foreground);
&.mat-primary {
#{$property}: mat.get-color-from-palette($primary, $hue);
#{$property}: mat.m2-get-color-from-palette($primary, $hue);
}
&.mat-accent {
#{$property}: mat.get-color-from-palette($accent, $hue);
#{$property}: mat.m2-get-color-from-palette($accent, $hue);
}
&.mat-warn {
#{$property}: mat.get-color-from-palette($warn, $hue);
#{$property}: mat.m2-get-color-from-palette($warn, $hue);
}
&.mat-primary,
@@ -24,7 +24,7 @@
&.mat-button-disabled {
&.mat-button-disabled {
$palette: if($property == 'color', $foreground, $background);
#{$property}: mat.get-color-from-palette($palette, disabled-button);
#{$property}: mat.m2-get-color-from-palette($palette, disabled-button);
}
}
}
@@ -41,7 +41,7 @@
}
@mixin custom-material($theme) {
$color: mat.get-color-config($theme);
$color: mat.m2-get-color-config($theme);
@include custom-buttons($color);
}

View File

@@ -6,9 +6,9 @@ $theme-ignore-duplication-warnings: true;
@include mat.core();
$picsur-primary: mat.define-palette(mat.$green-palette, 600, 100, 900);
$picsur-accent: mat.define-palette(mat.$blue-grey-palette, 600, 200, 800);
$picsur-warn: mat.define-palette(mat.$red-palette);
$picsur-primary: mat.m2-define-palette(mat.$m2-green-palette, 600, 100, 900);
$picsur-accent: mat.m2-define-palette(mat.$m2-blue-grey-palette, 600, 200, 800);
$picsur-warn: mat.m2-define-palette(mat.$m2-red-palette);
// Light Theme Text
$dark-text: #000000;

View File

@@ -1,11 +1,6 @@
{
"private": true,
"version": "0.5.3",
"workspaces": [
"shared",
"backend",
"frontend"
],
"scripts": {
"devdb:start": "docker-compose -f ./support/dev.docker-compose.yml up -d",
"devdb:stop": "docker-compose -f ./support/dev.docker-compose.yml down",
@@ -19,7 +14,7 @@
"lint": "eslint --fix ."
},
"resolutions": {
"typescript": "~5.2.0",
"typescript": "~5.5.4",
"fastify": ">=4.8.1",
"terser": ">=5.14.2",
"typeorm": ">=0.3.9",
@@ -32,15 +27,14 @@
"minimist": "npm:minimist-lite@*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-require-extensions": "^0.1.3",
"ms": "2.1.3",
"prettier": "^3.1.0",
"prettier-plugin-sh": "^0.13.1"
"prettier": "^3.3.3",
"prettier-plugin-sh": "^0.14.0"
},
"packageManager": "yarn@3.2.2"
"packageManager": "pnpm@9.6.0"
}

12828
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

4
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,4 @@
packages:
- "shared"
- "frontend"
- "backend"

View File

@@ -14,18 +14,19 @@
},
"dependencies": {
"ms": "2.1.3",
"zod": "^3.22.4"
"zod": "^3.23.8"
},
"devDependencies": {
"@types/ms": "^0.7.34",
"@types/node": "^20.10.0",
"tsc-watch": "^6.0.4",
"typescript": "^5.3.2"
"@types/node": "^22.1.0",
"rimraf": "^6.0.1",
"tsc-watch": "^6.2.0",
"typescript": "~5.5.4"
},
"scripts": {
"clean": "rm -rf ./dist",
"start": "yarn clean && tsc-watch",
"build": "yarn clean && tsc",
"purge": "rm -rf ./dist && rm -rf ./node_modules"
"clean": "rimraf ./dist",
"start": "pnpm clean && tsc-watch",
"build": "pnpm clean && tsc",
"purge": "rimraf ./dist && rimraf ./node_modules"
}
}

View File

@@ -1,4 +1,3 @@
version: '3'
services:
devdb:
image: postgres:14-alpine

15274
yarn.lock

File diff suppressed because it is too large Load Diff