made-in-common

ni

💡 Use the right package manager

by made-in-common

TypeScript

TypeScript99.6%
JavaScript0.4%

Commit activity

Last 12 weeks · 8 commits

Full graph →

Community health

3 of 6 standards met

Community profile →
50
✓README✓License○Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 8 in progress · Last activity 1d ago
See all on GitHub →
Wxh16144

Problem reuses one record, , that is shared by every terminal and every project. It is one global slot, so whoever ran last owns it. Two tabs on the same repo Two projects, one command each — the case that actually bites Different projects have different scripts, so the shared slot hands the other project's choice to : Two things make this worse than a mistake you notice: If the name does not exist in project A, all you get is a bare . It looks like is broken, not like you asked for the wrong script. If the name does exist — exists in almost every project — it runs silently. Nothing says it was tab B's choice; you only find out because the wrong thing built. is not affected by any of this: redirection only detaches stdout, stdin is still the pty. While reading that code path I also found a second bug: records the monorepo flag instead of the script. Both are about "what counts as the last command", so they are fixed together. Changes 1. : record the script name, not the flag leaves the flag in place, so the script is the word after it: Covers , , the interactive picker, and without a script (records nothing, as before). 2. : chooses where the record lives Set with in or . Unknown values are reported rather than silently moving the record somewhere else. The default stays so upgrading changes nothing; turning the new behaviour on is opt-in. 3. Identifying the terminal Every terminal emulator — iTerm2, Terminal.app, Kitty, WezTerm, Ghostty, Warp, tmux, VS Code, ssh — has to allocate a pty to run a shell, so the pty device name covers all of them at once. Proprietary variables (, , …) would be a whack-a-mole that never covers the next terminal. Node has no , so: Linux: → macOS: is not a symlink ( returns ), so match against → (~0.5 ms) Windows: no name is exposed for a console handle, so the parent process () stands in — an interactive tab runs a single shell, and that shell is the parent of every invoked in it, which is stable per tab Why a file per terminal, instead of a key inside one file The scenarios above are what this is for: a terminal is the thing that holds an intent. Tab A is "I am on the API, I run "; tab B is "I am on the web app, I run ". A per-terminal record keeps each intent where it was made, so never has to guess which project the shared slot was talking about. Given that, the two candidates were "one file with a map keyed by terminal" and "one file per terminal". The latter wins on two counts: No write races. Each process writes only its own file, so the corruption from concurrent runs (#147) cannot happen in mode at all — no merge, no read-modify-write, no lock. Nothing to prune. No key table, no LRU, no size cap: the pty names are a small, reused set, and the files are a few dozen bytes, so they can be left to the OS temp cleanup (macOS cleared everything older than 7 days in this machine's ; Linux defaults to 10 days). What this fixes, and what it does not The last row is deliberate scope: a terminal is the unit this feature keys on. Keying on terminal and working directory would cover it, but that needs a rule for what happens when you mid-session, and it changes nothing for the two-tab case above. Left for a follow-up if maintainers want it. Compatibility still maps to / , silently — nobody has to migrate an old shell profile. The option (#333) keeps working but prints a deprecation notice, since the docs no longer mention it. wins over the legacy variable when both are set. Also fixed: did not wait for the write is ed, but the helper fired its own promises and unconditionally returned : The new mode depends on "recorded" actually meaning "on disk" (e.g. prints and exits immediately), so the chain is awaited now. Its only caller is . The temp-file-and-rename behaviour from #147 is preserved. Behaviour changes With (and the legacy ), now fails instead of falling back to whatever another terminal recorded. That is the point of "off"; the error message says so. now records the script, so a following reruns it instead of listing the scripts. Tests — runs the real CLI against a fixture project: records the script for , reruns it with , records nothing for alone; then the three modes (, , ) and the legacy variable. — keys, per-key files, and that one key never leaks into another. — every way of setting the option, including the deprecated ones. and the new tests pass; is green apart from the pre-existing failures, which also fail on . Known limitations Same terminal, different projects. The key is the terminal, not the directory, so -ing to another project in the same tab still lets the previous project's script through. has the same problem, so this is not a regression, but it is not fixed either. Windows**: without a tty name the parent process is used, so this works for interactive tabs but not for /CI. Named Windows Terminal sessions are not distinguished. macOS and pty names are reused after a terminal is closed, so a stale record can be picked up by a new tab — the same reuse the single shared file already had. Not verified on Windows hardware: the path is reasoned from how a tab hosts a single shell, so a maintainer on Windows should double-check it.

Wxh16144 · 6d ago
ychampion

Fixes #376. Cause used to infer indentation in . Under the multiline () flag, matches right after , so on CRLF files captured together with the leading spaces/tabs (e.g. ). Passing that to inserted extra blank lines throughout . Both and also always wrote LF () endings instead of preserving . Changes Restrict in to horizontal whitespace () so line breaks and leading blank lines are ignored. Add and in , and use in both and () so line endings and existing indentation are preserved. Add regression tests in and covering CRLF (2-space, 4-space, tab), leading blank lines, and LF files.

ychampion · 1w ago
unrevised6419

Description and the released are broken for : any package that is not already cataloged is passed to the agent as . Cause #359 changed to return objects and updated the skip path to . #361 was written against plain strings and added for mode. The two changes touch different lines, so merging into #361 raised no conflict, but CI on that merge commit failed with: The workflow has been failing on since (, ). Fix Push , the argument as the user typed it, matching the other skip path. Tests No new tests: the four -mode tests in and already cover this and fail on . With this change, typecheck, lint, and all 729 tests pass. Split out from #363, which carries the same fix. 🤖 Generated with Claude Code

unrevised6419 · 2w ago
Wxh16144

有这么一个场景,假设有一个文件目录为这样: 我希望在 目录下使用 , 在 目录中使用 ; 这个时候我有以下几种方案: 1. 在目录下的项目的 package.json 文件中添加 ; 2. 借助 环境变量,指定 文件路径; 3. 本次请求的功能:使用 findUp 递归向上查找配置文件,如上树形图所示; 上述方案的一些顾虑: 方案1: 如果是三方开源项目,需要手动去添加记录,产生不必要的 git 变更。 方案2: 可能需写一些 shell 脚本来支持目录变更后修改环境变量或者覆盖 文件内容,如借助 的 hooks 方案3: 如果实现则会存在一个问题是配置文件混乱,使用者不知道执行命令后使用的是那个包管理器,当其实可以丰富一下帮助文档,比如 目前只是一个 debugger 功能,但可以在这个上面输出更多的内容, config 信息等等等 本次功能请求: 如上树形目录图,在没有明确包管理器时,递归向父目录查找配置文件。

Wxh16144 · 2w ago
not-manu

Clear and concise description of the problem the picker only supports arrows (and ctrl+p/ctrl+n) for navigation. coming from fzf/vim, ctrl+j / ctrl+k is the muscle memory - leaving the home row breaks the flow. Suggested solution bind ctrl+j → down and ctrl+k → up, like fzf does. (see linked pr) Alternative ctrl+p / ctrl+n already work, but ctrl+j/k is what most fzf/vim users reach for. Additional context _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

not-manu · 2w ago
Structured data for AI agents

Repository: made-in-common/ni. Description: 💡 Use the right package manager Stars: 8320, Forks: 280. Primary language: TypeScript. Languages: TypeScript (99.6%), JavaScript (0.4%). License: MIT. Topics: cli, npm, package-manager, pnpm, yarn. Latest release: v30.6.0 (2mo ago). Open PRs: 8, open issues: 20. Last activity: 1d ago. Community health: 50%. Top contributors: antfu, userquin, sxzz, Wxh16144, privatenumber, antfubot, rznn7, unrevised6419, hannoeru, iiio2 and others.