In a monorepo with custom dev command, `ntl dev` runs with root cwd
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 474
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 53
Description
Describe the bug
In a monorepo with the following structure:
- package.json
- packages
- test
- package.json
- netlify.toml
- vite-project
- package.json
- netlify.toml
- test
..running ntl dev always has the cwd as the root of the repo. This happens whether it is run from inside packages/test or at the root, choosing test from the menu. This is confusing behaviour, and is different from the case where the framework is detected.
The only workaround is to add --cwd . to every command.
Steps to reproduce
- Clone https://github.com/ascorbic/monorepo-repro
- Run
pnpm i cdtopackages/testand runntl dev. Observepwdoutputcdtopackages/vite-projectand runntl dev. Observe that it runs correctly: runningviteinsidepackages/vite-project.- Uncomment the
commandinprojects/vite-project/netlify.toml - Run
ntl devagain. Observe that build fails
Configuration
[dev]
command = "vite"
Environment
System:
OS: macOS 13.4.1
CPU: (8) arm64 Apple M1
Memory: 115.97 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: 8.9.0 - ~/Library/pnpm/pnpm
npmGlobalPackages:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the ntl dev command with the monorepo reproduction and compare behavior from packages/test and packages/vite-project. Inspect how the command in each netlify.toml is executed; done means custom dev commands use the selected project directory without requiring --cwd ., while framework-detected commands continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100