Track version-fox/vfox#745: .nvmrc and .node-version are not applied after a `cd`

未关闭
#46 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, lua
领域
cli, devtools

调研方向

This is a tracking issue whose fix lives upstream in version-fox/vfox#745, so start by reading that issue and watching for a vfox release that contains it. Nothing in this repo should change until then. When the release lands, replay the "Several projects in one shell" scenario in docs/scenarios.md with it. Done means the workaround in lib/util.lua and its call in hooks/parse_legacy_file.lua are removed if vfox now tracks version files, and the English and Chinese docs are updated.

由索引模型根据 Issue 内容生成。

描述

bug help wanted

.nvmrc and .node-version are not applied when you cd into their directory from a running shell, and a shell that started in such a directory does not go back to the global release when you cd out of it. The cause is in vfox, not in this plugin: vfox env serves the output it cached for the previous directory, and the cache does not know about version files. It is reported upstream as version-fox/vfox#745. This issue tracks it until a vfox release fixes it.

Where it stands

release 0.5.3 with the workaround of #44
a shell that starts in the directory applied applied
cd into the directory ignored applied
the file is edited in the directory the shell is in ignored applied at the next prompt
cd out into a directory with no config stays on the file's release stays on the file's release

A .vfox.toml is applied in the first, second and last of these. The workaround of #44 is util.forget_env_state: it removes vfox's env-state.json whenever vfox asks the plugin to read a version file, so vfox calculates again at every prompt in such a directory. It cannot help on the way out, because the plugin is not called in a directory with nothing to read.

When vfox has fixed it

  • A vfox release contains the fix (version-fox/vfox#745 and the pull request that closes it). Release: ________
  • Replay it with that release, with plugin 0.5.3 and with the plugin of main: the shell of "Several projects in one shell" in docs/scenarios.md, then an edit of the file in the directory the shell is in. The reproduction in version-fox/vfox#745 is the short form.
  • If vfox notices version files itself, edits included: remove util.forget_env_state (added by #44, lib/util.lua), its call in hooks/parse_legacy_file.lua, its tests and the hiding of __VFOX_CURTMPPATH in tests/hooks_test.lua, and the remark in tests/e2e/windows/verify.go. If vfox only keys the cache on the directory, keep it for edits in place.
  • Change the documents that describe the limit, in English and Chinese: docs/nvmrc.md ("When the file is read"), docs/scenarios.md ("Several projects in one shell"), docs/development.md ("Legacy files", "Known gaps"), docs/changes.md, docs/troubleshooting.md, README.md and README_CN.md.
  • Say from which vfox version this works, and what older ones do.
主要语言
Go
星标
10
派生
8
平均合并
1 小时 51 分钟
30 天内合并 PR
12

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

version-fox/vfox-nodejs 的其他 Issue

查看 version-fox/vfox-nodejs 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。