histoire-dev / histoire-dev/histoire

Docs are wrong for Typescript projects

Open
#669 5 comments 1 reaction 0 assignees View on GitHub
to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

For TS + nuxt projects, I cannot just do what the docs say about adding the `env.d.ts` into the tsconfig. It will just overwrite the nuxt config and therefore vanish out all auto imports etc. If I copy over the generated tsconfig from the `.nuxt` directory it's working, but this is more like a workaround.

### Reproduction

https://github.com/lud-hu/nuxt-histoire-reproduction/blob/main/tsconfig.json

### System Info

```shell
System:
OS: macOS 14.0
CPU: (8) arm64 Apple M1
Memory: 68.38 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm
pnpm: 8.15.1 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 121.0.6167.139
Edge: 121.0.2277.98
Safari: 17.0
npmPackages:
@histoire/plugin-nuxt: ^0.17.9 => 0.17.9
@histoire/plugin-vue: ^0.17.9 => 0.17.9
histoire: ^0.17.9 => 0.17.9
```

### Used Package Manager

yarn

### 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

Open the contributing guide

Research direction

Start with the TypeScript configuration guidance in the linked Histoire guide and compare it with the reproduction's tsconfig.json and the generated .nuxt configuration. Confirm how the documented env.d.ts setup overwrites Nuxt's generated settings, then update the guidance so a TS + Nuxt project retains auto imports and the generated configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.