diff --git a/client/homebrew/navbar/print.navitem.jsx b/client/homebrew/navbar/print.navitem.jsx
index e669214b3..ff2d75d67 100644
--- a/client/homebrew/navbar/print.navitem.jsx
+++ b/client/homebrew/navbar/print.navitem.jsx
@@ -12,7 +12,7 @@ export default function(){
return ()=>{
document.removeEventListener('print:startprep', handlePrintStartPrep);
document.removeEventListener('print:finishedprep', handlePrintPrepFinished);
- }
+ };
}, []);
const handlePrintStartPrep = ()=>{ setPrinting(true); };
diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx
index dbf3ac9cb..990403d6c 100644
--- a/client/homebrew/pages/editPage/editPage.jsx
+++ b/client/homebrew/pages/editPage/editPage.jsx
@@ -9,7 +9,7 @@ import _ from 'lodash';
import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js';
-import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
+import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
import SplitPane from '@components/splitPane/splitPane.jsx';
import Editor from '../../editor/editor.jsx';
@@ -163,7 +163,7 @@ const EditPage = (props)=>{
{alertOwnershipToTransfer && (
- You must be the Owner to transfer between the Homebrewery and Google Drive!
+ You must be the Owner to transfer between the Homebrewery and Google Drive!
The owner of this file is {currentBrew.authors[0]}.
Okay
diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx
index 1d35ef0e1..af4c4cbf5 100644
--- a/client/homebrew/pages/homePage/homePage.jsx
+++ b/client/homebrew/pages/homePage/homePage.jsx
@@ -9,7 +9,7 @@ import _ from 'lodash';
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
-import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
+import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
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 edf4d2125..b7f8fb7cd 100644
--- a/client/homebrew/pages/newPage/newPage.jsx
+++ b/client/homebrew/pages/newPage/newPage.jsx
@@ -1,4 +1,4 @@
-/* eslint-disable max-lines */
+
import './newPage.less';
// Common imports
@@ -10,7 +10,7 @@ import _ from 'lodash';
import { DEFAULT_BREW } from '../../../../server/brewDefaults.js';
import { printCurrentBrew, fetchThemeBundle, splitTextStyleAndMetadata } from '@shared/helpers.js';
-import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx'
+import useCommonEditPageFunctions from '../../utils/commonEditPageFunctions.jsx';
import SplitPane from '@components/splitPane/splitPane.jsx';
import Editor from '../../editor/editor.jsx';
diff --git a/client/homebrew/utils/commonEditPageFunctions.jsx b/client/homebrew/utils/commonEditPageFunctions.jsx
index c8ecbaa0c..b4d3022b4 100644
--- a/client/homebrew/utils/commonEditPageFunctions.jsx
+++ b/client/homebrew/utils/commonEditPageFunctions.jsx
@@ -30,11 +30,11 @@ export default function useCommonEditPageFunctions(dependencies) {
save,
} = dependencies;
- const [isSaving , setIsSaving] = useState(false);
- const [lastSavedTime , setLastSavedTime] = useState(new Date());
- const [autoSaveEnabled , setAutoSaveEnabled] = useState(!sandbox);
+ const [isSaving, setIsSaving] = useState(false);
+ const [lastSavedTime, setLastSavedTime] = useState(new Date());
+ const [autoSaveEnabled, setAutoSaveEnabled] = useState(!sandbox);
const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true);
- const [unsavedChanges , setUnsavedChanges] = useState(false);
+ const [unsavedChanges, setUnsavedChanges] = useState(false);
const unsavedChangesRef = useRef(unsavedChanges); // onBeforeUnload lives outside React and needs ref to unsavedChanges
const warnUnsavedTimeout = useRef(null); // timers live outside React and need ref to consistently track time
@@ -105,7 +105,7 @@ export default function useCommonEditPageFunctions(dependencies) {
if(field == 'metadata') localStorage.setItem(METAKEY, JSON.stringify({
renderer : value.renderer,
theme : value.theme,
- lang : value.lang
+ lang : value.lang
}));
}
};
@@ -155,7 +155,7 @@ export default function useCommonEditPageFunctions(dependencies) {
return
Reminder...
- {text}
+ {text}
;
}
@@ -180,5 +180,5 @@ export default function useCommonEditPageFunctions(dependencies) {
renderSaveButton,
autoSaveEnabled,
unsavedChanges,
- }
+ };
}
\ No newline at end of file
diff --git a/server/admin.api.js b/server/admin.api.js
index 1b6e5328d..f741d8b9a 100644
--- a/server/admin.api.js
+++ b/server/admin.api.js
@@ -37,14 +37,14 @@ export default function createAdminApi(vite) {
throw { HBErrorCode: '52', code: 401, message: 'Access denied' };
}
};
-
+
// Search for up to 300 brews that have not been viewed or updated in 30 days and are shorter than 140 bytes
const junkBrewsPipeline = [
{ $match : {
updatedAt : { $lt: Moment().subtract(30, 'days').toDate() },
lastViewed : { $lt: Moment().subtract(30, 'days').toDate() }
} },
- { $project: { _id: 1, textBinSize: { $binarySize: '$textBin' }, updatedAt: 1, lastViewed: 1} },
+ { $project: { _id: 1, textBinSize: { $binarySize: '$textBin' }, updatedAt: 1, lastViewed: 1 } },
{ $match: { textBinSize: { $lt: 140 } } },
{ $limit: 300 }
];
@@ -52,14 +52,14 @@ export default function createAdminApi(vite) {
// Search for up to 500 unauthored brews that have not been viewed or updated in two years
const lostBrewsPipeline = [
{
- $match: {
- authors: [],
- updatedAt: { $lt: Moment().subtract(2, 'years').toDate() },
- lastViewed: { $lt: Moment().subtract(2, 'years').toDate() }
+ $match : {
+ authors : [],
+ updatedAt : { $lt: Moment().subtract(2, 'years').toDate() },
+ lastViewed : { $lt: Moment().subtract(2, 'years').toDate() }
}
},
{
- $limit: 500
+ $limit : 500
}
];
@@ -70,7 +70,7 @@ export default function createAdminApi(vite) {
router.get('/admin/cleanupJunk', mw.adminOnly, (req, res)=>{
HomebrewModel.aggregate(junkBrewsPipeline).option({ maxTimeMS: 60000 })
- .then((objs)=>res.json({ count: objs.length, brewCollection : objs }))
+ .then((objs)=>res.json({ count: objs.length, brewCollection: objs }))
.catch((error)=>{
console.error(error);
res.status(500).json({ error: 'Internal Server Error' });
@@ -93,7 +93,7 @@ export default function createAdminApi(vite) {
router.get('/admin/cleanupLost', mw.adminOnly, (req, res)=>{
HomebrewModel.aggregate(lostBrewsPipeline).option({ maxTimeMS: 60000 })
- .then((objs)=>res.json({ count: objs.length, brewCollection : objs }))
+ .then((objs)=>res.json({ count: objs.length, brewCollection: objs }))
.catch((error)=>{
console.error(error);
res.status(500).json({ error: 'Internal Server Error' });
diff --git a/server/app.js b/server/app.js
index cff01dcff..7caa7f308 100644
--- a/server/app.js
+++ b/server/app.js
@@ -137,7 +137,7 @@ export default async function createApp(vite) {
return res.sendFile(`robots.txt`, { root: process.cwd() });
});
//serve brew for sharepage rerender
- app.get('/api/fetch/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, res) => {
+ app.get('/api/fetch/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, res)=>{
const { brew } = req;
brew.authors.includes(req.account?.username)
? sanitizeBrew(brew, 'shareAuthor')
@@ -285,9 +285,9 @@ export default async function createApp(vite) {
'',
`\n`
+ `\n`
- + ogMetaTags
+ + `window.__INITIAL_PROPS__ = ${safeProps
+ }\n${
+ ogMetaTags}`
);
return html;
diff --git a/server/homebrew.api.spec.js b/server/homebrew.api.spec.js
index 0e09cc044..8bda5407b 100644
--- a/server/homebrew.api.spec.js
+++ b/server/homebrew.api.spec.js
@@ -360,25 +360,25 @@ describe('Tests for api', ()=>{
trashed : false,
updatedAt : undefined,
views : 0,
- bleedSize: {
- top: '.125in',
- bottom: '.125in',
- inner: '.125in',
- outer: '.125in',
+ bleedSize : {
+ top : '.125in',
+ bottom : '.125in',
+ inner : '.125in',
+ outer : '.125in',
},
- columns: '2',
- columnGutter: '.125in',
- legalAuthors: '',
- license: 'None',
- safetySpace: {
- top: '.25in',
- bottom: '.25in',
- outer: '.25in',
- inner: '.5in',
+ columns : '2',
+ columnGutter : '.125in',
+ legalAuthors : '',
+ license : 'None',
+ safetySpace : {
+ top : '.25in',
+ bottom : '.25in',
+ outer : '.25in',
+ inner : '.5in',
},
- trimSize: {
- width: '8.5in',
- height: '11in',
+ trimSize : {
+ width : '8.5in',
+ height : '11in',
},
});
expect(next).toHaveBeenCalled();
@@ -471,25 +471,25 @@ describe('Tests for api', ()=>{
renderer : 'v3',
theme : 'phb',
googleId : '12345',
- bleedSize: {
- top: '.125in',
- bottom: '.125in',
- inner: '.125in',
- outer: '.125in',
+ bleedSize : {
+ top : '.125in',
+ bottom : '.125in',
+ inner : '.125in',
+ outer : '.125in',
},
- columns: '2',
- columnGutter: '.125in',
- legalAuthors: '',
- license: 'None',
- safetySpace: {
- top: '.25in',
- bottom: '.25in',
- outer: '.25in',
- inner: '.5in',
+ columns : '2',
+ columnGutter : '.125in',
+ legalAuthors : '',
+ license : 'None',
+ safetySpace : {
+ top : '.25in',
+ bottom : '.25in',
+ outer : '.25in',
+ inner : '.5in',
},
- trimSize: {
- width: '8.5in',
- height: '11in',
+ trimSize : {
+ width : '8.5in',
+ height : '11in',
},
});
@@ -534,25 +534,25 @@ brew`);
renderer : 'v3',
theme : 'phb',
googleId : '12345',
- bleedSize: {
- top: '.125in',
- bottom: '.125in',
- inner: '.125in',
- outer: '.125in',
+ bleedSize : {
+ top : '.125in',
+ bottom : '.125in',
+ inner : '.125in',
+ outer : '.125in',
},
- columns: '2',
- columnGutter: '.125in',
- legalAuthors: '',
- license: 'None',
- safetySpace: {
- top: '.25in',
- bottom: '.25in',
- outer: '.25in',
- inner: '.5in',
+ columns : '2',
+ columnGutter : '.125in',
+ legalAuthors : '',
+ license : 'None',
+ safetySpace : {
+ top : '.25in',
+ bottom : '.25in',
+ outer : '.25in',
+ inner : '.5in',
},
- trimSize: {
- width: '8.5in',
- height: '11in',
+ trimSize : {
+ width : '8.5in',
+ height : '11in',
},
});
@@ -687,16 +687,16 @@ brew`);
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith({
- _id : '1',
- authors : ['test user'],
- createdAt : undefined,
- description : '',
- editId : expect.any(String),
- gDrive : false,
- pageCount : 1,
- published : false,
- renderer : 'V3',
- lang : 'en',
+ _id : '1',
+ authors : ['test user'],
+ createdAt : undefined,
+ description : '',
+ editId : expect.any(String),
+ gDrive : false,
+ pageCount : 1,
+ published : false,
+ renderer : 'V3',
+ lang : 'en',
shareId : expect.any(String),
style : undefined,
tags : [],
@@ -708,25 +708,25 @@ brew`);
trashed : false,
updatedAt : undefined,
views : 0,
- bleedSize: {
- top: '.125in',
- bottom: '.125in',
- inner: '.125in',
- outer: '.125in',
+ bleedSize : {
+ top : '.125in',
+ bottom : '.125in',
+ inner : '.125in',
+ outer : '.125in',
},
- columns: '2',
- columnGutter: '.125in',
- legalAuthors: '',
- license: 'None',
- safetySpace: {
- top: '.25in',
- bottom: '.25in',
- outer: '.25in',
- inner: '.5in',
+ columns : '2',
+ columnGutter : '.125in',
+ legalAuthors : '',
+ license : 'None',
+ safetySpace : {
+ top : '.25in',
+ bottom : '.25in',
+ outer : '.25in',
+ inner : '.5in',
},
- trimSize: {
- width: '8.5in',
- height: '11in',
+ trimSize : {
+ width : '8.5in',
+ height : '11in',
},
});
});
@@ -765,16 +765,16 @@ brew`);
expect(google.newGoogleBrew).toHaveBeenCalled();
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith({
- _id : '1',
- authors : ['test user'],
- bleedSize: {
- top: '.125in',
- bottom: '.125in',
- inner: '.125in',
- outer: '.125in',
+ _id : '1',
+ authors : ['test user'],
+ bleedSize : {
+ top : '.125in',
+ bottom : '.125in',
+ inner : '.125in',
+ outer : '.125in',
},
- columns: '2',
- columnGutter: '.125in',
+ columns : '2',
+ columnGutter : '.125in',
createdAt : undefined,
description : '',
editId : expect.any(String),
@@ -784,29 +784,29 @@ brew`);
renderer : 'V3',
lang : 'en',
shareId : expect.any(String),
- legalAuthors: '',
- license: 'None',
- safetySpace: {
- top: '.25in',
- bottom: '.25in',
- outer: '.25in',
- inner: '.5in',
+ legalAuthors : '',
+ license : 'None',
+ safetySpace : {
+ top : '.25in',
+ bottom : '.25in',
+ outer : '.25in',
+ inner : '.5in',
},
- googleId : expect.any(String),
- style : undefined,
- tags : [],
- text : undefined,
- textBin : undefined,
- theme : '5ePHB',
- thumbnail : '',
- title : 'asdf',
- trashed : false,
- trimSize: {
- width: '8.5in',
- height: '11in',
+ googleId : expect.any(String),
+ style : undefined,
+ tags : [],
+ text : undefined,
+ textBin : undefined,
+ theme : '5ePHB',
+ thumbnail : '',
+ title : 'asdf',
+ trashed : false,
+ trimSize : {
+ width : '8.5in',
+ height : '11in',
},
- updatedAt : undefined,
- views : 0
+ updatedAt : undefined,
+ views : 0
});
});
});
@@ -1031,7 +1031,7 @@ brew`);
);
});
});
-
+
describe('deleteGoogleBrew', ()=>{
it('should check auth and delete brew', async ()=>{
const result = await api.deleteGoogleBrew({ username: 'test user' }, 'id', 'editId', res);
@@ -1261,7 +1261,7 @@ brew`);
expect(saved.googleId).toEqual(brew.googleId);
});
});
-
+
describe('Split Text, Style, and Metadata', ()=>{
it('basic splitting', async ()=>{
@@ -1372,5 +1372,5 @@ brew`);
expect(testBrew.text).toEqual('text\n');
});
});
-
+
});
diff --git a/tests/html/helpers.test.js b/tests/html/helpers.test.js
index a81a62173..336101a29 100644
--- a/tests/html/helpers.test.js
+++ b/tests/html/helpers.test.js
@@ -47,19 +47,19 @@ describe(`brewSnippetsToJSON`, ()=>{
gen : 'I am the first brew snippet!\n',
name : 'First Brew Snippet'
}, {
- gen : 'I am the second brew Snippet!',
- name: 'Second Brew Snippet'
+ gen : 'I am the second brew Snippet!',
+ name : 'Second Brew Snippet'
}
- ]}]
+ ] }]
};
const rendered = brewSnippetsToJSON(`Test Snippets JSON without theme snippets`, brewSnippetsBrewTest, null, true);
expect(rendered).toStrictEqual(testMenuObject);
});
- it('converts raw brew snippets with theme snippets to JSON', function() {
+ it('converts raw brew snippets with theme snippets to JSON', function() {
const testMenuObject = {
groupName : 'Brew Snippets',
- icon : 'fas fa-th-list',
+ icon : 'fas fa-th-list',
view : 'text',
snippets : [{
gen : '',
@@ -76,20 +76,20 @@ describe(`brewSnippetsToJSON`, ()=>{
icon : '',
name : 'Second Theme Snippet',
},
- ]},
- {
- name : 'Test Snippets JSON with theme snippets',
- subsnippets : [
- {
- gen : 'I am the first brew snippet!\n',
- name : 'First Brew Snippet'
- },
- {
- gen : 'I am the second brew Snippet!',
- name: 'Second Brew Snippet'
- }
- ]
- }]};
+ ] },
+ {
+ name : 'Test Snippets JSON with theme snippets',
+ subsnippets : [
+ {
+ gen : 'I am the first brew snippet!\n',
+ name : 'First Brew Snippet'
+ },
+ {
+ gen : 'I am the second brew Snippet!',
+ name : 'Second Brew Snippet'
+ }
+ ]
+ }] };
const rendered = brewSnippetsToJSON(`Test Snippets JSON with theme snippets`, brewSnippetsBrewTest, brewSnippetsThemeTest, true);
expect(rendered).toStrictEqual(testMenuObject);
});
@@ -103,8 +103,8 @@ describe(`YAMLSnippetsToText`, ()=>{
gen : 'I am the first brew snippet!\n',
name : 'First Brew Snippet'
}, {
- gen : 'I am the second brew Snippet!',
- name: 'Second Brew Snippet'
+ gen : 'I am the second brew Snippet!',
+ name : 'Second Brew Snippet'
}
]
}];
diff --git a/tests/markdown/non-breaking-spaces.test.js b/tests/markdown/non-breaking-spaces.test.js
index 8bc4b894e..ff08f8277 100644
--- a/tests/markdown/non-breaking-spaces.test.js
+++ b/tests/markdown/non-breaking-spaces.test.js
@@ -1,6 +1,6 @@
-import {hbfm} from 'marked-hbfm';
+import { hbfm } from 'marked-hbfm';
describe('Non-Breaking Spaces Interactions', ()=>{
test('I am actually a single-line definition list!', function() {
diff --git a/themes/V3/Blank/snippets.js b/themes/V3/Blank/snippets.js
index 738bbda67..fdaad40fa 100644
--- a/themes/V3/Blank/snippets.js
+++ b/themes/V3/Blank/snippets.js
@@ -329,7 +329,7 @@ export default [
},
{
name : 'DTRPG Community Content',
- icon : null,
+ icon : null,
subsnippets : [
{
name : 'Chronicle System Guild Colophon',