Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
fix(deps): use core-package as peer-dep
Browse files Browse the repository at this point in the history
  • Loading branch information
fostyfost committed Oct 26, 2021
1 parent 79d7e93 commit 97b1e68
Show file tree
Hide file tree
Showing 61 changed files with 227 additions and 209 deletions.
240 changes: 127 additions & 113 deletions .pnp.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/active-post/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { ACTIVE_POST_REDUCER_KEY, activePostReducer } from '@/eggs/active-post/reducer'
import { loadActivePostWatcher } from '@/eggs/active-post/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/aviasales/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { AVIASALES_REDUCER_KEY, aviasalesReducer } from '@/eggs/aviasales/reducer'
import { aviasalesSaga } from '@/eggs/aviasales/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/chuck-norris/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { ChuckNorrisPublicAction } from '@/eggs/chuck-norris/action-creators'
import { CHUCK_NORRIS_REDUCER_KEY, chuckNorrisReducer } from '@/eggs/chuck-norris/reducer'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/clock/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { CLOCK_REDUCER_KEY, clockReducer } from '@/eggs/clock/reducer'
import { startClockWatcher } from '@/eggs/clock/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EggTuple } from '@redux-eggs/redux'
import type { EggTuple } from '@redux-eggs/core'

import { getXkcdEgg } from '@/eggs/xkcd'

Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/count/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { COUNT_REDUCER_KEY, countReducer } from '@/eggs/count/reducer'
import { countWatcher } from '@/eggs/count/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/dog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { DOG_REDUCER_KEY, dogReducer } from '@/eggs/dog/reducer'
import { loadDogWatcher } from '@/eggs/dog/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/fox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { FOX_REDUCER_KEY, foxReducer } from '@/eggs/fox/reducer'
import { loadFoxWatcher } from '@/eggs/fox/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/picsum/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { PICSUM_REDUCER_KEY, picsumReducer } from '@/eggs/picsum/reducer'
import { loadPicsumWatcher } from '@/eggs/picsum/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/posts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg, EggEventHandler } from '@redux-eggs/redux'
import type { Egg, EggEventHandler } from '@redux-eggs/core'

import { POSTS_REDUCER_KEY, postsReducer } from '@/eggs/posts/reducer'
import { loadPostsWatcher } from '@/eggs/posts/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/users/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { USERS_REDUCER_KEY, usersReducer } from '@/eggs/users/reducer'
import { loadUsersWatcher } from '@/eggs/users/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/eggs/xkcd/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { XkcdPublicAction } from '@/eggs/xkcd/action-creators'
import { XKCD_REDUCER_KEY, xkcdReducer } from '@/eggs/xkcd/reducer'
Expand Down
1 change: 1 addition & 0 deletions examples/example-next-gip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
]
},
"dependencies": {
"@redux-eggs/core": "workspace:*",
"@redux-eggs/next": "workspace:*",
"@redux-eggs/react": "workspace:*",
"@redux-eggs/redux": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/store/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EggExt } from '@redux-eggs/core'
import { createWrapperInitializer } from '@redux-eggs/next'
import type { EggExt } from '@redux-eggs/redux'
import { createStore } from '@redux-eggs/redux'
import type { SagaExt } from '@redux-eggs/saga-extension'
import { getSagaExtension } from '@redux-eggs/saga-extension'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-gip/store/logger-extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Extension } from '@redux-eggs/redux'
import type { Extension } from '@redux-eggs/core'
import type { Middleware } from 'redux'

export const getLoggerExtension = (): Extension => {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/active-post/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadActivePostWatcher } from '@/eggs/active-post/saga'
import { ACTIVE_POST_SLICE, activePostReducer } from '@/eggs/active-post/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/aviasales/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { aviasalesSaga } from '@/eggs/aviasales/saga'
import { AVIASALES_SLICE, aviasalesReducer } from '@/eggs/aviasales/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/chuck-norris/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadChuckNorrisJokeWatcher } from '@/eggs/chuck-norris/saga'
import { CHUCK_NORRIS_SLICE, ChuckNorrisPublicAction, chuckNorrisReducer } from '@/eggs/chuck-norris/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/clock/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { startClockWatcher } from '@/eggs/clock/saga'
import { CLOCK_SLICE, clockReducer } from '@/eggs/clock/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EggTuple } from '@redux-eggs/redux-toolkit'
import type { EggTuple } from '@redux-eggs/core'

import { getXkcdEgg } from '@/eggs/xkcd'

Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/count/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { countWatcher } from '@/eggs/count/saga'
import { COUNT_SLICE, countReducer } from '@/eggs/count/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/dog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadDogWatcher } from '@/eggs/dog/saga'
import { DOG_SLICE, dogReducer } from '@/eggs/dog/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/fox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadFoxWatcher } from '@/eggs/fox/saga'
import { FOX_SLICE, foxReducer } from '@/eggs/fox/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/picsum/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadPicsumWatcher } from '@/eggs/picsum/saga'
import { PICSUM_SLICE, picsumReducer } from '@/eggs/picsum/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/posts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg, EggEventHandler } from '@redux-eggs/redux-toolkit'
import type { Egg, EggEventHandler } from '@redux-eggs/core'

import { loadPostsWatcher } from '@/eggs/posts/saga'
import { POSTS_SLICE, postsReducer } from '@/eggs/posts/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/users/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadUsersWatcher } from '@/eggs/users/saga'
import { USERS_SLICE, usersReducer } from '@/eggs/users/slice'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/eggs/xkcd/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux-toolkit'
import type { Egg } from '@redux-eggs/core'

import { loadXkcdInfoWatcher } from '@/eggs/xkcd/saga'
import { XKCD_SLICE, XkcdPublicAction, xkcdReducer } from '@/eggs/xkcd/slice'
Expand Down
1 change: 1 addition & 0 deletions examples/example-next-rtk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
]
},
"dependencies": {
"@redux-eggs/core": "workspace:*",
"@redux-eggs/next": "workspace:*",
"@redux-eggs/react": "workspace:*",
"@redux-eggs/redux-toolkit": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/store/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EggExt } from '@redux-eggs/core'
import { createWrapperInitializer } from '@redux-eggs/next'
import type { EggExt } from '@redux-eggs/redux-toolkit'
import { createStore } from '@redux-eggs/redux-toolkit'
import type { SagaExt } from '@redux-eggs/saga-extension'
import { getSagaExtension } from '@redux-eggs/saga-extension'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next-rtk/store/logger-extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Extension } from '@redux-eggs/redux-toolkit'
import type { Extension } from '@redux-eggs/core'
import type { Middleware } from '@reduxjs/toolkit'

export const getLoggerExtension = (): Extension => {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/active-post/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { ACTIVE_POST_REDUCER_KEY, activePostReducer } from '@/eggs/active-post/reducer'
import { loadActivePostWatcher } from '@/eggs/active-post/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/aviasales/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { AVIASALES_REDUCER_KEY, aviasalesReducer } from '@/eggs/aviasales/reducer'
import { aviasalesSaga } from '@/eggs/aviasales/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/chuck-norris/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { ChuckNorrisPublicAction } from '@/eggs/chuck-norris/action-creators'
import { CHUCK_NORRIS_REDUCER_KEY, chuckNorrisReducer } from '@/eggs/chuck-norris/reducer'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/clock/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { CLOCK_REDUCER_KEY, clockReducer } from '@/eggs/clock/reducer'
import { startClockWatcher } from '@/eggs/clock/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EggTuple } from '@redux-eggs/redux'
import type { EggTuple } from '@redux-eggs/core'

import { getXkcdEgg } from '@/eggs/xkcd'

Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/count/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { COUNT_REDUCER_KEY, countReducer } from '@/eggs/count/reducer'
import { countWatcher } from '@/eggs/count/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/dog/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { DOG_REDUCER_KEY, dogReducer } from '@/eggs/dog/reducer'
import { loadDogWatcher } from '@/eggs/dog/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/fox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { FOX_REDUCER_KEY, foxReducer } from '@/eggs/fox/reducer'
import { loadFoxWatcher } from '@/eggs/fox/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/picsum/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { PICSUM_REDUCER_KEY, picsumReducer } from '@/eggs/picsum/reducer'
import { loadPicsumWatcher } from '@/eggs/picsum/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/posts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg, EggEventHandler } from '@redux-eggs/redux'
import type { Egg, EggEventHandler } from '@redux-eggs/core'

import { POSTS_REDUCER_KEY, postsReducer } from '@/eggs/posts/reducer'
import { loadPostsWatcher } from '@/eggs/posts/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/users/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { USERS_REDUCER_KEY, usersReducer } from '@/eggs/users/reducer'
import { loadUsersWatcher } from '@/eggs/users/saga'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/eggs/xkcd/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'

import { XkcdPublicAction } from '@/eggs/xkcd/action-creators'
import { XKCD_REDUCER_KEY, xkcdReducer } from '@/eggs/xkcd/reducer'
Expand Down
1 change: 1 addition & 0 deletions examples/example-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
]
},
"dependencies": {
"@redux-eggs/core": "workspace:*",
"@redux-eggs/next": "workspace:*",
"@redux-eggs/react": "workspace:*",
"@redux-eggs/redux": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/store/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EggExt } from '@redux-eggs/core'
import { createWrapperInitializer } from '@redux-eggs/next'
import type { EggExt } from '@redux-eggs/redux'
import { createStore } from '@redux-eggs/redux'
import type { SagaExt } from '@redux-eggs/saga-extension'
import { getSagaExtension } from '@redux-eggs/saga-extension'
Expand Down
2 changes: 1 addition & 1 deletion examples/example-next/store/logger-extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Extension } from '@redux-eggs/redux'
import type { Extension } from '@redux-eggs/core'
import type { Middleware } from 'redux'

export const getLoggerExtension = (): Extension => {
Expand Down
4 changes: 2 additions & 2 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Redux Eggs wrapper for [Next.js](https://nextjs.org/) applications.
If you are using **Yarn**, run

```shell
yarn add @redux-eggs/next
yarn add @redux-eggs/core @redux-eggs/next
```

If you are using **NPM**, run

```shell
npm install --save @redux-eggs/next
npm install --save @redux-eggs/core @redux-eggs/next
```

`// TODO`
3 changes: 1 addition & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
"@redux-eggs-internal/rollup-plugin-filesize": "1.0.0",
"@redux-eggs/core": "1.0.5",
"@redux-eggs/redux": "1.0.5",
"@redux-eggs/redux-toolkit": "1.0.5",
"@reduxjs/toolkit": "1.6.2",
"@rollup/plugin-eslint": "8.0.1",
"@testing-library/react": "12.1.2",
"@types/jest": "27.0.2",
Expand Down Expand Up @@ -57,6 +55,7 @@
"typescript": "4.4.4"
},
"peerDependencies": {
"@redux-eggs/core": "^1.0.5",
"next": ">=11.1.0",
"react": "^16.8.3 || ^17.0.0",
"react-redux": "^7.0.0"
Expand Down
6 changes: 4 additions & 2 deletions packages/next/src/client/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* @jest-environment jsdom
*/

import type { Egg, StoreCreatorOptions } from '@redux-eggs/redux'
import { createStore, REDUCE_ACTION_TYPE } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'
import { REDUCE_ACTION_TYPE } from '@redux-eggs/core'
import type { StoreCreatorOptions } from '@redux-eggs/redux'
import { createStore } from '@redux-eggs/redux'
import type { RenderResult } from '@testing-library/react'
import { act, render } from '@testing-library/react'
import type { NextPage } from 'next'
Expand Down
42 changes: 22 additions & 20 deletions packages/next/src/server/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @jest-environment node
*/

import type { Egg } from '@redux-eggs/redux'
import type { Egg } from '@redux-eggs/core'
import { createStore as createReduxStore, createStore } from '@redux-eggs/redux'
import type {
GetServerSideProps,
Expand Down Expand Up @@ -1566,31 +1566,33 @@ describe('Next Eggs Wrapper tests (Server-side)', () => {
}
})

const getStaticProps: GetStaticProps<Props, InferGetStaticPathsQueryType<typeof getStaticPaths>> =
wrapper.wrapGetStaticProps(() => context => {
if (context.params?.q === '404') {
return {
notFound: true,
}
}

if (context.params?.q === '308') {
return {
redirect: {
permanent: true,
destination: '/',
},
revalidate: 1,
}
const getStaticProps: GetStaticProps<
Props,
InferGetStaticPathsQueryType<typeof getStaticPaths>
> = wrapper.wrapGetStaticProps(() => context => {
if (context.params?.q === '404') {
return {
notFound: true,
}
}

if (context.params?.q === '308') {
return {
props: {
num: 123,
redirect: {
permanent: true,
destination: '/',
},
revalidate: 1,
}
})
}

return {
props: {
num: 123,
},
revalidate: 1,
}
})

expect((wrapper.wrapPage(PageComponent) as EggsConfig).__eggs).toEqual([])
expect(await getStaticPaths({} as any)).toEqual({ paths: [{ params: { q: 'query' } }], fallback: false })
Expand Down
Loading

0 comments on commit 97b1e68

Please sign in to comment.