build(deps): update latest

This commit is contained in:
Divlo 2022-08-23 21:53:07 +00:00
parent 50dbab7dfe
commit 46745e1b7e
No known key found for this signature in database
GPG Key ID: 8F9478F220CE65E9
12 changed files with 1792 additions and 2603 deletions

View File

@ -12,7 +12,7 @@ services:
- 'host.docker.internal:host-gateway' - 'host.docker.internal:host-gateway'
thream-database: thream-database:
image: 'postgres:14.2' image: 'postgres:14.5'
environment: environment:
POSTGRES_USER: 'user' POSTGRES_USER: 'user'
POSTGRES_PASSWORD: 'password' POSTGRES_PASSWORD: 'password'

View File

@ -45,3 +45,6 @@ jobs:
uses: 'hadolint/hadolint-action@v1.6.0' uses: 'hadolint/hadolint-action@v1.6.0'
with: with:
dockerfile: './Dockerfile' dockerfile: './Dockerfile'
- name: 'prisma:validate'
run: 'npm run prisma:validate'

View File

@ -2,5 +2,6 @@
"*": ["editorconfig-checker"], "*": ["editorconfig-checker"],
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"], "*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
"*.{json,jsonc,yml,yaml}": ["prettier --write"], "*.{json,jsonc,yml,yaml}": ["prettier --write"],
"*.md": ["prettier --write", "markdownlint --dot --fix"] "*.{md,mdx}": ["prettier --write", "markdownlint-cli2 --fix"],
"prisma/schema.prisma": ["prisma validate"]
} }

10
.markdownlint-cli2.jsonc Normal file
View File

@ -0,0 +1,10 @@
{
"config": {
"default": true,
"MD013": false,
"MD033": false,
"MD041": false
},
"globs": ["**/*.{md,mdx}"],
"ignores": ["**/node_modules"]
}

View File

@ -1,6 +0,0 @@
{
"default": true,
"MD013": false,
"MD033": false,
"MD041": false
}

View File

@ -86,7 +86,6 @@ git commit -m "fix(services): should emit events to connected users"
- `services` : all REST API endpoints - `services` : all REST API endpoints
- `tools` : configs and utilities - `tools` : configs and utilities
- `typings` : types gloablly used in the project - `typings` : types gloablly used in the project
- `uploads` : uploaded files by users
### Services folder explained with an example ### Services folder explained with an example

View File

@ -1,15 +1,15 @@
FROM node:16.14.2 AS dependencies FROM node:16.17.0 AS dependencies
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY ./package*.json ./ COPY ./package*.json ./
RUN npm install RUN npm install
FROM node:16.14.2 AS builder FROM node:16.17.0 AS builder
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY --from=dependencies /usr/src/app/node_modules ./node_modules COPY --from=dependencies /usr/src/app/node_modules ./node_modules
COPY ./ ./ COPY ./ ./
RUN npm run prisma:generate && npm run build RUN npm run prisma:generate && npm run build
FROM node:16.14.2 AS runner FROM node:16.17.0 AS runner
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV NODE_ENV=production ENV NODE_ENV=production
COPY --from=builder /usr/src/app/node_modules ./node_modules COPY --from=builder /usr/src/app/node_modules ./node_modules

4302
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,11 +20,12 @@
"generate": "plop", "generate": "plop",
"lint:commit": "commitlint", "lint:commit": "commitlint",
"lint:editorconfig": "editorconfig-checker", "lint:editorconfig": "editorconfig-checker",
"lint:markdown": "markdownlint \"**/*.md\" --dot --ignore-path \".gitignore\"", "lint:markdown": "markdownlint-cli2",
"lint:typescript": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"", "lint:typescript": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"",
"lint:prettier": "prettier \".\" --check", "lint:prettier": "prettier \".\" --check",
"lint:staged": "lint-staged", "lint:staged": "lint-staged",
"test": "cross-env NODE_ENV=test c8 tap", "test": "cross-env NODE_ENV=test c8 tap",
"prisma:validate": "prisma validate",
"prisma:generate": "prisma generate", "prisma:generate": "prisma generate",
"prisma:studio": "prisma studio", "prisma:studio": "prisma studio",
"prisma:migrate:dev": "prisma migrate dev", "prisma:migrate:dev": "prisma migrate dev",
@ -33,26 +34,26 @@
"postinstall": "husky install" "postinstall": "husky install"
}, },
"dependencies": { "dependencies": {
"@fastify/cors": "8.0.0", "@fastify/cors": "8.1.0",
"@fastify/helmet": "9.1.0", "@fastify/helmet": "9.1.0",
"@fastify/multipart": "7.1.0", "@fastify/multipart": "7.1.0",
"@fastify/rate-limit": "7.0.0", "@fastify/rate-limit": "7.3.0",
"@fastify/sensible": "5.1.0", "@fastify/sensible": "5.1.0",
"@fastify/swagger": "7.4.0", "@fastify/swagger": "7.4.1",
"@prisma/client": "3.12.0", "@prisma/client": "4.2.1",
"@sinclair/typebox": "0.23.5", "@sinclair/typebox": "0.24.28",
"@thream/socketio-jwt": "3.0.0", "@thream/socketio-jwt": "3.0.0",
"axios": "0.26.1", "axios": "0.26.1",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"dotenv": "16.0.1", "dotenv": "16.0.1",
"ejs": "3.1.8", "ejs": "3.1.8",
"fastify": "4.2.0", "fastify": "4.5.2",
"fastify-plugin": "3.0.1", "fastify-plugin": "4.2.0",
"form-data": "4.0.0", "form-data": "4.0.0",
"http-errors": "2.0.0", "http-errors": "2.0.0",
"jsonwebtoken": "8.5.1", "jsonwebtoken": "8.5.1",
"ms": "2.1.3", "ms": "2.1.3",
"nodemailer": "6.7.5", "nodemailer": "6.7.8",
"read-pkg": "7.1.0", "read-pkg": "7.1.0",
"socket.io": "4.5.1" "socket.io": "4.5.1"
}, },
@ -62,38 +63,38 @@
"@saithodev/semantic-release-backmerge": "2.1.2", "@saithodev/semantic-release-backmerge": "2.1.2",
"@semantic-release/git": "10.0.1", "@semantic-release/git": "10.0.1",
"@swc/cli": "0.1.57", "@swc/cli": "0.1.57",
"@swc/core": "1.2.207", "@swc/core": "1.2.242",
"@types/bcryptjs": "2.4.2", "@types/bcryptjs": "2.4.2",
"@types/busboy": "1.5.0", "@types/busboy": "1.5.0",
"@types/ejs": "3.1.1", "@types/ejs": "3.1.1",
"@types/http-errors": "1.8.2", "@types/http-errors": "1.8.2",
"@types/jsonwebtoken": "8.5.8", "@types/jsonwebtoken": "8.5.8",
"@types/ms": "0.7.31", "@types/ms": "0.7.31",
"@types/node": "18.0.0", "@types/node": "18.7.11",
"@types/nodemailer": "6.4.4", "@types/nodemailer": "6.4.5",
"@types/sinon": "10.0.12", "@types/sinon": "10.0.13",
"@types/tap": "15.0.7", "@types/tap": "15.0.7",
"@typescript-eslint/eslint-plugin": "5.30.0", "@typescript-eslint/eslint-plugin": "5.34.0",
"c8": "7.11.3", "c8": "7.12.0",
"concurrently": "7.2.2", "concurrently": "7.3.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"eslint": "8.18.0", "eslint": "8.22.0",
"eslint-config-conventions": "2.0.0", "eslint-config-conventions": "3.0.0",
"eslint-config-prettier": "8.5.0", "eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0", "eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "4.1.0", "eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "6.0.0", "eslint-plugin-promise": "6.0.0",
"eslint-plugin-unicorn": "42.0.0", "eslint-plugin-unicorn": "43.0.2",
"husky": "8.0.1", "husky": "8.0.1",
"lint-staged": "13.0.3", "lint-staged": "13.0.3",
"markdownlint-cli": "0.31.1", "markdownlint-cli2": "0.5.1",
"nodemon": "2.0.18", "nodemon": "2.0.19",
"plop": "3.1.1", "plop": "3.1.1",
"prettier": "2.7.1", "prettier": "2.7.1",
"prisma": "3.12.0", "prisma": "4.2.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"semantic-release": "19.0.3", "semantic-release": "19.0.5",
"sinon": "14.0.0", "sinon": "14.0.0",
"tap": "16.3.0", "tap": "16.3.0",
"typescript": "4.7.4" "typescript": "4.7.4"

View File

@ -14,8 +14,7 @@ export const messageSchema = {
type: Type.Union(types, { default: 'text' }), type: Type.Union(types, { default: 'text' }),
mimetype: Type.String({ mimetype: Type.String({
maxLength: 127, maxLength: 127,
default: 'text/plain', default: 'text/plain'
format: 'mimetype'
}), }),
createdAt: date.createdAt, createdAt: date.createdAt,
updatedAt: date.updatedAt, updatedAt: date.updatedAt,

View File

@ -1,6 +1,6 @@
import dotenv from 'dotenv' import dotenv from 'dotenv'
import nodemailer from 'nodemailer' import nodemailer from 'nodemailer'
import type SMTPTransport from 'nodemailer/lib/smtp-transport.js' import type SMTPTransport from 'nodemailer/lib/smtp-transport/index.js'
dotenv.config() dotenv.config()
const EMAIL_PORT = parseInt(process.env.EMAIL_PORT ?? '465', 10) const EMAIL_PORT = parseInt(process.env.EMAIL_PORT ?? '465', 10)

View File

@ -8,7 +8,9 @@ await tap.test('tools/plugins/socket-io', async (t) => {
const PORT = 3030 const PORT = 3030
const application = fastify() const application = fastify()
await application.register(fastifySocketIo) await application.register(fastifySocketIo)
await application.listen(PORT) await application.listen({
port: PORT
})
t.not(application.io, null) t.not(application.io, null)
await application.close() await application.close()
}) })