Skip to content

Commit

Permalink
Rename "prepare" script to "curate" to prevent auto-runs (#914)
Browse files Browse the repository at this point in the history
The `prepare` script runs automatically when the repository is installed.
On top of creating issues when the repository is set as dependency in
another project for some reason, as described in:
#789 (comment)

... this also seems wrong because:
1. There is no guarantee that the curation will run without errors. A patch
may no longer apply for instance.
2. Projects may want to depend on the raw data and may not need to run the
curation and package preparation logic at all.

This update replaces the "prepare" script with a "curate" one, explicitly
called in the jobs that need it.

Other projects that depend on the webref repository directly and on curated data
also need to update to call npm run curate explicitly.
  • Loading branch information
tidoust authored Mar 13, 2023
1 parent 7648834 commit 312adc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/curate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ jobs:
# the curated branch
fetch-depth: 0

- name: Prepare curated and packages data
# Note that "ci" runs the "prepare" script
- name: Install dependencies
run: npm ci

- name: Prepare curated and packages data
run: npm run curate

- name: Test curated and packages data
run: npm run test

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm ci
- run: npm test
- name: Install dependencies
run: npm ci
- name: Prepare curated and packages data
run: npm run curate
- name: Test curated and packages data
run: npm test
env:
FORCE_COLOR: 3
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"scripts": {
"create-patch": "node tools/create-patch.js",
"prepare": "node tools/prepare-curated.js ed curated && node tools/prepare-packages.js curated packages",
"curate": "node tools/prepare-curated.js ed curated && node tools/prepare-packages.js curated packages",
"test": "mocha --recursive",
"test-css": "mocha --recursive test/css",
"test-elements": "mocha --recursive test/elements",
Expand Down

0 comments on commit 312adc7

Please sign in to comment.