Skip to content
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
9 changes: 8 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ const { overrides } = require('@netlify/eslint-config-node')

module.exports = {
extends: '@netlify/eslint-config-node',
plugins: ['sort-destructure-keys'],
plugins: [
'sort-destructure-keys',
// custom workspace lint rules found under `./tools/lint-rules`
'workspace',
],
parserOptions: {
ecmaVersion: '2020',
babelOptions: {
Expand All @@ -12,9 +16,12 @@ module.exports = {
},
},
rules: {
'workspace/no-process-cwd': 'error',
// Those rules from @netlify/eslint-config-node are currently disabled
// TODO: remove, so those rules are enabled
complexity: 0,
'no-inline-comments': 'off',
'no-underscore-dangle': 'off',
'func-style': 'off',
'max-depth': 0,
'max-lines': 0,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['14.18.0', '*']
node-version: ['16.16.0', '*']
fail-fast: false

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['14.18.0', '*']
node-version: ['16.16.0', '*']
shard: ['1/3', '2/3', '3/3']

exclude:
- os: macOS-latest
node-version: '14.18.0'
node-version: '16.16.0'
- os: windows-latest
node-version: '14.18.0'
node-version: '16.16.0'
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/legacy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['14.18.0', '*']
node-version: ['16.16.0', '*']
machine: ['0', '1', '2', '3', '4', '5', '6']

exclude:
- os: macOS-latest
node-version: '14.18.0'
node-version: '16.16.0'
- os: windows-latest
node-version: '14.18.0'
node-version: '16.16.0'
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ['14.18.0', '*']
node-version: ['16.16.0', '*']
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
Expand Down
11 changes: 6 additions & 5 deletions bin/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { argv } from 'process'
import updateNotifier from 'update-notifier'

import { createMainCommand } from '../src/commands/index.mjs'
import { error } from '../src/utils/command-helpers.mjs'
import getPackageJson from '../src/utils/get-package-json.mjs'

// 12 hours
Expand All @@ -15,16 +16,16 @@ try {
pkg,
updateCheckInterval: UPDATE_CHECK_INTERVAL,
}).notify()
} catch (error) {
console.log('Error checking for updates:')
console.log(error)
} catch (error_) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: Not something for this PR, but I personally really dislike this pattern of having a method that throws an error called error and then having to use error_ for the variable that holds the error.

The method should be called something like printError.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree!! it was just called like this and I wanted to keep the PR as small

error('Error checking for updates:')
error(error_)
}

const program = createMainCommand()

try {
await program.parseAsync(argv)
program.onEnd()
} catch (error) {
program.onEnd(error)
} catch (error_) {
program.onEnd(error_)
}
18 changes: 6 additions & 12 deletions docs/commands/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ netlify addons

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

| Subcommand | description |
|:--------------------------- |:-----|
Expand Down Expand Up @@ -61,9 +60,8 @@ netlify addons:auth

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---
## `addons:config`
Expand All @@ -82,9 +80,8 @@ netlify addons:config

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---
## `addons:create`
Expand All @@ -104,9 +101,8 @@ netlify addons:create

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---
## `addons:delete`
Expand All @@ -126,10 +122,9 @@ netlify addons:delete

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `force` (*boolean*) - delete without prompting (useful for CI)
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---
## `addons:list`
Expand All @@ -144,10 +139,9 @@ netlify addons:list

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `json` (*boolean*) - Output add-on data as JSON
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---

Expand Down
4 changes: 1 addition & 3 deletions docs/commands/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ netlify api
**Flags**

- `data` (*string*) - Data to use
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `list` (*boolean*) - List out available API methods
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand Down
3 changes: 1 addition & 2 deletions docs/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ netlify build

- `context` (*string*) - Specify a build context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
- `dry` (*boolean*) - Dry run: show instructions without running them
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `offline` (*boolean*) - disables any features that require network access
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

**Examples**

Expand Down
5 changes: 1 addition & 4 deletions docs/commands/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ netlify completion
**Flags**

- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

| Subcommand | description |
|:--------------------------- |:-----|
Expand All @@ -45,9 +43,8 @@ netlify completion:install

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---

Expand Down
5 changes: 2 additions & 3 deletions docs/commands/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ netlify deploy
- `build` (*boolean*) - Run build command before deploying
- `context` (*string*) - Context to use when resolving build configuration
- `dir` (*string*) - Specify a folder to deploy
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `functions` (*string*) - Specify a functions folder to deploy
- `json` (*boolean*) - Output deployment data as JSON
- `message` (*string*) - A short message to include in the deploy log
Expand All @@ -97,10 +98,8 @@ netlify deploy
- `site` (*string*) - A site name or ID to deploy to
- `skip-functions-cache` (*boolean*) - Ignore any functions created as part of a previous `build` or `deploy` commands, forcing them to be bundled again as part of the deployment
- `timeout` (*string*) - Timeout to wait for deployment to finish
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `trigger` (*boolean*) - Trigger a new build of your site on Netlify without uploading local files
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand Down
7 changes: 3 additions & 4 deletions docs/commands/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ netlify dev
- `dir` (*string*) - dir with static files
- `edge-inspect` (*string*) - enable the V8 Inspector Protocol for Edge Functions, with an optional address in the host:port format
- `edge-inspect-brk` (*string*) - enable the V8 Inspector Protocol for Edge Functions and pause execution on the first line of code, with an optional address in the host:port format
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `framework` (*string*) - framework to use. Defaults to #auto which automatically detects a framework
- `functions` (*string*) - specify a functions folder to serve
- `functions-port` (*string*) - port of functions server
- `geo` (*cache | mock | update*) - force geolocation data to be updated, use cached data from the last 24h if found, or use a mock location
- `live` (*string*) - start a public live session; optionally, supply a subdomain to generate a custom URL
- `no-open` (*boolean*) - disables the automatic opening of a browser window
- `offline` (*boolean*) - disables any features that require network access
- `port` (*string*) - port of netlify dev
- `target-port` (*string*) - port of target app server
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

| Subcommand | description |
|:--------------------------- |:-----|
Expand Down Expand Up @@ -73,9 +73,8 @@ netlify dev:exec
**Flags**

- `context` (*string*) - Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

**Examples**

Expand Down
29 changes: 11 additions & 18 deletions docs/commands/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ netlify env

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

| Subcommand | description |
|:--------------------------- |:-----|
Expand Down Expand Up @@ -54,11 +53,10 @@ netlify env:clone

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `from` (*string*) - Site ID (From)
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `to` (*string*) - Site ID (To)
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand All @@ -85,10 +83,9 @@ netlify env:get
**Flags**

- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `scope` (*builds | functions | post-processing | runtime | any*) - Specify a scope
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand Down Expand Up @@ -116,10 +113,9 @@ netlify env:import

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `replace-existing` (*boolean*) - Replace all existing variables instead of merging them with the current ones
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

---
## `env:list`
Expand All @@ -135,12 +131,11 @@ netlify env:list
**Flags**

- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `json` (*boolean*) - Output environment variables as JSON
- `plain` (*boolean*) - Output environment variables as plaintext
- `scope` (*builds | functions | post-processing | runtime | any*) - Specify a scope
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand Down Expand Up @@ -171,11 +166,10 @@ netlify env:set
**Flags**

- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `scope` (*builds | functions | post-processing | runtime*) - Specify a scope (default: all scopes)
- `secret` (*boolean*) - Indicate whether the environment variable value can be read again.
- `debug` (*boolean*) - Print debugging information

**Examples**

Expand Down Expand Up @@ -207,9 +201,8 @@ netlify env:unset
**Flags**

- `context` (*string*) - Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information
- `http-proxy` (*string*) - Proxy server address to route requests through.
- `http-proxy-certificate-filename` (*string*) - Certificate file to use when connecting using a proxy server

**Examples**

Expand Down
Loading