mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Merge branch 'yarn_workspaces_turbo' into upgrade_esbuild
This commit is contained in:
commit
26a9ed2b67
5
.github/workflows/test_database.yml
vendored
5
.github/workflows/test_database.yml
vendored
@ -42,6 +42,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18.20.7'
|
||||
|
||||
- name: Database | docker-compose
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mariadb
|
||||
|
||||
|
||||
5
.github/workflows/test_e2e.yml
vendored
5
.github/workflows/test_e2e.yml
vendored
@ -9,6 +9,11 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Node.js version
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18.20.7'
|
||||
|
||||
- name: install bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
2
backend/@types/random-bigint/index.d.ts
vendored
2
backend/@types/random-bigint/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
|
||||
declare module 'random-bigint' {
|
||||
function random(bits: number, cb?: (err: Error, num: BigInt) => void): BigInt
|
||||
export = random
|
||||
|
||||
2
backend/@types/sodium-native/index.d.ts
vendored
2
backend/@types/sodium-native/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
|
||||
export * from '@/node_modules/@types/sodium-native'
|
||||
|
||||
declare module 'sodium-native' {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
// eslint-disable-next-line import/no-commonjs, import/unambiguous
|
||||
module.exports = {
|
||||
verbose: true,
|
||||
preset: 'ts-jest',
|
||||
@ -25,22 +24,18 @@ module.exports = {
|
||||
'@typeorm/(.*)': '<rootDir>/src/typeorm/$1',
|
||||
'@test/(.*)': '<rootDir>/test/$1',
|
||||
'@entity/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../database/entity/$1'
|
||||
: '<rootDir>/../database/build/entity/$1',
|
||||
'@logging/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../database/logging/$1'
|
||||
: '<rootDir>/../database/build/logging/$1',
|
||||
'@dbTools/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../database/src/$1'
|
||||
: '<rootDir>/../database/build/src/$1',
|
||||
'@config/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../config/src/$1'
|
||||
: '<rootDir>/../config/build/$1',
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { User } from 'database'
|
||||
|
||||
import { convertGradidoLanguageToHumhub } from '@/apis/humhub/convertLanguage'
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
|
||||
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { validate } from 'config-schema'
|
||||
import { latestDbVersion } from 'database'
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
@ -4,13 +4,11 @@ import { LogError } from './LogError'
|
||||
|
||||
describe('LogError', () => {
|
||||
it('logs an Error when created', () => {
|
||||
/* eslint-disable-next-line no-new */
|
||||
new LogError('new LogError')
|
||||
expect(logger.error).toBeCalledWith('new LogError')
|
||||
})
|
||||
|
||||
it('logs an Error including additional data when created', () => {
|
||||
/* eslint-disable-next-line no-new */
|
||||
new LogError('new LogError', { some: 'data' })
|
||||
expect(logger.error).toBeCalledWith('new LogError', { some: 'data' })
|
||||
})
|
||||
@ -18,7 +16,6 @@ describe('LogError', () => {
|
||||
it('does not contain additional data in Error object when thrown', () => {
|
||||
try {
|
||||
throw new LogError('new LogError', { someWeirdValue123: 'arbitraryData456' })
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
} catch (e: any) {
|
||||
expect(e.stack).not.toMatch(/(someWeirdValue123|arbitraryData456)/i)
|
||||
}
|
||||
|
||||
@ -1,9 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
|
||||
import { Decimal } from 'decimal.js-light'
|
||||
|
||||
expect.extend({
|
||||
@ -28,7 +22,6 @@ interface CustomMatchers<R = unknown> {
|
||||
}
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace jest {
|
||||
interface Expect extends CustomMatchers {}
|
||||
interface Matchers<R> extends CustomMatchers<R> {}
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
|
||||
import { createTestClient } from 'apollo-server-testing'
|
||||
import { entities } from 'database'
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// eslint-disable-next-line import/no-unassigned-import
|
||||
import 'openai/shims/node'
|
||||
import { CONFIG } from '@/config'
|
||||
import { i18n } from '@/server/localization'
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
"scripts": {
|
||||
"build": "tsx ./esbuild.config.ts",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "biome check --error-on-warnings .",
|
||||
"lint:fix": "biome check --error-on-warnings . --write",
|
||||
"clear": "cross-env TZ=UTC tsx src/index.ts clear",
|
||||
"up": "cross-env TZ=UTC tsx src/index.ts up",
|
||||
"down": "cross-env TZ=UTC tsx src/index.ts down",
|
||||
"reset": "cross-env TZ=UTC tsx src/index.ts reset",
|
||||
"clear": "cross-env TZ=UTC tsx src/index.ts clear",
|
||||
"lint": "biome check --error-on-warnings .",
|
||||
"lint:fix": "biome check --error-on-warnings . --write",
|
||||
"up:backend_test": "cross-env TZ=UTC DB_DATABASE=gradido_test_backend tsx src/index.ts up",
|
||||
"up:federation_test": "cross-env TZ=UTC DB_DATABASE=gradido_test_federation tsx src/index.ts up",
|
||||
"up:dht_test": "cross-env TZ=UTC DB_DATABASE=gradido_test_dht tsx src/index.ts up"
|
||||
|
||||
@ -41,6 +41,16 @@ async function convertJsToTsInMigrations(connection: Connection): Promise<number
|
||||
return result.affectedRows
|
||||
}
|
||||
|
||||
async function convertJsToTsInMigrations(connection: Connection): Promise<number> {
|
||||
const [result] = await connection.query<ResultSetHeader>(`
|
||||
UPDATE ${CONFIG.MIGRATIONS_TABLE}
|
||||
SET fileName = REPLACE(fileName, '.js', '.ts')
|
||||
WHERE fileName LIKE '%.js'
|
||||
`)
|
||||
|
||||
return result.affectedRows
|
||||
}
|
||||
|
||||
export const getDatabaseState = async (): Promise<DatabaseState> => {
|
||||
const connection = await connectToDatabaseServer()
|
||||
if (!connection) {
|
||||
|
||||
@ -14,13 +14,16 @@
|
||||
"cache": false
|
||||
},
|
||||
"up": {
|
||||
"cache": false
|
||||
"cache": false,
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
"down": {
|
||||
"cache": false
|
||||
"cache": false,
|
||||
"dependsOn": ["build"]
|
||||
},
|
||||
"reset": {
|
||||
"cache": false
|
||||
"cache": false,
|
||||
"dependsOn": ["build"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
// eslint-disable-next-line import/no-commonjs, import/unambiguous
|
||||
module.exports = {
|
||||
verbose: true,
|
||||
preset: 'ts-jest',
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
/* eslint-disable n/no-process-env */
|
||||
import { validate } from 'config-schema'
|
||||
import { latestDbVersion } from 'database'
|
||||
import dotenv from 'dotenv'
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import DHT from '@hyperswarm/dht'
|
||||
import { Community as DbCommunity, FederatedCommunity as DbFederatedCommunity } from 'database'
|
||||
import { validate as validateUUID, version as versionUUID } from 'uuid'
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
import DHT from '@hyperswarm/dht'
|
||||
import {
|
||||
CommunityLoggingView,
|
||||
|
||||
@ -25,7 +25,6 @@ module.exports = {
|
||||
? '<rootDir>/../database/entity/$1'
|
||||
: '<rootDir>/../database/build/entity/$1',
|
||||
'@logging/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../database/logging/$1'
|
||||
: '<rootDir>/../database/build/logging/$1',
|
||||
@ -34,7 +33,6 @@ module.exports = {
|
||||
? '<rootDir>/../database/src/$1'
|
||||
: '<rootDir>/../database/build/src/$1',
|
||||
'@config/(.*)':
|
||||
// eslint-disable-next-line n/no-process-env
|
||||
process.env.NODE_ENV === 'development'
|
||||
? '<rootDir>/../config/src/$1'
|
||||
: '<rootDir>/../config/build/$1',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user