Skip to content

Commit e9eab18

Browse files
authored
Merge pull request #933 from per1234/configure-npm-path
Make default npm project path configurable via taskfile variable
2 parents e3e418b + 2affc92 commit e9eab18

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/check-markdown-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths:
99
- ".github/workflows/check-markdown-task.ya?ml"
1010
- ".markdown-link-check.json"
11-
- "**/.npmrc"
11+
- ".npmrc"
1212
- "package.json"
1313
- "package-lock.json"
1414
- "Taskfile.ya?ml"
@@ -23,7 +23,7 @@ on:
2323
paths:
2424
- ".github/workflows/check-markdown-task.ya?ml"
2525
- ".markdown-link-check.json"
26-
- "**/.npmrc"
26+
- ".npmrc"
2727
- "package.json"
2828
- "package-lock.json"
2929
- "Taskfile.ya?ml"

.github/workflows/check-prettier-formatting-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
push:
88
paths:
99
- ".github/workflows/check-prettier-formatting-task.ya?ml"
10+
- ".npmrc"
1011
- "Taskfile.ya?ml"
11-
- "**/.npmrc"
1212
- "**/.prettierignore"
1313
- "**/.prettierrc*"
1414
# CSS
@@ -111,8 +111,8 @@ on:
111111
pull_request:
112112
paths:
113113
- ".github/workflows/check-prettier-formatting-task.ya?ml"
114+
- ".npmrc"
114115
- "Taskfile.ya?ml"
115-
- "**/.npmrc"
116116
- "**/.prettierignore"
117117
- "**/.prettierrc*"
118118
# CSS

.github/workflows/check-workflows-task.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ on:
66
push:
77
paths:
88
- ".github/workflows/*.ya?ml"
9-
- "**/.npmrc"
9+
- ".npmrc"
1010
- "package.json"
1111
- "package-lock.json"
1212
- "Taskfile.ya?ml"
1313
pull_request:
1414
paths:
1515
- ".github/workflows/*.ya?ml"
16-
- "**/.npmrc"
16+
- ".npmrc"
1717
- "package.json"
1818
- "package-lock.json"
1919
- "Taskfile.ya?ml"

Taskfile.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ includes:
55
dist: ./DistTasks.yml
66

77
vars:
8+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
9+
# Path of the project's primary npm-managed project:
10+
DEFAULT_NPM_PROJECT_PATH: .
811
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml
912
PROJECT_NAME: "arduino-lint"
1013
DIST_DIR: "dist"
@@ -155,6 +158,8 @@ tasks:
155158
WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}"
156159
deps:
157160
- task: npm:install-deps
161+
vars:
162+
PROJECT_PATH: .
158163
cmds:
159164
- |
160165
wget \
@@ -248,6 +253,8 @@ tasks:
248253
desc: Format all supported files with Prettier
249254
deps:
250255
- task: npm:install-deps
256+
vars:
257+
PROJECT_PATH: .
251258
cmds:
252259
- |
253260
npx \
@@ -412,6 +419,8 @@ tasks:
412419
deps:
413420
- task: docs:generate
414421
- task: npm:install-deps
422+
vars:
423+
PROJECT_PATH: .
415424
cmds:
416425
- |
417426
npx \
@@ -423,6 +432,8 @@ tasks:
423432
desc: Automatically correct linting violations in Markdown files where possible
424433
deps:
425434
- task: npm:install-deps
435+
vars:
436+
PROJECT_PATH: .
426437
cmds:
427438
- |
428439
npx \
@@ -435,6 +446,8 @@ tasks:
435446
desc: Check for problems in Markdown files
436447
deps:
437448
- task: npm:install-deps
449+
vars:
450+
PROJECT_PATH: .
438451
cmds:
439452
- |
440453
npx \
@@ -447,7 +460,7 @@ tasks:
447460
npm:install-deps:
448461
desc: Install dependencies managed by npm
449462
dir: |
450-
"{{default "./" .PROJECT_PATH}}"
463+
"{{default .DEFAULT_NPM_PROJECT_PATH .PROJECT_PATH}}"
451464
cmds:
452465
- npm install
453466

@@ -498,7 +511,7 @@ tasks:
498511
STYLELINTRC_SCHEMA_PATH:
499512
sh: task utility:mktemp-file TEMPLATE="stylelintrc-schema-XXXXXXXXXX.json"
500513
INSTANCE_PATH: >-
501-
{{default "." .PROJECT_PATH}}/package.json
514+
{{default .DEFAULT_NPM_PROJECT_PATH .PROJECT_PATH}}/package.json
502515
PROJECT_FOLDER:
503516
sh: pwd
504517
WORKING_FOLDER:

0 commit comments

Comments
 (0)