Smaller findings from the codegen tooling second pass (#660–#665).
- Codegen rewrites every file on each run, even when the bytes are identical. Watchers such as
tsc --watch, a bundler or an IDE wake on every regeneration, and the vite plugin's HMR sees changes that aren't there. Writing a file only when its content differs fixes this. Keep the temp-file + rename write chosen for symlinked outputs.
--bindgen-only's help text names a .did.d.ts file that is never produced.
docs/.../cli.mdx says a canister's name must match its key, but nothing enforces that, and --canister looks up the key. Either enforce it in loadConfig, with an error naming both, or correct the docs. Correcting the docs is the smaller change.
examples/vite-plugin-demo/icp.yaml uses the assets sync step, which icp-cli 1.5 removed. CI pins icp-cli 1.2.0, so CI still passes, but a user on current icp-cli can't deploy the example. This needs a decision on which icp-cli version the examples target.
Acceptance
Smaller findings from the codegen tooling second pass (#660–#665).
tsc --watch, a bundler or an IDE wake on every regeneration, and the vite plugin's HMR sees changes that aren't there. Writing a file only when its content differs fixes this. Keep the temp-file + rename write chosen for symlinked outputs.--bindgen-only's help text names a.did.d.tsfile that is never produced.docs/.../cli.mdxsays a canister'snamemust match its key, but nothing enforces that, and--canisterlooks up the key. Either enforce it inloadConfig, with an error naming both, or correct the docs. Correcting the docs is the smaller change.examples/vite-plugin-demo/icp.yamluses theassetssync step, which icp-cli 1.5 removed. CI pins icp-cli 1.2.0, so CI still passes, but a user on current icp-cli can't deploy the example. This needs a decision on which icp-cli version the examples target.Acceptance
main.cli.mdxmatch the code.