mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 15:27:49 +01:00
update most packages
This commit is contained in:
@@ -72,9 +72,51 @@ jobs:
|
||||
name: test frontend
|
||||
command: cd frontend && npm test
|
||||
|
||||
test-frontend-build:
|
||||
docker:
|
||||
- image: circleci/node:14
|
||||
|
||||
working_directory: ~/photos/frontend
|
||||
|
||||
steps:
|
||||
- checkout:
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- backend-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
- run:
|
||||
name: install backend deps
|
||||
command: npm i
|
||||
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: backend-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- frontend-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
- run:
|
||||
name: install frontend deps
|
||||
command: cd frontend && npm i
|
||||
|
||||
- save_cache:
|
||||
paths:
|
||||
- frontend/node_modules
|
||||
key: frontend-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
- run:
|
||||
name: test frontend
|
||||
command: cd frontend && npm run build
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
test:
|
||||
jobs:
|
||||
- test-backend
|
||||
- test-frontend
|
||||
- test-frontend-build:
|
||||
requires:
|
||||
- test-frontend
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
"workspaceFolder": "/workspace",
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
@@ -20,7 +19,7 @@
|
||||
3000
|
||||
],
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "npm config set unsafe-perm=true && npm i && cd frontend && npm i",
|
||||
// "postCreateCommand": "npm config set unsafe-perm=true && npm i && cd frontend && npm i",
|
||||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node"
|
||||
}
|
||||
@@ -16,4 +16,5 @@ module.exports = {
|
||||
"react-spring": "<rootDir>/node_modules/react-spring/web.cjs",
|
||||
},
|
||||
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
|
||||
testEnvironment: "jsdom",
|
||||
};
|
||||
|
||||
5119
frontend/package-lock.json
generated
5119
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,57 +13,58 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@blueprintjs/core": "^3.33.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
||||
"@typescript-eslint/parser": "^4.4.0",
|
||||
"autoprefixer": "^9.8.6",
|
||||
"@blueprintjs/core": "^3.47.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.5",
|
||||
"@typescript-eslint/parser": "^4.28.5",
|
||||
"autoprefixer": "^9",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.5",
|
||||
"eslint": "^7.10.0",
|
||||
"eslint-config-prettier": "^6.12.0",
|
||||
"eslint-import-resolver-typescript": "^2.3.0",
|
||||
"eslint-plugin-html": "^6.1.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jest": "^24.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.3.1",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"eslint-plugin-react": "^7.21.3",
|
||||
"eslint-plugin-react-hooks": "^4.1.2",
|
||||
"jest": "^26.5.2",
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-import-resolver-typescript": "^2.4.0",
|
||||
"eslint-plugin-html": "^6.1.2",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"eslint-plugin-react": "^7.24.0",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"jest": "^27.0.6",
|
||||
"parcel": "^1.12.4",
|
||||
"pluralize": "^8.0.0",
|
||||
"postcss": "^8.1.1",
|
||||
"prettier": "^2.1.2",
|
||||
"prettier-eslint": "^11.0.0",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-redux": "^7.2.1",
|
||||
"postcss": "^8.3.6",
|
||||
"prettier": "^2.3.2",
|
||||
"prettier-eslint": "^13.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-redux": "^7.2.4",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-spring": "^8.0.27",
|
||||
"redux": "^4.0.5",
|
||||
"redux-devtools-extension": "^2.13.8",
|
||||
"react-spring": "^8",
|
||||
"redux": "^4.1.0",
|
||||
"redux-devtools-extension": "^2.13.9",
|
||||
"redux-persist": "^6.0.0",
|
||||
"redux-saga": "^1.1.3",
|
||||
"sass": "^1.27.0",
|
||||
"sass": "^1.37.0",
|
||||
"spark-md5": "^3.0.1",
|
||||
"ts-jest": "^26.4.1",
|
||||
"typescript": "^4.0.3"
|
||||
"ts-jest": "^27.0.4",
|
||||
"typescript": "^4.3.5",
|
||||
"flush-promises": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/autoprefixer": "^9.7.2",
|
||||
"@types/enzyme": "^3.10.7",
|
||||
"@types/enzyme-adapter-react-16": "^1.0.6",
|
||||
"@types/eslint": "^7.2.4",
|
||||
"@types/enzyme": "^3.10.9",
|
||||
"@types/eslint": "^7.28.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/pluralize": "^0.0.29",
|
||||
"@types/prettier": "^2.1.1",
|
||||
"@types/react": "^16.9.51",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/react-redux": "^7.1.9",
|
||||
"@types/react-router": "^5.1.8",
|
||||
"@types/react-router-dom": "^5.1.6",
|
||||
"@types/sass": "^1.16.0",
|
||||
"@types/prettier": "^2.3.2",
|
||||
"@types/react": "^17.0.15",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/react-redux": "^7.1.18",
|
||||
"@types/react-router": "^5.1.16",
|
||||
"@types/react-router-dom": "^5.1.8",
|
||||
"@types/sass": "^1.16.1",
|
||||
"@types/spark-md5": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as Enzyme from "enzyme";
|
||||
import * as Adapter from "enzyme-adapter-react-16";
|
||||
import * as Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
||||
|
||||
Enzyme.configure({ adapter: new Adapter() });
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export function flushPromises(): Promise<unknown> {
|
||||
return new Promise(setImmediate);
|
||||
}
|
||||
|
||||
3246
package-lock.json
generated
3246
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
90
package.json
90
package.json
@@ -23,66 +23,66 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@koa/cors": "^3.1.0",
|
||||
"@koa/router": "^10.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.9.1",
|
||||
"@typescript-eslint/parser": "^4.9.1",
|
||||
"bcrypt": "^5.0.0",
|
||||
"chai": "^4.2.0",
|
||||
"class-validator": "^0.12.2",
|
||||
"concurrently": "^5.3.0",
|
||||
"@koa/router": "^10.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.5",
|
||||
"@typescript-eslint/parser": "^4.28.5",
|
||||
"bcrypt": "^5.0.1",
|
||||
"chai": "^4.3.4",
|
||||
"class-validator": "^0.13.1",
|
||||
"concurrently": "^6.2.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"deasync": "^0.1.21",
|
||||
"eslint": "^7.15.0",
|
||||
"eslint-config-prettier": "^7.0.0",
|
||||
"eslint-import-resolver-typescript": "^2.3.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-mocha": "^8.0.0",
|
||||
"eslint-plugin-prettier": "^3.2.0",
|
||||
"exifreader": "^3.12.6",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-import-resolver-typescript": "^2.4.0",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-mocha": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"exifreader": "^3.16.0",
|
||||
"hasha": "^5.2.2",
|
||||
"husky": "^4.3.5",
|
||||
"husky": "^7.0.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"koa": "^2.13.0",
|
||||
"koa": "^2.13.1",
|
||||
"koa-body": "^4.2.0",
|
||||
"koa-jwt": "^4.0.0",
|
||||
"koa-jwt": "^4.0.1",
|
||||
"koa-logger": "^3.2.1",
|
||||
"koa-send": "^5.0.1",
|
||||
"koa-sslify": "^4.0.3",
|
||||
"koa-sslify": "^5.0.0",
|
||||
"koa-static": "^5.0.0",
|
||||
"mime-types": "^2.1.27",
|
||||
"mocha": "^8.2.1",
|
||||
"mime-types": "^2.1.32",
|
||||
"mocha": "^9.0.3",
|
||||
"mysql": "^2.18.1",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-eslint": "^12.0.0",
|
||||
"sharp": "^0.26.3",
|
||||
"supertest": "^6.0.1",
|
||||
"ts-node": "^9.1.1",
|
||||
"ts-node-dev": "^1.1.1",
|
||||
"tsconfig-paths": "^3.9.0",
|
||||
"typeorm": "^0.2.29",
|
||||
"typescript": "^4.1.3"
|
||||
"prettier": "^2.3.2",
|
||||
"prettier-eslint": "^13.0.0",
|
||||
"sharp": "^0.28.3",
|
||||
"supertest": "^6.1.4",
|
||||
"ts-node": "^10.1.0",
|
||||
"ts-node-dev": "^1.1.8",
|
||||
"tsconfig-paths": "^3.10.1",
|
||||
"typeorm": "^0.2.36",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcrypt": "^3.0.0",
|
||||
"@types/chai": "^4.2.14",
|
||||
"@types/concurrently": "^5.2.1",
|
||||
"@types/bcrypt": "^5.0.0",
|
||||
"@types/chai": "^4.2.21",
|
||||
"@types/concurrently": "^6.2.1",
|
||||
"@types/deasync": "^0.1.1",
|
||||
"@types/eslint": "^7.2.6",
|
||||
"@types/eslint": "^7.28.0",
|
||||
"@types/eslint-plugin-prettier": "^3.1.0",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/koa": "^2.11.6",
|
||||
"@types/jsonwebtoken": "^8.5.4",
|
||||
"@types/koa": "^2.13.4",
|
||||
"@types/koa-logger": "^3.1.1",
|
||||
"@types/koa-send": "^4.1.2",
|
||||
"@types/koa-sslify": "^4.0.1",
|
||||
"@types/koa-static": "^4.0.1",
|
||||
"@types/koa__cors": "^3.0.2",
|
||||
"@types/koa__router": "^8.0.3",
|
||||
"@types/koa-send": "^4.1.3",
|
||||
"@types/koa-sslify": "^4.0.2",
|
||||
"@types/koa-static": "^4.0.2",
|
||||
"@types/koa__cors": "^3.0.3",
|
||||
"@types/koa__router": "^8.0.7",
|
||||
"@types/mime-types": "^2.1.0",
|
||||
"@types/mocha": "^8.2.0",
|
||||
"@types/mysql": "^2.15.16",
|
||||
"@types/prettier": "^2.1.5",
|
||||
"@types/sharp": "^0.26.1",
|
||||
"@types/supertest": "^2.0.10"
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/mysql": "^2.15.19",
|
||||
"@types/prettier": "^2.3.2",
|
||||
"@types/sharp": "^0.28.5",
|
||||
"@types/supertest": "^2.0.11"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -73,7 +73,7 @@ photosRouter.post("/photos/upload/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { id } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
};
|
||||
|
||||
if (!id) {
|
||||
@@ -82,7 +82,7 @@ photosRouter.post("/photos/upload/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { user } = ctx.state;
|
||||
const photo = await Photo.findOne({ id, user });
|
||||
const photo = await Photo.findOne({ id: parseInt(id), user });
|
||||
if (!photo) {
|
||||
ctx.throw(404);
|
||||
return;
|
||||
@@ -221,16 +221,17 @@ photosRouter.get("/photos/byID/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { id } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
};
|
||||
|
||||
if (!id) {
|
||||
ctx.throw(400);
|
||||
return;
|
||||
}
|
||||
|
||||
const { user } = ctx.state;
|
||||
|
||||
const photo = await Photo.findOne({ id, user });
|
||||
const photo = await Photo.findOne({ id: parseInt(id), user });
|
||||
|
||||
if (!photo) {
|
||||
ctx.throw(404);
|
||||
@@ -245,7 +246,7 @@ photosRouter.get("/photos/byID/:id", async (ctx) => {
|
||||
|
||||
photosRouter.get("/photos/showByID/:id/:token", async (ctx) => {
|
||||
const { id, token } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
token: string | undefined;
|
||||
};
|
||||
|
||||
@@ -264,7 +265,7 @@ photosRouter.get("/photos/showByID/:id/:token", async (ctx) => {
|
||||
const { user } = photoReqJSON;
|
||||
|
||||
const photo = await Photo.findOne({
|
||||
id,
|
||||
id: parseInt(id),
|
||||
user: { id: user },
|
||||
});
|
||||
|
||||
@@ -273,7 +274,7 @@ photosRouter.get("/photos/showByID/:id/:token", async (ctx) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.request.query["size"]) {
|
||||
if (ctx.request.query["size"] && typeof ctx.request.query["size"] == "string") {
|
||||
const size = parseInt(ctx.request.query["size"]);
|
||||
await send(ctx, await photo.getReadyThumbnailPath(size));
|
||||
return;
|
||||
@@ -288,23 +289,24 @@ photosRouter.get("/photos/showByID/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { id } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
};
|
||||
|
||||
if (!id) {
|
||||
ctx.throw(400);
|
||||
return;
|
||||
}
|
||||
|
||||
const { user } = ctx.state;
|
||||
|
||||
const photo = await Photo.findOne({ id, user });
|
||||
const photo = await Photo.findOne({ id: parseInt(id), user });
|
||||
|
||||
if (!photo || !(await photo.fileExists())) {
|
||||
ctx.throw(404);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.request.query["size"]) {
|
||||
if (ctx.request.query["size"] && typeof ctx.request.query["size"] == "string") {
|
||||
const size = parseInt(ctx.request.query["size"]);
|
||||
await send(ctx, await photo.getReadyThumbnailPath(size));
|
||||
return;
|
||||
@@ -321,16 +323,17 @@ photosRouter.get("/photos/getShowByIDToken/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { id } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
};
|
||||
|
||||
if (!id) {
|
||||
ctx.throw(400);
|
||||
return;
|
||||
}
|
||||
|
||||
const { user } = ctx.state;
|
||||
|
||||
const photo = await Photo.findOne({ id, user });
|
||||
const photo = await Photo.findOne({ id: parseInt(id), user });
|
||||
if (!photo || !(await photo.fileExists())) {
|
||||
ctx.throw(404);
|
||||
return;
|
||||
@@ -348,16 +351,17 @@ photosRouter.delete("/photos/byID/:id", async (ctx) => {
|
||||
}
|
||||
|
||||
const { id } = ctx.params as {
|
||||
id: number | undefined;
|
||||
id: string | undefined;
|
||||
};
|
||||
|
||||
if (!id) {
|
||||
ctx.throw(400);
|
||||
return;
|
||||
}
|
||||
|
||||
const { user } = ctx.state;
|
||||
|
||||
const photo = await Photo.findOne({ id, user });
|
||||
const photo = await Photo.findOne({ id: parseInt(id), user });
|
||||
|
||||
if (!photo) {
|
||||
ctx.throw(404);
|
||||
|
||||
Reference in New Issue
Block a user