Skip to content

Commit 2cb39d1

Browse files
authored
[INFRA] Replace npm-requirements hack with package.json (#2226)
* chore: Replace npm-requirements hack with package.json * chore: Update CONTRIBUTING guide to use npm run * chore(ci): Use npm install/run * chore(ci): Update dependabot config * chore: Add prettier to package.json * chore: Add cffconvert to Python dependencies * chore: Update makefile to install and use dependencies * [DATALAD RUNCMD] uv lock --upgrade === Do not change lines below === { "chain": [], "cmd": "uv lock --upgrade", "exit": 0, "extra_inputs": [], "inputs": [ "pyproject.toml" ], "outputs": [ "uv.lock" ], "pwd": "." } ^^^ Do not change lines above ^^^
1 parent 1c539c0 commit 2cb39d1

File tree

10 files changed

+5665
-759
lines changed

10 files changed

+5665
-759
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ updates:
1919
interval: "monthly"
2020
labels:
2121
- "exclude-from-changelog"
22+
groups:
23+
build-dependencies:
24+
patterns: ["*"]
25+
- package-ecosystem: "npm"
26+
directory: "/"
27+
schedule:
28+
interval: "monthly"
29+
labels:
30+
- "exclude-from-changelog"
31+
groups:
32+
node-utilities:
33+
patterns: ["*"]

.github/workflows/validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
with:
2929
node-version: 22
3030
- name: Install dependencies
31-
run: npm install `cat npm-requirements.txt`
31+
run: npm install
3232
- name: Run style checks
33-
run: npx remark src/**/*.md --frail --rc-path .remarkrc
33+
run: npm run remark
3434

3535
# YAML
3636
yamllint:

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ pdf_build_src/src_copy
1414
pdf_build_src/tests/data/output
1515

1616
# JS/NPM
17-
package-lock.json
18-
package.json
1917
node_modules/
2018

2119
# Python gitignore

CONTRIBUTING.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -293,48 +293,41 @@ NodeJS.
293293
Remark-CLI can be installed via [npm](https://www.npmjs.com/), which is part of
294294
the NodeJS distribution.
295295

296-
To install the packages we use for our style guide, the following command will
297-
work on most command lines:
296+
To install the packages we use for our style guide, use the following command:
298297

299298
```shell
300-
npm install `cat npm-requirements.txt`
301-
```
302-
303-
The equivalent command on PowerShell is:
304-
305-
```shell
306-
npm install @(cat npm-requirements.txt)
299+
npm install
307300
```
308301

309302
### 3. Find documents that are failing the check
310303

311304
Run the following from the root directory of `bids-specification`:
312305

313306
```shell
314-
npx remark ./src/*.md ./src/*/*.md
307+
npm run remark
315308
```
316309

317310
### 4. Fix the flagged document
318311

319312
Please go to the directory where the flagged file is and run remark like this:
320313

321314
```shell
322-
npx remark flagged_file.md -o flagged_file_fixed.md
315+
npx remark path/to/flagged_file.md -o path/to/flagged_file_fixed.md
323316
```
324317

325-
Please confirm this has fixed the file. To do this, please run this:
318+
To confirm this has fixed the file, run:
326319

327320
```shell
328-
npx remark flagged_file_fixed.md --frail
321+
npx remark path/to/flagged_file_fixed.md --frail
329322
```
330323

331324
This command will indicate whether this file now conforms to the style guide.
332325
If it passes, replace `flagged_file.md` with the contents of
333326
`flagged_file_fixed.md`, add and commit the change:
334327

335328
```shell
336-
mv flagged_file_fixed.md flagged_file.md
337-
git add flagged_file.md
329+
mv path/to/flagged_file_fixed.md path/to/flagged_file.md
330+
git add path/to/flagged_file.md
338331
git commit -m 'STY: Fixed Markdown style'
339332
```
340333

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
.PHONY: tools/contributors.tsv
2+
all:
3+
4+
install: .venv node_modules
5+
6+
node_modules: package.json package-lock.json
7+
npm install
28

3-
validate_citation_cff: CITATION.cff
4-
cffconvert --validate
9+
.venv: pyproject.toml uv.lock
10+
uv sync --frozen --group doc --group tools
511

6-
update_contributors:
12+
validate_citation_cff: CITATION.cff .venv
13+
uv run cffconvert --validate
14+
15+
update_contributors: .venv
716
uv run tools/add_contributors.py
817
uv run tools/print_contributors.py
918
npx all-contributors-cli generate
1019

1120
runprettier:
12-
prettier --write "src/schema/**/*.yaml"
21+
npx prettier --write "src/schema/**/*.yaml"
1322
python3 -m yamllint -f standard src/schema/ -c .yamllint.yml
1423

1524
SCHEMA_CHANGES := $(shell git diff --name-only | grep src/schema/*.yaml)
@@ -23,6 +32,4 @@ commitschema:
2332

2433
formatschema: runprettier commitschema
2534

26-
all:
27-
2835
.PHONY: runprettier commitschema

npm-requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)