Skip to content

Commit 154c9fb

Browse files
setup(infra): use node --run (#337)
1 parent be1b6fb commit 154c9fb

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm install
3232

3333
- name: Run Prettier
34-
run: npm run prettier
34+
run: node --run prettier
3535

3636
- name: Run ESLint
37-
run: npm run lint
37+
run: node --run lint

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm install
3232

3333
- name: Run Tests
34-
run: npm run test:unit
34+
run: node --run test:unit
3535
e2e-test:
3636
name: E2E Tests
3737
runs-on: ubuntu-latest
@@ -52,4 +52,4 @@ jobs:
5252
run: npm install
5353

5454
- name: Run Tests
55-
run: npm run test:e2e
55+
run: node --run test:e2e

.github/workflows/update-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: npm install && npm update nodejs-latest-linker --save
3838

3939
- name: Update Redirect Links
40-
run: node scripts/build-r2-symlinks.mjs && npm run format
40+
run: node scripts/build-r2-symlinks.mjs && node --run format
4141
env:
4242
CF_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }}
4343
CF_SECRET_ACCESS_KEY: ${{ secrets.CF_SECRET_ACCESS_KEY }}

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ The steps below will give you a general idea of how to prepare your local enviro
103103
9. Run the following to confirm that linting and formatting are passing.
104104
105105
```bash
106-
npm run format
107-
npm run test:unit
108-
npm run test:e2e
106+
node --run format
107+
node --run test:unit
108+
node --run test:e2e
109109
```
110110
111111
10. To run the worker locally, see [Dev Setup](./docs/dev-setup.md).
@@ -130,11 +130,11 @@ This repository contains a few scripts and commands for performing numerous task
130130
<details>
131131
<summary>Commands for Testing, Maintaining, and Contributing to the Worker</summary>
132132

133-
- `npm run format` Formats the code to the repository's standards.
134-
- `npm run lint` Lints the code to the repository's standards.
135-
- `npm run test:unit` Runs the [Unit Tests](./COLLABORATOR_GUIDE.md#unit-tests) to ensure individual components are working as expected.
136-
- `npm run test:e2e` Runs the [E2E Tests](./COLLABORATOR_GUIDE.md#e2e-tests) to ensure requests act as expected.
137-
- `npm run build:handlebars` Compiles the Handlebars templates. **Required for any changes to the templates to take affect**.
133+
- `node --run format` Formats the code to the repository's standards.
134+
- `node --run lint` Lints the code to the repository's standards.
135+
- `node --run test:unit` Runs the [Unit Tests](./COLLABORATOR_GUIDE.md#unit-tests) to ensure individual components are working as expected.
136+
- `node --run test:e2e` Runs the [E2E Tests](./COLLABORATOR_GUIDE.md#e2e-tests) to ensure requests act as expected.
137+
- `node --run build:handlebars` Compiles the Handlebars templates. **Required for any changes to the templates to take affect**.
138138

139139
</details>
140140

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"format": "prettier --check --write \"**/*.{ts,js,mjs,json,md}\"",
99
"prettier": "prettier --check \"**/*.{ts,js,mjs,json,md}\"",
1010
"lint": "eslint ./src",
11-
"test": "npm run test:unit && npm run test:e2e",
11+
"test": "node --run test:unit && node --run test:e2e",
1212
"test:unit": "node --test --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --import=tsx ./tests/unit/index.test.ts",
1313
"test:e2e": "wrangler deploy --dry-run --outdir=dist && node --test --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --import=tsx ./tests/e2e/index.test.ts",
1414
"build:handlebars": "node scripts/compile-handlebars.js"

0 commit comments

Comments
 (0)