netlify-cli 11.1.0 → 11.2.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 +38 -38
- package/package.json +3 -3
- package/src/commands/init/init.js +2 -0
- package/src/commands/link/link.js +2 -10
- package/src/commands/sites/sites-create.js +4 -6
- package/src/utils/init/config-github.js +2 -0
- package/src/utils/init/plugins.js +1 -29
- package/src/utils/init/utils.js +15 -64
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "11.
|
|
9
|
+
"version": "11.2.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@netlify/build": "^27.
|
|
14
|
-
"@netlify/config": "^18.2.
|
|
13
|
+
"@netlify/build": "^27.15.4",
|
|
14
|
+
"@netlify/config": "^18.2.1",
|
|
15
15
|
"@netlify/edge-bundler": "^1.13.0",
|
|
16
16
|
"@netlify/framework-info": "^9.2.0",
|
|
17
17
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
@@ -1189,14 +1189,14 @@
|
|
|
1189
1189
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
1190
1190
|
},
|
|
1191
1191
|
"node_modules/@netlify/build": {
|
|
1192
|
-
"version": "27.
|
|
1193
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.
|
|
1194
|
-
"integrity": "sha512
|
|
1192
|
+
"version": "27.15.4",
|
|
1193
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.4.tgz",
|
|
1194
|
+
"integrity": "sha512-4fNEB3V4DF1HQEQrRfFFRWWRNNlkZEdcyWXz1ekzAwQ6rJYmhUxHV5tJg98AhHTrovXBmlWK1gLF3qLaGGoMFA==",
|
|
1195
1195
|
"dependencies": {
|
|
1196
1196
|
"@bugsnag/js": "^7.0.0",
|
|
1197
1197
|
"@netlify/cache-utils": "^4.0.0",
|
|
1198
|
-
"@netlify/config": "^18.2.
|
|
1199
|
-
"@netlify/edge-bundler": "^1.
|
|
1198
|
+
"@netlify/config": "^18.2.2",
|
|
1199
|
+
"@netlify/edge-bundler": "^1.13.0",
|
|
1200
1200
|
"@netlify/functions-utils": "^4.2.4",
|
|
1201
1201
|
"@netlify/git-utils": "^4.0.0",
|
|
1202
1202
|
"@netlify/plugins-list": "^6.36.0",
|
|
@@ -1806,9 +1806,9 @@
|
|
|
1806
1806
|
}
|
|
1807
1807
|
},
|
|
1808
1808
|
"node_modules/@netlify/build/node_modules/read-pkg-up/node_modules/type-fest": {
|
|
1809
|
-
"version": "2.18.
|
|
1810
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
1811
|
-
"integrity": "sha512-
|
|
1809
|
+
"version": "2.18.1",
|
|
1810
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
1811
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
|
|
1812
1812
|
"engines": {
|
|
1813
1813
|
"node": ">=12.20"
|
|
1814
1814
|
},
|
|
@@ -1817,9 +1817,9 @@
|
|
|
1817
1817
|
}
|
|
1818
1818
|
},
|
|
1819
1819
|
"node_modules/@netlify/build/node_modules/read-pkg/node_modules/type-fest": {
|
|
1820
|
-
"version": "2.18.
|
|
1821
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
1822
|
-
"integrity": "sha512-
|
|
1820
|
+
"version": "2.18.1",
|
|
1821
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
1822
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
|
|
1823
1823
|
"engines": {
|
|
1824
1824
|
"node": ">=12.20"
|
|
1825
1825
|
},
|
|
@@ -2011,9 +2011,9 @@
|
|
|
2011
2011
|
}
|
|
2012
2012
|
},
|
|
2013
2013
|
"node_modules/@netlify/config": {
|
|
2014
|
-
"version": "18.2.
|
|
2015
|
-
"resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.
|
|
2016
|
-
"integrity": "sha512-
|
|
2014
|
+
"version": "18.2.2",
|
|
2015
|
+
"resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
|
|
2016
|
+
"integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
|
|
2017
2017
|
"dependencies": {
|
|
2018
2018
|
"chalk": "^5.0.0",
|
|
2019
2019
|
"cron-parser": "^4.1.0",
|
|
@@ -2321,9 +2321,9 @@
|
|
|
2321
2321
|
}
|
|
2322
2322
|
},
|
|
2323
2323
|
"node_modules/@netlify/config/node_modules/type-fest": {
|
|
2324
|
-
"version": "2.18.
|
|
2325
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
2326
|
-
"integrity": "sha512-
|
|
2324
|
+
"version": "2.18.1",
|
|
2325
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
2326
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
|
|
2327
2327
|
"engines": {
|
|
2328
2328
|
"node": ">=12.20"
|
|
2329
2329
|
},
|
|
@@ -23374,14 +23374,14 @@
|
|
|
23374
23374
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
23375
23375
|
},
|
|
23376
23376
|
"@netlify/build": {
|
|
23377
|
-
"version": "27.
|
|
23378
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.
|
|
23379
|
-
"integrity": "sha512
|
|
23377
|
+
"version": "27.15.4",
|
|
23378
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.4.tgz",
|
|
23379
|
+
"integrity": "sha512-4fNEB3V4DF1HQEQrRfFFRWWRNNlkZEdcyWXz1ekzAwQ6rJYmhUxHV5tJg98AhHTrovXBmlWK1gLF3qLaGGoMFA==",
|
|
23380
23380
|
"requires": {
|
|
23381
23381
|
"@bugsnag/js": "^7.0.0",
|
|
23382
23382
|
"@netlify/cache-utils": "^4.0.0",
|
|
23383
|
-
"@netlify/config": "^18.2.
|
|
23384
|
-
"@netlify/edge-bundler": "^1.
|
|
23383
|
+
"@netlify/config": "^18.2.2",
|
|
23384
|
+
"@netlify/edge-bundler": "^1.13.0",
|
|
23385
23385
|
"@netlify/functions-utils": "^4.2.4",
|
|
23386
23386
|
"@netlify/git-utils": "^4.0.0",
|
|
23387
23387
|
"@netlify/plugins-list": "^6.36.0",
|
|
@@ -23752,9 +23752,9 @@
|
|
|
23752
23752
|
},
|
|
23753
23753
|
"dependencies": {
|
|
23754
23754
|
"type-fest": {
|
|
23755
|
-
"version": "2.18.
|
|
23756
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
23757
|
-
"integrity": "sha512-
|
|
23755
|
+
"version": "2.18.1",
|
|
23756
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
23757
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
|
|
23758
23758
|
}
|
|
23759
23759
|
}
|
|
23760
23760
|
},
|
|
@@ -23769,9 +23769,9 @@
|
|
|
23769
23769
|
},
|
|
23770
23770
|
"dependencies": {
|
|
23771
23771
|
"type-fest": {
|
|
23772
|
-
"version": "2.18.
|
|
23773
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
23774
|
-
"integrity": "sha512-
|
|
23772
|
+
"version": "2.18.1",
|
|
23773
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
23774
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
|
|
23775
23775
|
}
|
|
23776
23776
|
}
|
|
23777
23777
|
},
|
|
@@ -23885,9 +23885,9 @@
|
|
|
23885
23885
|
}
|
|
23886
23886
|
},
|
|
23887
23887
|
"@netlify/config": {
|
|
23888
|
-
"version": "18.2.
|
|
23889
|
-
"resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.
|
|
23890
|
-
"integrity": "sha512-
|
|
23888
|
+
"version": "18.2.2",
|
|
23889
|
+
"resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
|
|
23890
|
+
"integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
|
|
23891
23891
|
"requires": {
|
|
23892
23892
|
"chalk": "^5.0.0",
|
|
23893
23893
|
"cron-parser": "^4.1.0",
|
|
@@ -24063,9 +24063,9 @@
|
|
|
24063
24063
|
"integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="
|
|
24064
24064
|
},
|
|
24065
24065
|
"type-fest": {
|
|
24066
|
-
"version": "2.18.
|
|
24067
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.
|
|
24068
|
-
"integrity": "sha512-
|
|
24066
|
+
"version": "2.18.1",
|
|
24067
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
|
|
24068
|
+
"integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
|
|
24069
24069
|
},
|
|
24070
24070
|
"yocto-queue": {
|
|
24071
24071
|
"version": "1.0.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.2.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"@whitep4nth3r (https://twitter.com/whitep4nth3r)",
|
|
@@ -222,8 +222,8 @@
|
|
|
222
222
|
"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\""
|
|
223
223
|
},
|
|
224
224
|
"dependencies": {
|
|
225
|
-
"@netlify/build": "^27.
|
|
226
|
-
"@netlify/config": "^18.2.
|
|
225
|
+
"@netlify/build": "^27.15.4",
|
|
226
|
+
"@netlify/config": "^18.2.1",
|
|
227
227
|
"@netlify/edge-bundler": "^1.13.0",
|
|
228
228
|
"@netlify/framework-info": "^9.2.0",
|
|
229
229
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
@@ -198,6 +198,8 @@ const init = async (options, command) => {
|
|
|
198
198
|
siteInfo = await createOrLinkSiteToRepo(command)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
log()
|
|
202
|
+
|
|
201
203
|
// Check for existing CI setup
|
|
202
204
|
const remoteBuildRepo = getRepoUrl({ siteInfo })
|
|
203
205
|
if (remoteBuildRepo && !options.force) {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
const { join, relative } = require('path')
|
|
3
|
-
const path = require('path')
|
|
4
|
-
const { cwd } = require('process')
|
|
5
|
-
|
|
6
2
|
const inquirer = require('inquirer')
|
|
7
3
|
const isEmpty = require('lodash/isEmpty')
|
|
8
4
|
|
|
@@ -234,10 +230,6 @@ or run ${chalk.cyanBright('netlify sites:create')} to create a site.`)
|
|
|
234
230
|
log(`Admin url: ${chalk.magentaBright(site.admin_url)}`)
|
|
235
231
|
log(`Site url: ${chalk.cyanBright(site.ssl_url || site.url)}`)
|
|
236
232
|
log()
|
|
237
|
-
|
|
238
|
-
log(`Site id saved to ${path.join(netlify.site.root, '/.netlify/state.json')}`)
|
|
239
|
-
// log(`Local Config: .netlify/config.json`)
|
|
240
|
-
log()
|
|
241
233
|
log(`You can now run other \`netlify\` cli commands in this directory`)
|
|
242
234
|
|
|
243
235
|
return site
|
|
@@ -296,7 +288,7 @@ const link = async (options, command) => {
|
|
|
296
288
|
|
|
297
289
|
// Save site ID
|
|
298
290
|
state.set('siteId', siteData.id)
|
|
299
|
-
log(`Linked to ${siteData.name}
|
|
291
|
+
log(`Linked to ${siteData.name}`)
|
|
300
292
|
|
|
301
293
|
await track('sites_linked', {
|
|
302
294
|
siteId: siteData.id,
|
|
@@ -327,7 +319,7 @@ const link = async (options, command) => {
|
|
|
327
319
|
const [firstSiteData] = results
|
|
328
320
|
state.set('siteId', firstSiteData.id)
|
|
329
321
|
|
|
330
|
-
log(`Linked to ${firstSiteData.name}
|
|
322
|
+
log(`Linked to ${firstSiteData.name}`)
|
|
331
323
|
|
|
332
324
|
await track('sites_linked', {
|
|
333
325
|
siteId: (firstSiteData && firstSiteData.id) || siteId,
|
|
@@ -39,16 +39,14 @@ const getSiteNameInput = async (name, user, api) => {
|
|
|
39
39
|
]
|
|
40
40
|
siteSuggestion = sample(suggestions)
|
|
41
41
|
|
|
42
|
-
console.log(
|
|
43
|
-
`Choose a unique site name (e.g. ${siteSuggestion}.netlify.app) or leave it blank for a random name. You can update the site name later.`,
|
|
44
|
-
)
|
|
45
42
|
const { name: nameInput } = await inquirer.prompt([
|
|
46
43
|
{
|
|
47
44
|
type: 'input',
|
|
48
45
|
name: 'name',
|
|
49
|
-
message: 'Site name (
|
|
50
|
-
|
|
51
|
-
validate: (input) =>
|
|
46
|
+
message: 'Site name (you can change it later):',
|
|
47
|
+
default: siteSuggestion,
|
|
48
|
+
validate: (input) =>
|
|
49
|
+
/^[a-zA-Z\d-]+$/.test(input || undefined) || 'Only alphanumeric characters and hyphens are allowed',
|
|
52
50
|
},
|
|
53
51
|
])
|
|
54
52
|
name = nameInput || siteSuggestion
|
|
@@ -224,6 +224,8 @@ const configGithub = async ({ command, repoName, repoOwner, siteId }) => {
|
|
|
224
224
|
})
|
|
225
225
|
await saveNetlifyToml({ repositoryRoot, config, configPath, baseDir, buildCmd, buildDir, functionsDir })
|
|
226
226
|
|
|
227
|
+
log()
|
|
228
|
+
|
|
227
229
|
const octokit = getGitHubClient(token)
|
|
228
230
|
const [deployKey, githubRepo] = await Promise.all([
|
|
229
231
|
addDeployKey({ api, octokit, repoOwner, repoName }),
|
|
@@ -1,38 +1,10 @@
|
|
|
1
|
-
const fetch = require('node-fetch')
|
|
2
|
-
|
|
3
|
-
// TODO: use static `import` after migrating this repository to pure ES modules
|
|
4
|
-
const netlifyPluginsList = import('@netlify/plugins-list')
|
|
5
|
-
|
|
6
|
-
// 1 minute
|
|
7
|
-
const PLUGINS_LIST_TIMEOUT = 6e4
|
|
8
|
-
|
|
9
|
-
const getPluginsList = async () => {
|
|
10
|
-
const { pluginsList, pluginsUrl } = await netlifyPluginsList
|
|
11
|
-
try {
|
|
12
|
-
const response = await fetch(pluginsUrl, { timeout: PLUGINS_LIST_TIMEOUT })
|
|
13
|
-
return await response.json()
|
|
14
|
-
} catch {
|
|
15
|
-
return pluginsList
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const getPluginInfo = (list, packageName) => list.find(({ package }) => package === packageName)
|
|
20
|
-
|
|
21
1
|
const isPluginInstalled = (configPlugins, plugin) =>
|
|
22
2
|
configPlugins.some(({ package: configPlugin }) => configPlugin === plugin)
|
|
23
3
|
|
|
24
4
|
const getRecommendPlugins = (frameworkPlugins, config) =>
|
|
25
5
|
frameworkPlugins.filter((plugin) => !isPluginInstalled(config.plugins, plugin))
|
|
26
6
|
|
|
27
|
-
const getPluginsToInstall = ({ installSinglePlugin, plugins, recommendedPlugins }) => {
|
|
28
|
-
if (Array.isArray(plugins)) {
|
|
29
|
-
return plugins.map((plugin) => ({ package: plugin }))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return installSinglePlugin === true ? [{ package: recommendedPlugins[0] }] : []
|
|
33
|
-
}
|
|
34
|
-
|
|
35
7
|
const getUIPlugins = (configPlugins) =>
|
|
36
8
|
configPlugins.filter(({ origin }) => origin === 'ui').map(({ package }) => ({ package }))
|
|
37
9
|
|
|
38
|
-
module.exports = {
|
|
10
|
+
module.exports = { getRecommendPlugins, getUIPlugins }
|
package/src/utils/init/utils.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const { existsSync } = require('fs')
|
|
3
3
|
const { writeFile } = require('fs').promises
|
|
4
|
-
const { EOL } = require('os')
|
|
5
4
|
const path = require('path')
|
|
6
5
|
const process = require('process')
|
|
7
6
|
|
|
@@ -10,11 +9,12 @@ const inquirer = require('inquirer')
|
|
|
10
9
|
const isEmpty = require('lodash/isEmpty')
|
|
11
10
|
|
|
12
11
|
const { normalizeBackslash } = require('../../lib/path')
|
|
12
|
+
const { log } = require('../command-helpers')
|
|
13
13
|
const { chalk, error: failAndExit, warn } = require('../command-helpers')
|
|
14
14
|
|
|
15
15
|
const { getFrameworkInfo } = require('./frameworks')
|
|
16
16
|
const { detectNodeVersion } = require('./node-version')
|
|
17
|
-
const {
|
|
17
|
+
const { getRecommendPlugins, getUIPlugins } = require('./plugins')
|
|
18
18
|
|
|
19
19
|
const normalizeDir = ({ baseDirectory, defaultValue, dir }) => {
|
|
20
20
|
if (dir === undefined) {
|
|
@@ -55,14 +55,7 @@ const getDefaultSettings = ({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const getPromptInputs =
|
|
59
|
-
defaultBaseDir,
|
|
60
|
-
defaultBuildCmd,
|
|
61
|
-
defaultBuildDir,
|
|
62
|
-
defaultFunctionsDir,
|
|
63
|
-
frameworkName,
|
|
64
|
-
recommendedPlugins,
|
|
65
|
-
}) => {
|
|
58
|
+
const getPromptInputs = ({ defaultBaseDir, defaultBuildCmd, defaultBuildDir }) => {
|
|
66
59
|
const inputs = [
|
|
67
60
|
defaultBaseDir !== undefined && {
|
|
68
61
|
type: 'input',
|
|
@@ -83,50 +76,9 @@ const getPromptInputs = async ({
|
|
|
83
76
|
message: 'Directory to deploy (blank for current dir):',
|
|
84
77
|
default: defaultBuildDir,
|
|
85
78
|
},
|
|
86
|
-
{
|
|
87
|
-
type: 'input',
|
|
88
|
-
name: 'functionsDir',
|
|
89
|
-
message: 'Netlify functions folder:',
|
|
90
|
-
default: defaultFunctionsDir,
|
|
91
|
-
},
|
|
92
79
|
].filter(Boolean)
|
|
93
80
|
|
|
94
|
-
|
|
95
|
-
return inputs
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const pluginsList = await getPluginsList()
|
|
99
|
-
|
|
100
|
-
const prefix = `Seems like this is a ${formatTitle(frameworkName)} site.${EOL}❇️ `
|
|
101
|
-
if (recommendedPlugins.length === 1) {
|
|
102
|
-
const { name } = getPluginInfo(pluginsList, recommendedPlugins[0])
|
|
103
|
-
return [
|
|
104
|
-
...inputs,
|
|
105
|
-
{
|
|
106
|
-
type: 'confirm',
|
|
107
|
-
name: 'installSinglePlugin',
|
|
108
|
-
message: `${prefix}We're going to install this Build Plugin: ${formatTitle(
|
|
109
|
-
`${name} plugin`,
|
|
110
|
-
)}${EOL}➡️ OK to install?`,
|
|
111
|
-
default: true,
|
|
112
|
-
},
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const infos = recommendedPlugins.map((packageName) => getPluginInfo(pluginsList, packageName))
|
|
117
|
-
return [
|
|
118
|
-
...inputs,
|
|
119
|
-
{
|
|
120
|
-
type: 'checkbox',
|
|
121
|
-
name: 'plugins',
|
|
122
|
-
message: `${prefix}We're going to install these plugins: ${infos
|
|
123
|
-
.map(({ name }) => `${name} plugin`)
|
|
124
|
-
.map(formatTitle)
|
|
125
|
-
.join(', ')}${EOL}➡️ OK to install??`,
|
|
126
|
-
choices: infos.map((info) => ({ name: `${info.name} plugin`, value: info.package })),
|
|
127
|
-
default: infos.map((info) => info.package),
|
|
128
|
-
},
|
|
129
|
-
]
|
|
81
|
+
return inputs.filter(Boolean)
|
|
130
82
|
}
|
|
131
83
|
|
|
132
84
|
// `repositoryRoot === siteRoot` means the base directory wasn't detected by @netlify/config, so we use cwd()
|
|
@@ -154,25 +106,24 @@ const getBuildSettings = async ({ config, env, repositoryRoot, siteRoot }) => {
|
|
|
154
106
|
frameworkBuildDir,
|
|
155
107
|
frameworkPlugins,
|
|
156
108
|
})
|
|
157
|
-
|
|
158
|
-
|
|
109
|
+
|
|
110
|
+
if (recommendedPlugins.length !== 0) {
|
|
111
|
+
log(`Configuring ${formatTitle(frameworkName)} runtime...`)
|
|
112
|
+
log()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const { baseDir, buildCmd, buildDir } = await inquirer.prompt(
|
|
116
|
+
getPromptInputs({
|
|
117
|
+
defaultBaseDir,
|
|
159
118
|
defaultBuildCmd,
|
|
160
119
|
defaultBuildDir,
|
|
161
|
-
defaultFunctionsDir,
|
|
162
|
-
defaultBaseDir,
|
|
163
|
-
recommendedPlugins,
|
|
164
|
-
frameworkName,
|
|
165
120
|
}),
|
|
166
121
|
)
|
|
167
|
-
const pluginsToInstall = getPluginsToInstall({
|
|
168
|
-
plugins,
|
|
169
|
-
installSinglePlugin,
|
|
170
|
-
recommendedPlugins,
|
|
171
|
-
})
|
|
172
122
|
|
|
123
|
+
const pluginsToInstall = recommendedPlugins.map((plugin) => ({ package: plugin }))
|
|
173
124
|
const normalizedBaseDir = baseDir ? normalizeBackslash(baseDir) : undefined
|
|
174
125
|
|
|
175
|
-
return { baseDir: normalizedBaseDir, buildCmd, buildDir, functionsDir, pluginsToInstall }
|
|
126
|
+
return { baseDir: normalizedBaseDir, buildCmd, buildDir, functionsDir: defaultFunctionsDir, pluginsToInstall }
|
|
176
127
|
}
|
|
177
128
|
|
|
178
129
|
const getNetlifyToml = ({
|