microsoft / microsoft/lage

Allow having a custom `npmClient` for some tasks.

Open
#314 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
816
Forks
88
PR merge metrics
No merged PRs in 30d

Description

We have a requirement to have some tasks execute with some binary which is not yarn/npm. Specifically these tasks are supposed to run on an external service - so we would like to have lage run these tasks using some other binary which would call the service API instead of actually executing the verb with yarn/npm.

Since lage already supports npmClient as a configuration parameter, adding support for this would simply mean extending this configuration to task level.

So as an example suppose our test verb is supposed to execute using some external which expects an API call to start the execution.
In our lage config we would give a task level option -

...
taskOptions: {
   test: {
      npmClient: "customExecutor"
   }
},
npmClient: "yarn"
...

(This is of course just for illustration - we can discuss over the best way to represent the custom executor in the lage config)

When lage goes to run the test verb for a package it would see that in the configuration there is a custom npmClient specified - and it would execute customExecutor run test in the package instead of yarn run test. This customExecutor in turn would be responsible for the custom execution logic we would want over yarn/npm. If there are other verbs - let's say build - then lage would run using the default/top level configuration yarn run build.

Essentially we want to hook into the lage task executor to have other non-standard way of executing these verbs. The suggested method seems to be the simplest way to get that.

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

Start by reading the task executor and configuration handling described in the issue, especially how the top-level npmClient is resolved for each verb. The issue names no files or tests; done means a task-level executor can override the default for one verb while other verbs retain the top-level behavior, with the custom command receiving the verb.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.