netlify-cli 17.11.0 → 17.12.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "17.11.0",
3
+ "version": "17.12.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "17.11.0",
9
+ "version": "17.12.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "17.11.0",
4
+ "version": "17.12.0",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -28,7 +28,7 @@ import inquirerAutocompletePrompt from 'inquirer-autocomplete-prompt';
28
28
  import merge from 'lodash/merge.js';
29
29
  import { NetlifyAPI } from 'netlify';
30
30
  import { getAgent } from '../lib/http-agent.js';
31
- import { NETLIFY_CYAN, USER_AGENT, chalk, error, exit, getToken, log, normalizeConfig, padLeft, pollForToken, sortOptions, warn, } from '../utils/command-helpers.js';
31
+ import { NETLIFY_CYAN, USER_AGENT, chalk, error, exit, getToken, log, version, normalizeConfig, padLeft, pollForToken, sortOptions, warn, } from '../utils/command-helpers.js';
32
32
  import getGlobalConfig from '../utils/get-global-config.js';
33
33
  import { getSiteByName } from '../utils/get-site.js';
34
34
  import openBrowser from '../utils/open-browser.js';
@@ -434,7 +434,8 @@ class BaseCommand extends Command {
434
434
  token,
435
435
  ...apiUrlOpts,
436
436
  });
437
- const { buildDir, config, configPath, repositoryRoot, siteInfo } = cachedConfig;
437
+ const { buildDir, config, configPath, env, repositoryRoot, siteInfo } = cachedConfig;
438
+ env.NETLIFY_CLI_VERSION = { sources: ['internal'], value: version };
438
439
  const normalizedConfig = normalizeConfig(config);
439
440
  const agent = await getAgent({
440
441
  httpProxy: flags.httpProxy,
@@ -7,8 +7,7 @@ import { chalk, error, log, logJson } from '../../utils/command-helpers.js';
7
7
  import { AVAILABLE_CONTEXTS, getEnvelopeEnv, getHumanReadableScopes } from '../../utils/env/index.js';
8
8
  const MASK_LENGTH = 50;
9
9
  const MASK = '*'.repeat(MASK_LENGTH);
10
- // @ts-expect-error TS(7031) FIXME: Binding element 'environment' implicitly has an 'a... Remove this comment to see the full error message
11
- const getTable = ({ environment, hideValues, scopesColumn }) => {
10
+ const getTable = ({ environment, hideValues, scopesColumn, }) => {
12
11
  const table = new AsciiTable(`Environment variables`);
13
12
  const headings = ['Key', 'Value', scopesColumn && 'Scope'].filter(Boolean);
14
13
  table.setHeading(...headings);
@@ -16,10 +15,8 @@ const getTable = ({ environment, hideValues, scopesColumn }) => {
16
15
  // Key
17
16
  key,
18
17
  // Value
19
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
20
18
  hideValues ? MASK : variable.value || ' ',
21
19
  // Scope
22
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
23
20
  scopesColumn && getHumanReadableScopes(variable.scopes),
24
21
  ].filter(Boolean)));
25
22
  return table.toString();
@@ -43,20 +40,15 @@ export const envList = async (options, command) => {
43
40
  return false;
44
41
  }
45
42
  // filter out general sources
46
- environment = Object.fromEntries(
47
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
48
- Object.entries(environment).filter(([, variable]) => variable.sources[0] !== 'general'));
43
+ environment = Object.fromEntries(Object.entries(environment).filter(([, variable]) => variable.sources[0] !== 'general' && variable.sources[0] !== 'internal'));
49
44
  // Return json response for piping commands
50
45
  if (options.json) {
51
- const envDictionary = Object.fromEntries(
52
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
53
- Object.entries(environment).map(([key, variable]) => [key, variable.value]));
46
+ const envDictionary = Object.fromEntries(Object.entries(environment).map(([key, variable]) => [key, variable.value]));
54
47
  logJson(envDictionary);
55
48
  return false;
56
49
  }
57
50
  if (options.plain) {
58
51
  const plaintext = Object.entries(environment)
59
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
60
52
  .map(([key, variable]) => `${key}=${variable.value}`)
61
53
  .join('\n');
62
54
  log(plaintext);
@@ -7,7 +7,7 @@ use simple_logger::SimpleLogger;
7
7
 
8
8
  #[tokio::main]
9
9
  async fn main() -> Result<(), Error> {
10
- SimpleLogger::new().with_level(LevelFilter::Info).init().unwrap();
10
+ SimpleLogger::new().with_utc_timestamps().with_level(LevelFilter::Info).init().unwrap();
11
11
 
12
12
  let func = handler_fn(my_handler);
13
13
  lambda_runtime::run(func).await?;
@@ -26,4 +26,4 @@ pub(crate) async fn my_handler(event: ApiGatewayProxyRequest, _ctx: Context) ->
26
26
  };
27
27
 
28
28
  Ok(resp)
29
- }
29
+ }
@@ -35,15 +35,15 @@ const buildClientContext = function (headers) {
35
35
  // "testData": "NETLIFY_DEV_LOCALLY_EMULATED_IDENTITY"
36
36
  // }
37
37
  };
38
- // This data is available on both the context root and under custom.netlify for retro-compatibility.
39
- // In the future it will only be available in custom.netlify.
40
- // @ts-expect-error
41
- const user = jwtDecode(parts[1]);
42
- const netlifyContext = JSON.stringify({
43
- identity: identity,
44
- user: user,
45
- });
46
38
  try {
39
+ // This data is available on both the context root and under custom.netlify for retro-compatibility.
40
+ // In the future it will only be available in custom.netlify.
41
+ // @ts-expect-error
42
+ const user = jwtDecode(parts[1]);
43
+ const netlifyContext = JSON.stringify({
44
+ identity: identity,
45
+ user: user,
46
+ });
47
47
  return {
48
48
  identity: identity,
49
49
  user: user,
@@ -40,7 +40,8 @@ export const chalk = safeChalk(argv.includes('--json'));
40
40
  export const padLeft = (str, count, filler = ' ') => str.padStart(str.length + count, filler);
41
41
  const platform = WSL ? 'wsl' : os.platform();
42
42
  const arch = os.arch() === 'ia32' ? 'x86' : os.arch();
43
- const { name, version } = await getPackageJson();
43
+ const { name, version: packageVersion } = await getPackageJson();
44
+ export const version = packageVersion;
44
45
  export const USER_AGENT = `${name}/${version} ${platform}-${arch} node-${process.version}`;
45
46
  /** A list of base command flags that needs to be sorted down on documentation and on help pages */
46
47
  const BASE_FLAGS = new Set(['--debug', '--httpProxy', '--httpProxyCertificateFilename']);