diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bf986cca..13d339892 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,17 +2,23 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 +version: 2.1 + +orbs: + node: circleci/node@3.0.0 + jobs: build: docker: - - image: circleci/node:16.10.0 - - image: circleci/mongo:4.4 + - image: cimg/node:16.11.0 + - image: mongo:4.4 - working_directory: ~/repo + working_directory: ~/homebrewery + executor: node/default steps: - - checkout + - checkout: + path: ~/homebrewery # Download and cache dependencies - restore_cache: @@ -21,12 +27,48 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - run: npm install + - node/install-npm + - node/install-packages: + app-dir: ~/homebrewery + cache-path: node_modules + override-ci-command: npm i - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} + - persist_to_workspace: + root: . + paths: + - . + + test: + docker: + - image: cimg/node:16.11.0 + + working_directory: ~/homebrewery + parallelism: 4 + + steps: + - attach_workspace: + at: . + # run tests! - - run: npm run circleci + - run: + name: Test - Basic + command: npm run test:basic + - run: + name: Test - Mustache Spans + command: npm run test:mustache-span + - run: + name: Test - Routes + command: npm run test:route + +workflows: + build_and_test: + jobs: + - build + - test: + requires: + - build \ No newline at end of file diff --git a/changelog.md b/changelog.md index 34c832f9c..9fed601f8 100644 --- a/changelog.md +++ b/changelog.md @@ -29,11 +29,43 @@ pre { .page p + pre { margin-top : 0.1cm; } + +.page .openSans { + font-family: 'Open Sans'; + font-size: 0.9em; +} ``` ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Wednesday 27/03/2022 - v3.0.8 +{{taskList +* [x] Style updates to user page. + +* [x] Added a logout button (finally)! You can find it under {{openSans **USERNAME {{fa,fa-user}} → LOGOUT {{fas,fa-power-off}}**}} + + Fixes issues: [#303](https://github.com/naturalcrit/homebrewery/issues/303) + +* [x] Clarified the default text when submitting an issue via Reddit post. + +* [x] Fixed broken Table of Contents links in PDFs. (Thanks lucastucious!) + + Fixes issues: [#1749](https://github.com/naturalcrit/homebrewery/issues/1749) + +* [x] Fixed window resizing causing the edit page divider to get lost off of the edge of the page. + + Fixes issues: [#2053](https://github.com/naturalcrit/homebrewery/issues/2053) + +* [x] Fixed Class Table decorations overlapping main text. + + Fixes issues: [#1985](https://github.com/naturalcrit/homebrewery/issues/1985) + +* [x] Updated {{openSans **STYLE EDITOR {{fa,fa-pencil-alt}} → REMOVE DROP CAP {{fas,fa-remove-format}}**}} snippet to also remove small-caps first line font. + +* [x] Background work in preparation for brew themes. +}} + ### Wednesday 02/02/2022 - v3.0.7 {{taskList * [x] Revert active line highlighting. @@ -50,7 +82,7 @@ For a full record of development, visit our [Github Page](https://github.com/nat Fixes issues: [#1943](https://github.com/naturalcrit/homebrewery/issues/1943) -* [x] Added a Legacy to V3 migration guide under **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}** +* [x] Added a Legacy to V3 migration guide under {{openSans **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}**}} * [x] Background refactoring and unit tests. }} diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 7b008fe1e..10920a564 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -97,7 +97,11 @@ module.exports = [ gen : dedent`/* Removes Drop Caps */ .page h1+p:first-letter { all: unset; - }\n\n` + }\n\n + /* Removes Small-Caps in first line */ + .page h1+p:first-line { + all: unset; + }` }, { name : 'Tweak Drop Cap', diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 54dcf2206..094b96744 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -32,11 +32,14 @@ const Homebrew = createClass({ } }; }, - componentWillMount : function() { - global.account = this.props.account; + + getInitialState : function(){ global.version = this.props.version; + global.account = this.props.account; global.enable_v3 = this.props.enable_v3; + return {}; }, + render : function (){ return ( diff --git a/client/homebrew/navbar/account.navitem.jsx b/client/homebrew/navbar/account.navitem.jsx index ebff531b6..be92cea92 100644 --- a/client/homebrew/navbar/account.navitem.jsx +++ b/client/homebrew/navbar/account.navitem.jsx @@ -23,9 +23,17 @@ const Account = createClass({ // Reset divider position window.localStorage.removeItem('naturalcrit-pane-split'); // Clear login cookie - document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${window.domain ? `domain=${window.domain}` : ''}`; + let domain = ''; + if(window.location?.hostname) { + let domainArray = window.location.hostname.split('.'); + if(domainArray.length > 2){ + domainArray = [''].concat(domainArray.slice(-2)); + } + domain = domainArray.join('.'); + } + document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;samesite=lax;${domain ? `domain=${domain}` : ''}`; window.location = '/'; - }; + } }, render : function(){ diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index b3255db45..7929bb5e2 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -14,12 +14,10 @@ const Navbar = createClass({ }; }, - componentDidMount : function() { - //const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); - this.setState({ - //showNonChromeWarning : !isChrome, - ver : window.version - }); + getInitialState : function() { + return { + ver : global.version + }; }, /* diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 969b80f49..1863333b3 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -276,26 +276,26 @@ const EditPage = createClass({ console.log(errMsg); } catch (e){} - if(this.state.errors.status == '401'){ - return - Oops! -
- You must be signed in to a Google account - to save this to
Google Drive!
- -
- Sign In -
-
-
- Not Now -
-
-
; - } + // if(this.state.errors.status == '401'){ + // return + // Oops! + //
+ // You must be signed in to a Google account + // to save this to
Google Drive!
+ // + //
+ // Sign In + //
+ //
+ //
+ // Not Now + //
+ //
+ //
; + // } - if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api.*Google.*$/m)){ return Oops!
diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index b99d6f85a..657371fb1 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -187,26 +187,26 @@ const NewPage = createClass({ console.log(errMsg); } catch (e){} - if(this.state.errors.status == '401'){ - return - Oops! -
- You must be signed in to a Google account - to save this to
Google Drive!
- -
- Sign In -
-
-
- Not Now -
-
-
; - } + // if(this.state.errors.status == '401'){ + // return + // Oops! + //
+ // You must be signed in to a Google account + // to save this to
Google Drive!
+ // + //
+ // Sign In + //
+ //
+ //
+ // Not Now + //
+ //
+ //
; + // } - if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){ + if(this.state.errors.response.req.url.match(/^\/api.*Google.*$/m)){ return Oops!
diff --git a/package-lock.json b/package-lock.json index 59cc94b9c..1ccd615cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "homebrewery", - "version": "3.0.7", + "version": "3.0.8", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.0.7", + "version": "3.0.8", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -23150,4 +23150,4 @@ "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==" } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 88ab6b494..a6f25b0ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebrewery", "description": "Create authentic looking D&D homebrews using only markdown", - "version": "3.0.7", + "version": "3.0.8", "engines": { "node": "16.11.x" }, @@ -20,6 +20,9 @@ "verify": "npm run lint && npm test", "test": "jest", "test:dev": "jest --verbose --watch", + "test:basic": "jest tests/markdown/basic.test.js --verbose", + "test:mustache-span": "jest tests/markdown/mustache-span.test.js --verbose", + "test:route": "jest tests/routes/static-pages.test.js --verbose", "phb": "node scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run buildall", @@ -31,6 +34,7 @@ "build/*" ], "jest": { + "testTimeout" : 15000, "modulePaths": [ "mode_modules", "shared",