molt icon indicating copy to clipboard operation
molt copied to clipboard

Raises `Error: multiple bump targets`

Open Milly opened this issue 1 year ago • 3 comments

@molt/action In github action in Denops.vim (eb9ef6a): https://github.com/vim-denops/denops.vim/actions/runs/10436394656/job/28901411214#step:3:480

deno run --allow-env --allow-read --allow-write --allow-net --allow-run=deno,git --no-prompt --unstable-kv jsr:@molt/[email protected]
...
Error: multiple bump targets for jsr:@std/async

Also, when running the @molt/cli, an AssertionError without message.

> deno task update
Task update deno run --allow-env --allow-read --allow-write --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli **/*.ts
error: Uncaught (in promise) AssertionError
    throw new AssertionError(msg);
          ^
    at assert (https://jsr.io/@std/assert/1.0.2/assert.ts:21:11)
    at new Update (https://jsr.io/@molt/core/0.19.6/mod.ts:189:5)
    at Dependency.check (https://jsr.io/@molt/core/0.19.6/mod.ts:137:14)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async Promise.all (index 0)
    at async Command.actionHandler (https://jsr.io/@molt/cli/0.19.6/main.ts:71:20)
    at async Command.execute (https://jsr.io/@cliffy/command/1.0.0-rc.5/command.ts:1940:7)
    at async Command.parseCommand (https://jsr.io/@cliffy/command/1.0.0-rc.5/command.ts:1772:14)
    at async https://jsr.io/@molt/cli/0.19.6/main.ts:113:1

I'm guessing the cause is probably the same. How should I deal with this?

Milly avatar Aug 18 '24 06:08 Milly

I tried the following and it worked fine in this simple case:

File: a.ts

import * as _ from "jsr:@std/async@^1.0.0";

File: b.ts

```ts
import * as _ from "jsr:@std/async@^0.224.0";

Run:

> deno run -A jsr:@molt/cli a.ts b.ts
� @std/async 0.224.2 → 1.0.3 (^1.0.0, ^0.224.0 → ^1.0.0)

Milly avatar Aug 18 '24 06:08 Milly

In denops.vim, a non-existent version of @std/async was defined as a test fixture for testing the dependencies cache. This was the direct cause of the error.

File: tests/denops/testdata/no_check/cli_constraint_error_on_issue_401.ts

import * as _ from "jsr:@std/[email protected]";

Does molt/cli have a function to exclude files? I couldn't use --ignore because it ignores dependencies.

I want it like this:

deno run -A jsr:@molt/cli --exclude no_check **/*.ts

It would also be good if the same could be done with molt-action:

steps:
  - uses: hasundue/molt-action@v1
    with:
      source: "**/*.ts"
      exclude: "no_check"

Milly avatar Aug 20 '24 01:08 Milly

@Milly Sorry for my late response, and appreciate your effort for investigating the problem :pray:

  • [ ] Panicking on a non-existent version is a bug. Should be fixed to just warn it gracefully.

Does molt/cli have a function to exclude files?

No, unfortunately. You may utilize the glob of your shell though.

  • [ ] I'm positive to add exclude option and input to the CLI and the action respectively.

I'm preparing for the moving on the weekend these days, so I'm afraid but it is unlikely for these tasks done before that.

hasundue avatar Aug 23 '24 03:08 hasundue