Skip to content

Commit

Permalink
⬆️ big deps upgrade (vitepress/eslint)
Browse files Browse the repository at this point in the history
  • Loading branch information
prazdevs committed Jan 10, 2024
1 parent 06c96d9 commit c4af844
Show file tree
Hide file tree
Showing 24 changed files with 2,949 additions and 1,478 deletions.
5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

49 changes: 24 additions & 25 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<!-- DO NOT IGNORE THE TEMPLATE!
Thank you for contributing!
Before submitting the PR, please make sure you do the following:
- Read the [Contributing Guide](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/CONTRIBUTING.md).
- Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- Ideally, include relevant tests that fail without this PR but pass with it.
-->

## Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

## Linked Issues

<!-- Reference the issues this PR solves -->


## Additional context

<!-- e.g. is there anything you'd like reviewers to focus on? -->
<!-- DO NOT IGNORE THE TEMPLATE!
Thank you for contributing!
Before submitting the PR, please make sure you do the following:
- Read the [Contributing Guide](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/CONTRIBUTING.md).
- Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- Ideally, include relevant tests that fail without this PR but pass with it.
-->

## Description

<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->

## Linked Issues

<!-- Reference the issues this PR solves -->

## Additional context

<!-- e.g. is there anything you'd like reviewers to focus on? -->
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ If it is your first time or you need help creating a PR, you can [read the GitHu

When submitting a pull request, make sure your PR's title also follows the [commit convention](#commit-convention).


If your PR fixes or resolves an existing issue, please link it in your PR description (replace `123` with a real issue number):

```md
Expand All @@ -84,7 +83,7 @@ Commits in the PR don't matter as they are [squashed and merged](https://docs.gi

To maintain this project's quality, make sure the [`build`](#pnpm-run-build), [`test`](#pnpm-run-test) run successfully on your machine before submitting the PR.

When adding new features and introducing new source code into the `core` of the plugin, try to add related test cases.
When adding new features and introducing new source code into the `core` of the plugin, try to add related test cases.
If you need help implementing them, you can specify it in the description and we will gladly help you doing so!
_Helpers such as the `/nuxt` don't need to be tested as they are just pre-configured plugins and rely on external tools/frameworks._

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Want to add some feature? PRs are welcome!

## 👤 About the author

Feel free to contact me:
Feel free to contact me:

[![twitter: @prazdevs](https://img.shields.io/twitter/follow/prazdevs?style=social)](https://twitter.com/prazdevs)

## 📝 License

Copyright © 2021-present [Sacha Bouillez](https://github.com/prazdevs).
Copyright © 2021-present [Sacha Bouillez](https://github.com/prazdevs).
This project is under [MIT](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/LICENSE) license.
4 changes: 2 additions & 2 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default defineConfig({
lastUpdated: true,
markdown: {
theme: {
light: 'css-variables',
dark: 'css-variables',
light: 'catppuccin-latte',
dark: 'catppuccin-mocha',
},
},
themeConfig: {
Expand Down
1 change: 0 additions & 1 deletion docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export const useStore = defineStore('store', {
In this store, only `save.me` and `saveMeToo` values will be persisted. `save.notMe` will not be persisted.
:::


## serializer

- **type**: [`Serializer`](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/packages/plugin/src/types.ts#L5)
Expand Down
3 changes: 0 additions & 3 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ This plugin is compatible with `pinia^2.0.0`, make sure you have [Pinia installe
- Compatibility with Vue 2 and 3.
- No external dependencies.


## Installation

1. Install the dependency with your favorite package manager:
Expand Down Expand Up @@ -69,6 +68,4 @@ export const useStore = defineStore(
```
:::



Your whole store will now be saved with the [default persistence settings](/guide/config).
2 changes: 1 addition & 1 deletion docs/guide/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ While the plugin offers a lot of flexibility and functionality, there are some l

## References are not persisted

Due to serialization process, references are lost on refresh.
Due to serialization process, references are lost on refresh.
Consider the following:

```ts
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/why.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Why this plugin ?

This plugin was born in the early days of Pinia, before it officially replaced [VueX](https://vuex.vuejs.org/). It aims to reproduce [vuex-persistedstate](https://github.com/robinvdvleuten/vuex-persistedstate) for Pinia.
This plugin was born in the early days of Pinia, before it officially replaced [VueX](https://vuex.vuejs.org/). It aims to reproduce [vuex-persistedstate](https://github.com/robinvdvleuten/vuex-persistedstate) for Pinia.

## Do I need a plugin to persist my stores ?

Expand Down
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ features:
- title: Usable everywhere
details: Compatible with Vue 2 and 3, Nuxt (SSR), and everything that can use Pinia.
---

17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import config from '@antfu/eslint-config'

export default config({
ignores: ['**/cache'],
}, {
files: ['packages/plugin/src/types.ts'],
rules: {
'ts/no-unused-vars': [
'error',
{ varsIgnorePattern: '^S$|^Store$' },
],
'unused-imports/no-unused-vars': [
'error',
{ varsIgnorePattern: '^S$|^Store$' },
],
},
})
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "3.1.0",
"private": true,
"packageManager": "pnpm@8.7.6",
"packageManager": "pnpm@8.14.0",
"description": "Monorepo for pinia-plugin-persistedstate",
"author": "prazdevs",
"license": "MIT",
Expand All @@ -25,22 +25,23 @@
"release:nuxt": "pnpm -F @pinia-plugin-persistedstate/nuxt run release"
},
"devDependencies": {
"@antfu/eslint-config": "^0.42.0",
"@types/node": "^20.6.2",
"@vitest/coverage-v8": "^0.34.4",
"@vitest/ui": "^0.34.4",
"bumpp": "^9.2.0",
"eslint": "^8.49.0",
"happy-dom": "^12.0.1",
"lint-staged": "^14.0.1",
"@antfu/eslint-config": "^2.6.2",
"@types/node": "^20.10.8",
"@vitest/coverage-v8": "^1.1.3",
"@vitest/ui": "^1.1.3",
"bumpp": "^9.2.1",
"eslint": "^8.56.0",
"happy-dom": "^12.10.3",
"lint-staged": "^15.2.0",
"simple-git-hooks": "^2.9.0",
"stale-dep": "^0.7.0",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vitepress": "1.0.0-rc.14",
"vitest": "^0.34.4",
"vue": "^3.3.4"
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vite": "^5.0.11",
"vitepress": "1.0.0-rc.36",
"vitepress-plugin-twoslash": "^0.9.18",
"vitest": "^1.1.3",
"vue": "^3.4.7"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged"
Expand Down
4 changes: 1 addition & 3 deletions packages/nuxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ export default defineNuxtConfig({
})
```


## 🔧 Configuration

Usage and configuration informations can be found in [the documentation](https://prazdevs.github.io/pinia-plugin-persistedstate/frameworks/nuxt-3.html)


## 📝 License

Copyright © 2022 [Sacha Bouillez](https://github.com/prazdevs).
Copyright © 2022 [Sacha Bouillez](https://github.com/prazdevs).
This project is under [MIT](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/LICENSE) license.
16 changes: 8 additions & 8 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
"@pinia/nuxt": "^0.5.0"
},
"dependencies": {
"@nuxt/kit": "^3.8.0",
"defu": "^6.1.2",
"pinia-plugin-persistedstate": ">=3.2.0"
"@nuxt/kit": "^3.9.1",
"defu": "^6.1.4",
"pinia-plugin-persistedstate": ">=3.2.1"
},
"devDependencies": {
"@nuxt/module-builder": "^0.5.2",
"@nuxt/schema": "^3.8.0",
"@nuxt/test-utils": "^3.8.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.9.1",
"@nuxt/test-utils": "^3.9.0",
"@pinia/nuxt": "^0.5.1",
"eslint": "^8.49.0",
"nuxt": "^3.8.0"
"eslint": "^8.56.0",
"nuxt": "^3.9.1"
}
}
4 changes: 2 additions & 2 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { addImports, addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'
import { type CookieOptions } from 'nuxt/app'
import { type NuxtModule } from 'nuxt/schema'
import type { CookieOptions } from 'nuxt/app'
import type { NuxtModule } from 'nuxt/schema'
import { defu } from 'defu'

export interface ModuleOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Pinia } from 'pinia'
import type { Pinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate'

import { type ModuleOptions } from '../module'
import type { ModuleOptions } from '../module'

import { defineNuxtPlugin, useRuntimeConfig } from '#app'
import { persistedState } from '#imports'
Expand Down
21 changes: 0 additions & 21 deletions packages/plugin/.eslintrc

This file was deleted.

4 changes: 1 addition & 3 deletions packages/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
```


## 🔧 Configuration

Usage and configuration informations can be found in [the documentation](https://prazdevs.github.io/pinia-plugin-persistedstate/guide/)


## 📝 License

Copyright © 2022 [Sacha Bouillez](https://github.com/prazdevs).
Copyright © 2022 [Sacha Bouillez](https://github.com/prazdevs).
This project is under [MIT](https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/LICENSE) license.
3 changes: 2 additions & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "pinia-plugin-persistedstate",
"type": "module",
"version": "3.2.1",
"description": "Configurable persistence and rehydration of Pinia stores.",
"author": "prazdevs",
Expand Down Expand Up @@ -38,6 +39,6 @@
"pinia": "^2.0.0"
},
"devDependencies": {
"pinia": "^2.1.6"
"pinia": "^2.1.7"
}
}
10 changes: 5 additions & 5 deletions packages/plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import type {

import { normalizeOptions } from './normalize'
import { pick } from './pick'
import {
type PersistedStateFactoryOptions,
type PersistedStateOptions,
type Serializer,
type StorageLike,
import type {
PersistedStateFactoryOptions,
PersistedStateOptions,
Serializer,
StorageLike,
} from './types'

interface Persistence {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type PiniaPluginContext, type StateTree } from 'pinia'
import type { PiniaPluginContext, StateTree } from 'pinia'

type Prettify<T> = { [K in keyof T]: T[K] }

Expand Down
8 changes: 4 additions & 4 deletions packages/plugin/tests/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ describe('default', () => {
//* arrange
const error = new Error('access_denied')
Object.defineProperty(window, 'localStorage', {
get: () => { throw error }
get: () => { throw error },
})
const spy = vi
.spyOn(globalThis.console, 'error')
Expand All @@ -448,7 +448,7 @@ describe('default', () => {
useStore()

//* assert
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]' ,error)
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]', error)
})

it('error logs hydration errors', () => {
Expand All @@ -474,7 +474,7 @@ describe('default', () => {
useStore()

//* assert
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]' ,error)
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]', error)
})

it('error logs persistence errors', async () => {
Expand Down Expand Up @@ -502,7 +502,7 @@ describe('default', () => {
await nextTick()

//* assert
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]' ,error)
expect(spy).toHaveBeenCalledWith('[pinia-plugin-persistedstate]', error)
})
})

Expand Down
Loading

0 comments on commit c4af844

Please sign in to comment.