generated from react18-tools/turborepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from react18-tools/standardise
Standardise
- Loading branch information
Showing
24 changed files
with
361 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*lock.* | ||
*lock.* | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode"] | ||
"recommendations": ["esbenp.prettier-vscode", "mayank1513.trello-kanban-task-board"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module.exports = { | ||
extends: ["custom/next"], | ||
rules: { | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# nextjs | ||
|
||
## 1.0.2 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [2894d47] | ||
- [email protected] | ||
|
||
## 1.0.1 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,15 @@ | |
"build": "turbo run build", | ||
"dev": "turbo run dev", | ||
"lint": "turbo run lint", | ||
"test": "turbo run test", | ||
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,css,scss}\"" | ||
}, | ||
"devDependencies": { | ||
"@changesets/cli": "^2.26.2", | ||
"eslint": "^8.47.0", | ||
"prettier": "^3.0.2", | ||
"@changesets/cli": "^2.27.1", | ||
"eslint": "^8.56.0", | ||
"prettier": "^3.1.1", | ||
"tsconfig": "workspace:*", | ||
"turbo": "latest" | ||
"turbo": "^1.11.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "turbo-template" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { act, cleanup, renderHook } from "@testing-library/react"; | ||
|
||
import { afterEach, describe, test } from "vitest"; | ||
import { useCookieStore, useMyStore } from "./store"; | ||
|
||
describe.concurrent("Setting state", () => { | ||
afterEach(cleanup); | ||
test("test initial state", async ({ expect }) => { | ||
const { result } = renderHook(() => useMyStore()); | ||
expect(result.current.count).toBe(0); | ||
}); | ||
|
||
test("test setting state", async ({ expect }) => { | ||
const { result } = renderHook(() => useCookieStore()); | ||
act(() => result.current.setCount(5)); | ||
expect(result.current.count).toBe(5); | ||
}); | ||
|
||
test("test exclude key", async ({ expect }) => { | ||
const { result } = renderHook(() => useCookieStore()); | ||
act(() => result.current.set_Count(6)); | ||
expect(result.current._count).toBe(6); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { create } from "../vitest.setup"; | ||
import { syncTabs } from "../src"; | ||
|
||
type MyStoreType = { | ||
count: number; | ||
_count: number; | ||
setCount: (c: number) => void; | ||
set_Count: (c: number) => void; | ||
}; | ||
|
||
export const useMyStore = create<MyStoreType>( | ||
syncTabs( | ||
set => ({ | ||
count: 0, | ||
_count: 0 /** skipped as it matches the regexp provided */, | ||
setCount: count => set(state => ({ ...state, count })), | ||
set_Count: _count => set(state => ({ ...state, _count })), | ||
}), | ||
{ name: "example", exclude: [/^_/] }, | ||
), | ||
); | ||
|
||
export const useCookieStore = create<MyStoreType>( | ||
syncTabs( | ||
set => ({ | ||
count: 0, | ||
_count: 0 /** skipped as it matches the regexp provided */, | ||
setCount: count => set(state => ({ ...state, count })), | ||
set_Count: _count => set(state => ({ ...state, _count })), | ||
}), | ||
{ name: "example", include: [/count/], exclude: [/^_/] }, | ||
), | ||
); |
Oops, something went wrong.