-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This gives us more control about the build process * Expose `react-hot-toast/headless` - Fixes #39 * Bundle size is even smaller now TODO: * Find alternative for `tsdx lint` and possibly `tsdx test`
- Loading branch information
Showing
7 changed files
with
80 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
node_modules | ||
.cache | ||
dist | ||
/headless | ||
.vscode | ||
.vercel |
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,21 @@ | ||
import { toast } from '../core/toast'; | ||
|
||
export { | ||
DefaultToastOptions, | ||
IconTheme, | ||
Renderable, | ||
resolveValue, | ||
Toast, | ||
ToasterProps, | ||
ToastOptions, | ||
ToastPosition, | ||
ToastType, | ||
ValueFunction, | ||
ValueOrFunction, | ||
} from '../core/types'; | ||
|
||
export { useToaster } from '../core/use-toaster'; | ||
export { useStore as useToasterStore } from '../core/store'; | ||
|
||
export { toast }; | ||
export default toast; |
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,38 +1,13 @@ | ||
import { toast } from './core/toast'; | ||
|
||
// Type re-export workaround, to stay compatible with TS 3.7 and lower | ||
import { | ||
ToastOptions as _ToastOptions, | ||
ToastPosition as _ToastPosition, | ||
Toast as _Toast, | ||
Renderable as _Renderable, | ||
ValueOrFunction as _ValueOrFunction, | ||
ToasterProps as _ToasterProps, | ||
DefaultToastOptions as _DefaultToastOptions, | ||
IconTheme as _IconTheme, | ||
ToastType as _ToastType, | ||
ValueFunction as _ValueFunction, | ||
} from './core/types'; | ||
export { useToaster } from './core/use-toaster'; | ||
export * from './headless'; | ||
|
||
export { ToastBar } from './components/toast-bar'; | ||
export { ToastIcon } from './components/toast-icon'; | ||
export { Toaster } from './components/toaster'; | ||
export { useStore as useToasterStore } from './core/store'; | ||
export { CheckmarkIcon } from './components/checkmark'; | ||
export { ErrorIcon } from './components/error'; | ||
export { LoaderIcon } from './components/loader'; | ||
export { resolveValue } from './core/types'; | ||
|
||
export type ToastOptions = _ToastOptions; | ||
export type ToastPosition = _ToastPosition; | ||
export type Toast = _Toast; | ||
export type Renderable = _Renderable; | ||
export type ValueOrFunction<TValue, TArg> = _ValueOrFunction<TValue, TArg>; | ||
export type ToasterProps = _ToasterProps; | ||
export type DefaultToastOptions = _DefaultToastOptions; | ||
export type IconTheme = _IconTheme; | ||
export type ToastType = _ToastType; | ||
export type ValueFunction<TArg, TValue> = _ValueFunction<TArg, TValue>; | ||
|
||
export { toast }; | ||
export default toast; |
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,26 @@ | ||
import { defineConfig, Options } from 'tsup'; | ||
|
||
const commonConfig: Options = { | ||
minify: true, | ||
dts: true, | ||
format: ['esm', 'cjs'], | ||
sourcemap: true, | ||
clean: true, | ||
outExtension({ format }) { | ||
return { | ||
js: format === 'cjs' ? '.js' : `.${format}.js`, | ||
}; | ||
}, | ||
}; | ||
export default defineConfig([ | ||
{ | ||
...commonConfig, | ||
entry: ['src/index.tsx'], | ||
outDir: 'dist', | ||
}, | ||
{ | ||
...commonConfig, | ||
entry: ['src/headless/index.ts'], | ||
outDir: 'headless', | ||
}, | ||
]); |
This file was deleted.
Oops, something went wrong.