Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- completed

jobs:
post-package-size:
post-benchmarks:
runs-on: ubuntu-latest
steps:
# This posts the status to the PR/commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main]
jobs:
package-size:
calculate-benchmarks:
if: startsWith(github.head_ref, 'release-please') == false
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Build package
run: npm run build
- run: npm run e2e
- name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down Expand Up @@ -89,6 +91,8 @@ jobs:
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Build package
run: npm run build
- run: npm run e2e
- name: Notify Slack
uses: 8398a7/action-slack@v3
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format:
name: Format
if: "${{ !startsWith(github.head_ref, 'release-') }}"
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install core dependencies
run: npm ci --no-audit
- name: Check format
run: npm run format
44 changes: 7 additions & 37 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
integration:
name: Integration
if: "${{ !startsWith(github.head_ref, 'release-') }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
Expand All @@ -27,55 +28,41 @@ jobs:
node-version: '22'
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
- name: Check for release
id: release-check
# For windows we have to use $env:
run: |-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
if: "${{ startsWith(github.head_ref, 'release-') }}"
# This improves Windows network performance, we need this since we open many ports in our tests
- name: Increase Windows port limit and reduce time wait delay
run: |
netsh int ipv4 set dynamicport tcp start=1025 num=64511
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters /v TcpTimedWaitDelay /t REG_DWORD /d 30 /f
if: "${{ matrix.os == 'windows-latest' && !steps.release-check.outputs.IS_RELEASE }}"
if: "${{ matrix.os == 'windows-latest' }}"
- name: Git checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Install PNPM
run: |
corepack enable
corepack prepare [email protected] --activate
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Setup Deno
uses: denoland/setup-deno@v1
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
with:
deno-version: v1.44.4
- name: Install core dependencies
run: npm ci --no-audit
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Build package
run: npm run build
- name: Generate self-signed certificates
run: npm run certs
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
shell: bash
- name: Prepare tests
run: npm run test:init
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
- name: Tests
uses: nick-fields/retry@v3
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
with:
timeout_minutes: 15
max_attempts: 3
Expand Down Expand Up @@ -103,7 +90,6 @@ jobs:
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
shell: bash
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'

- name: Sanitize shard for artefact name
id: sanitize-shard-name
Expand All @@ -122,22 +108,14 @@ jobs:
with:
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
token: ${{ secrets.CODECOV_TOKEN }}
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
# Specific tests for known test that failed on windows using node 23.
# Can be replaced with larger node 23 tests in the future.
integration-win-node-23:
name: Integration test windows latest node23 specific
if: "${{ !startsWith(github.head_ref, 'release-') }}"
runs-on: windows-latest
timeout-minutes: 40
steps:
# Sets an output parameter if this is a release PR
- name: Check for release
id: release-check
# For windows we have to use $env:
run: |-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
if: "${{ startsWith(github.head_ref, 'release-') }}"
# This improves Windows network performance, we need this since we open many ports in our tests
- name: Increase Windows port limit and reduce time wait delay
run: |
Expand All @@ -147,37 +125,31 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '23.x'
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Install PNPM
run: |
corepack enable
corepack prepare [email protected] --activate
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Setup Deno
uses: denoland/setup-deno@v1
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
with:
deno-version: v1.44.4
- name: Install core dependencies
run: npm ci --no-audit
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Build package
run: npm run build
- name: Generate self-signed certificates
run: npm run certs
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
shell: bash
- name: Prepare tests
run: npm run test:init
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
- name: Tests
uses: nick-fields/retry@v3
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
with:
timeout_minutes: 15
max_attempts: 3
Expand Down Expand Up @@ -205,7 +177,6 @@ jobs:
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
shell: bash
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'

- name: Store npm error artefacts
uses: actions/upload-artifact@v4
Expand All @@ -220,4 +191,3 @@ jobs:
with:
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
token: ${{ secrets.CODECOV_TOKEN }}
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint
if: "${{ !startsWith(github.head_ref, 'release-') }}"
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install core dependencies
run: npm ci --no-audit
- name: Run lint
run: npm run lint
18 changes: 3 additions & 15 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
unit:
name: Unit
if: "${{ !startsWith(github.head_ref, 'release-') }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -19,35 +20,22 @@ jobs:
node-version: '22.x'
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
- name: Check for release
id: release-check
# For windows we have to use $env:
run: |-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
if: "${{ startsWith(github.head_ref, 'release-') }}"
- name: Git checkout
uses: actions/checkout@v4
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
check-latest: true
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Install core dependencies
run: npm ci --no-audit
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Linting
run: npm run format:ci
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
- name: Build package
run: npm run build
- name: Run unit tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
retry_on: error
command: npm run test:ci:vitest:unit
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
6 changes: 2 additions & 4 deletions .github/workflows/verify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ jobs:
cache: npm
- name: Install core dependencies
run: npm ci --no-audit
- name: Install site dependencies
run: npm run site:build:install
- name: Generate docs
run: npm run docs
run: npm run site:build
- name: Check for changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to docs files detected"
else
echo "Changes to docs files detected, please run 'npm run docs' to sync docs"
echo "Changes to docs files detected, please run 'npm run site:build' to sync docs"
exit 1
fi
30 changes: 18 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
- [Releasing](#releasing)
- [License](#license)


## Developing locally

First, fork and clone the repository. If you’re not sure how to do this, please watch
Expand All @@ -33,7 +32,7 @@
Run:

```bash
npm install && npm run site:build:install
npm install && npm run build
```

Tests are run with:
Expand Down Expand Up @@ -73,6 +72,7 @@

```bash
npm run format
npm run lint
```

Alternatively, you can set up your IDE to integrate with Prettier and ESLint for JavaScript and Markdown files.
Expand All @@ -91,11 +91,14 @@

### Attaching a Debugger

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, my editor reformatted this. I can revert it if the reviewer cares.

When debugging a project, it's super helpful to attach a debugger to the CLI. If you use VS Code, here's how you can do it:
When debugging a project, it's super helpful to attach a debugger to the CLI. If you use VS Code, here's how you can do

Check warning on line 94 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'it's' Raw Output: {"message": "[smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'it's'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 94, "column": 27}}}, "severity": "WARNING"}

Check warning on line 94 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'here's' Raw Output: {"message": "[smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'here's'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 94, "column": 99}}}, "severity": "WARNING"}
it:

1. Open this repository in VS Code.
2. Open a "JavaScript Debug Terminal" (e.g. by searching for it in the Command Palette (Shift-Cmd+P)). Every Node process that's opened in this terminal will have a debugger attached.
3. Place a breakpoint somewhere in the CLI. You will have to place them in the compiled `.js` files as opposed to the `.ts` files.
2. Open a "JavaScript Debug Terminal" (e.g. by searching for it in the Command Palette (Shift-Cmd+P)). Every Node

Check warning on line 98 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartQuotesBegin] Use a smart opening quote (“) instead of a straight quote for ' "JavaScript' Raw Output: {"message": "[smart-marks.smartQuotesBegin] Use a smart opening quote (“) instead of a straight quote for ' \"JavaScript'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 98, "column": 10}}}, "severity": "WARNING"}

Check warning on line 98 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartQuotesEnd] Use a smart closing quote (”) instead of a straight quote for 'Terminal"' Raw Output: {"message": "[smart-marks.smartQuotesEnd] Use a smart closing quote (”) instead of a straight quote for 'Terminal\"'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 98, "column": 29}}}, "severity": "WARNING"}
process that's opened in this terminal will have a debugger attached.

Check warning on line 99 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'that's' Raw Output: {"message": "[smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'that's'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 99, "column": 12}}}, "severity": "WARNING"}
3. Place a breakpoint somewhere in the CLI. You will have to place them in the compiled `.js` files as opposed to the

Check warning on line 100 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [base.spelling] Spellcheck: did you really mean 'breakpoint'? Raw Output: {"message": "[base.spelling] Spellcheck: did you really mean 'breakpoint'?", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 100, "column": 12}}}, "severity": "WARNING"}
`.ts` files.
4. In your JavaScript Debug Terminal, navigate to the project you'd like to debug.
5. Run `/path/to/netlify/cli/bin/run.js`. The debugger should be connecting automatically.

Expand All @@ -113,9 +116,10 @@

> If you’d like to learn more on how `netlify dev` works, check [here](./docs/netlify-dev.md)


### Adding or updating a command
If you're adding a new command or updating an existing one, make sure to also add docs for it by running `npm run site:build`.

If you're adding a new command or updating an existing one, make sure to also add docs for it by running

Check warning on line 121 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'you're' Raw Output: {"message": "[smart-marks.smartApostrophes] Use a smart apostrophe (’) instead of a straight single quote mark in 'you're'", "location": {"path": "CONTRIBUTING.md", "range": {"start": {"line": 121, "column": 4}}}, "severity": "WARNING"}
`npm run site:build`.

This will automatically generate documentation for you that will look like the following:

Expand All @@ -130,17 +134,18 @@
<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) -->

<!-- AUTO-GENERATED-CONTENT:END -->

```

When adding a new command, you will also need to add it to the nav sidebar manually by adding it to the `navOrder` array in `site/src/_app.js`
When adding a new command, you will also need to add it to the nav sidebar manually by adding it to the `navOrder` array
in `site/src/_app.js`

### Updating our documentation

If documentation looks to be out of date, it is likely that the code for the command itself is not correct.

To update the documentation, update the code (rather than the markdown files) and then run `npm run docs` to sync the docs. To confirm that the changes to the docs are correct, run `cd site && npm run dev:start` to run the docs locally.

To update the documentation, update the code (rather than the markdown files) and then run `npm run site:build` to sync
the docs. To confirm that the changes to the docs are correct, run `cd site && npm run dev:start` to run the docs
locally.

### Testing

Expand Down Expand Up @@ -200,7 +205,8 @@

## Releasing

Tag the 'release' pull request using the `automerge` label. This will merge the pull request on GitHub and publish the package to npm.
Tag the 'release' pull request using the `automerge` label. This will merge the pull request on GitHub and publish the
package to npm.

### Creating a prerelease

Expand Down
Loading
Loading