Skip to content

Make default npm project path configurable via taskfile variable #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 21, 2025

A repository might contain multiple npm-managed projects. For this reason, the appropriate npm-managed tasks have a parameter environment variable that allows it to be configured for an arbitrary path, with the "Check npm" workflow having a job matrix of paths to pass.

Generally, even if there are multiple npm-managed projects, there will be one primary project that is most often the target of contributor operation. Since it would be inconvenient for the contributor to pass the environment variable path every time they want to run a task for that primary project, the tasks are configured to have a default path which is used if the variable is not defined by the user.

Since the primary npm-managed project would typically be in the root of the repository, the default value is set to the root. In the case where the primary npm-managed project is not in the root of the repository, the template installer will need to adjust this. Previously the default was hard coded in each individual task. The template will be made easier to install by defining the default in a single place via a friendly taskfile variable, following the convention already established by the templates for Go-based projects.

per1234 added 2 commits June 21, 2025 03:19
The behavior of the `go:test` task can be configured via environment variables. It is important to document these
parameter variables in order to make their existence known to contributors who would find them useful.

Previously, the parameter environment variables of this task were undocumented.
A repository might contain multiple npm-managed projects. For this reason, the appropriate npm-managed tasks have a
parameter environment variable that allows it to be configured for an arbitrary path, with the "Check npm" workflow
having a job matrix of paths to pass.

Generally, even if there are multiple npm-managed projects, there will be one primary project that is most often the
target of contributor operation. Since it would be inconvenient for the contributor to pass the environment variable
path every time they want to run a task for that primary project, the tasks are configured to have a default path which
is used if the variable is not defined by the user.

Since the primary npm-managed project would typically be in the root of the repository, the default value is set to the
root. In the case where the primary npm-managed project is not in the root of the repository, the template installer
will need to adjust this. Previously the default was hard coded in each individual task. The template will be made
easier to install by defining the default in a single place via a friendly taskfile variable, following the convention
already established by the templates for Go-based projects.
@per1234 per1234 self-assigned this Jun 21, 2025
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 21, 2025
@per1234 per1234 merged commit b45abbd into arduino:main Jun 21, 2025
51 checks passed
@per1234 per1234 deleted the default-npm-project-var branch June 21, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant