netlify-cli 12.6.0 → 12.7.1

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": "12.6.0",
4
+ "version": "12.7.1",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -38,7 +38,7 @@
38
38
  "url": "https://github.com/netlify/cli/issues"
39
39
  },
40
40
  "scripts": {
41
- "prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
41
+ "prepare": "is-ci || husky install node_modules/@netlify/eslint-config-node/.husky/",
42
42
  "start": "node ./bin/run.mjs",
43
43
  "test": "run-s format test:dev",
44
44
  "format": "run-s format:check-fix:*",
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "config": {
74
74
  "eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,html}\" \"*.{mjs,cjs,js,md,html}\" \".*.{mjs,cjs,js,md,html}\"",
75
- "prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
75
+ "prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
76
76
  },
77
77
  "dependencies": {
78
78
  "@fastify/static": "^6.6.0",
@@ -111,6 +111,7 @@
111
111
  "execa": "^5.0.0",
112
112
  "express": "^4.17.1",
113
113
  "express-logging": "^1.1.1",
114
+ "extract-zip": "^2.0.1",
114
115
  "fastify": "^4.10.2",
115
116
  "find-up": "^5.0.0",
116
117
  "flush-write-stream": "^2.0.0",
@@ -132,7 +133,7 @@
132
133
  "is-plain-obj": "^3.0.0",
133
134
  "is-wsl": "^2.2.0",
134
135
  "isexe": "^2.0.0",
135
- "jsonwebtoken": "^8.5.1",
136
+ "jsonwebtoken": "^9.0.0",
136
137
  "jwt-decode": "^3.0.0",
137
138
  "lambda-local": "^2.0.1",
138
139
  "listr": "^0.14.3",
@@ -192,6 +193,7 @@
192
193
  "graphviz": "^0.0.9",
193
194
  "husky": "^8.0.0",
194
195
  "ini": "^2.0.0",
196
+ "is-ci": "^3.0.1",
195
197
  "mock-fs": "^5.1.2",
196
198
  "nock": "^13.2.4",
197
199
  "p-timeout": "^4.0.0",
@@ -469,11 +469,7 @@ export default class BaseCommand extends Command {
469
469
  return await resolveConfig({
470
470
  config: options.config,
471
471
  cwd,
472
- context:
473
- options.context ||
474
- process.env.CONTEXT ||
475
- // Dev commands have a default context of `dev`, otherwise we let netlify/config handle default behavior
476
- (['dev', 'dev:exec'].includes(this.name()) ? 'dev' : undefined),
472
+ context: options.context || process.env.CONTEXT || this.getDefaultContext(),
477
473
  debug: this.opts().debug,
478
474
  siteId: options.siteId || (typeof options.site === 'string' && options.site) || state.get('siteId'),
479
475
  token,
@@ -505,4 +501,19 @@ export default class BaseCommand extends Command {
505
501
  exit(1)
506
502
  }
507
503
  }
504
+
505
+ /**
506
+ * Returns the context that should be used in case one hasn't been explicitly
507
+ * set. The default context is `dev` most of the time, but some commands may
508
+ * wish to override that.
509
+ *
510
+ * @returns {string}
511
+ */
512
+ getDefaultContext() {
513
+ if (this.name() === 'serve') {
514
+ return 'production'
515
+ }
516
+
517
+ return 'dev'
518
+ }
508
519
  }