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

fix(build): alias entries in rollup config #2942

Merged
merged 2 commits into from
Jan 7, 2025
Merged

fix(build): alias entries in rollup config #2942

merged 2 commits into from
Jan 7, 2025

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Jan 7, 2025

I think I forgot this change when Zustand v5 lands.

git diff --no-index dist.orig dist
diff --git a/dist.orig/esm/index.d.mts b/dist/esm/index.d.mts
index a65c352..a1afbf8 100644
--- a/dist.orig/esm/index.d.mts
+++ b/dist/esm/index.d.mts
@@ -1,2 +1,2 @@
-export * from './vanilla.mjs';
-export * from './react.mjs';
+export * from 'zustand/vanilla';
+export * from 'zustand/react';
diff --git a/dist.orig/esm/middleware/combine.d.mts b/dist/esm/middleware/combine.d.mts
index d6ebb81..929f8a6 100644
--- a/dist.orig/esm/middleware/combine.d.mts
+++ b/dist/esm/middleware/combine.d.mts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Write<T, U> = Omit<T, keyof U> & U;
 type Combine = <T extends object, U extends object, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initialState: T, additionalStateCreator: StateCreator<T, Mps, Mcs, U>) => StateCreator<Write<T, U>, Mps, Mcs>;
 export declare const combine: Combine;
diff --git a/dist.orig/esm/middleware/devtools.d.mts b/dist/esm/middleware/devtools.d.mts
index 25b4e0d..84ecd83 100644
--- a/dist.orig/esm/middleware/devtools.d.mts
+++ b/dist/esm/middleware/devtools.d.mts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Config = Parameters<(Window extends {
     __REDUX_DEVTOOLS_EXTENSION__?: infer T;
 } ? T : {
diff --git a/dist.orig/esm/middleware/immer.d.mts b/dist/esm/middleware/immer.d.mts
index e90a9e0..677f963 100644
--- a/dist.orig/esm/middleware/immer.d.mts
+++ b/dist/esm/middleware/immer.d.mts
@@ -1,5 +1,5 @@
 import type { Draft } from 'immer';
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Immer = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [...Mps, ['zustand/immer', never]], Mcs>) => StateCreator<T, Mps, [['zustand/immer', never], ...Mcs]>;
 declare module '../vanilla.mjs' {
     interface StoreMutators<S, A> {
diff --git a/dist.orig/esm/middleware/persist.d.mts b/dist/esm/middleware/persist.d.mts
index a3d0207..20b29f7 100644
--- a/dist.orig/esm/middleware/persist.d.mts
+++ b/dist/esm/middleware/persist.d.mts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 export interface StateStorage {
     getItem: (name: string) => string | null | Promise<string | null>;
     setItem: (name: string, value: string) => unknown | Promise<unknown>;
diff --git a/dist.orig/esm/middleware/redux.d.mts b/dist/esm/middleware/redux.d.mts
index 567c3b8..bb297fd 100644
--- a/dist.orig/esm/middleware/redux.d.mts
+++ b/dist/esm/middleware/redux.d.mts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Write<T, U> = Omit<T, keyof U> & U;
 type Action = {
     type: string;
diff --git a/dist.orig/esm/middleware/subscribeWithSelector.d.mts b/dist/esm/middleware/subscribeWithSelector.d.mts
index 306e853..afe0f1e 100644
--- a/dist.orig/esm/middleware/subscribeWithSelector.d.mts
+++ b/dist/esm/middleware/subscribeWithSelector.d.mts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type SubscribeWithSelector = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [
     ...Mps,
     ['zustand/subscribeWithSelector', never]
diff --git a/dist.orig/esm/react.d.mts b/dist/esm/react.d.mts
index c952240..4abfce8 100644
--- a/dist.orig/esm/react.d.mts
+++ b/dist/esm/react.d.mts
@@ -1,4 +1,4 @@
-import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla.mjs';
+import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type ExtractState<S> = S extends {
     getState: () => infer T;
 } ? T : never;
diff --git a/dist.orig/esm/shallow.d.mts b/dist/esm/shallow.d.mts
index d2fc673..806efca 100644
--- a/dist.orig/esm/shallow.d.mts
+++ b/dist/esm/shallow.d.mts
@@ -1,2 +1,2 @@
-export { shallow } from './vanilla/shallow.mjs';
-export { useShallow } from './react/shallow.mjs';
+export { shallow } from 'zustand/vanilla/shallow';
+export { useShallow } from 'zustand/react/shallow';
diff --git a/dist.orig/esm/traditional.d.mts b/dist/esm/traditional.d.mts
index 7ce9909..002463f 100644
--- a/dist.orig/esm/traditional.d.mts
+++ b/dist/esm/traditional.d.mts
@@ -1,4 +1,4 @@
-import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla.mjs';
+import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type ExtractState<S> = S extends {
     getState: () => infer T;
 } ? T : never;
diff --git a/dist.orig/index.d.ts b/dist/index.d.ts
index 2060531..a1afbf8 100644
--- a/dist.orig/index.d.ts
+++ b/dist/index.d.ts
@@ -1,2 +1,2 @@
-export * from './vanilla';
-export * from './react';
+export * from 'zustand/vanilla';
+export * from 'zustand/react';
diff --git a/dist.orig/middleware/combine.d.ts b/dist/middleware/combine.d.ts
index 6e9d2d1..929f8a6 100644
--- a/dist.orig/middleware/combine.d.ts
+++ b/dist/middleware/combine.d.ts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Write<T, U> = Omit<T, keyof U> & U;
 type Combine = <T extends object, U extends object, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initialState: T, additionalStateCreator: StateCreator<T, Mps, Mcs, U>) => StateCreator<Write<T, U>, Mps, Mcs>;
 export declare const combine: Combine;
diff --git a/dist.orig/middleware/devtools.d.ts b/dist/middleware/devtools.d.ts
index 7d72f35..189b575 100644
--- a/dist.orig/middleware/devtools.d.ts
+++ b/dist/middleware/devtools.d.ts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Config = Parameters<(Window extends {
     __REDUX_DEVTOOLS_EXTENSION__?: infer T;
 } ? T : {
diff --git a/dist.orig/middleware/immer.d.ts b/dist/middleware/immer.d.ts
index 9ee1865..e6de523 100644
--- a/dist.orig/middleware/immer.d.ts
+++ b/dist/middleware/immer.d.ts
@@ -1,5 +1,5 @@
 import type { Draft } from 'immer';
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Immer = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [...Mps, ['zustand/immer', never]], Mcs>) => StateCreator<T, Mps, [['zustand/immer', never], ...Mcs]>;
 declare module '../vanilla' {
     interface StoreMutators<S, A> {
diff --git a/dist.orig/middleware/persist.d.ts b/dist/middleware/persist.d.ts
index 2bebf20..23ddcb4 100644
--- a/dist.orig/middleware/persist.d.ts
+++ b/dist/middleware/persist.d.ts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 export interface StateStorage {
     getItem: (name: string) => string | null | Promise<string | null>;
     setItem: (name: string, value: string) => unknown | Promise<unknown>;
diff --git a/dist.orig/middleware/redux.d.ts b/dist/middleware/redux.d.ts
index 41a61e1..509527c 100644
--- a/dist.orig/middleware/redux.d.ts
+++ b/dist/middleware/redux.d.ts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type Write<T, U> = Omit<T, keyof U> & U;
 type Action = {
     type: string;
diff --git a/dist.orig/middleware/subscribeWithSelector.d.ts b/dist/middleware/subscribeWithSelector.d.ts
index 3243f26..ca35387 100644
--- a/dist.orig/middleware/subscribeWithSelector.d.ts
+++ b/dist/middleware/subscribeWithSelector.d.ts
@@ -1,4 +1,4 @@
-import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
+import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
 type SubscribeWithSelector = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [
     ...Mps,
     ['zustand/subscribeWithSelector', never]
diff --git a/dist.orig/react.d.ts b/dist/react.d.ts
index 722a92e..4abfce8 100644
--- a/dist.orig/react.d.ts
+++ b/dist/react.d.ts
@@ -1,4 +1,4 @@
-import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla';
+import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type ExtractState<S> = S extends {
     getState: () => infer T;
 } ? T : never;
diff --git a/dist.orig/shallow.d.ts b/dist/shallow.d.ts
index 7da9b72..806efca 100644
--- a/dist.orig/shallow.d.ts
+++ b/dist/shallow.d.ts
@@ -1,2 +1,2 @@
-export { shallow } from './vanilla/shallow';
-export { useShallow } from './react/shallow';
+export { shallow } from 'zustand/vanilla/shallow';
+export { useShallow } from 'zustand/react/shallow';
diff --git a/dist.orig/traditional.d.ts b/dist/traditional.d.ts
index 918dcd7..002463f 100644
--- a/dist.orig/traditional.d.ts
+++ b/dist/traditional.d.ts
@@ -1,4 +1,4 @@
-import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla';
+import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
 type ExtractState<S> = S extends {
     getState: () => infer T;
 } ? T : never;

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 1:58pm

Copy link

codesandbox-ci bot commented Jan 7, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

github-actions bot commented Jan 7, 2025

Size Change: 0 B

Total Size: 12 kB

ℹ️ View Unchanged
Filename Size
./dist/esm/index.mjs 64 B
./dist/esm/middleware.mjs 3.58 kB
./dist/esm/middleware/immer.mjs 210 B
./dist/esm/react.mjs 320 B
./dist/esm/react/shallow.mjs 193 B
./dist/esm/shallow.mjs 82 B
./dist/esm/traditional.mjs 411 B
./dist/esm/vanilla.mjs 403 B
./dist/esm/vanilla/shallow.mjs 523 B
./dist/index.js 244 B
./dist/middleware.js 3.59 kB
./dist/middleware/immer.js 229 B
./dist/react.js 336 B
./dist/react/shallow.js 208 B
./dist/shallow.js 189 B
./dist/traditional.js 423 B
./dist/vanilla.js 416 B
./dist/vanilla/shallow.js 535 B

compressed-size-action

Copy link

pkg-pr-new bot commented Jan 7, 2025

Open in Stackblitzdemostarter

npm i https://pkg.pr.new/zustand@2942

commit: 3425802

@sukvvon
Copy link
Contributor

sukvvon commented Jan 7, 2025

@dai-shi I reflected this PR in #2939

@dai-shi dai-shi added this to the v5.0.3 milestone Jan 7, 2025
@dai-shi dai-shi merged commit 4378abe into main Jan 7, 2025
29 checks passed
@dai-shi dai-shi deleted the fix/build/alias branch January 7, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants