0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-24 07:43:01 +00:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Trevor Buckner
253dbb358b Merge pull request #4366 from naturalcrit/relocateSplitPane
Moving splitPane over to the components folder
2025-07-29 16:36:39 -04:00
Trevor Buckner
719edd82c5 Moving splitPane over to the components folder
Just to reduce the number of changes needed to review on the UI overhaul #4122 PR
2025-07-29 16:35:25 -04:00
Trevor Buckner
63d957fdc6 Merge pull request #4357 from naturalcrit/dependabot/npm_and_yarn/dev-dependencies-e74ffdea55
Bump the dev-dependencies group across 1 directory with 3 updates
2025-07-23 16:39:37 -04:00
dependabot[bot]
7751c0e37b Bump the dev-dependencies group across 1 directory with 3 updates
Bumps the dev-dependencies group with 3 updates in the / directory: [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest), [stylelint](https://github.com/stylelint/stylelint) and [supertest](https://github.com/ladjs/supertest).


Updates `jest` from 30.0.4 to 30.0.5
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.5/packages/jest)

Updates `stylelint` from 16.21.1 to 16.22.0
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.21.1...16.22.0)

Updates `supertest` from 7.1.3 to 7.1.4
- [Release notes](https://github.com/ladjs/supertest/releases)
- [Commits](https://github.com/ladjs/supertest/compare/v7.1.3...v7.1.4)

---
updated-dependencies:
- dependency-name: jest
  dependency-version: 30.0.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: stylelint
  dependency-version: 16.22.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: supertest
  dependency-version: 7.1.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-23 03:52:56 +00:00
11 changed files with 673 additions and 550 deletions

View File

@@ -21,7 +21,7 @@ const Account = require('../../navbar/account.navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const VaultNavItem = require('../../navbar/vault.navitem.jsx');
const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const SplitPane = require('client/components/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');

View File

@@ -15,7 +15,7 @@ const AccountNavItem = require('../../navbar/account.navitem.jsx');
const ErrorNavItem = require('../../navbar/error-navitem.jsx');
const { fetchThemeBundle } = require('../../../../shared/helpers.js');
const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const SplitPane = require('client/components/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');

View File

@@ -14,7 +14,7 @@ const ErrorNavItem = require('../../navbar/error-navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const HelpNavItem = require('../../navbar/help.navitem.jsx');
const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const SplitPane = require('client/components/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');

View File

@@ -12,7 +12,7 @@ const Account = require('../../navbar/account.navitem.jsx');
const NewBrew = require('../../navbar/newbrew.navitem.jsx');
const HelpNavItem = require('../../navbar/help.navitem.jsx');
const BrewItem = require('../basePages/listPage/brewItem/brewItem.jsx');
const SplitPane = require('../../../../shared/naturalcrit/splitPane/splitPane.jsx');
const SplitPane = require('client/components/splitPane/splitPane.jsx');
const ErrorIndex = require('../errorPage/errors/errorIndex.js');
import request from '../../utils/request-middleware.js';

1101
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -142,13 +142,13 @@
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.3.0",
"jest": "^30.0.4",
"jest": "^30.0.5",
"jest-expect-message": "^1.1.3",
"jsdom-global": "^3.0.2",
"postcss-less": "^6.0.0",
"stylelint": "^16.21.1",
"stylelint": "^16.22.0",
"stylelint-config-recess-order": "^7.1.0",
"stylelint-config-recommended": "^16.0.0",
"supertest": "^7.1.3"
"supertest": "^7.1.4"
}
}

View File

@@ -161,7 +161,7 @@ fs.emptyDirSync('./build');
livereload('./build'); // Install the Chrome extension LiveReload to automatically refresh the browser
watchFile('./server.js', { // Restart server when change detected to this file or any nested directory from here
ignore : ['./build', './client', './themes'], // Ignore folders that are not running server code / avoids unneeded restarts
ext : 'js' // Extensions to watch (only .js/.json by default)
ext : 'js json' // Extensions to watch (only .js/.json by default)
//watch : ['./server', './themes'], // Watch additional folders if needed
});
}

View File

@@ -147,109 +147,6 @@ app.get('/', (req, res, next)=>{
return next();
});
app.get('/analyze', async (req, res, next) => {
const accounts = JSON.parse(fs.readFileSync('accounts.json', 'utf8'));
let totalBrewsStubbed = accounts.reduce((sum, account) => {
if (account.brewsStubbed) {
return sum + account.brewsStubbed;
}
return sum;
}, 0);
let totalAccountsProcessed = accounts.filter(account => account.fullyProcessed).length;
let totalAccountsWithInvalidCredentials = accounts.filter(account => account.invalidCredentials).length;
console.log(`Total Brews Stubbed: ${totalBrewsStubbed}`);
console.log(`Total Accounts Processed: ${totalAccountsProcessed}`);
console.log(`Total Accounts with Invalid Credentials: ${totalAccountsWithInvalidCredentials}`);
});
app.get('/destroy', async (req, res, next) => {
const accounts = JSON.parse(fs.readFileSync('accounts.json', 'utf8'));
let updated = false;
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
for (let i = 40000; i < accounts.length; i++) {
if (accounts[i].fullyProcessed || accounts[i].invalidCredentials) continue;
const originalAccount = { ...accounts[i] };
const account = accounts[i];
console.log(`Processing account: ${account.username}`);
let googleBrews;
let auth;
try {
auth = await GoogleActions.authCheck(account, res);
googleBrews = await GoogleActions.listGoogleBrews(auth);
} catch (err) {
console.error(`Auth error for ${account.username}`);
accounts[i] = { ...originalAccount, invalidCredentials: true };
updated = true;
continue;
}
if (!auth) {
accounts[i] = { ...originalAccount, missingAuth: true };
updated = true;
continue;
}
console.log('Google Brews:', googleBrews.length);
if (googleBrews.length === 0) {
accounts[i] = { ...originalAccount, fullyProcessed: true, brewsStubbed: 0 };
updated = true;
continue;
}
const fields = ['googleId', 'title', 'editId', 'shareId'];
let brews = await HomebrewModel.getByUser(account.username, true, fields).catch(err => console.error(err));
const stubbedEditIds = new Set(brews.map(b => b.editId));
googleBrews = googleBrews.filter(b => !stubbedEditIds.has(b.editId));
console.log('Unstubbed Google Brews:', googleBrews.length);
const results = await Promise.all(
googleBrews.map(async (brew) => {
let brewFromServer = await GoogleActions.getGoogleBrew(auth, brew.googleId, brew.editId, 'edit');
splitTextStyleAndMetadata(brewFromServer);
brewFromServer.authors = [account.username];
api.excludeStubProps(brewFromServer);
console.log(`Trying to Stub: ${brewFromServer.title} (${brewFromServer.shareId})`);
let saved = await new HomebrewModel(brewFromServer).save().catch(err => console.error(err));
if (saved) {
console.log(`Saved Stub: ${saved.title} (${saved.shareId})`);
return true;
}
return false;
})
);
const stubCount = results.filter(Boolean).length;
console.log('Brews stubbed:', stubCount);
accounts[i] = {
...originalAccount,
brewsStubbed: stubCount,
fullyProcessed: stubCount === googleBrews.length
};
updated = true;
sleep(1000);
}
if (updated) {
fs.writeFileSync('accounts.json', JSON.stringify(accounts, null, 2), 'utf8');
console.log('accounts.json updated');
}
res.send('One account processed');
});
//Home page Legacy
app.get('/legacy', (req, res, next)=>{
req.brew = {

View File

@@ -8,8 +8,7 @@
import Mongoose from 'mongoose';
const getMongoDBURL = (config)=>{
console.log('mongodb uri', config.get('MONGODB_URI'));
return config.get('MONGODB_URI') ||
return config.get('mongodb_uri') ||
config.get('mongolab_uri') ||
'mongodb://127.0.0.1/homebrewery'; // changed from mongodb://localhost/homebrewery to accommodate versions 16+ of node.
};