Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: RyanClementsHax/storybook-addon-next
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.6.8
Choose a base ref
...
head repository: RyanClementsHax/storybook-addon-next
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.6.9
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Sep 6, 2022

  1. fix(deps): remove unnecessary nextjs versions

    - no longer use next 9 - 11 as dev dependencies
    - this was an attempt to get better typing on the router
    - it was removed because it caused added security flagging for code we never used and we casted to the any type anyway as it would be a lot of overhead to make sure that the type of the router matched the type of the router context
    RyanClementsHax committed Sep 6, 2022

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    9b5d7f2 View commit details
  2. Merge pull request #116 from RyanClementsHax/next-router-versions

    fix(deps): remove unnecessary nextjs versions
    RyanClementsHax authored Sep 6, 2022

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    b72a426 View commit details
Showing with 207 additions and 3,418 deletions.
  1. +0 −3 package.json
  2. +2 −4 src/routing/decorator.tsx
  3. +1 −10 src/routing/resolved-router-context.ts
  4. +0 −14 src/routing/resolved-router.ts
  5. +204 −3,387 yarn.lock
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -69,9 +69,6 @@
"husky": "^7.0.4",
"lint-staged": "^12.1.2",
"next": "^12.0.7",
"nextv10": "npm:next@10.0.0",
"nextv11": "npm:next@11.0.0",
"nextv9": "npm:next@9.0.0",
"prettier": "^2.5.1",
"react": "^17.0.2",
"semantic-release": "^19.0.3",
6 changes: 2 additions & 4 deletions src/routing/decorator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// this will be aliased by webpack at runtime (this is just for typing)
import { RouterContext } from './resolved-router-context'
// this will be aliased by webpack at runtime (this is just for typing)
import Router from './resolved-router'
import Router from 'next/router'
import { action } from '@storybook/addon-actions'
import { StoryContext } from '@storybook/addons'

@@ -58,8 +57,7 @@ export const RouterDecorator = (
} as NonNullable<typeof Router.router>

return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
<RouterContext.Provider value={Router.router as any}>
<RouterContext.Provider value={Router.router}>
<Story />
</RouterContext.Provider>
)
11 changes: 1 addition & 10 deletions src/routing/resolved-router-context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// this file will be aliased by webpack at runtime (this is just for typing)

import { RouterContext as RouterContextV12 } from 'next/dist/shared/lib/router-context'
import { RouterContext as RouterContextV11 } from 'nextv11/dist/next-server/lib/router-context'
import { RouterContext as RouterContextV10 } from 'nextv10/dist/next-server/lib/router-context'
import { RouterContext as RouterContextV9 } from 'next-server/dist/lib/router-context'

export const RouterContext:
| typeof RouterContextV12
| typeof RouterContextV11
| typeof RouterContextV10
| typeof RouterContextV9 = RouterContextV12
export { RouterContext } from 'next/dist/shared/lib/router-context'
14 changes: 0 additions & 14 deletions src/routing/resolved-router.ts

This file was deleted.

Loading