Skip to content

Commit

Permalink
[code-infra] Update path-to-regexp to 6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Sep 20, 2024
1 parent 0b3251e commit c6b5451
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 35 deletions.
3 changes: 2 additions & 1 deletion packages/toolpad-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@
"@mui/lab": "6.0.0-beta.10",
"@mui/utils": "6.1.1",
"@toolpad/utils": "workspace:*",
"@vitejs/plugin-react": "4.3.1",
"client-only": "^0.0.1",
"invariant": "2.2.4",
"path-to-regexp": "6.2.2",
"path-to-regexp": "6.3.0",
"prop-types": "15.8.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/toolpad-core/src/nextjs/AppProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { render, screen } from '@testing-library/react';
import { AppProvider } from './AppProvider';
import { Router } from '../AppProvider';

vi.mock('./nextNavigation', () => {
vi.mock('next/navigation', () => {
const searchParams = new URLSearchParams();
const push = () => {};
const replace = () => {};
Expand All @@ -20,9 +20,9 @@ vi.mock('./nextNavigation', () => {
};
});

vi.mock('./nextRouter', () => ({ useRouter: () => null }));
vi.mock('next/router', () => ({ useRouter: () => null }));

vi.mock('./nextCompatRouter', () => ({ useRouter: () => null }));
vi.mock('next/compat/router', () => ({ useRouter: () => null }));

interface RouterTestProps {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/src/nextjs/AppProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
import { useRouter } from './nextCompatRouter';
import { useRouter } from 'next/compat/router';
import { AppProviderNextApp } from './AppProviderNextApp';
import { AppProviderNextPages } from './AppProviderNextPages';
import type { AppProviderProps } from '../AppProvider';
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/src/nextjs/AppProviderNextApp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { usePathname, useSearchParams, useRouter } from './nextNavigation';
import { usePathname, useSearchParams, useRouter } from 'next/navigation';
import { AppProvider } from '../AppProvider';
import type { AppProviderProps, Navigate, Router } from '../AppProvider';

Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-core/src/nextjs/AppProviderNextPages.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { asArray } from '@toolpad/utils/collections';
import { useRouter } from './nextRouter';
import { useRouter } from 'next/router';
import { AppProvider } from '../AppProvider';
import type { AppProviderProps, Navigate, Router } from '../AppProvider';

Expand Down
1 change: 0 additions & 1 deletion packages/toolpad-core/src/nextjs/nextCompatRouter.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/toolpad-core/src/nextjs/nextNavigation.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/toolpad-core/src/nextjs/nextRouter.ts

This file was deleted.

11 changes: 2 additions & 9 deletions packages/toolpad-core/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
test: {
setupFiles: ['../../test/setupVitest.ts', '@testing-library/jest-dom/vitest'],
browser: {
Expand All @@ -19,13 +21,4 @@ export default defineConfig({
reporter: ['text', 'lcov'],
},
},
resolve: {
alias: [
{
// FIXME(https://github.com/mui/material-ui/issues/35233)
find: /^@mui\/icons-material\/(?!esm\/)([^/]*)/,
replacement: '@mui/icons-material/esm/$1',
},
],
},
});
2 changes: 1 addition & 1 deletion packages/toolpad-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"node-fetch": "2.7.0",
"node-fetch-har": "1.0.1",
"open-editor": "5.0.0",
"path-to-regexp": "7.1.0",
"path-to-regexp": "6.3.0",
"perf-cascade": "3.0.3",
"pg": "8.12.0",
"piscina": "4.6.1",
Expand Down
27 changes: 12 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c6b5451

Please sign in to comment.