Skip to content

Commit

Permalink
Prerelease (#25)
Browse files Browse the repository at this point in the history
* prerelease

* new props for provider

* typed override name

* add test and docs

* merge provider props

* pump version

* remove redundant params

* found out type for abstract constructor

* pump version

* add isolatedModule
  • Loading branch information
SilentCatD authored Dec 9, 2023
1 parent 0cb0ff0 commit e3edc35
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.3

- enable `isolatedModules` in tsconfig

# 1.3.2

- Found out a way to use abstract constructor type.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scoped-provider",
"version": "1.3.2",
"version": "1.3.3",
"description": "Library for DI in react without the need of self-creating context everytime.",
"type": "module",
"source": "src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useNamedProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function useNamedProvider<T>(name: string, configs?: UseNamedProviderConfig): T
}

export default useNamedProvider
export { UseNamedProviderConfigDisAllowUndef, UseNamedProviderConfig, UseNamedProviderConfigAllowUndef }
export type { UseNamedProviderConfigDisAllowUndef, UseNamedProviderConfig, UseNamedProviderConfigAllowUndef }
2 changes: 1 addition & 1 deletion src/hooks/useProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function useProvider<T>(ctor: Constructor<T>, configs?: string | UseProviderConf
}

export default useProvider
export { UseProviderConfigsAllowUndef, UseProviderConfigsDisAllowUndef, UseProviderConfigs }
export type { UseProviderConfigsAllowUndef, UseProviderConfigsDisAllowUndef, UseProviderConfigs }
19 changes: 11 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,23 @@ export type {
NamedConsumerDisAllowUndefProps,
NamedConsumerAllowUndefProps,
}
export { Create, Constructor }
export { ProviderProps, Provider, CreateProviderProps, ValueProviderProps }
export { ProviderScope, ProviderScopeProps }
export { ProviderContext, ContextData }
export {
useProvider,
useNamedProvider,
export type { Create, Constructor }
export { Provider }
export type { ProviderProps, CreateProviderProps, ValueProviderProps }
export { ProviderScope }
export type { ProviderScopeProps }
export { ProviderContext }
export type { ContextData }
export { useProvider, useNamedProvider }
export type {
UseNamedProviderConfig,
UseNamedProviderConfigAllowUndef,
UseNamedProviderConfigDisAllowUndef,
UseProviderConfigsAllowUndef,
UseProviderConfigsDisAllowUndef,
UseProviderConfigs,
}
export { MultiProvider, ReceivableElement, MultiProviderProps }
export { MultiProvider }
export type { ReceivableElement, MultiProviderProps }
export { ResourcesNotProvidedError }
export { getObjectRuntimeName, isCreate }
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"isolatedModules": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"jsx": "react-jsx",
Expand Down

0 comments on commit e3edc35

Please sign in to comment.