Skip to content

Commit

Permalink
Merge branch 'master' into fixContentNegotiationTestFail-#3904
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ambatte authored Nov 24, 2024
2 parents 108d368 + 66f7197 commit 7a76c67
Show file tree
Hide file tree
Showing 50 changed files with 318 additions and 304 deletions.
10 changes: 10 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime",
"babel-plugin-transform-import-meta"
]
}
2 changes: 1 addition & 1 deletion client/homebrew/brewRenderer/brewRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { useState, useRef, useCallback, useMemo } = React;
const _ = require('lodash');

const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
const Markdown = require('naturalcrit/markdown.js');
import Markdown from 'naturalcrit/markdown.js';
const ErrorBar = require('./errorBar/errorBar.jsx');
const ToolBar = require('./toolBar/toolBar.jsx');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('./notificationPopup.less');
import React, { useEffect, useState } from 'react';
const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';

import Dialog from '../../../components/dialog.jsx';

Expand Down
2 changes: 1 addition & 1 deletion client/homebrew/editor/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const dedent = require('dedent-tabs').default;
const Markdown = require('../../../shared/naturalcrit/markdown.js');
import Markdown from '../../../shared/naturalcrit/markdown.js';

const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx');
const SnippetBar = require('./snippetbar/snippetbar.jsx');
Expand Down
2 changes: 1 addition & 1 deletion client/homebrew/editor/metadataEditor/metadataEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('./metadataEditor.less');
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';
const Nav = require('naturalcrit/nav/nav.jsx');
const Combobox = require('client/components/combobox.jsx');
const TagInput = require('../tagInput/tagInput.jsx');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('./brewItem.less');
const React = require('react');
const createClass = require('create-react-class');
const moment = require('moment');
const request = require('../../../../utils/request-middleware.js');
import request from '../../../../utils/request-middleware.js';

const googleDriveIcon = require('../../../../googleDrive.svg');
const homebreweryIcon = require('../../../../thumbnail.png');
Expand Down
4 changes: 2 additions & 2 deletions client/homebrew/pages/editPage/editPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const React = require('react');
const _ = require('lodash');
const createClass = require('create-react-class');

const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';
const { Meta } = require('vitreum/headtags');

const Nav = require('naturalcrit/nav/nav.jsx');
Expand All @@ -23,7 +23,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');

const LockNotification = require('./lockNotification/lockNotification.jsx');

const Markdown = require('naturalcrit/markdown.js');
import Markdown from 'naturalcrit/markdown.js';

const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js');
const { printCurrentBrew, fetchThemeBundle } = require('../../../../shared/helpers.js');
Expand Down
2 changes: 1 addition & 1 deletion client/homebrew/pages/errorPage/errorPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('./errorPage.less');
const React = require('react');
const UIPage = require('../basePages/uiPage/uiPage.jsx');
const Markdown = require('../../../../shared/naturalcrit/markdown.js');
import Markdown from '../../../../shared/naturalcrit/markdown.js';
const ErrorIndex = require('./errors/errorIndex.js');

const ErrorPage = ({ brew })=>{
Expand Down
2 changes: 1 addition & 1 deletion client/homebrew/pages/homePage/homePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('./homePage.less');
const React = require('react');
const createClass = require('create-react-class');
const cx = require('classnames');
const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';
const { Meta } = require('vitreum/headtags');

const Nav = require('naturalcrit/nav/nav.jsx');
Expand Down
4 changes: 2 additions & 2 deletions client/homebrew/pages/newPage/newPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
require('./newPage.less');
const React = require('react');
const createClass = require('create-react-class');
const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';

const Markdown = require('naturalcrit/markdown.js');
import Markdown from 'naturalcrit/markdown.js';

const Nav = require('naturalcrit/nav/nav.jsx');
const PrintNavItem = require('../../navbar/print.navitem.jsx');
Expand Down
2 changes: 1 addition & 1 deletion client/homebrew/pages/vaultPage/vaultPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BrewItem = require('../basePages/listPage/brewItem/brewItem.jsx');
const SplitPane = require('../../../../shared/naturalcrit/splitPane/splitPane.jsx');
const ErrorIndex = require('../errorPage/errors/errorIndex.js');

const request = require('../../utils/request-middleware.js');
import request from '../../utils/request-middleware.js';

const VaultPage = (props)=>{
const [pageState, setPageState] = useState(parseInt(props.query.page) || 1);
Expand Down
4 changes: 2 additions & 2 deletions client/homebrew/utils/request-middleware.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const request = require('superagent');
import request from 'superagent';

const addHeader = (request)=>request.set('Homebrewery-Version', global.version);

Expand All @@ -9,4 +9,4 @@ const requestMiddleware = {
delete : (path)=>addHeader(request.delete(path)),
};

module.exports = requestMiddleware;
export default requestMiddleware;
6 changes: 4 additions & 2 deletions client/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const template = async function(name, title='', props = {}){
});
const ogMetaTags = ogTags.join('\n');

const ssrModule = await import(`../build/${name}/ssr.cjs`);

return `<!DOCTYPE html>
<html>
<head>
Expand All @@ -21,12 +23,12 @@ const template = async function(name, title='', props = {}){
<title>${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}</title>
</head>
<body>
<main id="reactRoot">${require(`../build/${name}/ssr.js`)(props)}</main>
<main id="reactRoot">${ssrModule.default(props)}</main>
<script src=${`/${name}/bundle.js`}></script>
<script>start_app(${JSON.stringify(props)})</script>
</body>
</html>
`;
};

module.exports = template;
export default template;
Loading

0 comments on commit 7a76c67

Please sign in to comment.