diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 27dba4f82..8e74473b3 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -5,8 +5,8 @@ import './brewRenderer.less'; import React, { useState, useRef, useMemo, useEffect } from 'react'; import _ from 'lodash'; -import MarkdownLegacy from '../../../shared/markdownLegacy.js'; -import Markdown from '../../../shared/markdown.js'; +import MarkdownLegacy from '@shared/markdownLegacy.js'; +import Markdown from '@shared/markdown.js'; import ErrorBar from './errorBar/errorBar.jsx'; import ToolBar from './toolBar/toolBar.jsx'; @@ -15,7 +15,7 @@ import RenderWarnings from '../../components/renderWarnings/renderWarnings.jsx'; import NotificationPopup from './notificationPopup/notificationPopup.jsx'; import Frame from 'react-frame-component'; import dedent from 'dedent'; -import { printCurrentBrew } from '../../../shared/helpers.js'; +import { printCurrentBrew } from '@shared/helpers.js'; import HeaderNav from './headerNav/headerNav.jsx'; import safeHTML from './safeHTML.js'; diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index 612fccc85..5f4fc5608 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -1,7 +1,7 @@ import './notificationPopup.less'; import React, { useEffect, useState } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import Dialog from '../../../components/dialog.jsx'; diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 9707fe84f..7f55ebf08 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -4,7 +4,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import _ from 'lodash'; import dedent from 'dedent'; -import Markdown from '../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import CodeEditor from '../../components/codeEditor/codeEditor.jsx'; import SnippetBar from './snippetbar/snippetbar.jsx'; diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 1438a1946..304664ff5 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -7,7 +7,7 @@ import _ from 'lodash'; import cx from 'classnames'; import { loadHistory } from '../../utils/versionHistory.js'; -import { brewSnippetsToJSON } from '../../../../shared/helpers.js'; +import { brewSnippetsToJSON } from '@shared/helpers.js'; import Legacy5ePHB from '@themes/Legacy/5ePHB/snippets.js'; import V3_5ePHB from '@themes/V3/5ePHB/snippets.js'; diff --git a/client/homebrew/navbar/newbrew.navitem.jsx b/client/homebrew/navbar/newbrew.navitem.jsx index 4664d509b..ac72121f1 100644 --- a/client/homebrew/navbar/newbrew.navitem.jsx +++ b/client/homebrew/navbar/newbrew.navitem.jsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; import Nav from './nav.jsx'; -import { splitTextStyleAndMetadata } from '../../../shared/helpers.js'; +import { splitTextStyleAndMetadata } from '@shared/helpers.js'; const BREWKEY = 'HB_newPage_content'; const STYLEKEY = 'HB_newPage_style'; diff --git a/client/homebrew/navbar/print.navitem.jsx b/client/homebrew/navbar/print.navitem.jsx index e7a6ff053..ea262cf03 100644 --- a/client/homebrew/navbar/print.navitem.jsx +++ b/client/homebrew/navbar/print.navitem.jsx @@ -1,6 +1,6 @@ import React from 'react'; import Nav from './nav.jsx'; -import { printCurrentBrew } from '../../../shared/helpers.js'; +import { printCurrentBrew } from '@shared/helpers.js'; export default function(){ return diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 7857f507e..d40058557 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -4,11 +4,11 @@ import './editPage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js'; -import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '../../../../shared/helpers.js'; +import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js'; import SplitPane from '../../../components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; diff --git a/client/homebrew/pages/errorPage/errorPage.jsx b/client/homebrew/pages/errorPage/errorPage.jsx index ffbfc43bb..837775b97 100644 --- a/client/homebrew/pages/errorPage/errorPage.jsx +++ b/client/homebrew/pages/errorPage/errorPage.jsx @@ -1,7 +1,7 @@ import './errorPage.less'; import React from 'react'; import UIPage from '../basePages/uiPage/uiPage.jsx'; -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import ErrorIndex from './errors/errorIndex.js'; const ErrorPage = ({ brew })=>{ diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index 7d51eead5..030e05a04 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -4,11 +4,11 @@ import './homePage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; -import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '../../../../shared/helpers.js'; +import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js'; import SplitPane from '../../../components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index 501c761db..7f3247d04 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -4,11 +4,11 @@ import './newPage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; -import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '../../../../shared/helpers.js'; +import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js'; import SplitPane from '../../../components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 0c93d9d7f..093fc8965 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -13,7 +13,7 @@ import Account from '@navbar/account.navitem.jsx'; import BrewRenderer from '../../brewRenderer/brewRenderer.jsx'; import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js'; -import { printCurrentBrew, fetchThemeBundle } from '../../../../shared/helpers.js'; +import { printCurrentBrew, fetchThemeBundle } from '@shared/helpers.js'; const SharePage = (props)=>{ const { brew = DEFAULT_BREW_LOAD, disableMeta = false } = props; diff --git a/tests/markdown/basic.test.js b/tests/markdown/basic.test.js index f2405d0d8..f62963e83 100644 --- a/tests/markdown/basic.test.js +++ b/tests/markdown/basic.test.js @@ -1,6 +1,6 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; test('Processes the markdown within an HTML block if its just a class wrapper', function() { const source = '
*Bold text*
'; diff --git a/tests/markdown/definition-lists.test.js b/tests/markdown/definition-lists.test.js index 35ad12ef7..8592bee5a 100644 --- a/tests/markdown/definition-lists.test.js +++ b/tests/markdown/definition-lists.test.js @@ -1,6 +1,6 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; describe('Inline Definition Lists', ()=>{ test('No Term 1 Definition', function() { diff --git a/tests/markdown/emojis.test.js b/tests/markdown/emojis.test.js index 072de10f9..34a7bb4d2 100644 --- a/tests/markdown/emojis.test.js +++ b/tests/markdown/emojis.test.js @@ -1,4 +1,4 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; import dedent from 'dedent'; // Marked.js adds line returns after closing tags on some default tokens. diff --git a/tests/markdown/hard-breaks.test.js b/tests/markdown/hard-breaks.test.js index 1f48f8f1e..4f9643244 100644 --- a/tests/markdown/hard-breaks.test.js +++ b/tests/markdown/hard-breaks.test.js @@ -1,6 +1,6 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; describe('Hard Breaks', ()=>{ test('Single Break', function() { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index 95ca2f58d..b0b551ffc 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ import dedent from 'dedent'; -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; // Marked.js adds line returns after closing tags on some default tokens. // This removes those line returns for comparison sake. diff --git a/tests/markdown/non-breaking-spaces.test.js b/tests/markdown/non-breaking-spaces.test.js index 731d0546e..e47b6ec87 100644 --- a/tests/markdown/non-breaking-spaces.test.js +++ b/tests/markdown/non-breaking-spaces.test.js @@ -1,6 +1,6 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; describe('Non-Breaking Spaces Interactions', ()=>{ test('I am actually a single-line definition list!', function() { diff --git a/tests/markdown/paragraph-justification.test.js b/tests/markdown/paragraph-justification.test.js index 6ce454623..1fcf38730 100644 --- a/tests/markdown/paragraph-justification.test.js +++ b/tests/markdown/paragraph-justification.test.js @@ -1,6 +1,6 @@ -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; describe('Justification', ()=>{ test('Left Justify', function() { diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index 884553703..43a7ef477 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ import dedent from 'dedent'; -import Markdown from '../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; // Marked.js adds line returns after closing tags on some default tokens. // This removes those line returns for comparison sake. diff --git a/themes/V3/Blank/snippets/footer.gen.js b/themes/V3/Blank/snippets/footer.gen.js index c97cf4cb3..596592629 100644 --- a/themes/V3/Blank/snippets/footer.gen.js +++ b/themes/V3/Blank/snippets/footer.gen.js @@ -1,4 +1,4 @@ -import Markdown from '../../../../shared/markdown.js'; +import Markdown from '@shared/markdown.js'; export default { createFooterFunc : function(headerSize=1){ diff --git a/vite.config.js b/vite.config.js index 2710e1b74..6025f8736 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,9 +9,10 @@ export default defineConfig({ resolve: { alias: { "@vitreum": path.resolve(__dirname, "./vitreum"), + "@shared": path.resolve(__dirname, "./shared"), "@sharedStyles": path.resolve(__dirname, "./shared/naturalcrit/styles"), - "@navbar":path.resolve(__dirname, "./client/homebrew/navbar"), - "@themes":path.resolve(__dirname, "./themes"), + "@navbar": path.resolve(__dirname, "./client/homebrew/navbar"), + "@themes": path.resolve(__dirname, "./themes"), }, }, build: {