From 1aabb84731e64e8227be66e90ba75ceaf1c3148a Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:40:32 -0500 Subject: [PATCH 1/7] Revert --experimental-vm-modules Code works but does not work with jest as expected. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f8007c608..cd4fda141 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node --experimental-require-module scripts/dev.js", - "quick": "node --experimental-require-module scripts/quick.js", - "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", - "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", + "dev": "node scripts/dev.js", + "quick": "node scripts/quick.js", + "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", + "builddev": "node scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node --experimental-require-module scripts/phb.js", + "phb": "node scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node --experimental-require-module server.js" + "start": "node server.js" }, "author": "stolksdorf", "license": "MIT", From 9506be6b65f687e095e95278c3362121b425656c Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 10 Oct 2024 17:41:40 -0500 Subject: [PATCH 2/7] Revert "Revert --experimental-vm-modules" This reverts commit 1aabb84731e64e8227be66e90ba75ceaf1c3148a. --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cd4fda141..f8007c608 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { - "dev": "node scripts/dev.js", - "quick": "node scripts/quick.js", - "build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js", - "builddev": "node scripts/buildHomebrew.js --dev", + "dev": "node --experimental-require-module scripts/dev.js", + "quick": "node --experimental-require-module scripts/quick.js", + "build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js", + "builddev": "node --experimental-require-module scripts/buildHomebrew.js --dev", "lint": "eslint --fix", "lint:dry": "eslint", "stylelint": "stylelint --fix **/*.{less}", @@ -38,10 +38,10 @@ "test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace", "test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace", "test:route": "jest tests/routes/static-pages.test.js --verbose", - "phb": "node scripts/phb.js", + "phb": "node --experimental-require-module scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node server.js" + "start": "node --experimental-require-module server.js" }, "author": "stolksdorf", "license": "MIT", From 631ef795b75239505a2812ed046f2b108cb8c2eb Mon Sep 17 00:00:00 2001 From: David Bolack Date: Thu, 17 Oct 2024 18:30:31 -0500 Subject: [PATCH 3/7] Fix .tocGlobalH? Based on OH DEAR GOD THE LAG! discoveries related to the global toggles, these are being moved from a markup tag to a styles tab insert. --- themes/V3/5ePHB/snippets.js | 47 +++++++++++++++++-------------------- themes/V3/5ePHB/style.less | 12 ---------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 543b1cf5c..798a36193 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -154,31 +154,6 @@ module.exports = [ ] }, - { - name : 'Table of Contents Toggles', - icon : 'fas fa-book', - //gen : `{{tocGlobalH4}}\n\n`, - disabled : true - // RELIES ON .PAGES:HAS() WHICH IS VERY SLOW - // WILL BE MOVED TO STYLE TAB SNIPPETS - // subsnippets : [ - // { - // name : 'Enable H1-H4 all pages', - // icon : 'fas fa-dice-four', - // gen : `{{tocGlobalH4}}\n\n`, - // }, - // { - // name : 'Enable H1-H5 all pages', - // icon : 'fas fa-dice-five', - // gen : `{{tocGlobalH5}}\n\n`, - // }, - // { - // name : 'Enable H1-H6 all pages', - // icon : 'fas fa-dice-six', - // gen : `{{tocGlobalH6}}\n\n`, - // }, - // ] - } ] }, { @@ -217,6 +192,28 @@ module.exports = [ line-height: 1em; }\n\n` }, + { + name : 'Table of Contents Toggles', + icon : 'fas fa-book', + disabled : false, + subsnippets : [ + { + name : 'Enable H1-H4 all pages', + icon : 'fas fa-dice-four', + gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H5 all pages', + icon : 'fas fa-dice-five', + gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + }, + { + name : 'Enable H1-H6 all pages', + icon : 'fas fa-dice-six', + gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + }, + ] + } ] }, diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 1216d0370..ba975e58a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -814,18 +814,6 @@ h6, // These add Headers 'back' to inclusion. //NOTE: DO NOT USE :HAS WITH .PAGES!!! EXTREMELY SLOW TO RENDER ON LARGE DOCS! -//WILL BE MOVED TO A STYLE TAB SNIPPET INSTEAD -// .pages:has(.tocGlobalH4) { -// h4 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH5) { -// h4, h5 {--TOC: include; } -// } - -// .pages:has(.tocGlobalH6) { -// h4, h5, h6 {--TOC: include; } -// } // Block level inclusion changes // These include either a single (include) or a range (depth) From cd09408aa89d5e2598fecd1da14d24f98e28e8dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 03:37:53 +0000 Subject: [PATCH 4/7] Bump mongoose from 8.7.1 to 8.7.2 Bumps [mongoose](https://github.com/Automattic/mongoose) from 8.7.1 to 8.7.2. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md) - [Commits](https://github.com/Automattic/mongoose/compare/8.7.1...8.7.2) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3fb0ad29..76c6e2dd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.7.1", + "mongoose": "^8.7.2", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.3.1", @@ -10661,9 +10661,9 @@ } }, "node_modules/mongoose": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.7.1.tgz", - "integrity": "sha512-RpNMyhyzLVCVbf8xTVbrf/18G3MqQzNw5pJdvOJ60fzbCa3cOZzz9L+8XpqzBXtRlgZGWv0T7MmOtvrT8ocp1Q==", + "version": "8.7.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.7.2.tgz", + "integrity": "sha512-Ok4VzMds9p5G3ZSUhmvBm1GdxanbzhS29jpSn02SPj+IXEVFnIdfwAlHHXWkyNscZKlcn8GuMi68FH++jo0flg==", "dependencies": { "bson": "^6.7.0", "kareem": "2.6.3", diff --git a/package.json b/package.json index a4c6ee38a..d25c1b1d1 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.7.1", + "mongoose": "^8.7.2", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.3.1", From ac766f3b37428f9d0029840d00d11807689b61c2 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:23:56 -0400 Subject: [PATCH 5/7] Update brewRenderer.jsx --- client/homebrew/brewRenderer/brewRenderer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index dba99638b..b9b9f5589 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -179,8 +179,8 @@ const BrewRenderer = (props)=>{ styleObject.backgroundImage = `url("data:image/svg+xml;utf8,${global.config.deployment}")`; } - const renderedStyle = useMemo(()=> renderStyle(), [props.style?.length, props.themeBundle]); - renderedPages = useMemo(() => renderPages(), [props.text?.length]); + const renderedStyle = useMemo(()=> renderStyle(), [props.style, props.themeBundle]); + renderedPages = useMemo(() => renderPages(), [props.text]); return ( <> From 9d81f50b609dc551375af031639fe4db386d7da1 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:46:59 -0400 Subject: [PATCH 6/7] Remove `disabled = false` Don't need that tag at all when it's false. --- themes/V3/5ePHB/snippets.js | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 798a36193..f06064895 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -195,7 +195,6 @@ module.exports = [ { name : 'Table of Contents Toggles', icon : 'fas fa-book', - disabled : false, subsnippets : [ { name : 'Enable H1-H4 all pages', From d53a271c9ff8be2c736b2bb8720ead0a74747b2b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 18 Oct 2024 10:53:16 -0400 Subject: [PATCH 7/7] Change to `.page` and tweak spacing/newlines to match other snippets All of our "global" style snippets are just set at `.page`, not `.pages`. This still applies globally but is consistent with our current approach. --- themes/V3/5ePHB/snippets.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index f06064895..dbcdc6f2a 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -199,17 +199,17 @@ module.exports = [ { name : 'Enable H1-H4 all pages', icon : 'fas fa-dice-four', - gen : `\n.pages {\n h4 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H5 all pages', icon : 'fas fa-dice-five', - gen : `\n.pages {\n h4, h5 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5 {--TOC: include; }\n}\n\n`, }, { name : 'Enable H1-H6 all pages', icon : 'fas fa-dice-six', - gen : `\n.pages {\n h4, h5, h6 {--TOC: include; }\n}\n\n`, + gen : `.page {\n\th4, h5, h6 {--TOC: include; }\n}\n\n`, }, ] }