netlify-cli 14.0.0-rc → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "14.0.0-rc",
4
+ "version": "14.0.0",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -117,15 +117,15 @@
117
117
  "netlify-redirect-parser": "^14.1.2",
118
118
  "netlify-redirector": "^0.4.0",
119
119
  "node-fetch": "^2.6.0",
120
- "node-version-alias": "^2.0.0",
120
+ "node-version-alias": "^3.0.0",
121
121
  "ora": "^6.0.0",
122
122
  "p-filter": "^3.0.0",
123
123
  "p-map": "^5.0.0",
124
- "p-wait-for": "^3.0.0",
124
+ "p-wait-for": "^5.0.0",
125
125
  "parallel-transform": "^1.2.0",
126
126
  "parse-github-url": "^1.0.2",
127
127
  "parse-gitignore": "^2.0.0",
128
- "path-key": "^3.1.1",
128
+ "path-key": "^4.0.0",
129
129
  "prettyjson": "^1.2.1",
130
130
  "pump": "^3.0.0",
131
131
  "raw-body": "^2.4.1",
@@ -136,7 +136,7 @@
136
136
  "strip-ansi-control-characters": "^2.0.0",
137
137
  "tabtab": "^3.0.2",
138
138
  "tempy": "^3.0.0",
139
- "terminal-link": "^2.1.1",
139
+ "terminal-link": "^3.0.0",
140
140
  "through2-filter": "^3.0.0",
141
141
  "through2-map": "^3.0.0",
142
142
  "to-readable-stream": "^2.1.0",
@@ -147,6 +147,6 @@
147
147
  "uuid": "^9.0.0",
148
148
  "wait-port": "^1.0.1",
149
149
  "winston": "^3.2.1",
150
- "write-file-atomic": "^4.0.0"
150
+ "write-file-atomic": "^5.0.0"
151
151
  }
152
152
  }
@@ -1,6 +1,6 @@
1
1
  import execa from 'execa'
2
2
 
3
- import { injectEnvVariables } from '../../utils/dev.mjs'
3
+ import { getDotEnvVariables, injectEnvVariables } from '../../utils/dev.mjs'
4
4
  import { getEnvelopeEnv, normalizeContext } from '../../utils/env/index.mjs'
5
5
 
6
6
  /**
@@ -16,7 +16,8 @@ const devExec = async (cmd, options, command) => {
16
16
  env = await getEnvelopeEnv({ api, context: options.context, env, siteInfo })
17
17
  }
18
18
 
19
- await injectEnvVariables({ devConfig: { ...config.dev }, env, site })
19
+ env = await getDotEnvVariables({ devConfig: { ...config.dev }, env, site })
20
+ injectEnvVariables(env)
20
21
 
21
22
  await execa(cmd, command.args.slice(1), {
22
23
  stdio: 'inherit',
@@ -18,7 +18,7 @@ import {
18
18
  normalizeConfig,
19
19
  } from '../../utils/command-helpers.mjs'
20
20
  import detectServerSettings, { getConfigWithPlugins } from '../../utils/detect-server-settings.mjs'
21
- import { getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
21
+ import { getDotEnvVariables, getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
22
22
  import { getEnvelopeEnv, normalizeContext } from '../../utils/env/index.mjs'
23
23
  import { ensureNetlifyIgnore } from '../../utils/gitignore.mjs'
24
24
  import { startNetlifyGraph, startPollingForAPIAuthentication } from '../../utils/graph.mjs'
@@ -96,7 +96,8 @@ const dev = async (options, command) => {
96
96
  log(`${NETLIFYDEVLOG} Injecting environment variable values for ${chalk.yellow('all scopes')}`)
97
97
  }
98
98
 
99
- await injectEnvVariables({ devConfig, env, site })
99
+ env = await getDotEnvVariables({ devConfig, env, site })
100
+ injectEnvVariables(env)
100
101
  await promptEditorHelper({ chalk, config, log, NETLIFYDEVLOG, repositoryRoot, state })
101
102
 
102
103
  const { addonsUrls, capabilities, siteUrl, timeouts } = await getSiteInformation({
@@ -19,7 +19,7 @@ import ora from 'ora'
19
19
  import { fileExistsAsync } from '../../lib/fs.mjs'
20
20
  import { getAddons, getCurrentAddon, getSiteData } from '../../utils/addons/prepare.mjs'
21
21
  import { NETLIFYDEVERR, NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, error, log } from '../../utils/command-helpers.mjs'
22
- import { injectEnvVariables } from '../../utils/dev.mjs'
22
+ import { getDotEnvVariables, injectEnvVariables } from '../../utils/dev.mjs'
23
23
  import execa from '../../utils/execa.mjs'
24
24
  import { readRepoURL, validateRepoURL } from '../../utils/read-repo-url.mjs'
25
25
 
@@ -549,11 +549,12 @@ const handleOnComplete = async ({ command, onComplete }) => {
549
549
  const { config } = command.netlify
550
550
 
551
551
  if (onComplete) {
552
- await injectEnvVariables({
552
+ const env = await getDotEnvVariables({
553
553
  devConfig: { ...config.dev },
554
554
  env: command.netlify.cachedConfig.env,
555
555
  site: command.netlify.site,
556
556
  })
557
+ injectEnvVariables(env)
557
558
  await onComplete.call(command)
558
559
  }
559
560
  }
@@ -2,7 +2,7 @@
2
2
  import { join } from 'path'
3
3
 
4
4
  import { startFunctionsServer } from '../../lib/functions/server.mjs'
5
- import { acquirePort, getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
5
+ import { acquirePort, getDotEnvVariables, getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
6
6
  import { getFunctionsDir } from '../../utils/functions/index.mjs'
7
7
 
8
8
  const DEFAULT_PORT = 9999
@@ -16,11 +16,12 @@ const functionsServe = async (options, command) => {
16
16
  const { api, config, site, siteInfo } = command.netlify
17
17
 
18
18
  const functionsDir = getFunctionsDir({ options, config }, join('netlify', 'functions'))
19
- const { env } = command.netlify.cachedConfig
19
+ let { env } = command.netlify.cachedConfig
20
20
 
21
21
  env.NETLIFY_DEV = { sources: ['internal'], value: 'true' }
22
22
 
23
- await injectEnvVariables({ devConfig: { ...config.dev }, env, site })
23
+ env = await getDotEnvVariables({ devConfig: { ...config.dev }, env, site })
24
+ injectEnvVariables(env)
24
25
 
25
26
  const { capabilities, siteUrl, timeouts } = await getSiteInformation({
26
27
  offline: options.offline,
@@ -16,7 +16,7 @@ import {
16
16
  normalizeConfig,
17
17
  } from '../../utils/command-helpers.mjs'
18
18
  import detectServerSettings, { getConfigWithPlugins } from '../../utils/detect-server-settings.mjs'
19
- import { getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
19
+ import { getDotEnvVariables, getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs'
20
20
  import { getEnvelopeEnv, normalizeContext } from '../../utils/env/index.mjs'
21
21
  import { getInternalFunctionsDir } from '../../utils/functions/functions.mjs'
22
22
  import { ensureNetlifyIgnore } from '../../utils/gitignore.mjs'
@@ -52,7 +52,8 @@ const serve = async (options, command) => {
52
52
  log(`${NETLIFYDEVLOG} Injecting environment variable values for ${chalk.yellow('all scopes')}`)
53
53
  }
54
54
 
55
- await injectEnvVariables({ devConfig, env, site })
55
+ env = await getDotEnvVariables({ devConfig, env, site })
56
+ injectEnvVariables(env)
56
57
  await promptEditorHelper({ chalk, config, log, NETLIFYDEVLOG, repositoryRoot, state })
57
58
 
58
59
  const { addonsUrls, capabilities, siteUrl, timeouts } = await getSiteInformation({
@@ -42,8 +42,10 @@ const waitForBuildFinish = async function (api, siteId, spinner) {
42
42
 
43
43
  await pWaitFor(waitForBuildToFinish, {
44
44
  interval: BUILD_FINISH_INTERVAL,
45
- timeout: BUILD_FINISH_TIMEOUT,
46
- message: 'Timeout while waiting for deploy to finish',
45
+ timeout: {
46
+ milliseconds: BUILD_FINISH_TIMEOUT,
47
+ message: 'Timeout while waiting for deploy to finish',
48
+ },
47
49
  })
48
50
 
49
51
  // return only when build done or timeout happens
@@ -79,11 +79,12 @@ export const initializeProxy = async ({
79
79
  const server = prepareServer({
80
80
  config,
81
81
  configPath,
82
- directories: [internalFunctionsPath, userFunctionsPath].filter(Boolean),
82
+ directory: userFunctionsPath,
83
83
  env: configEnv,
84
84
  getUpdatedConfig,
85
85
  importMaps: [importMap].filter(Boolean),
86
86
  inspectSettings,
87
+ internalDirectory: internalFunctionsPath,
87
88
  internalFunctions,
88
89
  port: isolatePort,
89
90
  projectDir,
@@ -153,11 +154,12 @@ export const isEdgeFunctionsRequest = (req) => req[headersSymbol] !== undefined
153
154
  const prepareServer = async ({
154
155
  config,
155
156
  configPath,
156
- directories,
157
+ directory,
157
158
  env: configEnv,
158
159
  getUpdatedConfig,
159
160
  importMaps,
160
161
  inspectSettings,
162
+ internalDirectory,
161
163
  internalFunctions,
162
164
  port,
163
165
  projectDir,
@@ -187,9 +189,10 @@ const prepareServer = async ({
187
189
  bundler,
188
190
  config,
189
191
  configPath,
190
- directories,
192
+ directories: [directory].filter(Boolean),
191
193
  env: configEnv,
192
194
  getUpdatedConfig,
195
+ internalDirectories: [internalDirectory].filter(Boolean),
193
196
  internalFunctions,
194
197
  projectDir,
195
198
  runIsolate,