diff --git a/.changeset/config.json b/.changeset/config.json index 70058eb..814e2f9 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,8 +1,8 @@ { "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "udecode/zustood" }], + "changelog": ["@changesets/changelog-github", { "repo": "udecode/zustand-x" }], "commit": false, - "linked": [["@udecode/zustood*"]], + "linked": [["zustand-x"]], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 9ed9910..7b9a7b4 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,6 +1,6 @@ --- name: '🚨 Bug' -about: A bug that occurs in zustood logic +about: A bug that occurs in zustand-x logic title: '' labels: bug assignees: '' diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 757af71..e2b5f06 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: "💬 Support: Discussions" - url: https://github.com/udecode/zustood/discussions + url: https://github.com/udecode/zustand-x/discussions about: Share ideas, ask and answer questions in our Discussions. \ No newline at end of file diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml index 1fe4a22..60812d3 100644 --- a/.github/workflows/comment.yml +++ b/.github/workflows/comment.yml @@ -72,4 +72,4 @@ jobs: with: issue-number: ${{ github.event.issue.number }} body: | - A new release has been made for this pull request. You can install it with `yarn add @udecode/zustood@${{ steps.version.outputs.version }}`. \ No newline at end of file + A new release has been made for this pull request. You can install it with `yarn add zustand-x@${{ steps.version.outputs.version }}`. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fca4d61..7312e29 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Thanks for your interest in improving `zustood`! We are a +Thanks for your interest in improving `zustand-x`! We are a community-driven project and welcome contributions of all kinds: from discussion to documentation to bugfixes to feature improvements. @@ -12,7 +12,7 @@ everyone's precious time. No software is bug-free. So, if you got an issue, follow these steps: - Search the - [issue list](https://github.com/udecode/zustood/issues?utf8=%E2%9C%93&q=) + [issue list](https://github.com/udecode/zustand-x/issues?utf8=%E2%9C%93&q=) for current and old issues. - If you find an existing issue, please UPVOTE the issue by adding a "thumbs-up reaction". We use this to help prioritize issues! @@ -33,8 +33,8 @@ package manager. See [installation guide](https://yarnpkg.com/en/docs/install). 1. `cd ~` (optional) -2. `git clone https://github.com/udecode/zustood.git` _bonus_: use your own fork for this step -3. `cd zustood` +2. `git clone https://github.com/udecode/zustand-x.git` _bonus_: use your own fork for this step +3. `cd zustand-x` 4. `yarn install` 5. `yarn build` @@ -111,7 +111,7 @@ a PR if tests are failing. include a short description of what you contributed and, if it is a code change, instructions for how to manually test out the change. This is informally enforced by our -[PR template](https://github.com/udecode/zustood/blob/main/.github/PULL_REQUEST_TEMPLATE.md). +[PR template](https://github.com/udecode/zustand-x/blob/main/.github/PULL_REQUEST_TEMPLATE.md). If your PR is reviewed as only needing trivial changes (e.g. small typos etc), and you have commit access then you can merge the PR after making those changes. @@ -132,7 +132,7 @@ great place to start. Here's how you can help: ### Responding to questions -[Q&A](https://github.com/udecode/zustood/discussions/categories/q-a) is a +[Q&A](https://github.com/udecode/zustand-x/discussions/categories/q-a) is a great place to help. If you can answer a question, it will help the asker as well as anyone who has a similar question. Also in the future if anyone has that same question they can easily find it by searching. @@ -160,7 +160,7 @@ labels to filter issues down so we can see all of the issues for a particular area, and keep the total number of open issues under control. For example, here is the list of -[open, untyped issues](https://github.com/udecode/zustood/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20-label%3A%22bug%22%20-label%3A%22discussion%22%20-label%3A%22feature%22%20-label%3A%22maintenance%22%20-label%3A%22question%20%2F%20support%22%20-label%3A%22documentation%22%20-label%3A%22greenkeeper%22). +[open, untyped issues](https://github.com/udecode/zustand-x/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20-label%3A%22bug%22%20-label%3A%22discussion%22%20-label%3A%22feature%22%20-label%3A%22maintenance%22%20-label%3A%22question%20%2F%20support%22%20-label%3A%22documentation%22%20-label%3A%22greenkeeper%22). For more info see [searching issues](https://help.github.com/articles/searching-issues/) in the Github docs. diff --git a/README.md b/README.md index 9649565..18c68fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Zustood +# ZustandX [Zustand](https://github.com/pmndrs/zustand) is a small, fast and scalable state-management solution battle-tested against common @@ -9,21 +9,21 @@ and [context loss](https://github.com/facebook/react/issues/13332) between mixed renderers. It may be the one state-manager in the React space that gets all of these right. -As zustand is un-opinionated by design, it's challenging to find out the +As `zustand` is un-opinionated by design, it's challenging to find out the best patterns to use when creating stores, often leading to boilerplate code. -Zustood, built on top of zustand, is providing a powerful store factory +`zustand-x`, built on top of `zustand`, is providing a powerful store factory which solves these challenges, so you can focus on your app. ```bash -yarn add zustand @udecode/zustood +yarn add zustand zustand-x ``` -Visit [zustood.netlify.app](https://zustood.netlify.app) for the +Visit [zustand-x.netlify.app](https://zustand-x.netlify.app) for the API. -### Why zustood over zustand? +### Why zustand-x in addition to zustand? - Much less boilerplate - Modular state management: @@ -36,10 +36,10 @@ API. ## Create a store ```ts -import { createStore } from '@udecode/zustood' +import { createStore } from 'zustand-x' const repoStore = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, owner: { name: 'someone', @@ -53,7 +53,7 @@ const repoStore = createStore('repo')({ - the parameter of the second function is the initial state of your store - the main difference with zustand is that you don't need to define a - getter and a setter for each field, these are generated by zustood + getter and a setter for each field, these are generated by zustand-x Note that the zustand store is accessible through: @@ -110,12 +110,12 @@ repoStore.get.state() ### Extend selectors You generally want to write derived selectors (those depending on other -selectors) for reusability. Zustood supports extending selectors with +selectors) for reusability. ZustandX supports extending selectors with full typescript support: ```ts const repoStore = createStore('repo')({ - name: 'zustood ', + name: 'zustandX', stars: 0, middlewares: ['immer', 'devtools', 'persist'] }) @@ -152,11 +152,11 @@ store.set.state((draft) => { ``` However, you generally want to create derived actions for reusability. -Zustood supports extending actions with full typescript support: +ZustandX supports extending actions with full typescript support: ```ts const repoStore = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }) .extendActions((set, get, api) => ({ @@ -182,7 +182,7 @@ one to import. By combining all the stores, selectors and actions, just pick what you need using TS autocomplete. ```ts -import { mapValuesKey } from '@udecode/zustood'; +import { mapValuesKey } from 'zustand-x'; // Global store export const rootStore = { @@ -281,7 +281,7 @@ export interface CreateStoreOptions { ### Middlewares -Zustood is using these middlewares: +ZustandX is using these middlewares: - `immer`: required. Autofreeze can be enabled using `immer.enabledAutoFreeze` option. - `devtools`: enabled if `devtools.enabled` option is `true`. @@ -294,7 +294,7 @@ Zustood is using these middlewares: ### Ideas and discussions -[Discussions](https://github.com/udecode/zustood/discussions) is the best +[Discussions](https://github.com/udecode/zustand-x/discussions) is the best place for bringing opinions and contributions. Letting us know if we're going in the right or wrong direction is great feedback and will be much appreciated! @@ -305,7 +305,7 @@ appreciated! 🌟 Stars and 📥 Pull requests are welcome! Don't hesitate to **share your feedback** here. Read our -[contributing guide](https://github.com/udecode/zustood/blob/main/CONTRIBUTING.md) +[contributing guide](https://github.com/udecode/zustand-x/blob/main/CONTRIBUTING.md) to get started.

@@ -316,4 +316,4 @@ to get started. ## License -[MIT](https://github.com/udecode/zustood/blob/main/LICENSE) +[MIT](https://github.com/udecode/zustand-x/blob/main/LICENSE) diff --git a/packages/zustood/README.md b/packages/zustood/README.md index 3af0513..04a0810 100644 --- a/packages/zustood/README.md +++ b/packages/zustood/README.md @@ -1,4 +1,7 @@ -# Zustood +> [!NOTE] +> `@udecode/zustood` has been renamed to `zustand-x`. + +# ZustandX [Zustand](https://github.com/pmndrs/zustand) is a small, fast and scalable state-management solution battle-tested against common @@ -13,17 +16,17 @@ As zustand is un-opinionated by design, it's challenging to find out the best patterns to use when creating stores, often leading to boilerplate code. -Zustood, built on top of zustand, is providing a powerful store factory +ZustandX, built on top of zustand, is providing a powerful store factory which solves these challenges, so you can focus on your app. ```bash -yarn add zustand @udecode/zustood +yarn add zustand zustand-x ``` -Visit [zustood.udecode.io](https://zustood.udecode.io) for the +Visit [zustand-x.udecode.io](https://zustand-x.udecode.io) for the API. -### Why zustood over zustand? +### Why zustand-x over zustand? - Much less boilerplate - Modular state management: @@ -35,10 +38,10 @@ API. ## Create a store ```ts -import { createStore } from '@udecode/zustood' +import { createStore } from 'zustand-x' const repoStore = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }) ``` @@ -48,7 +51,7 @@ const repoStore = createStore('repo')({ - the parameter of the second function is the initial state of your store - the main difference with zustand is that you don't need to define a - getter and a setter for each field, these are generated by zustood + getter and a setter for each field, these are generated by zustand-x Note that the zustand store is accessible through: @@ -94,12 +97,12 @@ repoStore.get.state() ### Extend selectors You generally want to write derived selectors (those depending on other -selectors) for reusability. Zustood supports extending selectors with +selectors) for reusability. ZustandX supports extending selectors with full typescript support: ```ts const repoStore = createStore('repo')({ - name: 'zustood ', + name: 'zustandX', stars: 0, }) .extendSelectors((set, get, api) => ({ @@ -135,11 +138,11 @@ store.set.state((draft) => { ``` However, you generally want to create derived actions for reusability. -Zustood supports extending actions with full typescript support: +ZustandX supports extending actions with full typescript support: ```ts const repoStore = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }) .extendActions((set, get, api) => ({ @@ -165,7 +168,7 @@ one to import. By combining all the stores, selectors and actions, just pick what you need using TS autocomplete. ```ts -import { mapValuesKey } from '@udecode/zustood'; +import { mapValuesKey } from 'zustand-x'; // Global store export const rootStore = { @@ -230,7 +233,7 @@ export interface CreateStoreOptions { ### Middlewares -Zustood is using these middlewares: +ZustandX is using these middlewares: - `immer`: required. Autofreeze can be enabled using `immer.enabledAutoFreeze` option. - `devtools`: enabled if `devtools.enabled` option is `true`. @@ -243,7 +246,7 @@ Zustood is using these middlewares: ### Ideas and discussions -[Discussions](https://github.com/udecode/zustood/discussions) is the best +[Discussions](https://github.com/udecode/zustand-x/discussions) is the best place for bringing opinions and contributions. Letting us know if we're going in the right or wrong direction is great feedback and will be much appreciated! @@ -254,9 +257,9 @@ appreciated! 🌟 Stars and 📥 Pull requests are welcome! Don't hesitate to **share your feedback** here. Read our -[contributing guide](https://github.com/udecode/zustood/blob/main/CONTRIBUTING.md) +[contributing guide](https://github.com/udecode/zustand-x/blob/main/CONTRIBUTING.md) to get started. ## License -[MIT](https://github.com/udecode/zustood/blob/main/LICENSE) +[MIT](https://github.com/udecode/zustand-x/blob/main/LICENSE) diff --git a/packages/zustood/package.json b/packages/zustood/package.json index ad2b238..f62f3aa 100644 --- a/packages/zustood/package.json +++ b/packages/zustood/package.json @@ -1,18 +1,18 @@ { - "name": "@udecode/zustood", + "name": "zustand-x", "version": "2.0.0", "description": "A modular store factory using zustand", "keywords": [ "zustand" ], - "homepage": "https://github.com/udecode/zustood", + "homepage": "https://github.com/udecode/zustand-x", "bugs": { - "url": "https://github.com/udecode/zustood/issues" + "url": "https://github.com/udecode/zustand-x/issues" }, "repository": { "type": "git", - "url": "https://github.com/udecode/zustood.git", - "directory": "packages/zustood" + "url": "https://github.com/udecode/zustand-x.git", + "directory": "packages/zustand-x" }, "license": "MIT", "main": "dist/index.js", diff --git a/packages/zustood/src/createStore.spec.ts b/packages/zustood/src/createStore.spec.ts index a3e7547..039bb8f 100644 --- a/packages/zustood/src/createStore.spec.ts +++ b/packages/zustood/src/createStore.spec.ts @@ -1,20 +1,20 @@ import { createStore } from './createStore'; -describe('zustood', () => { +describe('zustandX', () => { describe('when get', () => { const store = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }); it('should be', () => { - expect(store.get.name()).toEqual('zustood'); + expect(store.get.name()).toEqual('zustandX'); }); }); describe('when extending actions', () => { const store = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }) .extendActions((set, get, api) => ({ @@ -41,7 +41,7 @@ describe('zustood', () => { describe('when extending selectors', () => { const store = createStore('repo')({ - name: 'zustood ', + name: 'zustandX ', stars: 0, }) .extendSelectors((set, get, api) => ({ @@ -54,14 +54,14 @@ describe('zustood', () => { it('should be', () => { expect(store.get.title('Repository: ')).toBe( - 'Repository: zustood with 0 stars' + 'Repository: zustandX with 0 stars' ); }); }); describe('when set.state', () => { const store = createStore('repo')({ - name: 'zustood', + name: 'zustandX', stars: 0, }); @@ -80,7 +80,7 @@ describe('zustood', () => { describe('deletes a property', () => { it('should delete that property', () => { const store = createStore('repo')<{ name?: string; stars: number }>({ - name: 'zustood', + name: 'zustandX', stars: 0, }); diff --git a/scripts/typedoc.json b/scripts/typedoc.json index 87110cc..b1597f0 100644 --- a/scripts/typedoc.json +++ b/scripts/typedoc.json @@ -7,9 +7,9 @@ "**/*.development.*" ], "includeVersion": true, - "name": "@udecode/zustood", - "entryPoints": ["../packages/zustood/src/index.ts"], + "name": "zustand-x", + "entryPoints": ["../packages/zustand-x/src/index.ts"], "out": "../typedoc", - "tsconfig": "../packages/zustood/tsconfig.json", + "tsconfig": "../packages/zustand-x/tsconfig.json", "readme": "./README.md" }