@netlify/config 23.0.9 → 23.0.10
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/lib/main.js
CHANGED
|
@@ -11,6 +11,7 @@ interface AutoInstallOptions {
|
|
|
11
11
|
testOpts: any;
|
|
12
12
|
mode: ModeOption;
|
|
13
13
|
extensionApiBaseUrl: string;
|
|
14
|
+
debug?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare function handleAutoInstallExtensions({ featureFlags, siteId, accountId, token, buildDir, integrations, offline, testOpts, mode, extensionApiBaseUrl, }: AutoInstallOptions): Promise<IntegrationResponse[]>;
|
|
16
|
+
export declare function handleAutoInstallExtensions({ featureFlags, siteId, accountId, token, buildDir, integrations, offline, testOpts, mode, extensionApiBaseUrl, debug, }: AutoInstallOptions): Promise<IntegrationResponse[]>;
|
|
16
17
|
export {};
|
|
@@ -12,58 +12,29 @@ function getPackageJSON(directory) {
|
|
|
12
12
|
return {};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
export async function handleAutoInstallExtensions({ featureFlags, siteId, accountId, token, buildDir, integrations, offline, testOpts = {}, mode, extensionApiBaseUrl, }) {
|
|
15
|
+
export async function handleAutoInstallExtensions({ featureFlags, siteId, accountId, token, buildDir, integrations, offline, testOpts = {}, mode, extensionApiBaseUrl, debug = false, }) {
|
|
16
16
|
if (!featureFlags?.auto_install_required_extensions) {
|
|
17
17
|
return integrations;
|
|
18
18
|
}
|
|
19
|
-
if (!accountId) {
|
|
20
|
-
|
|
21
|
-
accountId
|
|
22
|
-
siteId
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (!token) {
|
|
40
|
-
console.error("Failed to auto install extension(s): Missing 'token'", {
|
|
41
|
-
accountId,
|
|
42
|
-
siteId,
|
|
43
|
-
buildDir,
|
|
44
|
-
offline,
|
|
45
|
-
mode,
|
|
46
|
-
});
|
|
47
|
-
return integrations;
|
|
48
|
-
}
|
|
49
|
-
if (!buildDir) {
|
|
50
|
-
console.error("Failed to auto install extension(s): Missing 'buildDir'", {
|
|
51
|
-
accountId,
|
|
52
|
-
siteId,
|
|
53
|
-
buildDir,
|
|
54
|
-
offline,
|
|
55
|
-
mode,
|
|
56
|
-
});
|
|
57
|
-
return integrations;
|
|
58
|
-
}
|
|
59
|
-
if (offline) {
|
|
60
|
-
console.error("Failed to auto install extension(s): Running as 'offline'", {
|
|
61
|
-
accountId,
|
|
62
|
-
siteId,
|
|
63
|
-
buildDir,
|
|
64
|
-
offline,
|
|
65
|
-
mode,
|
|
66
|
-
});
|
|
19
|
+
if (!accountId || !siteId || !token || !buildDir || offline) {
|
|
20
|
+
const reason = !accountId
|
|
21
|
+
? 'Missing accountId'
|
|
22
|
+
: !siteId
|
|
23
|
+
? 'Missing siteId'
|
|
24
|
+
: !token
|
|
25
|
+
? 'Missing token'
|
|
26
|
+
: !buildDir
|
|
27
|
+
? 'Missing buildDir'
|
|
28
|
+
: 'Running as offline';
|
|
29
|
+
if (debug) {
|
|
30
|
+
console.error(`Failed to auto install extension(s): ${reason}`, {
|
|
31
|
+
accountId,
|
|
32
|
+
siteId,
|
|
33
|
+
buildDir,
|
|
34
|
+
offline,
|
|
35
|
+
mode,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
67
38
|
return integrations;
|
|
68
39
|
}
|
|
69
40
|
try {
|
|
@@ -34,11 +34,17 @@ export const installExtension = async ({ netlifyToken, accountId, slug, hostSite
|
|
|
34
34
|
* @returns Array of extensions with their associated packages
|
|
35
35
|
*/
|
|
36
36
|
export async function fetchAutoInstallableExtensionsMeta() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
try {
|
|
38
|
+
const url = new URL(`/meta/auto-installable`, process.env.EXTENSION_API_BASE_URL ?? EXTENSION_API_BASE_URL);
|
|
39
|
+
const response = await fetch(url.toString());
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw new Error(`Failed to fetch extensions meta`);
|
|
42
|
+
}
|
|
43
|
+
const data = await response.json();
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(`Failed to fetch auto-installable extensions meta: ${error.message}`, error);
|
|
48
|
+
return [];
|
|
41
49
|
}
|
|
42
|
-
const data = await response.json();
|
|
43
|
-
return data;
|
|
44
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.10",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": ">=18.14.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "4a0f587ae4efe1c2e62c25c11374e3fbaa9aebce"
|
|
98
98
|
}
|