Skip to content

Commit 5a420dd

Browse files
committed
build: relocate site netlify.toml to site/ directory
1 parent 25fcdd8 commit 5a420dd

File tree

12 files changed

+693
-45
lines changed

12 files changed

+693
-45
lines changed

.github/workflows/verify-docs.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 10
1313
steps:
14-
- name: Git checkout
15-
uses: actions/checkout@v4
16-
- name: Use Node.js
17-
uses: actions/setup-node@v4
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
1817
with:
19-
node-version: lts/*
18+
node-version: 18.14.0
2019
cache: npm
21-
- name: Install core dependencies
20+
21+
- name: Install dependencies
2222
run: npm ci --no-audit
23-
- name: Install site dependencies
24-
run: npm run site:build:install
23+
24+
- name: Install ./site dependencies
25+
run: npm ci --prefix=site --no-audit
26+
2527
- name: Generate docs
26-
run: npm run docs
28+
run: npm run --prefix=site build
29+
2730
- name: Check for changes
2831
run: |
2932
if [ -z "$(git status --porcelain)" ]; then

CONTRIBUTING.md

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

27-
2827
## Developing locally
2928

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

3534
```bash
36-
npm install && npm run site:build:install
35+
npm install
3736
```
3837

3938
Tests are run with:
@@ -91,11 +90,14 @@ DEBUG=true ./bin/run.js [command]
9190

9291
### Attaching a Debugger
9392

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:
93+
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
94+
it:
9595

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

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

114116
> If you’d like to learn more on how `netlify dev` works, check [here](./docs/netlify-dev.md)
115117
116-
117118
### 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`.
119+
120+
If you're adding a new command or updating an existing one, make sure to also add docs for it by running `npm run docs`.
119121

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

@@ -130,17 +132,17 @@ description: A description.
130132
<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) -->
131133

132134
<!-- AUTO-GENERATED-CONTENT:END -->
133-
134135
```
135136

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

138140
### Updating our documentation
139141

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

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

145147
### Testing
146148

@@ -200,7 +202,8 @@ We actively welcome your pull requests.
200202

201203
## Releasing
202204

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

205208
### Creating a prerelease
206209

package-lock.json

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@
5454
"e2e": "node ./tools/e2e/run.js",
5555
"docs": "npm run --prefix=site build",
5656
"watch": "c8 --reporter=lcov vitest --watch",
57-
"site:build": "run-s site:build:*",
58-
"site:build:install": "cd site && npm install --no-audit",
59-
"site:build:assets": "cd site && npm run build",
6057
"postinstall-pack": "node ./scripts/postinstall.js",
6158
"postinstall": "npm run build && node ./scripts/postinstall.js",
6259
"prepublishOnly": "node ./scripts/prepare-for-publish.js",
6360
"certs": "openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj \"/CN=localhost\" -extensions EXT -config certconf"
6461
},
6562
"dependencies": {
66-
"@bugsnag/js": "8.2.0",
6763
"@fastify/static": "7.0.4",
6864
"@netlify/blobs": "8.1.1",
6965
"@netlify/build": "29.59.2",
@@ -169,6 +165,7 @@
169165
},
170166
"devDependencies": {
171167
"@babel/preset-react": "7.26.3",
168+
"@bugsnag/js": "8.2.0",
172169
"@eslint/compat": "^1.2.7",
173170
"@eslint/js": "^9.21.0",
174171
"@netlify/functions": "3.0.1",

netlify.toml renamed to site/netlify.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
[build]
2-
# This will be run the site build
3-
command = "npm run site:build"
4-
# This is the directory is publishing to netlify's CDN
5-
publish = "site/dist"
2+
command = "pushd .. && npm ci --no-verify && popd && npm run build"
3+
publish = "dist"
64

75
[functions]
8-
# Sets a custom directory for Netlify Functions
9-
directory = "functions"
10-
11-
# Specifies `esbuild` for functions bundling
126
node_bundler = "esbuild"
137

148
#####################

functions/error-reporting.ts renamed to site/netlify/functions/error-reporting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import process from 'process'
22

33
import Bugsnag from '@bugsnag/js'
4-
import { Handler } from '@netlify/functions'
4+
import type { Handler } from '@netlify/functions'
55

66
Bugsnag.start({
77
apiKey: `${process.env.NETLIFY_BUGSNAG_API_KEY}`,

functions/telemetry.js renamed to site/netlify/functions/telemetry.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import fetch from 'node-fetch'
2-
31
const TELEMETRY_SERVICE_URL = 'https://cli-telemetry.netlify.engineering'
42

53
// This function is a workaround for our inability to redirect traffic to a ntl function in another site

0 commit comments

Comments
 (0)