Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "v1.4.1" #27

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notivue-monorepo",
"version": "1.4.1",
"version": "1.4.0",
"private": true,
"workspaces": [
"packages/*",
Expand All @@ -14,13 +14,12 @@
"build:demo": "bun run build && bun install && cd demo && bun run build",
"test": "bun run build && bun install && cd tests && bun run test",
"test:gui": "bun run build && concurrently \"cd packages/notivue && bun run watch\" \"bun install && cd tests && bun run test:gui\"",
"prepare": "bun x husky install"
"prepare": "bunx husky install"
},
"devDependencies": {
"concurrently": "^8.2.1",
"lint-staged": "^14.0.1",
"prettier": "^2.8.8",
"husky": "^8.0.3"
"prettier": "^2.8.8"
},
"trustedDependencies": [
"husky"
Expand Down
6 changes: 3 additions & 3 deletions packages/notivue/core/useStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useStore() {
* for the fact that each property is a [shallowRef](https://vuejs.org/api/reactivity-advanced.html#shallowref)
* that allows for reactive updates and side effects.
*
* Documentation: https://notivuedocs.netlify.app/api/use-notivue
* Documentation: https://notivue.netlify.app/api/use-notivue
*/
export function useNotivue(): ConfigSlice {
if (isSSR) {
Expand All @@ -36,7 +36,7 @@ export function useNotivue(): ConfigSlice {
*
* Portion of the store matching the actions to create notifications.
*
* Documentation: https://notivuedocs.netlify.app/api/use-push
* Documentation: https://notivue.netlify.app/api/use-push
*/
export function usePush() {
if (isSSR) return createPushSSR()
Expand All @@ -52,7 +52,7 @@ export function usePush() {
* - `entries` - read-only reactive array of all the current displayed notifications
* - `queue` - read-only reactive array of all the notifications waiting to be displayed
*
* Documentation: https://notivuedocs.netlify.app/api/use-notifications
* Documentation: https://notivue.netlify.app/api/use-notifications
*/
export function useNotifications(): NotivueComputedEntries {
if (isSSR) {
Expand Down
3 changes: 1 addition & 2 deletions packages/notivue/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function mergeNotificationOptions<T extends Obj = Obj>(
return {
...(mergedConfigOptions[optionsFromPush.type] ?? mergedConfigOptions.success),
...mergedConfigOptions.global,
...(optionsFromPush.type === 'promise' ? { duration: Infinity } : {}), // Force duration infinity...
...optionsFromPush, // ...except for push options
...optionsFromPush,
}
}
2 changes: 1 addition & 1 deletion packages/notivue/nuxt/module.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "notivue/nuxt",
"configKey": "notivue",
"version": "1.4.1"
"version": "1.4.0"
}
2 changes: 1 addition & 1 deletion packages/notivue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notivue",
"version": "1.4.1",
"version": "1.4.0",
"private": false,
"description": "Fully-featured toast notification system for Vue and Nuxt",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions tests/Notivue/components/Notivue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ function pushSkipQueue() {
}

async function pushPromiseAndResolve() {
const promise = push.promise(cyProps.options ?? {})
const promise = push.promise({ ...cyProps.options, duration: Infinity } ?? {})
await new Promise((resolve) => setTimeout(resolve, RESOLVE_REJECT_DELAY))

promise.resolve(cyProps.newOptions ?? cyProps.options ?? {})
}

async function pushPromiseAndReject() {
const promise = push.promise(cyProps.options ?? {})
const promise = push.promise({ ...cyProps.options, duration: Infinity } ?? {})
await new Promise((resolve) => setTimeout(resolve, RESOLVE_REJECT_DELAY))

promise.reject(cyProps.newOptions ?? cyProps.options ?? {})
Expand Down
4 changes: 2 additions & 2 deletions tests/Notivue/slot-custom-push-options.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ describe('Push notification options are merged properly with config', () => {
.checkSlotAgainst(expectedOptions)
})

it('Promise - Should not override promise duration', () => {
it('Promise', () => {
cy.mountNotivue(componentConf)

.get('.Promise')
.click()
.checkSlotAgainst({ ...expectedOptions, duration: null })
.checkSlotAgainst(expectedOptions)
})
})

Expand Down
4 changes: 2 additions & 2 deletions tests/Notivue/slot-global-options.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ describe('Global options have higher priority over defaults', () => {
.checkSlotAgainst(globalOptions)
})

it('Promise - Should not override duration', () => {
it('Promise', () => {
cy.mountNotivue(customConfig)

.get('.Promise')
.click()
.checkSlotAgainst({ ...globalOptions, duration: null })
.checkSlotAgainst(globalOptions)
})
})

Expand Down