Skip to content

codegen/cli: regeneration rewrites unchanged files, --bindgen-only help names a file never produced, cli.mdx name/key claim, vite-plugin-demo uses a removed icp-cli step #666

Description

@b3hr4d

Smaller findings from the codegen tooling second pass (#660–#665).

  1. 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.
  2. --bindgen-only's help text names a .did.d.ts file that is never produced.
  3. 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.
  4. 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

  • Regenerating with no input change leaves every output file's mtime unchanged. The test fails on main.
  • The help text and cli.mdx match the code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions