Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: relocate site netlify.toml to site/ directory #7090

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/verify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install core dependencies

- name: Install dependencies
run: npm ci --no-audit
- name: Install site dependencies
run: npm run site:build:install

- name: Install ./site dependencies
run: npm ci --prefix=site --no-audit

- name: Generate docs
run: npm run docs
run: npm run --prefix=site build

- name: Check for changes
run: |
if [ -z "$(git status --porcelain)" ]; then
Expand Down
27 changes: 15 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
```

Tests are run with:
Expand Down Expand Up @@ -91,11 +90,14 @@

### Attaching a Debugger

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 93 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": 93, "column": 27}}}, "severity": "WARNING"}

Check warning on line 93 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": 93, "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 97 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": 97, "column": 10}}}, "severity": "WARNING"}

Check warning on line 97 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": 97, "column": 29}}}, "severity": "WARNING"}
process that's opened in this terminal will have a debugger attached.

Check warning on line 98 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": 98, "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 99 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": 99, "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 +115,9 @@

> 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 `npm run docs`.

Check warning on line 120 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": 120, "column": 4}}}, "severity": "WARNING"}

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

Expand All @@ -130,17 +132,17 @@
<!-- 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 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.

### Testing

Expand Down Expand Up @@ -200,7 +202,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
18 changes: 14 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,12 @@
"e2e": "node ./tools/e2e/run.js",
"docs": "npm run --prefix=site build",
"watch": "c8 --reporter=lcov vitest --watch",
"site:build": "run-s site:build:*",
"site:build:install": "cd site && npm install --no-audit",
"site:build:assets": "cd site && npm run build",
"postinstall-pack": "node ./scripts/postinstall.js",
"postinstall": "npm run build && node ./scripts/postinstall.js",
"prepublishOnly": "node ./scripts/prepare-for-publish.js",
"certs": "openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj \"/CN=localhost\" -extensions EXT -config certconf"
},
"dependencies": {
"@bugsnag/js": "8.2.0",
"@fastify/static": "7.0.4",
"@netlify/blobs": "8.1.1",
"@netlify/build": "29.59.2",
Expand Down Expand Up @@ -169,6 +165,7 @@
},
"devDependencies": {
"@babel/preset-react": "7.26.3",
"@bugsnag/js": "8.2.0",
"@eslint/compat": "^1.2.7",
"@eslint/js": "^9.21.0",
"@netlify/functions": "3.0.1",
Expand Down
10 changes: 2 additions & 8 deletions netlify.toml → site/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
[build]
# This will be run the site build
command = "npm run site:build"
# This is the directory is publishing to netlify's CDN
publish = "site/dist"
command = "pushd .. && npm ci --no-verify && popd && npm run build"
publish = "dist"

[functions]
# Sets a custom directory for Netlify Functions
directory = "functions"

# Specifies `esbuild` for functions bundling
node_bundler = "esbuild"

#####################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import process from 'process'

import Bugsnag from '@bugsnag/js'
import { Handler } from '@netlify/functions'
import type { Handler } from '@netlify/functions'

Bugsnag.start({
apiKey: `${process.env.NETLIFY_BUGSNAG_API_KEY}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fetch from 'node-fetch'

const TELEMETRY_SERVICE_URL = 'https://cli-telemetry.netlify.engineering'

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