netlify-cli 9.8.4 → 9.9.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/npm-shrinkwrap.json +10 -10
- package/package.json +2 -2
- package/src/commands/build/build.js +29 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "9.
|
|
9
|
+
"version": "9.9.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@babel/preset-react": "^7.12.13",
|
|
128
|
-
"@netlify/eslint-config-node": "^5.1.
|
|
128
|
+
"@netlify/eslint-config-node": "^5.1.6",
|
|
129
129
|
"ava": "^4.0.0",
|
|
130
130
|
"c8": "^7.11.0",
|
|
131
131
|
"eslint-plugin-sort-destructure-keys": "^1.3.5",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"tomlify-j0.4": "^3.0.0",
|
|
149
149
|
"tree-kill": "^1.2.2",
|
|
150
150
|
"typescript": "^4.4.4",
|
|
151
|
-
"verdaccio": "^5.
|
|
151
|
+
"verdaccio": "^5.4.0"
|
|
152
152
|
},
|
|
153
153
|
"engines": {
|
|
154
154
|
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
|
|
@@ -3451,9 +3451,9 @@
|
|
|
3451
3451
|
}
|
|
3452
3452
|
},
|
|
3453
3453
|
"node_modules/@netlify/eslint-config-node": {
|
|
3454
|
-
"version": "5.1.
|
|
3455
|
-
"resolved": "https://registry.npmjs.org/@netlify/eslint-config-node/-/eslint-config-node-5.1.
|
|
3456
|
-
"integrity": "sha512-
|
|
3454
|
+
"version": "5.1.6",
|
|
3455
|
+
"resolved": "https://registry.npmjs.org/@netlify/eslint-config-node/-/eslint-config-node-5.1.6.tgz",
|
|
3456
|
+
"integrity": "sha512-eVxIgtv9DCvcsxsJkQHLhnCo5UJieytr8UgjuiRry2pambzlZxO2CHNg8ynZ027Q+JRkr+4beyGmhgek9ZlUVA==",
|
|
3457
3457
|
"dev": true,
|
|
3458
3458
|
"dependencies": {
|
|
3459
3459
|
"@babel/core": "^7.13.8",
|
|
@@ -26778,9 +26778,9 @@
|
|
|
26778
26778
|
"integrity": "sha512-tiKmDcHM2riSVN79c0mJY/67EBDafXQAMitHuLiCDAMdtz3kfv+NqdVG5krgf5lWR8Uf8AeZrUW5Q9RP25REvw=="
|
|
26779
26779
|
},
|
|
26780
26780
|
"@netlify/eslint-config-node": {
|
|
26781
|
-
"version": "5.1.
|
|
26782
|
-
"resolved": "https://registry.npmjs.org/@netlify/eslint-config-node/-/eslint-config-node-5.1.
|
|
26783
|
-
"integrity": "sha512-
|
|
26781
|
+
"version": "5.1.6",
|
|
26782
|
+
"resolved": "https://registry.npmjs.org/@netlify/eslint-config-node/-/eslint-config-node-5.1.6.tgz",
|
|
26783
|
+
"integrity": "sha512-eVxIgtv9DCvcsxsJkQHLhnCo5UJieytr8UgjuiRry2pambzlZxO2CHNg8ynZ027Q+JRkr+4beyGmhgek9ZlUVA==",
|
|
26784
26784
|
"dev": true,
|
|
26785
26785
|
"requires": {
|
|
26786
26786
|
"@babel/core": "^7.13.8",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.9.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
},
|
|
312
312
|
"devDependencies": {
|
|
313
313
|
"@babel/preset-react": "^7.12.13",
|
|
314
|
-
"@netlify/eslint-config-node": "^5.1.
|
|
314
|
+
"@netlify/eslint-config-node": "^5.1.6",
|
|
315
315
|
"ava": "^4.0.0",
|
|
316
316
|
"c8": "^7.11.0",
|
|
317
317
|
"eslint-plugin-sort-destructure-keys": "^1.3.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const { getBuildOptions, runBuild } = require('../../lib/build')
|
|
3
|
-
const { error, exit, getToken } = require('../../utils')
|
|
3
|
+
const { error, exit, generateNetlifyGraphJWT, getToken } = require('../../utils')
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @param {import('../../lib/build').BuildConfig} options
|
|
@@ -15,6 +15,32 @@ const checkOptions = ({ cachedConfig: { siteInfo = {} }, token }) => {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
const injectNetlifyGraphEnv = async function (command, { api, buildOptions, site }) {
|
|
19
|
+
const siteData = await api.getSite({ siteId: site.id })
|
|
20
|
+
const authlifyTokenId = siteData && siteData.authlify_token_id
|
|
21
|
+
|
|
22
|
+
if (authlifyTokenId) {
|
|
23
|
+
const netlifyToken = await command.authenticate()
|
|
24
|
+
// Only inject the authlify config if a token ID exists. This prevents
|
|
25
|
+
// calling command.authenticate() (which opens a browser window) if the
|
|
26
|
+
// user hasn't enabled API Authentication
|
|
27
|
+
const netlifyGraphConfig = {
|
|
28
|
+
netlifyToken,
|
|
29
|
+
authlifyTokenId,
|
|
30
|
+
siteId: site.id,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const netlifyGraphJWT = generateNetlifyGraphJWT(netlifyGraphConfig)
|
|
34
|
+
|
|
35
|
+
if (netlifyGraphJWT != null) {
|
|
36
|
+
// XXX(anmonteiro): this name is deprecated. Delete after 3/31/2022
|
|
37
|
+
const varData = { sources: ['general'], value: netlifyGraphJWT }
|
|
38
|
+
buildOptions.cachedConfig.env.ONEGRAPH_AUTHLIFY_TOKEN = varData
|
|
39
|
+
buildOptions.cachedConfig.env.NETLIFY_GRAPH_TOKEN = varData
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
18
44
|
/**
|
|
19
45
|
* The build command
|
|
20
46
|
* @param {import('commander').OptionValues} options
|
|
@@ -34,6 +60,8 @@ const build = async (options, command) => {
|
|
|
34
60
|
|
|
35
61
|
if (!options.offline) {
|
|
36
62
|
checkOptions(buildOptions)
|
|
63
|
+
const { api, site } = command.netlify
|
|
64
|
+
await injectNetlifyGraphEnv(command, { api, site, buildOptions })
|
|
37
65
|
}
|
|
38
66
|
|
|
39
67
|
const { exitCode } = await runBuild(buildOptions)
|