gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Make npm executions work with WorkParameter objects

Open sdilts opened this issue 5 months ago • 3 comments

I'm trying to write a task that uses the Worker API to execute several npx tasks in parallel. The parameters encoded in the WorkParameters class need to serializable, but since the NpmExecRunner::executeNpxCommand function takes in the extension object (which cannot be serialized) I'm unable to get anything working.

In short, can a serializable object be added that contains all of the information from the plugin configuration that executeNpxCommand needs to work?

sdilts avatar Aug 26 '25 18:08 sdilts

I'm willing to put together a PR, but I want to make sure that this is feasible or there isn't a better solution. I can post my code for the task if needed.

sdilts avatar Aug 26 '25 18:08 sdilts

Maybe a better idea is to make the ExecConfiguration type meet this requirement, and tweak the various APIs around that? I'm not sure what to do about the execOverrides field, but ever other field would be easy to convert.

sdilts avatar Aug 26 '25 20:08 sdilts

This looks to be similar to https://github.com/node-gradle/gradle-node-plugin/issues/334 which has a draft PR at https://github.com/node-gradle/gradle-node-plugin/pull/337

deepy avatar Sep 23 '25 09:09 deepy