mirror of https://github.com/sylv/micro.git
update deps, move to atlas configs
This commit is contained in:
parent
aec85d03a6
commit
40cbaaca8b
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"indent": " ",
|
||||||
|
"sortFirst": [
|
||||||
|
"name",
|
||||||
|
"version",
|
||||||
|
"license",
|
||||||
|
"repository",
|
||||||
|
"author",
|
||||||
|
"type",
|
||||||
|
"main",
|
||||||
|
"private",
|
||||||
|
"types",
|
||||||
|
"module",
|
||||||
|
"exports",
|
||||||
|
"source",
|
||||||
|
"publishConfig",
|
||||||
|
"contributors",
|
||||||
|
"keywords",
|
||||||
|
"files",
|
||||||
|
"workspaces",
|
||||||
|
"engines",
|
||||||
|
"scripts",
|
||||||
|
"contributors",
|
||||||
|
"dependencies",
|
||||||
|
"devDependencies",
|
||||||
|
"peerDependencies",
|
||||||
|
"keywords",
|
||||||
|
"mikro-orm",
|
||||||
|
"jest"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
extends: ["@commitlint/config-conventional"],
|
|
||||||
rules: {
|
|
||||||
"subject-case": [0],
|
|
||||||
},
|
|
||||||
};
|
|
16
package.json
16
package.json
|
@ -1,22 +1,24 @@
|
||||||
{
|
{
|
||||||
"name": "micro",
|
"name": "micro",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/sylv/micro.git",
|
"repository": "https://github.com/sylv/micro.git",
|
||||||
"author": "Ryan <ryan@sylver.me>",
|
"author": "Ryan <ryan@sylver.me>",
|
||||||
"license": "GPL-3.0",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@7.0.0",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16",
|
"node": ">=16",
|
||||||
"pnpm": ">=7"
|
"pnpm": ">=7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "turbo run lint",
|
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"test": "turbo run test",
|
"clean": "rm -rf ./packages/*/{tsconfig.tsbuildinfo,lib,dist,yarn-error.log,.next}",
|
||||||
"clean": "rm -rf ./packages/*/{tsconfig.tsbuildinfo,lib,dist,yarn-error.log,.next}"
|
"lint": "turbo run lint",
|
||||||
|
"sync": "syncpack format && syncpack fix-mismatches",
|
||||||
|
"test": "turbo run test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"turbo": "1.10.13"
|
"syncpack": "^12.3.0",
|
||||||
}
|
"turbo": "1.11.3"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@7.0.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: require.resolve('@sylo-digital/scripts/eslint/base'),
|
extends: require.resolve('@atlasbot/configs/eslint/node'),
|
||||||
overrides: [
|
parserOptions: {
|
||||||
{
|
project: './tsconfig.json',
|
||||||
files: ['**/*.{entity,embeddable,resolver}.ts'],
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-inferrable-types': 'off',
|
'unicorn/no-abusive-eslint-disable': 'off',
|
||||||
},
|
},
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,86 +1,86 @@
|
||||||
{
|
{
|
||||||
"name": "@ryanke/micro-api",
|
"name": "@ryanke/micro-api",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/sylv/micro.git",
|
"repository": "https://github.com/sylv/micro.git",
|
||||||
"author": "Ryan <ryan@sylver.me>",
|
"author": "Ryan <ryan@sylver.me>",
|
||||||
"license": "GPL-3.0",
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"engine": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "tsup --watch --onSuccess \"node dist/main.js --inspect --inspect-brk\"",
|
"build": "tsc --noEmit && tsup",
|
||||||
"build": "tsup",
|
|
||||||
"lint": "eslint src --fix --cache",
|
"lint": "eslint src --fix --cache",
|
||||||
"test": "vitest run"
|
"test": "vitest run",
|
||||||
|
"watch": "tsup --watch --onSuccess \"node dist/main.js --inspect --inspect-brk\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fastify/cookie": "^9.0.4",
|
"@fastify/cookie": "^9.2.0",
|
||||||
"@fastify/helmet": "^11.0.0",
|
"@fastify/helmet": "^11.1.1",
|
||||||
"@fastify/multipart": "^7.7.3",
|
"@fastify/multipart": "^8.1.0",
|
||||||
"@jenyus-org/graphql-utils": "^1.5.0",
|
"@jenyus-org/graphql-utils": "^1.5.0",
|
||||||
"@mercuriusjs/gateway": "^1.2.0",
|
"@mercuriusjs/gateway": "^2.2.0",
|
||||||
"@mikro-orm/core": "^5.7.14",
|
"@mikro-orm/core": "^5.9.7",
|
||||||
"@mikro-orm/migrations": "^5.7.14",
|
"@mikro-orm/migrations": "^5.9.7",
|
||||||
"@mikro-orm/nestjs": "^5.2.1",
|
"@mikro-orm/nestjs": "^5.2.3",
|
||||||
"@mikro-orm/postgresql": "^5.7.14",
|
"@mikro-orm/postgresql": "^5.9.7",
|
||||||
"@nestjs/common": "^10.2.2",
|
"@nestjs/common": "^10.3.0",
|
||||||
"@nestjs/core": "^10.2.2",
|
"@nestjs/core": "^10.3.0",
|
||||||
"@nestjs/graphql": "^12.0.8",
|
"@nestjs/graphql": "^12.0.11",
|
||||||
"@nestjs/jwt": "^10.1.0",
|
"@nestjs/jwt": "^10.2.0",
|
||||||
"@nestjs/mercurius": "^12.0.4",
|
"@nestjs/mercurius": "^12.0.11",
|
||||||
"@nestjs/passport": "^10.0.1",
|
"@nestjs/passport": "^10.0.3",
|
||||||
"@nestjs/platform-fastify": "^10.2.2",
|
"@nestjs/platform-fastify": "^10.3.0",
|
||||||
"@nestjs/schedule": "^3.0.3",
|
"@nestjs/schedule": "^4.0.0",
|
||||||
"@ryanke/venera": "^1.0.5",
|
"@ryanke/venera": "^1.0.5",
|
||||||
"rxjs": "^7.8.1",
|
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.0",
|
"class-validator": "^0.14.0",
|
||||||
"fastify": "^4.22.0",
|
"fastify": "^4.25.2",
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"graphql": "^16.8.0",
|
"graphql": "^16.8.1",
|
||||||
"mercurius": "^13.1.0",
|
"mercurius": "^13.3.3",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
"nodemailer": "^6.9.4",
|
"nodemailer": "^6.9.8",
|
||||||
"otplib": "^12.0.1",
|
"otplib": "^12.0.1",
|
||||||
"passport": "^0.6.0",
|
"passport": "^0.7.0",
|
||||||
"passport-jwt": "^4.0.1",
|
"passport-jwt": "^4.0.1",
|
||||||
"sharp": "^0.32.5",
|
"rxjs": "^7.8.1",
|
||||||
|
"sharp": "^0.33.1",
|
||||||
"stream-size": "^0.0.6"
|
"stream-size": "^0.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mikro-orm/cli": "^5.7.14",
|
"@atlasbot/configs": "^10.5.14",
|
||||||
"@swc/core": "^1.3.80",
|
"@mikro-orm/cli": "^5.9.7",
|
||||||
"@sylo-digital/scripts": "^1.0.12",
|
"@swc/core": "^1.3.102",
|
||||||
"@types/bcryptjs": "^2.4.3",
|
"@types/bcryptjs": "^2.4.6",
|
||||||
"@types/bytes": "^3.1.1",
|
"@types/bytes": "^3.1.4",
|
||||||
"@types/dedent": "^0.7.0",
|
"@types/dedent": "^0.7.2",
|
||||||
"@types/fluent-ffmpeg": "^2.1.21",
|
"@types/fluent-ffmpeg": "^2.1.24",
|
||||||
"@types/luxon": "^3.3.1",
|
"@types/luxon": "^3.4.0",
|
||||||
"@types/mime-types": "^2.1.1",
|
"@types/mime-types": "^2.1.4",
|
||||||
"@types/ms": "^0.7.31",
|
"@types/ms": "^0.7.34",
|
||||||
"@types/node": "^18.15.11",
|
"@types/node": "^20.10.6",
|
||||||
"@types/nodemailer": "^6.4.9",
|
"@types/nodemailer": "^6.4.14",
|
||||||
"@types/passport-jwt": "^3.0.9",
|
"@types/passport-jwt": "^4.0.0",
|
||||||
"bytes": "^3.1.2",
|
"bytes": "^3.1.2",
|
||||||
"content-range": "^2.0.2",
|
"content-range": "^2.0.2",
|
||||||
"dedent": "^1.5.1",
|
"dedent": "^1.5.1",
|
||||||
"escape-string-regexp": "^5.0.0",
|
"escape-string-regexp": "^5.0.0",
|
||||||
"file-type": "^18.5.0",
|
"file-type": "^18.7.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"istextorbinary": "^6.0.0",
|
"istextorbinary": "^9.5.0",
|
||||||
"luxon": "^3.4.2",
|
"luxon": "^3.4.4",
|
||||||
"ms": "^3.0.0-canary.1",
|
"ms": "^3.0.0-canary.1",
|
||||||
"nanoid": "^4.0.2",
|
"nanoid": "^5.0.4",
|
||||||
"normalize-url": "^8.0.0",
|
"normalize-url": "^8.0.0",
|
||||||
"pretty-bytes": "^6.1.1",
|
"pretty-bytes": "^6.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.2.1",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.2",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^8.0.1",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.3.3",
|
||||||
"vitest": "^0.34.3"
|
"vitest": "^1.1.3"
|
||||||
},
|
},
|
||||||
"mikro-orm": {
|
"mikro-orm": {
|
||||||
"useTsNode": true,
|
"useTsNode": true,
|
||||||
|
|
|
@ -16,7 +16,7 @@ export class ExifTransformer extends Transform {
|
||||||
private static readonly maxMarkerLength = Math.max(
|
private static readonly maxMarkerLength = Math.max(
|
||||||
ExifTransformer.exifMarker.length,
|
ExifTransformer.exifMarker.length,
|
||||||
ExifTransformer.xmpMarker.length,
|
ExifTransformer.xmpMarker.length,
|
||||||
ExifTransformer.flirMarker.length
|
ExifTransformer.flirMarker.length,
|
||||||
);
|
);
|
||||||
|
|
||||||
private remainingBytes?: number;
|
private remainingBytes?: number;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { customAlphabet } from 'nanoid';
|
import { customAlphabet } from 'nanoid';
|
||||||
import blocklist from '../blocklist.json' assert { type: 'json' };
|
import blocklist from '../blocklist.json';
|
||||||
|
|
||||||
const contentIdLength = 6;
|
const contentIdLength = 6;
|
||||||
const paranoidIdLength = 12;
|
const paranoidIdLength = 12;
|
||||||
|
|
|
@ -2,8 +2,6 @@ import { fileTypeFromBuffer } from 'file-type';
|
||||||
import * as mimeType from 'mime-types';
|
import * as mimeType from 'mime-types';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import type { PassThrough } from 'stream';
|
import type { PassThrough } from 'stream';
|
||||||
|
|
||||||
// @ts-expect-error see tsconfig.json/paths
|
|
||||||
import { isBinary } from 'istextorbinary';
|
import { isBinary } from 'istextorbinary';
|
||||||
|
|
||||||
const DEFAULT_TYPE = 'application/octet-stream';
|
const DEFAULT_TYPE = 'application/octet-stream';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Field, InputType } from '@nestjs/graphql';
|
import { Field, InputType } from '@nestjs/graphql';
|
||||||
import { IsEmail, IsLowercase, IsNotIn, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
import { IsEmail, IsLowercase, IsNotIn, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
||||||
import blocklist from '../../../blocklist.json' assert { type: 'json' };
|
import blocklist from '../../../blocklist.json';
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
export class CreateUserDto {
|
export class CreateUserDto {
|
||||||
|
|
|
@ -1,38 +1,13 @@
|
||||||
{
|
{
|
||||||
"include": ["src", "types"],
|
"extends": "@atlasbot/configs/tsconfig/esm.json",
|
||||||
|
"include": ["src"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// https://www.npmjs.com/package/@tsconfig/node18
|
|
||||||
// https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"lib": ["es2022"],
|
|
||||||
// "module": "CommonJS",
|
|
||||||
// "moduleResolution": "node",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"moduleResolution": "nodenext",
|
|
||||||
"target": "es2022",
|
|
||||||
"strict": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"declaration": true,
|
|
||||||
"pretty": true,
|
|
||||||
"newLine": "lf",
|
|
||||||
"stripInternal": true,
|
|
||||||
"noImplicitOverride": false,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"noUncheckedIndexedAccess": false,
|
"noUncheckedIndexedAccess": false,
|
||||||
"strictPropertyInitialization": false,
|
"strictPropertyInitialization": false,
|
||||||
|
"noImplicitOverride": false,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"baseUrl": ".",
|
"lib": ["es2021", "dom"]
|
||||||
"paths": {
|
|
||||||
// https://github.com/bevry/istextorbinary/issues/270
|
|
||||||
// voids the bad types or else ncc fails
|
|
||||||
"istextorbinary": ["*.sink.d.ts"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
extends: require.resolve('@sylo-digital/scripts/eslint/react'),
|
extends: require.resolve('@atlasbot/configs/eslint/next'),
|
||||||
ignorePatterns: ['**/generated/**'],
|
parserOptions: {
|
||||||
rules: {
|
project: './tsconfig.json',
|
||||||
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
||||||
'storybook/no-title-property-in-meta': 'off',
|
|
||||||
'jsx-a11y/media-has-caption': 'off',
|
|
||||||
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
||||||
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
|
|
||||||
'@typescript-eslint/no-misused-promises': 'off',
|
|
||||||
},
|
},
|
||||||
|
rules: {},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,59 +1,59 @@
|
||||||
{
|
{
|
||||||
"name": "@ryanke/micro-web",
|
"name": "@ryanke/micro-web",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/sylv/micro.git",
|
"repository": "https://github.com/sylv/micro.git",
|
||||||
"author": "Ryan <ryan@sylver.me>",
|
"author": "Ryan <ryan@sylver.me>",
|
||||||
"license": "GPL-3.0",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"engine": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "NODE_ENV=development concurrently \"next dev\" \"pnpm generate --watch\"",
|
|
||||||
"build": "NODE_ENV=production next build",
|
"build": "NODE_ENV=production next build",
|
||||||
|
"generate": "graphql-codegen --config codegen.yml",
|
||||||
"lint": "NODE_ENV=production next lint",
|
"lint": "NODE_ENV=production next lint",
|
||||||
"generate": "graphql-codegen --config codegen.yml"
|
"watch": "NODE_ENV=development concurrently \"next dev\" \"pnpm generate --watch\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.8.1",
|
"@apollo/client": "^3.8.8",
|
||||||
"@headlessui/react": "^1.7.17",
|
"@headlessui/react": "^1.7.17",
|
||||||
"@ryanke/pandora": "^0.0.9",
|
"@ryanke/pandora": "^0.0.9",
|
||||||
"@tailwindcss/typography": "^0.5.9",
|
"@tailwindcss/typography": "^0.5.10",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.16",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.1.0",
|
||||||
"concurrently": "^8.2.1",
|
"concurrently": "^8.2.2",
|
||||||
"copy-to-clipboard": "^3.3.3",
|
"copy-to-clipboard": "^3.3.3",
|
||||||
"dayjs": "^1.11.9",
|
"dayjs": "^1.11.10",
|
||||||
"deepmerge": "^4.3.1",
|
"deepmerge": "^4.3.1",
|
||||||
"formik": "^2.4.3",
|
"formik": "^2.4.5",
|
||||||
"generate-avatar": "1.4.10",
|
"generate-avatar": "1.4.10",
|
||||||
"graphql": "^16.8.0",
|
"graphql": "^16.8.1",
|
||||||
"http-status-codes": "^2.2.0",
|
"http-status-codes": "^2.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nanoid": "^4.0.2",
|
"next": "14.0.4",
|
||||||
"next": "13.4.19",
|
"postcss": "^8.4.33",
|
||||||
"postcss": "^8.4.29",
|
"prism-react-renderer": "^2.3.1",
|
||||||
"prism-react-renderer": "^2.0.6",
|
|
||||||
"qrcode.react": "^3.1.0",
|
"qrcode.react": "^3.1.0",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "^18.1.0",
|
"react-dom": "^18.1.0",
|
||||||
"react-feather": "^2.0.9",
|
"react-feather": "^2.0.9",
|
||||||
"react-markdown": "^8.0.7",
|
"react-markdown": "^9.0.1",
|
||||||
"remark-gfm": "^3.0.1",
|
"remark-gfm": "^4.0.0",
|
||||||
"swr": "^2.2.2",
|
"swr": "^2.2.4",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.4.1",
|
||||||
"yup": "^1.2.0"
|
"yup": "^1.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@atlasbot/configs": "^10.5.14",
|
||||||
"@graphql-codegen/cli": "^5.0.0",
|
"@graphql-codegen/cli": "^5.0.0",
|
||||||
"@graphql-codegen/typescript": "4.0.1",
|
"@graphql-codegen/typescript": "4.0.1",
|
||||||
"@graphql-codegen/typescript-operations": "4.0.1",
|
"@graphql-codegen/typescript-operations": "4.0.1",
|
||||||
"@graphql-codegen/typescript-react-apollo": "3.3.7",
|
"@graphql-codegen/typescript-react-apollo": "4.1.0",
|
||||||
"@sylo-digital/scripts": "^1.0.12",
|
"@parcel/watcher": "^2.3.0",
|
||||||
"@types/lodash": "^4.14.197",
|
"@types/lodash": "^4.14.202",
|
||||||
"@types/node": "^18.15.11",
|
"@types/node": "^20.10.6",
|
||||||
"@types/react": "^18.2.21",
|
"@types/react": "^18.2.47",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import type { Language } from 'prism-react-renderer';
|
import type { Language } from 'prism-react-renderer';
|
||||||
import { Fragment, memo } from 'react';
|
import { Children, Fragment, memo } from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import remarkGfm from 'remark-gfm';
|
import remarkGfm from 'remark-gfm';
|
||||||
import { SyntaxHighlighter } from './syntax-highlighter/syntax-highlighter';
|
import { SyntaxHighlighter } from './syntax-highlighter/syntax-highlighter';
|
||||||
|
@ -18,7 +18,7 @@ export const Markdown = memo<{ children: string; className?: string }>(({ childr
|
||||||
'prose-blockquote:font-normal prose-blockquote:not-italic',
|
'prose-blockquote:font-normal prose-blockquote:not-italic',
|
||||||
// make inline `code` blocks purple
|
// make inline `code` blocks purple
|
||||||
'prose-code:text-primary',
|
'prose-code:text-primary',
|
||||||
className
|
className,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -32,10 +32,15 @@ export const Markdown = memo<{ children: string; className?: string }>(({ childr
|
||||||
// prism syntax highlighter. so this just doesnt render the pre tag.
|
// prism syntax highlighter. so this just doesnt render the pre tag.
|
||||||
return <Fragment>{children}</Fragment>;
|
return <Fragment>{children}</Fragment>;
|
||||||
},
|
},
|
||||||
code({ inline, className, children, ...rest }) {
|
code({ className, children, ...rest }) {
|
||||||
const languageMatch = !inline && className && LANGUAGE_REGEX.exec(className);
|
const languageMatch = className && LANGUAGE_REGEX.exec(className);
|
||||||
const text = languageMatch ? children.filter((child) => typeof child === 'string').join(' ') : null;
|
const text = languageMatch
|
||||||
if (inline || !languageMatch || !text) {
|
? Children.toArray(children)
|
||||||
|
.filter((child) => typeof child === 'string')
|
||||||
|
.join(' ')
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (!languageMatch || !text) {
|
||||||
return (
|
return (
|
||||||
<code className={className} {...rest}>
|
<code className={className} {...rest}>
|
||||||
{children}
|
{children}
|
||||||
|
@ -45,7 +50,7 @@ export const Markdown = memo<{ children: string; className?: string }>(({ childr
|
||||||
|
|
||||||
const language = languageMatch.groups!.language as Language;
|
const language = languageMatch.groups!.language as Language;
|
||||||
return (
|
return (
|
||||||
<SyntaxHighlighter language={language} className={className} {...rest}>
|
<SyntaxHighlighter language={language} className={className} {...(rest as any)}>
|
||||||
{text}
|
{text}
|
||||||
</SyntaxHighlighter>
|
</SyntaxHighlighter>
|
||||||
);
|
);
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const SyntaxHighlighter = memo<SyntaxHighlighterProps>(
|
||||||
const containerClasses = clsx(
|
const containerClasses = clsx(
|
||||||
'text-left overflow-x-auto h-full relative',
|
'text-left overflow-x-auto h-full relative',
|
||||||
highlighterClasses,
|
highlighterClasses,
|
||||||
additionalClasses
|
additionalClasses,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -43,5 +43,5 @@ export const SyntaxHighlighter = memo<SyntaxHighlighterProps>(
|
||||||
}}
|
}}
|
||||||
</Highlight>
|
</Highlight>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -678,8 +678,15 @@ export function useGetFilesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<G
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetFilesQuery, GetFilesQueryVariables>(GetFilesDocument, options);
|
return Apollo.useLazyQuery<GetFilesQuery, GetFilesQueryVariables>(GetFilesDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetFilesSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetFilesQuery, GetFilesQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetFilesQuery, GetFilesQueryVariables>(GetFilesDocument, options);
|
||||||
|
}
|
||||||
export type GetFilesQueryHookResult = ReturnType<typeof useGetFilesQuery>;
|
export type GetFilesQueryHookResult = ReturnType<typeof useGetFilesQuery>;
|
||||||
export type GetFilesLazyQueryHookResult = ReturnType<typeof useGetFilesLazyQuery>;
|
export type GetFilesLazyQueryHookResult = ReturnType<typeof useGetFilesLazyQuery>;
|
||||||
|
export type GetFilesSuspenseQueryHookResult = ReturnType<typeof useGetFilesSuspenseQuery>;
|
||||||
export type GetFilesQueryResult = Apollo.QueryResult<GetFilesQuery, GetFilesQueryVariables>;
|
export type GetFilesQueryResult = Apollo.QueryResult<GetFilesQuery, GetFilesQueryVariables>;
|
||||||
export const GetPastesDocument = gql`
|
export const GetPastesDocument = gql`
|
||||||
query GetPastes($first: Float, $after: String) {
|
query GetPastes($first: Float, $after: String) {
|
||||||
|
@ -727,8 +734,15 @@ export function useGetPastesLazyQuery(
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetPastesQuery, GetPastesQueryVariables>(GetPastesDocument, options);
|
return Apollo.useLazyQuery<GetPastesQuery, GetPastesQueryVariables>(GetPastesDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetPastesSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetPastesQuery, GetPastesQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetPastesQuery, GetPastesQueryVariables>(GetPastesDocument, options);
|
||||||
|
}
|
||||||
export type GetPastesQueryHookResult = ReturnType<typeof useGetPastesQuery>;
|
export type GetPastesQueryHookResult = ReturnType<typeof useGetPastesQuery>;
|
||||||
export type GetPastesLazyQueryHookResult = ReturnType<typeof useGetPastesLazyQuery>;
|
export type GetPastesLazyQueryHookResult = ReturnType<typeof useGetPastesLazyQuery>;
|
||||||
|
export type GetPastesSuspenseQueryHookResult = ReturnType<typeof useGetPastesSuspenseQuery>;
|
||||||
export type GetPastesQueryResult = Apollo.QueryResult<GetPastesQuery, GetPastesQueryVariables>;
|
export type GetPastesQueryResult = Apollo.QueryResult<GetPastesQuery, GetPastesQueryVariables>;
|
||||||
export const ConfigDocument = gql`
|
export const ConfigDocument = gql`
|
||||||
query Config {
|
query Config {
|
||||||
|
@ -775,8 +789,15 @@ export function useConfigLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<Con
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<ConfigQuery, ConfigQueryVariables>(ConfigDocument, options);
|
return Apollo.useLazyQuery<ConfigQuery, ConfigQueryVariables>(ConfigDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useConfigSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<ConfigQuery, ConfigQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<ConfigQuery, ConfigQueryVariables>(ConfigDocument, options);
|
||||||
|
}
|
||||||
export type ConfigQueryHookResult = ReturnType<typeof useConfigQuery>;
|
export type ConfigQueryHookResult = ReturnType<typeof useConfigQuery>;
|
||||||
export type ConfigLazyQueryHookResult = ReturnType<typeof useConfigLazyQuery>;
|
export type ConfigLazyQueryHookResult = ReturnType<typeof useConfigLazyQuery>;
|
||||||
|
export type ConfigSuspenseQueryHookResult = ReturnType<typeof useConfigSuspenseQuery>;
|
||||||
export type ConfigQueryResult = Apollo.QueryResult<ConfigQuery, ConfigQueryVariables>;
|
export type ConfigQueryResult = Apollo.QueryResult<ConfigQuery, ConfigQueryVariables>;
|
||||||
export const GetUserDocument = gql`
|
export const GetUserDocument = gql`
|
||||||
query GetUser {
|
query GetUser {
|
||||||
|
@ -811,8 +832,15 @@ export function useGetUserLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<Ge
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetUserQuery, GetUserQueryVariables>(GetUserDocument, options);
|
return Apollo.useLazyQuery<GetUserQuery, GetUserQueryVariables>(GetUserDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetUserSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetUserQuery, GetUserQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetUserQuery, GetUserQueryVariables>(GetUserDocument, options);
|
||||||
|
}
|
||||||
export type GetUserQueryHookResult = ReturnType<typeof useGetUserQuery>;
|
export type GetUserQueryHookResult = ReturnType<typeof useGetUserQuery>;
|
||||||
export type GetUserLazyQueryHookResult = ReturnType<typeof useGetUserLazyQuery>;
|
export type GetUserLazyQueryHookResult = ReturnType<typeof useGetUserLazyQuery>;
|
||||||
|
export type GetUserSuspenseQueryHookResult = ReturnType<typeof useGetUserSuspenseQuery>;
|
||||||
export type GetUserQueryResult = Apollo.QueryResult<GetUserQuery, GetUserQueryVariables>;
|
export type GetUserQueryResult = Apollo.QueryResult<GetUserQuery, GetUserQueryVariables>;
|
||||||
export const LoginDocument = gql`
|
export const LoginDocument = gql`
|
||||||
mutation Login($username: String!, $password: String!, $otp: String) {
|
mutation Login($username: String!, $password: String!, $otp: String) {
|
||||||
|
@ -1069,8 +1097,15 @@ export function useGetFileLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<Ge
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetFileQuery, GetFileQueryVariables>(GetFileDocument, options);
|
return Apollo.useLazyQuery<GetFileQuery, GetFileQueryVariables>(GetFileDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetFileSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetFileQuery, GetFileQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetFileQuery, GetFileQueryVariables>(GetFileDocument, options);
|
||||||
|
}
|
||||||
export type GetFileQueryHookResult = ReturnType<typeof useGetFileQuery>;
|
export type GetFileQueryHookResult = ReturnType<typeof useGetFileQuery>;
|
||||||
export type GetFileLazyQueryHookResult = ReturnType<typeof useGetFileLazyQuery>;
|
export type GetFileLazyQueryHookResult = ReturnType<typeof useGetFileLazyQuery>;
|
||||||
|
export type GetFileSuspenseQueryHookResult = ReturnType<typeof useGetFileSuspenseQuery>;
|
||||||
export type GetFileQueryResult = Apollo.QueryResult<GetFileQuery, GetFileQueryVariables>;
|
export type GetFileQueryResult = Apollo.QueryResult<GetFileQuery, GetFileQueryVariables>;
|
||||||
export const DeleteFileDocument = gql`
|
export const DeleteFileDocument = gql`
|
||||||
mutation DeleteFile($fileId: ID!, $deleteKey: String) {
|
mutation DeleteFile($fileId: ID!, $deleteKey: String) {
|
||||||
|
@ -1141,8 +1176,15 @@ export function useGetInviteLazyQuery(
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetInviteQuery, GetInviteQueryVariables>(GetInviteDocument, options);
|
return Apollo.useLazyQuery<GetInviteQuery, GetInviteQueryVariables>(GetInviteDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetInviteSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetInviteQuery, GetInviteQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetInviteQuery, GetInviteQueryVariables>(GetInviteDocument, options);
|
||||||
|
}
|
||||||
export type GetInviteQueryHookResult = ReturnType<typeof useGetInviteQuery>;
|
export type GetInviteQueryHookResult = ReturnType<typeof useGetInviteQuery>;
|
||||||
export type GetInviteLazyQueryHookResult = ReturnType<typeof useGetInviteLazyQuery>;
|
export type GetInviteLazyQueryHookResult = ReturnType<typeof useGetInviteLazyQuery>;
|
||||||
|
export type GetInviteSuspenseQueryHookResult = ReturnType<typeof useGetInviteSuspenseQuery>;
|
||||||
export type GetInviteQueryResult = Apollo.QueryResult<GetInviteQuery, GetInviteQueryVariables>;
|
export type GetInviteQueryResult = Apollo.QueryResult<GetInviteQuery, GetInviteQueryVariables>;
|
||||||
export const CreateUserDocument = gql`
|
export const CreateUserDocument = gql`
|
||||||
mutation CreateUser($user: CreateUserDto!) {
|
mutation CreateUser($user: CreateUserDto!) {
|
||||||
|
@ -1261,8 +1303,15 @@ export function useGetPasteLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<G
|
||||||
const options = { ...defaultOptions, ...baseOptions };
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
return Apollo.useLazyQuery<GetPasteQuery, GetPasteQueryVariables>(GetPasteDocument, options);
|
return Apollo.useLazyQuery<GetPasteQuery, GetPasteQueryVariables>(GetPasteDocument, options);
|
||||||
}
|
}
|
||||||
|
export function useGetPasteSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<GetPasteQuery, GetPasteQueryVariables>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<GetPasteQuery, GetPasteQueryVariables>(GetPasteDocument, options);
|
||||||
|
}
|
||||||
export type GetPasteQueryHookResult = ReturnType<typeof useGetPasteQuery>;
|
export type GetPasteQueryHookResult = ReturnType<typeof useGetPasteQuery>;
|
||||||
export type GetPasteLazyQueryHookResult = ReturnType<typeof useGetPasteLazyQuery>;
|
export type GetPasteLazyQueryHookResult = ReturnType<typeof useGetPasteLazyQuery>;
|
||||||
|
export type GetPasteSuspenseQueryHookResult = ReturnType<typeof useGetPasteSuspenseQuery>;
|
||||||
export type GetPasteQueryResult = Apollo.QueryResult<GetPasteQuery, GetPasteQueryVariables>;
|
export type GetPasteQueryResult = Apollo.QueryResult<GetPasteQuery, GetPasteQueryVariables>;
|
||||||
export const ShortenDocument = gql`
|
export const ShortenDocument = gql`
|
||||||
mutation Shorten($link: String!, $host: String) {
|
mutation Shorten($link: String!, $host: String) {
|
||||||
|
|
8173
pnpm-lock.yaml
8173
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue