netlify-cli 15.8.1-rc.0 → 15.8.1-rc.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/npm-shrinkwrap.json +4209 -4089
- package/package.json +4 -4
- package/src/utils/init/config-manual.mjs +22 -5
- package/src/utils/init/frameworks.mjs +7 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "15.8.1-rc.
|
|
4
|
+
"version": "15.8.1-rc.1",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@bugsnag/js": "7.20.2",
|
|
46
46
|
"@fastify/static": "6.10.2",
|
|
47
|
-
"@netlify/build": "29.15.
|
|
47
|
+
"@netlify/build": "29.15.6",
|
|
48
48
|
"@netlify/build-info": "7.4.1",
|
|
49
49
|
"@netlify/config": "20.5.2",
|
|
50
|
-
"@netlify/edge-bundler": "8.16.
|
|
50
|
+
"@netlify/edge-bundler": "8.16.3",
|
|
51
51
|
"@netlify/local-functions-proxy": "1.1.1",
|
|
52
52
|
"@netlify/serverless-functions-api": "1.5.1",
|
|
53
|
-
"@netlify/zip-it-and-ship-it": "9.
|
|
53
|
+
"@netlify/zip-it-and-ship-it": "9.13.0",
|
|
54
54
|
"@octokit/rest": "19.0.13",
|
|
55
55
|
"@skn0tt/lambda-local": "2.0.3",
|
|
56
56
|
"ansi-escapes": "6.2.0",
|
|
@@ -5,7 +5,12 @@ import { exit, log } from '../command-helpers.mjs'
|
|
|
5
5
|
|
|
6
6
|
import { createDeployKey, getBuildSettings, saveNetlifyToml, setupSite } from './utils.mjs'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Prompts for granting the netlify ssh public key access to your repo
|
|
10
|
+
* @param {object} deployKey
|
|
11
|
+
* @param {string} deployKey.public_key
|
|
12
|
+
*/
|
|
13
|
+
const addDeployKey = async (deployKey) => {
|
|
9
14
|
log('\nGive this Netlify SSH public key access to your repository:\n')
|
|
10
15
|
log(`\n${deployKey.public_key}\n\n`)
|
|
11
16
|
|
|
@@ -23,6 +28,11 @@ const addDeployKey = async ({ deployKey }) => {
|
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* @param {object} config
|
|
33
|
+
* @param {Awaited<ReturnType<import('../../utils/get-repo-data.mjs').default>>} config.repoData
|
|
34
|
+
* @returns {Promise<string>}
|
|
35
|
+
*/
|
|
26
36
|
const getRepoPath = async ({ repoData }) => {
|
|
27
37
|
const { repoPath } = await inquirer.prompt([
|
|
28
38
|
{
|
|
@@ -30,6 +40,9 @@ const getRepoPath = async ({ repoData }) => {
|
|
|
30
40
|
name: 'repoPath',
|
|
31
41
|
message: 'The SSH URL of the remote git repo:',
|
|
32
42
|
default: repoData.url,
|
|
43
|
+
/**
|
|
44
|
+
* @param {string} url
|
|
45
|
+
*/
|
|
33
46
|
validate: (url) => SSH_URL_REGEXP.test(url) || 'The URL provided does not use the SSH protocol',
|
|
34
47
|
},
|
|
35
48
|
])
|
|
@@ -37,7 +50,11 @@ const getRepoPath = async ({ repoData }) => {
|
|
|
37
50
|
return repoPath
|
|
38
51
|
}
|
|
39
52
|
|
|
40
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} deployHook
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
const addDeployHook = async (deployHook) => {
|
|
41
58
|
log('\nConfigure the following webhook for your repository:\n')
|
|
42
59
|
log(`\n${deployHook}\n\n`)
|
|
43
60
|
const { deployHookAdded } = await inquirer.prompt([
|
|
@@ -55,7 +72,7 @@ const addDeployHook = async ({ deployHook }) => {
|
|
|
55
72
|
/**
|
|
56
73
|
* @param {object} config
|
|
57
74
|
* @param {import('../../commands/base-command.mjs').default} config.command
|
|
58
|
-
* @param {
|
|
75
|
+
* @param {Awaited<ReturnType<import('../../utils/get-repo-data.mjs').default>>} config.repoData
|
|
59
76
|
* @param {string} config.siteId
|
|
60
77
|
*/
|
|
61
78
|
export default async function configManual({ command, repoData, siteId }) {
|
|
@@ -77,7 +94,7 @@ export default async function configManual({ command, repoData, siteId }) {
|
|
|
77
94
|
await saveNetlifyToml({ repositoryRoot, config, configPath, baseDir, buildCmd, buildDir, functionsDir })
|
|
78
95
|
|
|
79
96
|
const deployKey = await createDeployKey({ api })
|
|
80
|
-
await addDeployKey(
|
|
97
|
+
await addDeployKey(deployKey)
|
|
81
98
|
|
|
82
99
|
const repoPath = await getRepoPath({ repoData })
|
|
83
100
|
const repo = {
|
|
@@ -99,7 +116,7 @@ export default async function configManual({ command, repoData, siteId }) {
|
|
|
99
116
|
configPlugins: config.plugins,
|
|
100
117
|
pluginsToInstall,
|
|
101
118
|
})
|
|
102
|
-
const deployHookAdded = await addDeployHook(
|
|
119
|
+
const deployHookAdded = await addDeployHook(updatedSite.deploy_hook)
|
|
103
120
|
if (!deployHookAdded) {
|
|
104
121
|
exit()
|
|
105
122
|
}
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
// @ts-
|
|
1
|
+
// @ts-check
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @param {{ project: import("@netlify/build-info").Project }} param0
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
7
|
export const getFrameworkInfo = async ({ project }) => {
|
|
8
|
-
const
|
|
8
|
+
const settings = await project.getBuildSettings()
|
|
9
9
|
// several frameworks can be detected - first one has highest priority
|
|
10
|
-
if (
|
|
11
|
-
const [
|
|
12
|
-
{
|
|
13
|
-
build: { command, directory },
|
|
14
|
-
name,
|
|
15
|
-
plugins,
|
|
16
|
-
},
|
|
17
|
-
] = frameworks
|
|
10
|
+
if (settings?.length) {
|
|
18
11
|
return {
|
|
19
|
-
frameworkName: name,
|
|
20
|
-
frameworkBuildCommand:
|
|
21
|
-
frameworkBuildDir:
|
|
22
|
-
frameworkPlugins:
|
|
12
|
+
frameworkName: settings[0].framework?.name,
|
|
13
|
+
frameworkBuildCommand: settings[0].buildCommand,
|
|
14
|
+
frameworkBuildDir: settings[0].dist,
|
|
15
|
+
frameworkPlugins: settings[0].plugins_recommended,
|
|
23
16
|
}
|
|
24
17
|
}
|
|
25
18
|
return {}
|