histoire-dev / histoire-dev/histoire
`setupApp` in `VueStoryProps` interface is not equal to `Vue3StorySetupHandler` interface
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
There is a difference between `VueStoryProps['setupApp']` and `Vue3StorySetupHandler` interfaces. `setupApp` method doesn't have `addWrapper` method in it's payload.
### Reproduction
```vue
import { Vue3StorySetupHandler } from '@histoire/plugin-vue';
const setupApp: Vue3StorySetupHandler = ({ app }) => {
app.use(/* something */);
};
```
```
error TS2322: Type 'Vue3StorySetupHandler' is not assignable to type '(payload: { app: App; story: Story; variant: Variant; }) => void | Promise'
```
### System Info
```shell
System:
OS: macOS 14.1.2
CPU: (10) arm64 Apple M1 Max
Memory: 1.15 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.20.2 - ~/.volta/tools/image/node/16.20.2/bin/node
npm: 9.6.5 - ~/.volta/tools/image/npm/9.6.5/bin/npm
pnpm: 8.3.1 - ~/.volta/bin/pnpm
Browsers:
Chrome: 121.0.6167.160
Safari: 17.1.2
npmPackages:
@histoire/plugin-vue: ^0.17.6 => 0.17.11
@vitejs/plugin-vue: ^4.0.0 => 4.6.2
histoire: ^0.17.6 => 0.17.9
vite: ^4.5.1 => 4.5.2
```
### Used Package Manager
npm
### Validations
- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Locate the TypeScript definitions for VueStoryProps['setupApp'] and Vue3StorySetupHandler, then compare their callback payloads with the provided reproduction. Update the mismatched type so setupApp accepts the same payload, including addWrapper, and verify that the example no longer produces the reported TS2322 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100