Skip to content

Commit 4571be3

Browse files
committed
revert: "chore: simplify and standardize package.json scripts and CI setup (#7069)"
This reverts commit 94cb80a.
1 parent 992431d commit 4571be3

12 files changed

+138
-335
lines changed

.github/workflows/benchmark-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- completed
77

88
jobs:
9-
post-benchmarks:
9+
post-package-size:
1010
runs-on: ubuntu-latest
1111
steps:
1212
# This posts the status to the PR/commit

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches: [main]
88
jobs:
9-
calculate-benchmarks:
9+
package-size:
1010
if: startsWith(github.head_ref, 'release-please') == false
1111
runs-on: ubuntu-latest
1212
steps:

.github/workflows/e2e-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ jobs:
4141
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
4242
- name: Install dependencies
4343
run: npm ci --no-audit
44-
- name: Build package
45-
run: npm run build
4644
- run: npm run e2e
4745
- name: Notify Slack
4846
uses: 8398a7/action-slack@v3
@@ -91,8 +89,6 @@ jobs:
9189
key: verdaccio-e2e-cli-${{ hashFiles('./package-lock.json') }}
9290
- name: Install dependencies
9391
run: npm ci --no-audit
94-
- name: Build package
95-
run: npm run build
9692
- run: npm run e2e
9793
- name: Notify Slack
9894
uses: 8398a7/action-slack@v3

.github/workflows/format.yml

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

.github/workflows/integration-tests.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
jobs:
1010
integration:
1111
name: Integration
12-
if: "${{ !startsWith(github.head_ref, 'release-') }}"
1312
runs-on: ${{ matrix.os }}
1413
timeout-minutes: 40
1514
strategy:
@@ -28,41 +27,55 @@ jobs:
2827
node-version: '22'
2928
fail-fast: false
3029
steps:
30+
# Sets an output parameter if this is a release PR
31+
- name: Check for release
32+
id: release-check
33+
# For windows we have to use $env:
34+
run: |-
35+
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
36+
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
37+
if: "${{ startsWith(github.head_ref, 'release-') }}"
3138
# This improves Windows network performance, we need this since we open many ports in our tests
3239
- name: Increase Windows port limit and reduce time wait delay
3340
run: |
3441
netsh int ipv4 set dynamicport tcp start=1025 num=64511
3542
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters /v TcpTimedWaitDelay /t REG_DWORD /d 30 /f
36-
if: "${{ matrix.os == 'windows-latest' }}"
43+
if: "${{ matrix.os == 'windows-latest' && !steps.release-check.outputs.IS_RELEASE }}"
3744
- name: Git checkout
3845
uses: actions/checkout@v4
3946
with:
4047
fetch-depth: 0
48+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
4149
- name: Use Node.js ${{ matrix.node-version }}
4250
uses: actions/setup-node@v4
4351
with:
4452
node-version: ${{ matrix.node-version }}
4553
cache: npm
4654
check-latest: true
55+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
4756
- name: Install PNPM
4857
run: |
4958
corepack enable
5059
corepack prepare [email protected] --activate
60+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5161
- name: Setup Deno
5262
uses: denoland/setup-deno@v1
63+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5364
with:
5465
deno-version: v1.44.4
5566
- name: Install core dependencies
5667
run: npm ci --no-audit
57-
- name: Build package
58-
run: npm run build
68+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
5969
- name: Generate self-signed certificates
6070
run: npm run certs
71+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
6172
shell: bash
6273
- name: Prepare tests
6374
run: npm run test:init
75+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
6476
- name: Tests
6577
uses: nick-fields/retry@v3
78+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
6679
with:
6780
timeout_minutes: 15
6881
max_attempts: 3
@@ -90,6 +103,7 @@ jobs:
90103
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
91104
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
92105
shell: bash
106+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
93107

94108
- name: Sanitize shard for artefact name
95109
id: sanitize-shard-name
@@ -108,14 +122,22 @@ jobs:
108122
with:
109123
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
110124
token: ${{ secrets.CODECOV_TOKEN }}
125+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
111126
# Specific tests for known test that failed on windows using node 23.
112127
# Can be replaced with larger node 23 tests in the future.
113128
integration-win-node-23:
114129
name: Integration test windows latest node23 specific
115-
if: "${{ !startsWith(github.head_ref, 'release-') }}"
116130
runs-on: windows-latest
117131
timeout-minutes: 40
118132
steps:
133+
# Sets an output parameter if this is a release PR
134+
- name: Check for release
135+
id: release-check
136+
# For windows we have to use $env:
137+
run: |-
138+
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
139+
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
140+
if: "${{ startsWith(github.head_ref, 'release-') }}"
119141
# This improves Windows network performance, we need this since we open many ports in our tests
120142
- name: Increase Windows port limit and reduce time wait delay
121143
run: |
@@ -125,31 +147,37 @@ jobs:
125147
uses: actions/checkout@v4
126148
with:
127149
fetch-depth: 0
150+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
128151
- name: Use Node.js
129152
uses: actions/setup-node@v4
130153
with:
131154
node-version: '23.x'
132155
cache: npm
133156
check-latest: true
157+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
134158
- name: Install PNPM
135159
run: |
136160
corepack enable
137161
corepack prepare [email protected] --activate
162+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
138163
- name: Setup Deno
139164
uses: denoland/setup-deno@v1
165+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
140166
with:
141167
deno-version: v1.44.4
142168
- name: Install core dependencies
143169
run: npm ci --no-audit
144-
- name: Build package
145-
run: npm run build
170+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
146171
- name: Generate self-signed certificates
147172
run: npm run certs
173+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
148174
shell: bash
149175
- name: Prepare tests
150176
run: npm run test:init
177+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
151178
- name: Tests
152179
uses: nick-fields/retry@v3
180+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
153181
with:
154182
timeout_minutes: 15
155183
max_attempts: 3
@@ -177,6 +205,7 @@ jobs:
177205
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT
178206
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT
179207
shell: bash
208+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'
180209

181210
- name: Store npm error artefacts
182211
uses: actions/upload-artifact@v4
@@ -191,3 +220,4 @@ jobs:
191220
with:
192221
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }}
193222
token: ${{ secrets.CODECOV_TOKEN }}
223+
if: '${{ !steps.release-check.outputs.IS_RELEASE }}'

.github/workflows/lint.yml

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

.github/workflows/unit-tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
jobs:
1010
unit:
1111
name: Unit
12-
if: "${{ !startsWith(github.head_ref, 'release-') }}"
1312
runs-on: ${{ matrix.os }}
1413
strategy:
1514
matrix:
@@ -20,22 +19,35 @@ jobs:
2019
node-version: '22.x'
2120
fail-fast: false
2221
steps:
22+
# Sets an output parameter if this is a release PR
23+
- name: Check for release
24+
id: release-check
25+
# For windows we have to use $env:
26+
run: |-
27+
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
28+
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
29+
if: "${{ startsWith(github.head_ref, 'release-') }}"
2330
- name: Git checkout
2431
uses: actions/checkout@v4
32+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
2533
- name: Use Node.js ${{ matrix.node-version }}
2634
uses: actions/setup-node@v4
2735
with:
2836
node-version: ${{ matrix.node-version }}
2937
cache: npm
3038
check-latest: true
39+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
3140
- name: Install core dependencies
3241
run: npm ci --no-audit
33-
- name: Build package
34-
run: npm run build
42+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
43+
- name: Linting
44+
run: npm run format:ci
45+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'
3546
- name: Run unit tests
3647
uses: nick-fields/retry@v3
3748
with:
3849
timeout_minutes: 15
3950
max_attempts: 3
4051
retry_on: error
4152
command: npm run test:ci:vitest:unit
53+
if: '${{!steps.release-check.outputs.IS_RELEASE}}'

.github/workflows/verify-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ jobs:
2020
cache: npm
2121
- name: Install core dependencies
2222
run: npm ci --no-audit
23+
- name: Install site dependencies
24+
run: npm run site:build:install
2325
- name: Generate docs
24-
run: npm run site:build
26+
run: npm run docs
2527
- name: Check for changes
2628
run: |
2729
if [ -z "$(git status --porcelain)" ]; then
2830
echo "No changes to docs files detected"
2931
else
30-
echo "Changes to docs files detected, please run 'npm run site:build' to sync docs"
32+
echo "Changes to docs files detected, please run 'npm run docs' to sync docs"
3133
exit 1
3234
fi

CONTRIBUTING.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ promote a positive and inclusive environment.
2424
- [Releasing](#releasing)
2525
- [License](#license)
2626

27+
2728
## Developing locally
2829

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

3435
```bash
35-
npm install && npm run build
36+
npm install && npm run site:build:install
3637
```
3738

3839
Tests are run with:
@@ -72,7 +73,6 @@ to run ESLint and Prettier automatically on file save. Otherwise, you should run
7273

7374
```bash
7475
npm run format
75-
npm run lint
7676
```
7777

7878
Alternatively, you can set up your IDE to integrate with Prettier and ESLint for JavaScript and Markdown files.
@@ -91,14 +91,11 @@ DEBUG=true ./bin/run.js [command]
9191

9292
### Attaching a Debugger
9393

94-
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
95-
it:
94+
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:
9695

9796
1. Open this repository in VS Code.
98-
2. Open a "JavaScript Debug Terminal" (e.g. by searching for it in the Command Palette (Shift-Cmd+P)). Every Node
99-
process that's opened in this terminal will have a debugger attached.
100-
3. Place a breakpoint somewhere in the CLI. You will have to place them in the compiled `.js` files as opposed to the
101-
`.ts` files.
97+
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.
98+
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.
10299
4. In your JavaScript Debug Terminal, navigate to the project you'd like to debug.
103100
5. Run `/path/to/netlify/cli/bin/run.js`. The debugger should be connecting automatically.
104101

@@ -116,10 +113,9 @@ A good place to start is reading the base command README and looking at the comm
116113

117114
> If you’d like to learn more on how `netlify dev` works, check [here](./docs/netlify-dev.md)
118115
119-
### Adding or updating a command
120116

121-
If you're adding a new command or updating an existing one, make sure to also add docs for it by running
122-
`npm run site:build`.
117+
### Adding or updating a command
118+
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`.
123119

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

@@ -134,18 +130,17 @@ description: A description.
134130
<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) -->
135131

136132
<!-- AUTO-GENERATED-CONTENT:END -->
133+
137134
```
138135

139-
When adding a new command, you will also need to add it to the nav sidebar manually by adding it to the `navOrder` array
140-
in `site/src/_app.js`
136+
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`
141137

142138
### Updating our documentation
143139

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

146-
To update the documentation, update the code (rather than the markdown files) and then run `npm run site:build` to sync
147-
the docs. To confirm that the changes to the docs are correct, run `cd site && npm run dev:start` to run the docs
148-
locally.
142+
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.
143+
149144

150145
### Testing
151146

@@ -205,8 +200,7 @@ We actively welcome your pull requests.
205200

206201
## Releasing
207202

208-
Tag the 'release' pull request using the `automerge` label. This will merge the pull request on GitHub and publish the
209-
package to npm.
203+
Tag the 'release' pull request using the `automerge` label. This will merge the pull request on GitHub and publish the package to npm.
210204

211205
### Creating a prerelease
212206

0 commit comments

Comments
 (0)