Mitosis output dir should accept any valid path
- Dominant language
- TypeScript
- Stars
- 14.4k
- Forks
- 671
- PR merge metrics
- No merged PRs in 30d
Description
### I am interested in helping provide a fix!
Yes
### Which generators are impacted?
- [X] All
- [ ] Angular
- [ ] HTML
- [ ] Qwik
- [ ] React
- [ ] React-Native
- [ ] Solid
- [ ] Stencil
- [ ] Svelte
- [ ] Vue
- [ ] Web components
### Reproduction case
dest: ['../anywhere']
### Expected Behaviour
Mitosis should accept any valid path for the dest.
(Also, why is the dest an array?)
### Actual Behaviour
Currently the output only accepts “forward” paths, i.e. it won’t write to “../../somewhere”.
### Additional Information
I'm not sure how big an obstacle this is in real use cases, but it requires workarounds in the E2E.
This is exacerbated by the need for the current working directory to be where the input `src` is located, see #494. Once that problem is fixed it would it would be possible to run Mitosis from an arbitrary higher directory, making this bug less noticeable.
Contributor guide
Research direction
Start by locating the shared output-destination handling for Mitosis generators and reproduce the issue with dest: ['../anywhere'] from the E2E setup. Trace why parent paths are rejected, then verify that valid relative paths such as ../../somewhere are accepted for all generators without breaking existing output behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100