diff --git a/.eslintrc.js b/.eslintrc.js index b286800565b..bb612f23035 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,8 +10,17 @@ module.exports = { 'node/no-mixed-requires': 2, // Browser globals should not use `require()`. Non-browser globals should 'node/prefer-global/console': 2, - 'node/prefer-global/text-decoder': 2, - 'node/prefer-global/text-encoder': 2, + 'node/prefer-global/buffer': [2, 'never'], + 'node/prefer-global/process': [2, 'never'], + // TODO: enable after dropping support for Node <10.0.0 + 'node/prefer-global/url-search-params': 0, + 'node/prefer-global/url': 0, + // TODO: enable after dropping support for Node <11.0.0 + 'node/prefer-global/text-decoder': 0, + 'node/prefer-global/text-encoder': 0, + // TODO: enable after dropping support for Node <11.4.0 + 'node/prefer-promises/fs': 0, + 'node/prefer-promises/dns': 0, // This does not work well in a monorepo 'node/shebang': 0, @@ -20,10 +29,6 @@ module.exports = { // 'node/no-sync': 2, // 'node/callback-return': 2, // 'node/global-require': 2, - // 'node/prefer-global/url-search-params': 2, - // 'node/prefer-global/url': 2, - // 'node/prefer-global/buffer': [2, 'never'], - // 'node/prefer-global/process': [2, 'never'], // TODO: harmonize with filename snake_case in other Netlify Dev projects 'unicorn/filename-case': [2, { case: 'kebabCase', ignore: ['.*.md'] }], diff --git a/scripts/run-on-error.js b/scripts/run-on-error.js index efdd4295f18..48123126bcd 100755 --- a/scripts/run-on-error.js +++ b/scripts/run-on-error.js @@ -1,9 +1,9 @@ #!/usr/bin/env node -const { argv } = require('process') +const process = require('process') const execa = require('execa') -const [, , npmScript, npmScriptOnError] = argv +const [, , npmScript, npmScriptOnError] = process.argv // Run a npm script. If that script fails, another npm script is run. // We use this for example with ESLint and Prettier to be able to fail if diff --git a/site/scripts/docs.js b/site/scripts/docs.js index 04b7bebec78..70548ba936d 100644 --- a/site/scripts/docs.js +++ b/site/scripts/docs.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const markdownMagic = require('markdown-magic') const stripAnsi = require('strip-ansi') diff --git a/src/commands/build/index.js b/src/commands/build/index.js index 7959a3c3944..da62016e5b7 100644 --- a/src/commands/build/index.js +++ b/src/commands/build/index.js @@ -1,3 +1,5 @@ +const process = require('process') + const { flags } = require('@oclif/command') const { getBuildOptions, runBuild } = require('../../lib/build') diff --git a/src/commands/deploy.js b/src/commands/deploy.js index 9436f740569..452f4909f3a 100644 --- a/src/commands/deploy.js +++ b/src/commands/deploy.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') diff --git a/src/commands/dev/index.js b/src/commands/dev/index.js index e904bcad4eb..5d7a54efbca 100644 --- a/src/commands/dev/index.js +++ b/src/commands/dev/index.js @@ -1,5 +1,6 @@ const childProcess = require('child_process') const path = require('path') +const process = require('process') const { flags: flagsLib } = require('@oclif/command') const boxen = require('boxen') diff --git a/src/commands/functions/build.js b/src/commands/functions/build.js index d7a67c402a3..ffc76a5338a 100644 --- a/src/commands/functions/build.js +++ b/src/commands/functions/build.js @@ -1,4 +1,5 @@ const fs = require('fs') +const process = require('process') const { zipFunctions } = require('@netlify/zip-it-and-ship-it') const { flags: flagsLib } = require('@oclif/command') diff --git a/src/commands/functions/create.js b/src/commands/functions/create.js index 27fa5d39f41..d7929731ae7 100644 --- a/src/commands/functions/create.js +++ b/src/commands/functions/create.js @@ -1,6 +1,7 @@ const cp = require('child_process') const fs = require('fs') const path = require('path') +const process = require('process') const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') diff --git a/src/commands/functions/invoke.js b/src/commands/functions/invoke.js index 715575255d5..db2d0cec089 100644 --- a/src/commands/functions/invoke.js +++ b/src/commands/functions/invoke.js @@ -1,5 +1,6 @@ const fs = require('fs') const path = require('path') +const process = require('process') const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') diff --git a/src/commands/functions/list.js b/src/commands/functions/list.js index b61b06e480a..c4eaa915f7a 100644 --- a/src/commands/functions/list.js +++ b/src/commands/functions/list.js @@ -1,3 +1,5 @@ +const process = require('process') + const { flags: flagsLib } = require('@oclif/command') const AsciiTable = require('ascii-table') diff --git a/src/commands/link.js b/src/commands/link.js index 35daa89a41b..a48c1513667 100644 --- a/src/commands/link.js +++ b/src/commands/link.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const { flags: flagsLib } = require('@oclif/command') const chalk = require('chalk') diff --git a/src/functions-templates/js/fauna-crud/create-schema.js b/src/functions-templates/js/fauna-crud/create-schema.js index ef339ce0974..b08803c1404 100755 --- a/src/functions-templates/js/fauna-crud/create-schema.js +++ b/src/functions-templates/js/fauna-crud/create-schema.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +const process = require('process') /* bootstrap database in your FaunaDB account - use with `netlify dev:exec ` */ const { query, Client } = require('faunadb') diff --git a/src/functions-templates/js/fauna-crud/create.js b/src/functions-templates/js/fauna-crud/create.js index 05325981ea5..c864c7b3275 100644 --- a/src/functions-templates/js/fauna-crud/create.js +++ b/src/functions-templates/js/fauna-crud/create.js @@ -1,3 +1,5 @@ +const process = require('process') + const { query, Client } = require('faunadb') /* configure faunaDB Client with our secret */ diff --git a/src/functions-templates/js/fauna-crud/delete.js b/src/functions-templates/js/fauna-crud/delete.js index f48a879004b..229a235c68a 100644 --- a/src/functions-templates/js/fauna-crud/delete.js +++ b/src/functions-templates/js/fauna-crud/delete.js @@ -1,4 +1,6 @@ /* Import faunaDB sdk */ +const process = require('process') + const { query, Client } = require('faunadb') const client = new Client({ diff --git a/src/functions-templates/js/fauna-crud/read-all.js b/src/functions-templates/js/fauna-crud/read-all.js index 418dc48afea..32fa08e039e 100644 --- a/src/functions-templates/js/fauna-crud/read-all.js +++ b/src/functions-templates/js/fauna-crud/read-all.js @@ -1,4 +1,6 @@ /* Import faunaDB sdk */ +const process = require('process') + const { query, Client } = require('faunadb') const client = new Client({ diff --git a/src/functions-templates/js/fauna-crud/read.js b/src/functions-templates/js/fauna-crud/read.js index e3f5b637f2b..5b51398650f 100644 --- a/src/functions-templates/js/fauna-crud/read.js +++ b/src/functions-templates/js/fauna-crud/read.js @@ -1,4 +1,6 @@ /* Import faunaDB sdk */ +const process = require('process') + const { query, Client } = require('faunadb') const client = new Client({ diff --git a/src/functions-templates/js/fauna-crud/update.js b/src/functions-templates/js/fauna-crud/update.js index 154d3ec8144..583af50b8c0 100644 --- a/src/functions-templates/js/fauna-crud/update.js +++ b/src/functions-templates/js/fauna-crud/update.js @@ -1,4 +1,6 @@ /* Import faunaDB sdk */ +const process = require('process') + const { query, Client } = require('faunadb') const client = new Client({ diff --git a/src/functions-templates/js/fauna-graphql/fauna-graphql.js b/src/functions-templates/js/fauna-graphql/fauna-graphql.js index aea1a711cb7..20acae3d420 100644 --- a/src/functions-templates/js/fauna-graphql/fauna-graphql.js +++ b/src/functions-templates/js/fauna-graphql/fauna-graphql.js @@ -1,3 +1,6 @@ +const { Buffer } = require('buffer') +const process = require('process') + const { createHttpLink } = require('apollo-link-http') const { ApolloServer } = require('apollo-server-lambda') const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools') diff --git a/src/functions-templates/js/fauna-graphql/sync-schema.js b/src/functions-templates/js/fauna-graphql/sync-schema.js index 78b3be9e467..4a8a59b51fe 100644 --- a/src/functions-templates/js/fauna-graphql/sync-schema.js +++ b/src/functions-templates/js/fauna-graphql/sync-schema.js @@ -1,4 +1,6 @@ #!/usr/bin/env node +const { Buffer } = require('buffer') +const process = require('process') /* sync GraphQL schema to your FaunaDB account - use with `netlify dev:exec ` */ const createFaunaGraphQL = function () { diff --git a/src/functions-templates/js/graphql-gateway/graphql-gateway.js b/src/functions-templates/js/graphql-gateway/graphql-gateway.js index decaa9c4e8c..cbe53b55534 100644 --- a/src/functions-templates/js/graphql-gateway/graphql-gateway.js +++ b/src/functions-templates/js/graphql-gateway/graphql-gateway.js @@ -4,6 +4,7 @@ * * Of course, feel free to modify this gateway to suit your needs. */ +const process = require('process') const { createHttpLink } = require('apollo-link-http') const { ApolloServer } = require('apollo-server-lambda') diff --git a/src/functions-templates/js/oauth-passport/utils/config.js b/src/functions-templates/js/oauth-passport/utils/config.js index eeda8bc6cf4..573b1d73fbb 100644 --- a/src/functions-templates/js/oauth-passport/utils/config.js +++ b/src/functions-templates/js/oauth-passport/utils/config.js @@ -1,6 +1,8 @@ // lambda/utils/config.js // Circumvent problem with Netlify CLI. // https://github.com/netlify/netlify-dev-plugin/issues/147 +const process = require('process') + const BASE_URL = process.env.NODE_ENV === 'development' ? 'http://localhost:8888' : process.env.BASE_URL const COOKIE_SECURE = process.env.NODE_ENV !== 'development' diff --git a/src/functions-templates/js/sanity-create/sanity-create.js b/src/functions-templates/js/sanity-create/sanity-create.js index 4dfbd639b47..5a7330d07a8 100644 --- a/src/functions-templates/js/sanity-create/sanity-create.js +++ b/src/functions-templates/js/sanity-create/sanity-create.js @@ -1,3 +1,5 @@ +const process = require('process') + const sanityClient = require('@sanity/client') // You will need to configure environment variables for Sanity.io project id, diff --git a/src/functions-templates/js/sanity-groq/sanity-groq.js b/src/functions-templates/js/sanity-groq/sanity-groq.js index 15c4605aefc..3b9d59e6acf 100644 --- a/src/functions-templates/js/sanity-groq/sanity-groq.js +++ b/src/functions-templates/js/sanity-groq/sanity-groq.js @@ -1,3 +1,5 @@ +const process = require('process') + const sanityClient = require('@sanity/client') // You will need to configure environment variables for Sanity.io project id diff --git a/src/functions-templates/js/send-email/send-email.js b/src/functions-templates/js/send-email/send-email.js index 63cf00b540a..2ea3f528170 100644 --- a/src/functions-templates/js/send-email/send-email.js +++ b/src/functions-templates/js/send-email/send-email.js @@ -1,4 +1,6 @@ // with thanks to https://github.com/Urigo/graphql-modules/blob/8cb2fd7d9938a856f83e4eee2081384533771904/website/lambda/contact.js +const process = require('process') + const sendMail = require('sendmail')() const { validateEmail, validateLength } = require('./validations') diff --git a/src/functions-templates/js/serverless-ssr/app/index.js b/src/functions-templates/js/serverless-ssr/app/index.js index 68a79e05f95..fad4df01075 100644 --- a/src/functions-templates/js/serverless-ssr/app/index.js +++ b/src/functions-templates/js/serverless-ssr/app/index.js @@ -1,4 +1,6 @@ /* Express App */ +const process = require('process') + const bodyParser = require('body-parser') const compression = require('compression') const cors = require('cors') diff --git a/src/functions-templates/js/slack-rate-limit/slack-rate-limit.js b/src/functions-templates/js/slack-rate-limit/slack-rate-limit.js index db999f9f154..fce6a20a86e 100644 --- a/src/functions-templates/js/slack-rate-limit/slack-rate-limit.js +++ b/src/functions-templates/js/slack-rate-limit/slack-rate-limit.js @@ -1,6 +1,8 @@ // code walkthrough: https://www.netlify.com/blog/2018/03/29/jamstack-architecture-on-netlify-how-identity-and-functions-work-together/#updating-user-data-with-the-identity-api // demo repo: https://github.com/biilmann/testing-slack-tutorial/tree/v3-one-message-an-hour // note: requires SLACK_WEBHOOK_URL environment variable +const process = require('process') + const slackURL = process.env.SLACK_WEBHOOK_URL const fetch = require('node-fetch') diff --git a/src/functions-templates/js/stripe-charge/stripe-charge.js b/src/functions-templates/js/stripe-charge/stripe-charge.js index 29a033e0d53..6176d9a3f86 100644 --- a/src/functions-templates/js/stripe-charge/stripe-charge.js +++ b/src/functions-templates/js/stripe-charge/stripe-charge.js @@ -1,4 +1,5 @@ // with thanks https://github.com/alexmacarthur/netlify-lambda-function-example/blob/68a0cdc05e201d68fe80b0926b0af7ff88f15802/lambda-src/purchase.js +const process = require('process') const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY) diff --git a/src/functions-templates/js/stripe-subscription/stripe-subscription.js b/src/functions-templates/js/stripe-subscription/stripe-subscription.js index de1b1742c4a..3b22f36641a 100644 --- a/src/functions-templates/js/stripe-subscription/stripe-subscription.js +++ b/src/functions-templates/js/stripe-subscription/stripe-subscription.js @@ -1,4 +1,5 @@ // with thanks https://github.com/LukeMwila/stripe-subscriptions-backend/blob/master/stripe-api/index.ts +const process = require('process') const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY) diff --git a/src/functions-templates/js/submission-created/submission-created.js b/src/functions-templates/js/submission-created/submission-created.js index d8b29c3734f..60bf7ead909 100644 --- a/src/functions-templates/js/submission-created/submission-created.js +++ b/src/functions-templates/js/submission-created/submission-created.js @@ -2,6 +2,8 @@ // require('dotenv').config() // // details in https://css-tricks.com/using-netlify-forms-and-netlify-functions-to-build-an-email-sign-up-widget +const process = require('process') + const fetch = require('node-fetch') const { EMAIL_TOKEN } = process.env const handler = async (event) => { diff --git a/src/functions-templates/js/token-hider/token-hider.js b/src/functions-templates/js/token-hider/token-hider.js index 11afb266403..ad31069817b 100644 --- a/src/functions-templates/js/token-hider/token-hider.js +++ b/src/functions-templates/js/token-hider/token-hider.js @@ -1,3 +1,5 @@ +const process = require('process') + const axios = require('axios') const qs = require('qs') diff --git a/src/functions-templates/js/url-shortener/generate-route.js b/src/functions-templates/js/url-shortener/generate-route.js index 769f7927ebd..40b8198853f 100644 --- a/src/functions-templates/js/url-shortener/generate-route.js +++ b/src/functions-templates/js/url-shortener/generate-route.js @@ -1,4 +1,5 @@ 'use strict' +const process = require('process') const Hashids = require('hashids') const request = require('request') diff --git a/src/functions-templates/js/url-shortener/get-route.js b/src/functions-templates/js/url-shortener/get-route.js index aaaae6e4800..48d90d9954a 100644 --- a/src/functions-templates/js/url-shortener/get-route.js +++ b/src/functions-templates/js/url-shortener/get-route.js @@ -1,4 +1,5 @@ 'use strict' +const process = require('process') const request = require('request') diff --git a/src/hooks/init.js b/src/hooks/init.js index bc87cb3f8e4..65e7c2584d5 100644 --- a/src/hooks/init.js +++ b/src/hooks/init.js @@ -1,3 +1,5 @@ +const process = require('process') + const envinfo = require('envinfo') const globalConfig = require('../utils/global-config') diff --git a/src/lib/exec-fetcher.js b/src/lib/exec-fetcher.js index ef330c74833..b65152d6bc2 100644 --- a/src/lib/exec-fetcher.js +++ b/src/lib/exec-fetcher.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const execa = require('execa') const { fetchVersion, fetchLatest, updateAvailable, newerVersion } = require('gh-release-fetch') diff --git a/src/lib/exec-fetcher.test.js b/src/lib/exec-fetcher.test.js index 7e124df2519..60028f4460b 100644 --- a/src/lib/exec-fetcher.test.js +++ b/src/lib/exec-fetcher.test.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const test = require('ava') const tempDirectory = require('temp-dir') diff --git a/src/lib/http-agent.test.js b/src/lib/http-agent.test.js index 0ba60f75ff1..b40de5b7c67 100644 --- a/src/lib/http-agent.test.js +++ b/src/lib/http-agent.test.js @@ -1,4 +1,5 @@ const http = require('http') +const process = require('process') const test = require('ava') const { createProxyServer } = require('http-proxy') diff --git a/src/utils/command.js b/src/utils/command.js index 8f9c136b89f..9d455db482e 100644 --- a/src/utils/command.js +++ b/src/utils/command.js @@ -1,3 +1,4 @@ +const process = require('process') const { URL } = require('url') const { format, inspect } = require('util') diff --git a/src/utils/create-stream-promise.js b/src/utils/create-stream-promise.js index 5022e10869f..6b0bf76341f 100644 --- a/src/utils/create-stream-promise.js +++ b/src/utils/create-stream-promise.js @@ -1,3 +1,5 @@ +const { Buffer } = require('buffer') + const createStreamPromise = function (stream, timeoutSeconds, bytesLimit = DEFAULT_BYTES_LIMIT) { return new Promise(function streamPromiseFunc(resolve, reject) { let data = [] diff --git a/src/utils/detect-server.js b/src/utils/detect-server.js index 57e431f2fc6..e2d7a17d7f2 100644 --- a/src/utils/detect-server.js +++ b/src/utils/detect-server.js @@ -1,5 +1,6 @@ const fs = require('fs') const path = require('path') +const process = require('process') const chalk = require('chalk') const fuzzy = require('fuzzy') diff --git a/src/utils/detect-server.test.js b/src/utils/detect-server.test.js index c77e05d140b..29e0714d0b8 100644 --- a/src/utils/detect-server.test.js +++ b/src/utils/detect-server.test.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const test = require('ava') const getPort = require('get-port') diff --git a/src/utils/dev.js b/src/utils/dev.js index dce39d44345..9021aefe3db 100644 --- a/src/utils/dev.js +++ b/src/utils/dev.js @@ -1,5 +1,7 @@ // reusable code for netlify dev // bit of a hasty abstraction but recommended by oclif +const process = require('process') + const chalk = require('chalk') const { diff --git a/src/utils/env.js b/src/utils/env.js index eca1869897e..a9736452e04 100644 --- a/src/utils/env.js +++ b/src/utils/env.js @@ -1,6 +1,6 @@ // dotenv loading similar to create-react-app / react-scripts or dotenv-load - const path = require('path') +const process = require('process') const dotenv = require('dotenv') const filterObject = require('filter-obj') diff --git a/src/utils/env.test.js b/src/utils/env.test.js index f7dae228af5..13617086e35 100644 --- a/src/utils/env.test.js +++ b/src/utils/env.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const sinon = require('sinon') diff --git a/src/utils/get-repo-data.js b/src/utils/get-repo-data.js index 30f402b2fdf..737342a5db7 100644 --- a/src/utils/get-repo-data.js +++ b/src/utils/get-repo-data.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const util = require('util') const findUp = require('find-up') diff --git a/src/utils/gh-auth.js b/src/utils/gh-auth.js index 692f2789754..8681a020475 100644 --- a/src/utils/gh-auth.js +++ b/src/utils/gh-auth.js @@ -1,5 +1,6 @@ // A simple ghauth inspired library for getting a personal access token const http = require('http') +const process = require('process') const querystring = require('querystring') const { Octokit } = require('@octokit/rest') diff --git a/src/utils/live-tunnel.js b/src/utils/live-tunnel.js index dd5319fe062..8605f1f811a 100644 --- a/src/utils/live-tunnel.js +++ b/src/utils/live-tunnel.js @@ -1,3 +1,5 @@ +const process = require('process') + const chalk = require('chalk') const execa = require('execa') const fetch = require('node-fetch') diff --git a/src/utils/open-browser.js b/src/utils/open-browser.js index 6ce5fb48779..03f8e2f885a 100644 --- a/src/utils/open-browser.js +++ b/src/utils/open-browser.js @@ -1,3 +1,5 @@ +const process = require('process') + const chalk = require('chalk') const isDockerContainer = require('is-docker') const open = require('open') diff --git a/src/utils/proxy.js b/src/utils/proxy.js index 2930e4ca031..38c7adb8e3c 100644 --- a/src/utils/proxy.js +++ b/src/utils/proxy.js @@ -1,3 +1,4 @@ +const { Buffer } = require('buffer') const http = require('http') const path = require('path') const { URL, URLSearchParams } = require('url') diff --git a/src/utils/serve-functions.js b/src/utils/serve-functions.js index 7f9d82d5214..af79d835f87 100644 --- a/src/utils/serve-functions.js +++ b/src/utils/serve-functions.js @@ -1,3 +1,4 @@ +const { Buffer } = require('buffer') const querystring = require('querystring') const { Readable } = require('stream') const { URL } = require('url') diff --git a/src/utils/state-config.js b/src/utils/state-config.js index 0490d264852..42a49380623 100644 --- a/src/utils/state-config.js +++ b/src/utils/state-config.js @@ -1,5 +1,6 @@ const fs = require('fs') const path = require('path') +const process = require('process') const dotProp = require('dot-prop') const findUp = require('find-up') diff --git a/src/utils/telemetry/index.js b/src/utils/telemetry/index.js index cc165aca49d..c2d5acd0226 100644 --- a/src/utils/telemetry/index.js +++ b/src/utils/telemetry/index.js @@ -1,5 +1,6 @@ const { spawn } = require('child_process') const path = require('path') +const process = require('process') const ci = require('ci-info') diff --git a/src/utils/telemetry/request.js b/src/utils/telemetry/request.js index 09528dbbae0..622057a2b5c 100644 --- a/src/utils/telemetry/request.js +++ b/src/utils/telemetry/request.js @@ -1,4 +1,6 @@ // Spawn a detached process +const process = require('process') + const fetch = require('node-fetch') const options = JSON.parse(process.argv[2]) diff --git a/src/utils/traffic-mesh.js b/src/utils/traffic-mesh.js index d27e67f7c3e..85d0ee93de2 100644 --- a/src/utils/traffic-mesh.js +++ b/src/utils/traffic-mesh.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const execa = require('execa') const waitPort = require('wait-port') diff --git a/tests/command.addons.test.js b/tests/command.addons.test.js index 5a9eafd9ddd..abb6c9dda48 100644 --- a/tests/command.addons.test.js +++ b/tests/command.addons.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const callCli = require('./utils/call-cli') diff --git a/tests/command.deploy.test.js b/tests/command.deploy.test.js index 4d3c073e084..082146d9430 100644 --- a/tests/command.deploy.test.js +++ b/tests/command.deploy.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const fetch = require('node-fetch') const omit = require('omit.js').default diff --git a/tests/command.dev.exec.test.js b/tests/command.dev.exec.test.js index 49b8f340e81..1dea3bc1331 100644 --- a/tests/command.dev.exec.test.js +++ b/tests/command.dev.exec.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const callCli = require('./utils/call-cli') diff --git a/tests/command.dev.test.js b/tests/command.dev.test.js index c998af21bfb..7626b3d3a3f 100644 --- a/tests/command.dev.test.js +++ b/tests/command.dev.test.js @@ -1,6 +1,7 @@ // Handlers are meant to be async outside tests /* eslint-disable require-await */ const path = require('path') +const process = require('process') const test = require('ava') const FormData = require('form-data') diff --git a/tests/command.env.test.js b/tests/command.env.test.js index 87ac71c11a4..96b83c90492 100644 --- a/tests/command.env.test.js +++ b/tests/command.env.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const isEmpty = require('lodash.isempty') const isObject = require('lodash.isobject') diff --git a/tests/utils/cli-path.js b/tests/utils/cli-path.js index 0135cadd940..fecd0a1e6e0 100644 --- a/tests/utils/cli-path.js +++ b/tests/utils/cli-path.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const cliPath = path.resolve(__dirname, '..', '..', 'bin', process.platform === 'win32' ? 'run.cmd' : 'run') diff --git a/tests/utils/dev-server.js b/tests/utils/dev-server.js index ec6700e797d..008fb4de805 100644 --- a/tests/utils/dev-server.js +++ b/tests/utils/dev-server.js @@ -1,4 +1,5 @@ const path = require('path') +const process = require('process') const execa = require('execa') const getPort = require('get-port') diff --git a/tests/utils/site-builder.js b/tests/utils/site-builder.js index c65eec8bc2c..ecf0f37cf6f 100644 --- a/tests/utils/site-builder.js +++ b/tests/utils/site-builder.js @@ -1,5 +1,6 @@ const os = require('os') const path = require('path') +const process = require('process') const tempDirectory = require('temp-dir') const { toToml } = require('tomlify-j0.4')