mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-20 03:55:54 +00:00
refactor: move logger into commons to use it in next.config.js
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
49ec70f2aa
commit
d675cc9ed9
45 changed files with 98 additions and 71 deletions
|
@ -1,26 +1,29 @@
|
|||
{
|
||||
"testRegex" : "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"testPathIgnorePatterns" : [
|
||||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
||||
"testPathIgnorePatterns": [
|
||||
"/dist/"
|
||||
],
|
||||
"moduleFileExtensions" : [
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js"
|
||||
],
|
||||
"extensionsToTreatAsEsm" : [
|
||||
"extensionsToTreatAsEsm": [
|
||||
".ts"
|
||||
],
|
||||
"moduleNameMapper" : {
|
||||
"^(\\.{1,2}/.*)\\.js$" : "$1"
|
||||
"moduleNameMapper": {
|
||||
"^(\\.{1,2}/.*)\\.js$": "$1"
|
||||
},
|
||||
"transformIgnorePatterns": ["<rootDir>/node_modules/"],
|
||||
"transform" : {
|
||||
"^.+\\.tsx?$" : [
|
||||
"testEnvironment": "jsdom",
|
||||
"transformIgnorePatterns": [
|
||||
"<rootDir>/node_modules/"
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": [
|
||||
"ts-jest",
|
||||
{
|
||||
"tsconfig" : "tsconfig.test.json",
|
||||
"useESM" : true
|
||||
"tsconfig": "tsconfig.test.json",
|
||||
"useESM": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
export * from './wait-for-other-promises-to-finish.js'
|
||||
export type { DeepPartial } from './deep-partial.js'
|
||||
export * from './test-modes.js'
|
||||
export * from './logger.js'
|
||||
|
|
|
@ -3,13 +3,22 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from './logger'
|
||||
import { Logger } from './logger.js'
|
||||
import { Settings } from 'luxon'
|
||||
import { Mock } from 'ts-mockery'
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
beforeEach,
|
||||
expect,
|
||||
it,
|
||||
afterEach
|
||||
} from '@jest/globals'
|
||||
import type { SpyInstance } from 'jest-mock'
|
||||
|
||||
let testMode = false
|
||||
let devMode = false
|
||||
jest.mock('@hedgedoc/commons', () => ({
|
||||
jest.mock('../utils/test-modes.js', () => ({
|
||||
get isTestMode() {
|
||||
return testMode
|
||||
},
|
||||
|
@ -22,11 +31,11 @@ describe('Logger', () => {
|
|||
let originalNow: () => number
|
||||
let dateShift = 0
|
||||
|
||||
let infoLogMock: jest.SpyInstance
|
||||
let warnLogMock: jest.SpyInstance
|
||||
let errorLogMock: jest.SpyInstance
|
||||
let debugLogMock: jest.SpyInstance
|
||||
let defaultLogMock: jest.SpyInstance
|
||||
let infoLogMock: SpyInstance
|
||||
let warnLogMock: SpyInstance
|
||||
let errorLogMock: SpyInstance
|
||||
let debugLogMock: SpyInstance
|
||||
let defaultLogMock: SpyInstance
|
||||
let isLocalStorageAccessDenied = false
|
||||
|
||||
const mockLocalStorage = () => {
|
||||
|
@ -63,7 +72,16 @@ describe('Logger', () => {
|
|||
defaultLogMock = jest.spyOn(console, 'log').mockReturnValue()
|
||||
|
||||
originalNow = Settings.now
|
||||
Settings.now = () => new Date(2021, 9, 25, dateShift, 1 + dateShift, 2 + dateShift, 3 + dateShift).valueOf()
|
||||
Settings.now = () =>
|
||||
new Date(
|
||||
2021,
|
||||
9,
|
||||
25,
|
||||
dateShift,
|
||||
1 + dateShift,
|
||||
2 + dateShift,
|
||||
3 + dateShift
|
||||
).valueOf()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { isDevMode, isTestMode } from '@hedgedoc/commons'
|
||||
import { isDevMode, isTestMode } from './test-modes.js'
|
||||
import { DateTime } from 'luxon'
|
||||
import pico from 'picocolors'
|
||||
|
||||
|
@ -16,7 +16,8 @@ export class Logger {
|
|||
|
||||
constructor(scope: string) {
|
||||
this.scope = scope
|
||||
this.debugLoggingEnabled = isDevMode || isTestMode || this.isDebugLoggingEnabled()
|
||||
this.debugLoggingEnabled =
|
||||
isDevMode || isTestMode || this.isDebugLoggingEnabled()
|
||||
}
|
||||
|
||||
private isDebugLoggingEnabled() {
|
||||
|
@ -75,7 +76,11 @@ export class Logger {
|
|||
if (typeof window === 'undefined') {
|
||||
return [pico.yellow(`[${timestamp}]`), pico.green(`(${this.scope})`)]
|
||||
} else {
|
||||
return [`%c[${timestamp}] %c(${this.scope})`, 'color: yellow', 'color: green']
|
||||
return [
|
||||
`%c[${timestamp}] %c(${this.scope})`,
|
||||
'color: yellow',
|
||||
'color: green'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,17 +3,19 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
const { isMockMode, isTestMode, isProfilingMode, isBuildTime } = require('@hedgedoc/commons')
|
||||
const { isMockMode, isTestMode, isProfilingMode, isBuildTime, Logger } = require('@hedgedoc/commons')
|
||||
const path = require('path')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
enabled: isProfilingMode
|
||||
})
|
||||
|
||||
console.log('Node environment is', process.env.NODE_ENV)
|
||||
const logger = new Logger('Bootstrap')
|
||||
|
||||
logger.info('Node environment is', process.env.NODE_ENV)
|
||||
|
||||
if (isTestMode) {
|
||||
console.warn(`This build runs in test mode. This means:
|
||||
logger.warn(`This build runs in test mode. This means:
|
||||
- No sandboxed iframe
|
||||
- Additional data-attributes for e2e tests added to DOM
|
||||
- Editor and renderer are running on the same origin
|
||||
|
@ -22,7 +24,7 @@ if (isTestMode) {
|
|||
}
|
||||
|
||||
if (isMockMode) {
|
||||
console.warn(`This build runs in mock mode. This means:
|
||||
logger.warn(`This build runs in mock mode. This means:
|
||||
- No real data. All API responses are mocked
|
||||
- No persistent data
|
||||
- No realtime editing
|
||||
|
@ -30,14 +32,14 @@ if (isMockMode) {
|
|||
}
|
||||
|
||||
if (isBuildTime) {
|
||||
console.warn(`This process runs in build mode. During build time this means:
|
||||
logger.warn(`This process runs in build mode. During build time this means:
|
||||
- Editor and Renderer base urls are https://example.org
|
||||
- No frontend config will be fetched
|
||||
`)
|
||||
}
|
||||
|
||||
if (isProfilingMode) {
|
||||
console.info('This build contains the bundle analyzer and profiling metrics.')
|
||||
logger.info('This build contains the bundle analyzer and profiling metrics.')
|
||||
}
|
||||
|
||||
/** @type {import('@svgr/webpack').LoaderOptions} */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { ApplicationLoaderError } from './application-loader-error'
|
||||
import { createSetUpTaskList } from './initializers'
|
||||
import { LoadingScreen } from './loading-screen/loading-screen'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { refreshHistoryState } from '../../../redux/history/methods'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { isDevMode, isTestMode } from '@hedgedoc/commons'
|
||||
import { fetchAndSetUser } from '../../login-page/auth/utils'
|
||||
import { loadDarkMode } from './load-dark-mode'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { DARK_MODE_LOCAL_STORAGE_KEY } from '../../../hooks/dark-mode/use-save-dark-mode-preference-to-local-storage'
|
||||
import { setDarkModePreference } from '../../../redux/dark-mode/methods'
|
||||
import { DarkModePreference } from '../../../redux/dark-mode/types'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
|
||||
const logger = new Logger('Dark mode initializer')
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { UiIcon } from '../../icons/ui-icon'
|
||||
import { ShowIf } from '../../show-if/show-if'
|
||||
import { CopyToClipboardButton } from '../copy-to-clipboard-button/copy-to-clipboard-button'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { ShowIf } from '../../show-if/show-if'
|
||||
import type { ReactElement, RefObject } from 'react'
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { HLJSApi } from 'highlight.js'
|
||||
import { useAsync } from 'react-use'
|
||||
import type { AsyncState } from 'react-use/lib/useAsyncFn'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import { ApiError } from '../../../api/common/api-error'
|
||||
import { ErrorToI18nKeyMapper } from '../../../api/common/error-to-i18n-key-mapper'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { LoadingScreen } from '../../application-loader/loading-screen/loading-screen'
|
||||
import { CommonErrorPage } from '../../error-pages/common-error-page'
|
||||
import { CustomAsyncLoadingBoundary } from '../async-loading-boundary/custom-async-loading-boundary'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { ORIGIN, useBaseUrl } from '../../../../hooks/common/use-base-url'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { useEditorToRendererCommunicator } from '../../../editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
||||
import type { RefObject } from 'react'
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import { concatCssClasses } from '../../../utils/concat-css-classes'
|
||||
import { cypressAttribute, cypressId } from '../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { isTestMode } from '@hedgedoc/commons'
|
||||
import { useEditorToRendererCommunicator } from '../../editor-page/render-context/editor-to-renderer-communicator-context-provider'
|
||||
import type { ScrollProps } from '../../editor-page/synced-scroll/scroll-props'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import type { PropsWithDataCypressId } from '../../utils/cypress-attribute'
|
||||
import { cypressId } from '../../utils/cypress-attribute'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { MutableRefObject } from 'react'
|
||||
import React, { useCallback, useEffect, useRef } from 'react'
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { getGlobalState } from '../../../../../redux'
|
||||
import { Logger } from '../../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { useEditorReceiveHandler } from '../../../../render-page/window-post-message-communicator/hooks/use-editor-receive-handler'
|
||||
import type { ImageUploadMessage } from '../../../../render-page/window-post-message-communicator/rendering-message'
|
||||
import { CommunicationMessageType } from '../../../../render-page/window-post-message-communicator/rendering-message'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { useCodemirrorReferenceContext } from '../../change-content-context/codemirror-reference-context'
|
||||
import type { ScrollState } from '../../synced-scroll/scroll-props'
|
||||
import { EditorView } from '@codemirror/view'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { setRealtimeSyncedState } from '../../../../../redux/realtime/methods'
|
||||
import { Logger } from '../../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { MessageTransporter, RealtimeDoc } from '@hedgedoc/commons'
|
||||
import { YDocSyncClientAdapter } from '@hedgedoc/commons'
|
||||
import type { Listener } from 'eventemitter2'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { cypressId } from '../../../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { ShowIf } from '../../../../common/show-if/show-if'
|
||||
import { acceptedMimeTypes } from '../../../../common/upload-image-mimetypes'
|
||||
import { UploadInput } from '../../../../common/upload-input'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { useApplicationState } from '../../../hooks/common/use-application-state'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { ScrollSource } from '../editor-page-content'
|
||||
import type { ScrollState } from '../synced-scroll/scroll-props'
|
||||
import type { RefObject } from 'react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { ScrollSource } from '../editor-page-content'
|
||||
import type { MutableRefObject } from 'react'
|
||||
import { useCallback } from 'react'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { defaultConfig } from '../../../api/common/default-config'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
|
||||
export const MOTD_LOCAL_STORAGE_KEY = 'motd.lastModified'
|
||||
const log = new Logger('Motd')
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { testId } from '../../../utils/test-id'
|
||||
import { CommonModal } from '../../common/modals/common-modal'
|
||||
import { RendererIframe } from '../../common/renderer-iframe/renderer-iframe'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { testId } from '../../../../utils/test-id'
|
||||
import { availableLanguages } from './available-languages'
|
||||
import { LanguageOption } from './language-option'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { AsyncLoadingBoundary } from '../common/async-loading-boundary/async-loading-boundary'
|
||||
import { RendererIframe } from '../common/renderer-iframe/renderer-iframe'
|
||||
import { RendererType } from '../render-page/window-post-message-communicator/rendering-message'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import type { AuthProvider } from '../../../../api/config/types'
|
||||
import { AuthProviderType } from '../../../../api/config/types'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { IconGitlab } from '../../../common/icons/additional/icon-gitlab'
|
||||
import styles from '../via-one-click.module.scss'
|
||||
import type { Icon } from 'react-bootstrap-icons'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { getProxiedUrl } from '../../../../api/media'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { useFrontendConfig } from '../../../common/frontend-config-context/use-frontend-config'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { TravelerNodeProcessor } from '../../node-preprocessors/traveler-node-processor'
|
||||
import type { DataNode, Element, Node } from 'domhandler'
|
||||
import { isComment, isTag } from 'domhandler'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { SlideOptions } from '@hedgedoc/commons'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import type Reveal from 'reveal.js'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import type { PropsWithDataCypressId } from '../../../../utils/cypress-attribute'
|
||||
import { cypressId } from '../../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { ShowIf } from '../../../common/show-if/show-if'
|
||||
import { ProxyImageFrame } from '../../extensions/image/proxy-image-frame'
|
||||
import styles from './click-shield.module.scss'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type { DispatchOptions, UiNotification } from './types'
|
||||
import { UiNotifications } from './ui-notifications'
|
||||
import type { TOptions } from 'i18next'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { cypressId } from '../../utils/cypress-attribute'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { UiIcon } from '../common/icons/ui-icon'
|
||||
import { ShowIf } from '../common/show-if/show-if'
|
||||
import styles from './notifications.module.scss'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type {
|
||||
CommunicationMessages,
|
||||
EditorToRendererMessageType,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import type {
|
||||
CommunicationMessages,
|
||||
EditorToRendererMessageType,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { Logger } from '../../../utils/logger'
|
||||
import type { Logger } from '@hedgedoc/commons'
|
||||
import { Optional } from '@mrdrogdrog/optional'
|
||||
import { EventEmitter2 } from 'eventemitter2'
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import { useRendererToEditorCommunicator } from '../../../../components/editor-page/render-context/renderer-to-editor-communicator-context-provider'
|
||||
import { CommunicationMessageType } from '../../../../components/render-page/window-post-message-communicator/rendering-message'
|
||||
import { Logger } from '../../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { FileContentFormat, readFile } from '../../../../utils/read-file'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { WaitSpinner } from '../../../components/common/wait-spinner/wait-spinne
|
|||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { useEffectWithCatch } from '../../../hooks/common/use-effect-with-catch'
|
||||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import styles from './abc.module.scss'
|
||||
import React, { useRef } from 'react'
|
||||
import { useAsync } from 'react-use'
|
||||
|
|
|
@ -8,7 +8,7 @@ import { AsyncLoadingBoundary } from '../../../components/common/async-loading-b
|
|||
import { ShowIf } from '../../../components/common/show-if/show-if'
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { useDarkModeState } from '../../../hooks/dark-mode/use-dark-mode-state'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { testId } from '../../../utils/test-id'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
|
|
@ -7,7 +7,7 @@ import { AsyncLoadingBoundary } from '../../../components/common/async-loading-b
|
|||
import { ShowIf } from '../../../components/common/show-if/show-if'
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useAsync } from 'react-use'
|
||||
import { ApplicationErrorAlert } from '../../../components/common/application-error-alert/application-error-alert'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { ShowIf } from '../../../components/common/show-if/show-if'
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { cypressId } from '../../../utils/cypress-attribute'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import styles from './mermaid.module.scss'
|
||||
import React, { Fragment, useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { AsyncLoadingBoundary } from '../../../components/common/async-loading-boundary/async-loading-boundary'
|
||||
import { ShowIf } from '../../../components/common/show-if/show-if'
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { Logger } from '../../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import React, { useEffect, useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useAsync } from 'react-use'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { DarkModePreference } from '../../redux/dark-mode/types'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { useApplicationState } from '../common/use-application-state'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import type { EditorConfig, EditorConfigActions } from './types'
|
||||
import { EditorConfigActionType } from './types'
|
||||
import type { Reducer } from 'redux'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
|
||||
const logger = new Logger('EditorConfig Local Storage')
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { addRemoteOriginToHistoryEntry, historyEntryToHistoryEntryPutDto } from
|
|||
import type { HistoryEntry, HistoryEntryWithOrigin } from '../../api/history/types'
|
||||
import { HistoryEntryOrigin } from '../../api/history/types'
|
||||
import { download } from '../../components/common/download/download'
|
||||
import { Logger } from '../../utils/logger'
|
||||
import { Logger } from '@hedgedoc/commons'
|
||||
import { getGlobalState, store } from '../index'
|
||||
import type { HistoryExportJson, RemoveEntryAction, SetEntriesAction, UpdateEntryAction, V1HistoryEntry } from './types'
|
||||
import { HistoryActionType } from './types'
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { BaseUrls } from '../components/common/base-url/base-url-context-provider'
|
||||
import { Logger } from './logger'
|
||||
import { isTestMode, isBuildTime } from '@hedgedoc/commons'
|
||||
import { NoSubdirectoryAllowedError, parseUrl } from '@hedgedoc/commons'
|
||||
import { NoSubdirectoryAllowedError, parseUrl, Logger, isTestMode, isBuildTime } from '@hedgedoc/commons'
|
||||
import { Optional } from '@mrdrogdrog/optional'
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue