Skip to content

Commit

Permalink
fix(deps): update nextjs monorepo to v13 (major) (#1277)
Browse files Browse the repository at this point in the history
* fix(deps): update nextjs monorepo to v13

* fix: remove next-transpile-modules

* fix(Link): remove child <a> tags

* chore(node): drop v14, check v20 support

* chore(deps): bump nock & hibp

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: James Mortemore <[email protected]>
  • Loading branch information
renovate[bot] and confuser authored May 7, 2023
1 parent e6006d3 commit d1aafe7
Show file tree
Hide file tree
Showing 52 changed files with 888 additions and 763 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Node.js ${{ matrix.node-version }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]

env:
DB_HOST: 127.0.0.1
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class SetupCommand extends Command {
}

if (server.console) {
if (!await playerExists(serverConn, server.tables.players, server.console)) {
if (!(await playerExists(serverConn, server.tables.players, server.console))) {
this.log('Console player not found, please update')
server.console = await askPlayer('Console UUID (paste "uuid" value from BanManager/console.yml)', serverConn, server.tables.players)
}
Expand Down
54 changes: 28 additions & 26 deletions components/AdminLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const AdminLayout = ({ children, title }) => {
<span className='mx-4'>
<Link href='/admin'>Admin</Link>
</span>
<Link href='/dashboard' passHref>
<a className='m-auto flex-grow text-right'><MdOutlineExitToApp className='inline-flex mx-5 hover:text-accent-200' /></a>
<Link href='/dashboard' passHref className='m-auto flex-grow text-right'>
<MdOutlineExitToApp className='inline-flex mx-5 hover:text-accent-200' />
</Link>
</div>
</div>
Expand All @@ -82,8 +82,9 @@ const AdminLayout = ({ children, title }) => {
'border-l-4 border-accent-500': router.asPath === href
})
return (
<Link key={`${href}${name}`} href={href} passHref>
<a className={className}>
(
<Link key={`${href}${name}`} href={href} passHref className={className}>

{icons[name] && <span className='text-left m-auto'>{icons[name]}</span>}
<span className='mx-4 text-base m-auto font-normal'>
{name}
Expand All @@ -96,40 +97,41 @@ const AdminLayout = ({ children, title }) => {
</span>
</button>
</span>}
</a>
</Link>

</Link>
)
)
})}
</div>
<div className='h-1/5 flex flex-col'>
<div className='flex-grow'>
<div className='flex px-4'>
<Link href={`/player/${user.id}`}>
<a className='flex'>
<Avatar width='36' height='36' uuid={user.id} />
<div className='ml-4 text-sm'>
<div>{user.name}</div>
<div>View Profile</div>
</div>
</a>
<Link href={`/player/${user.id}`} className='flex'>

<Avatar width='36' height='36' uuid={user.id} />
<div className='ml-4 text-sm'>
<div>{user.name}</div>
<div>View Profile</div>
</div>

</Link>
</div>
</div>
<div className='flex justify-evenly py-3 bg-gray-800'>
<Link href='/notifications'>
<a title='Notifications'>
<MdOutlineNotifications className='w-6 h-6' />
</a>
<Link href='/notifications' title='Notifications'>

<MdOutlineNotifications className='w-6 h-6' />

</Link>
<Link href='/account'>
<a title='Settings'>
<MdSettings className='w-6 h-6' />
</a>
<Link href='/account' title='Settings'>

<MdSettings className='w-6 h-6' />

</Link>
<Link href='/dashboard'>
<a title='Return'>
<MdLogout className='w-6 h-6' />
</a>
<Link href='/dashboard' title='Return'>

<MdLogout className='w-6 h-6' />

</Link>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Dropdown = ({ trigger = () => {}, children }) => {
const Item = ({ href = '', children, name, onClick, icon, className = '' }) => {
if (href) {
return (
<Link href={href} passHref>
<Link href={href} passHref legacyBehavior>
<ItemLink name={name} href={href} onClick={onClick} className={className} icon={icon}>{children}</ItemLink>
</Link>
)
Expand Down
65 changes: 38 additions & 27 deletions components/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ export default function Nav ({ leftItems, mobileItems, rightItems }) {
}

return (
<Link key={item.name} href={item.href} passHref>
<a href={item.href} key={item.name} className={`text-lg text-white ${router.asPath === item.href ? 'font-bold' : 'hover:text-primary-100'}`}>
(
<Link
key={item.name}
href={item.href}
passHref
className={`text-lg text-white ${router.asPath === item.href ? 'font-bold' : 'hover:text-primary-100'}`}
>

{item.name}
</a>
</Link>

</Link>
)
)
})

Expand All @@ -45,10 +52,10 @@ export default function Nav ({ leftItems, mobileItems, rightItems }) {
<div className='flex justify-between items-center my-6 pb-6 md:justify-start md:space-x-10'>
<div className='flex justify-start lg:w-0 lg:flex-1'>
<Link href='/' passHref>
<a>
<span className='sr-only'>Home</span>
<Image src={process.env.BASE_PATH + '/images/banmanager-icon.png'} alt='Logo' width='40' height='40' />
</a>

<span className='sr-only'>Home</span>
<Image src={process.env.BASE_PATH + '/images/banmanager-icon.png'} alt='Logo' width='40' height='40' />

</Link>
<div className='mx-8 w-48'>
<PlayerSelector
Expand All @@ -75,32 +82,36 @@ export default function Nav ({ leftItems, mobileItems, rightItems }) {
<NavigationOverlay drawerOpen={drawerOpen} setDrawerOpen={setDrawerOpen}>
<NavigationOverlay.Header>
<Link href='/' passHref key='logo-icon'>
<a>
<span className='sr-only'>Home</span>
<Image width='40' height='40' src={process.env.BASE_PATH + '/images/banmanager-icon.png'} alt='Logo' />
</a>

<span className='sr-only'>Home</span>
<Image width='40' height='40' src={process.env.BASE_PATH + '/images/banmanager-icon.png'} alt='Logo' />

</Link>
</NavigationOverlay.Header>
<NavigationOverlay.Body className='!px-2 flex flex-col sm:flex-row sm:justify-around'>
<nav>
{renderMenu(rightItems)}
{mobileItems.map(({ href, name, icon, label, splitBorder }) => (
<Fragment key={`${href}${name}`}>
<Link href={href} passHref>
<a className='hover:text-accent-200 hover:bg-gray-600 flex transition-colors text-gray-100 text-xl p-2 my-4 rounded-lg'>
{icon}
<span className='mx-4 text-lg font-normal'>
{name}
</span>
{!!label &&
<span className='flex-grow text-right'>
<button type='button' className='w-6 h-6 text-xs rounded-full text-white bg-accent-500'>
<span className='p-1'>
{label}
</span>
</button>
</span>}
</a>
<Link
href={href}
passHref
className='hover:text-accent-200 hover:bg-gray-600 flex transition-colors text-gray-100 text-xl p-2 my-4 rounded-lg'
>

{icon}
<span className='mx-4 text-lg font-normal'>
{name}
</span>
{!!label &&
<span className='flex-grow text-right'>
<button type='button' className='w-6 h-6 text-xs rounded-full text-white bg-accent-500'>
<span className='p-1'>
{label}
</span>
</button>
</span>}

</Link>
{splitBorder && <span className='text-5xl pb-4 mb-4 border-b border-accent-200 leading-none' />}
</Fragment>
Expand Down
22 changes: 11 additions & 11 deletions components/PlayerAppealForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ export default function PlayerAppealForm ({ actor, reason, expires, created, ser
<span>By</span>
<span className='ml-auto'>
<Link href={`/player/${actor.id}`} passHref>
<a>
<div className='flex items-center'>
<div className='flex-shrink-0'>
<Avatar uuid={actor.id} height='20' width='20' />
</div>
<div className='ml-3'>
<p className='whitespace-no-wrap'>
{actor.name}
</p>
</div>

<div className='flex items-center'>
<div className='flex-shrink-0'>
<Avatar uuid={actor.id} height='20' width='20' />
</div>
<div className='ml-3'>
<p className='whitespace-no-wrap'>
{actor.name}
</p>
</div>
</a>
</div>

</Link>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/PlayerLoginPasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export default function PlayerLoginPasswordForm ({ onSuccess }) {
data-cy='password'
{...register('password')}
/>
<Link href='/forgotten-password' passHref>
<a className='text-lg md:text-sm mb-3'>Forgot password?</a>
<Link href='/forgotten-password' passHref className='text-lg md:text-sm mb-3'>
Forgot password?
</Link>
<Button data-cy='submit-login-password' disabled={isSubmitting} loading={isSubmitting}>
Login
Expand Down
6 changes: 3 additions & 3 deletions components/PlayerNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ const PlayerNoteRow = ({ row, dateFormat, serverId, onDeleted }) => {
<div className='flex items-center space-x-8'>
{row.acl.update &&
<Link href={`/player/note/${serverId}-${row.id}`} passHref>
<a>
<FaPencilAlt className='w-6 h-6' />
</a>

<FaPencilAlt className='w-6 h-6' />

</Link>}
{row.acl.delete &&
<>
Expand Down
16 changes: 8 additions & 8 deletions components/PlayerPunishment.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ export default function PlayerPunishment ({ punishment, server, type, onDeleted
{punishment.acl.update &&
<li className='hover:text-accent-700'>
<Link href={`/player/${meta.editPath}/${server.id}-${punishment.id}`} passHref>
<a>
<FaPencilAlt className='w-6 h-6' />
</a>

<FaPencilAlt className='w-6 h-6' />

</Link>
</li>}
{punishment.acl.delete &&
Expand Down Expand Up @@ -138,11 +138,11 @@ export default function PlayerPunishment ({ punishment, server, type, onDeleted
</div>
{punishment.acl.yours &&
<Link href={`/player/appeal/${server.id}/${punishment.id}/${meta.editPath.replace('edit-', '')}`} passHref>
<a>
<Button className='bg-blue-600 hover:bg-blue-900 mt-4'>
Appeal
</Button>
</a>

<Button className='bg-blue-600 hover:bg-blue-900 mt-4'>
Appeal
</Button>

</Link>}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/PlayerWarnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const PlayerWarningRow = ({ row, dateFormat, serverId, onDeleted }) => {
<div className='flex items-center space-x-8'>
{row.acl.update &&
<Link href={`/player/warning/${serverId}-${row.id}`} passHref>
<a>
<FaPencilAlt className='w-6 h-6' />
</a>

<FaPencilAlt className='w-6 h-6' />

</Link>}
{row.acl.delete &&
<>
Expand Down
Loading

0 comments on commit d1aafe7

Please sign in to comment.