node-gradle / node-gradle/gradle-node-plugin

Support running Node tools in the Configuration Phase, and multiple tools per task by providing ValueSource implementations

Open
#334 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Groovy
Stars
677
Forks
120
PR merge metrics
No merged PRs in 30d

Description

Feature Request: Provide ValueSource implementations for running Node tools

Summary

Currently Gradle Plugin for Node has a 'task based' approach for running Node tools. One task can run one Node tool a single time. This is good for simple projects.

However, I would like to use Node tools in more advanced use cases:

  1. Use Node tools before task execution, during the configuration phase.

    As part of #81 I proposed a way to make npm install cacheable, but this would require running npm in the configuration phase (to manually add dependencies to the cache). Using a ValueSource would make this trivial.

  2. Support executing the same tool multiple times with different arguments or running different tools sequentially in the same task.

Proposal

Provide implementations of ValueSource so users can run node tools on-demand.

The existing task-based execution approach would still work as-is, but to avoid duplication it would be best to re-write the internal implementation to use a 'ValueSource first' approach. The existing tasks will have the same API surface (so there is no change for users), but internally they will use ValueSources.

We can break up the implementation into smaller steps by migrating each Node tool individually.

I'd be happy to make a PR.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reading the existing task-based Node tool execution implementation and the linked Gradle ValueSource API documentation. Done means providing ValueSource implementations, preserving the existing task API, and supporting configuration-phase execution and multiple tool invocations.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, node.js
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.