You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,6 +42,96 @@ The bootstrap command follows this precedence order when determining which packa
41
42
42
43
This means if you set a global preference (e.g., `algokit config py-package-manager uv`), it will be used across all projects unless explicitly overridden at the project level. Smart defaults only apply when you haven't set a preference yet.
43
44
45
+
## Package Manager Command Translation
46
+
47
+
During the bootstrap process, AlgoKit automatically translates package manager commands in your project's `.algokit.toml` file to match your configured package manager preferences. This ensures that project run commands work correctly regardless of which package manager the template was originally created with.
48
+
49
+
### How It Works
50
+
51
+
When you run `algokit project bootstrap`, if your project contains run commands in `.algokit.toml`, they will be automatically updated:
52
+
53
+
-**JavaScript**: `npm` ↔ `pnpm` - Only semantically equivalent commands are translated
54
+
-**Python**: `poetry` ↔ `uv` - Only semantically equivalent commands are translated
55
+
56
+
### JavaScript Translation (npm ↔ pnpm)
57
+
58
+
**Commands that translate:**
59
+
60
+
-`npm install` → `pnpm install`
61
+
-`npm run <script>` → `pnpm run <script>`
62
+
-`npm test` → `pnpm test`
63
+
-`npm start` → `pnpm start`
64
+
-`npm build` → `pnpm build`
65
+
66
+
**Commands that DON'T translate** (will show a warning):
-`npx` searches locally in `node_modules/.bin`, then in global installs, then downloads remotely if not found
70
+
-`pnpm exec` only searches locally in project dependencies (fails if not found locally)
71
+
-`pnpm dlx` always fetches from remote registry (never checks local dependencies)
72
+
-`npm fund` - No pnpm equivalent (pnpm does not provide funding information display)
73
+
-`npm audit` ↔ `pnpm audit` - May report different vulnerabilities due to differences in auditing algorithms and vulnerability databases (command translates with warning)
74
+
75
+
### Python Translation (poetry ↔ uv)
76
+
77
+
Only commands with equivalent semantics are translated:
78
+
79
+
**Commands that translate:**
80
+
81
+
-`poetry install` → `uv sync` (special case: different command name)
82
+
-`poetry run` → `uv run`
83
+
-`poetry add` → `uv add`
84
+
-`poetry remove` → `uv remove`
85
+
-`poetry lock` → `uv lock`
86
+
-`poetry init` → `uv init`
87
+
88
+
**Commands that DON'T translate** (will show a warning):
test = { commands = ["uv run pytest"] } # ✅ Translated
123
+
deps = { commands = ["poetry show --tree"] } # ⚠️ Not translated (warning shown)
124
+
```
125
+
126
+
You'll see warnings:
127
+
128
+
```
129
+
⚠️ Command 'npx create-next-app' behaves differently in pnpm. Consider using 'pnpm exec' for local binaries or 'pnpm dlx' for remote packages. The command will remain unchanged.
130
+
⚠️ Command 'poetry show --tree' has no direct equivalent in uv. The command will remain unchanged and may not work as expected.
131
+
```
132
+
133
+
This approach ensures your project commands work correctly while being transparent about limitations.
0 commit comments