netlify-cli 17.21.2 → 17.22.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/dist/commands/deploy/deploy.d.ts.map +1 -1
- package/dist/commands/deploy/deploy.js +2 -3
- package/dist/commands/dev/dev.d.ts.map +1 -1
- package/dist/commands/dev/dev.js +2 -0
- package/dist/commands/serve/index.d.ts.map +1 -1
- package/dist/commands/serve/index.js +1 -0
- package/dist/commands/serve/serve.d.ts.map +1 -1
- package/dist/commands/serve/serve.js +1 -0
- package/dist/lib/build.d.ts +2 -2
- package/dist/lib/build.d.ts.map +1 -1
- package/dist/lib/build.js +2 -2
- package/dist/lib/edge-functions/bootstrap.d.ts +2 -1
- package/dist/lib/edge-functions/bootstrap.d.ts.map +1 -1
- package/dist/lib/edge-functions/bootstrap.js +18 -2
- package/dist/lib/edge-functions/proxy.d.ts.map +1 -1
- package/dist/lib/edge-functions/proxy.js +1 -7
- package/dist/lib/spinner.d.ts +7 -17
- package/dist/lib/spinner.d.ts.map +1 -1
- package/dist/lib/spinner.js +0 -14
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/framework-server.d.ts.map +1 -1
- package/dist/utils/framework-server.js +0 -2
- package/dist/utils/proxy-server.d.ts +2 -1
- package/dist/utils/proxy-server.d.ts.map +1 -1
- package/dist/utils/proxy-server.js +2 -1
- package/dist/utils/proxy.d.ts +2 -1
- package/dist/utils/proxy.d.ts.map +1 -1
- package/dist/utils/proxy.js +29 -23
- package/dist/utils/run-build.js +1 -1
- package/npm-shrinkwrap.json +271 -190
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/deploy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAgCxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/deploy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAgCxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAuuB5C,eAAO,MAAM,MAAM,YAAmB,YAAY,WAAW,WAAW,kBAmHvE,CAAA"}
|
|
@@ -475,7 +475,7 @@ const bundleEdgeFunctions = async (options, command) => {
|
|
|
475
475
|
packagePath: command.workspacePackage,
|
|
476
476
|
buffer: true,
|
|
477
477
|
featureFlags: edgeFunctionsFeatureFlags,
|
|
478
|
-
edgeFunctionsBootstrapURL: getBootstrapURL(),
|
|
478
|
+
edgeFunctionsBootstrapURL: await getBootstrapURL(),
|
|
479
479
|
});
|
|
480
480
|
if (!success) {
|
|
481
481
|
statusCb({
|
|
@@ -703,7 +703,7 @@ export const deploy = async (options, command) => {
|
|
|
703
703
|
siteId,
|
|
704
704
|
deployToProduction,
|
|
705
705
|
});
|
|
706
|
-
return {};
|
|
706
|
+
return { newEnvChanges: { DEPLOY_ID: results.deployId, DEPLOY_URL: results.deployUrl } };
|
|
707
707
|
},
|
|
708
708
|
});
|
|
709
709
|
}
|
|
@@ -729,7 +729,6 @@ export const deploy = async (options, command) => {
|
|
|
729
729
|
deployToProduction,
|
|
730
730
|
});
|
|
731
731
|
if (options.open) {
|
|
732
|
-
// @ts-expect-error TS(2339) FIXME: Property 'siteUrl' does not exist on type '{}'.
|
|
733
732
|
const urlToOpen = deployToProduction ? results.siteUrl : results.deployUrl;
|
|
734
733
|
// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
|
|
735
734
|
await openBrowser({ url: urlToOpen });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/dev.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAU,MAAM,WAAW,CAAA;AA0BhD,OAAO,WAAW,MAAM,oBAAoB,CAAA;AA4D5C,eAAO,MAAM,GAAG,YAAmB,YAAY,WAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/dev.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAU,MAAM,WAAW,CAAA;AA0BhD,OAAO,WAAW,MAAM,oBAAoB,CAAA;AA4D5C,eAAO,MAAM,GAAG,YAAmB,YAAY,WAAW,WAAW,kBA0JpE,CAAA;AAED,eAAO,MAAM,gBAAgB,YAAa,WAAW,gBA8GpD,CAAA"}
|
package/dist/commands/dev/dev.js
CHANGED
|
@@ -174,6 +174,7 @@ export const dev = async (options, command) => {
|
|
|
174
174
|
config: mutatedConfig,
|
|
175
175
|
configPath: configPathOverride,
|
|
176
176
|
debug: options.debug,
|
|
177
|
+
disableEdgeFunctions: options.internalDisableEdgeFunctions,
|
|
177
178
|
projectDir: command.workingDir,
|
|
178
179
|
env,
|
|
179
180
|
getUpdatedConfig,
|
|
@@ -213,6 +214,7 @@ export const createDevCommand = (program) => {
|
|
|
213
214
|
.option('-d ,--dir <path>', 'dir with static files')
|
|
214
215
|
.option('-f ,--functions <folder>', 'specify a functions folder to serve')
|
|
215
216
|
.option('-o ,--offline', 'disables any features that require network access')
|
|
217
|
+
.addOption(new Option('--internal-disable-edge-functions', "disables edge functions. use this if your environment doesn't support Deno. This option is internal and should not be used by end users.").hideHelp(true))
|
|
216
218
|
.option('-l, --live [subdomain]', 'start a public live session; optionally, supply a subdomain to generate a custom URL', false)
|
|
217
219
|
.addOption(new Option('--functionsPort <port>', 'Old, prefer --functions-port. Port of functions server')
|
|
218
220
|
.argParser((value) => Number.parseInt(value))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,eAAO,MAAM,kBAAkB,YAAa,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,eAAO,MAAM,kBAAkB,YAAa,WAAW,gBAkDjD,CAAA"}
|
|
@@ -9,6 +9,7 @@ export const createServeCommand = (program) => program
|
|
|
9
9
|
.option('-d ,--dir <path>', 'dir with static files')
|
|
10
10
|
.option('-f ,--functions <folder>', 'specify a functions folder to serve')
|
|
11
11
|
.option('-o ,--offline', 'disables any features that require network access')
|
|
12
|
+
.addOption(new Option('--internal-disable-edge-functions', "disables edge functions. use this if your environment doesn't support Deno. This option is internal and should not be used by end users.").hideHelp(true))
|
|
12
13
|
.addOption(new Option('--functionsPort <port>', 'Old, prefer --functions-port. Port of functions server')
|
|
13
14
|
.argParser((value) => Number.parseInt(value))
|
|
14
15
|
.hideHelp(true))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/serve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwBxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAG5C,eAAO,MAAM,KAAK,YAAmB,YAAY,WAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/serve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwBxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAG5C,eAAO,MAAM,KAAK,YAAmB,YAAY,WAAW,WAAW,uBAgJtE,CAAA"}
|
|
@@ -113,6 +113,7 @@ export const serve = async (options, command) => {
|
|
|
113
113
|
config,
|
|
114
114
|
configPath: configPathOverride,
|
|
115
115
|
debug: options.debug,
|
|
116
|
+
disableEdgeFunctions: options.internalDisableEdgeFunctions,
|
|
116
117
|
env,
|
|
117
118
|
functionsRegistry,
|
|
118
119
|
geolocationMode: options.geo,
|
package/dist/lib/build.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const getBuildOptions: ({ cachedConfig, currentDir, deployHandler
|
|
|
29
29
|
};
|
|
30
30
|
packagePath: any;
|
|
31
31
|
token: any;
|
|
32
|
-
}) => {
|
|
32
|
+
}) => Promise<{
|
|
33
33
|
cachedConfig: any;
|
|
34
34
|
siteId: any;
|
|
35
35
|
packagePath: any;
|
|
@@ -57,7 +57,7 @@ export declare const getBuildOptions: ({ cachedConfig, currentDir, deployHandler
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
edgeFunctionsBootstrapURL: string;
|
|
60
|
-
}
|
|
60
|
+
}>;
|
|
61
61
|
/**
|
|
62
62
|
* run the build command
|
|
63
63
|
* @param {BuildConfig} options
|
package/dist/lib/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/lib/build.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AAKH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/lib/build.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AAKH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6D3B,CAAA;AAED;;;;GAIG;AAEH,eAAO,MAAM,QAAQ;;;;EAcpB,CAAA"}
|
package/dist/lib/build.js
CHANGED
|
@@ -25,7 +25,7 @@ import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/cons
|
|
|
25
25
|
* @param {*} config.deployHandler
|
|
26
26
|
* @returns {BuildConfig}
|
|
27
27
|
*/
|
|
28
|
-
export const getBuildOptions = ({
|
|
28
|
+
export const getBuildOptions = async ({
|
|
29
29
|
// @ts-expect-error TS(7031) FIXME: Binding element 'cachedConfig' implicitly has an '... Remove this comment to see the full error message
|
|
30
30
|
cachedConfig,
|
|
31
31
|
// @ts-expect-error TS(7031) FIXME: Binding element 'currentDir' implicitly has an 'an... Remove this comment to see the full error message
|
|
@@ -79,7 +79,7 @@ token, }) => {
|
|
|
79
79
|
functionsBundlingManifest: true,
|
|
80
80
|
},
|
|
81
81
|
eventHandlers,
|
|
82
|
-
edgeFunctionsBootstrapURL: getBootstrapURL(),
|
|
82
|
+
edgeFunctionsBootstrapURL: await getBootstrapURL(),
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
85
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/bootstrap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/bootstrap.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,yDAAyD,CAAA;AAE5F,eAAO,MAAM,eAAe,uBAe3B,CAAA"}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
import { env } from 'process';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { getURL } from '@netlify/edge-functions/version';
|
|
3
|
+
import { warn } from '../../utils/command-helpers.js';
|
|
4
|
+
export const FALLBACK_BOOTSTRAP_URL = 'https://edge.netlify.com/bootstrap/index-combined.ts';
|
|
5
|
+
export const getBootstrapURL = async () => {
|
|
6
|
+
if (env.NETLIFY_EDGE_BOOTSTRAP) {
|
|
7
|
+
return env.NETLIFY_EDGE_BOOTSTRAP;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
return await getURL();
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
warn(`Could not load latest version of Edge Functions environment: ${error?.message}`);
|
|
14
|
+
// If there was an error getting the bootstrap URL from the module, let's
|
|
15
|
+
// use the latest version of the bootstrap. This is not ideal, but better
|
|
16
|
+
// than failing to serve requests with edge functions.
|
|
17
|
+
return FALLBACK_BOOTSTRAP_URL;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/proxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAM3C,OAAO,WAAW,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAUhD,QAAA,MAAM,aAAa,eAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/lib/edge-functions/proxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAM3C,OAAO,WAAW,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAUhD,QAAA,MAAM,aAAa,eAAmC,CAAA;AAsBtD,eAAO,MAAM,kBAAkB,mCAI9B,CAAA;AAKD,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,oBAAoB,aAAc,QAAQ,YAAY,MAAM,WAKxE,CAAA;AAED,eAAO,MAAM,uBAAuB,8BAMnC,CAAA;AAED,eAAO,MAAM,eAAe;eAqBf,MAAM;kBACH,YAAY;aACjB,WAAW;YACZ,QAAQ;gBACJ,MAAM;WACX,OAAO;SACT,QAAQ;aACJ,QAAQ;gBACL,QAAQ;qBACH,QAAQ;sBACP,QAAQ;qBACT,QAAQ;cACf,QAAQ;qBACD,QAAQ;gBACb,MAAM;;cAER,QAAQ;cACR,QAAQ;WACX,QAAQ;oBAyBI,eAAe,GAAG;IAAE,eAAe,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,iCAkDjF,CAAA;AAGD,eAAO,MAAM,sBAAsB,uBAA4C,CAAA"}
|
|
@@ -15,14 +15,8 @@ import { EdgeFunctionsRegistry } from './registry.js';
|
|
|
15
15
|
const headersSymbol = Symbol('Edge Functions Headers');
|
|
16
16
|
const LOCAL_HOST = '127.0.0.1';
|
|
17
17
|
const getDownloadUpdateFunctions = () => {
|
|
18
|
-
// @ts-expect-error TS(7034) FIXME: Variable 'spinner' implicitly has type 'any' in so... Remove this comment to see the full error message
|
|
19
18
|
let spinner;
|
|
20
|
-
/**
|
|
21
|
-
* @param {Error=} error_
|
|
22
|
-
*/
|
|
23
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'error_' implicitly has an 'any' type.
|
|
24
19
|
const onAfterDownload = (error_) => {
|
|
25
|
-
// @ts-expect-error TS(2345) FIXME: Argument of type '{ error: boolean; spinner: any; ... Remove this comment to see the full error message
|
|
26
20
|
stopSpinner({ error: Boolean(error_), spinner });
|
|
27
21
|
};
|
|
28
22
|
const onBeforeDownload = () => {
|
|
@@ -125,7 +119,7 @@ const prepareServer = async ({ command, config, configPath, debug, directory, en
|
|
|
125
119
|
const runIsolate = await bundler.serve({
|
|
126
120
|
...getDownloadUpdateFunctions(),
|
|
127
121
|
basePath: projectDir,
|
|
128
|
-
bootstrapURL: getBootstrapURL(),
|
|
122
|
+
bootstrapURL: await getBootstrapURL(),
|
|
129
123
|
debug,
|
|
130
124
|
distImportMapPath: join(projectDir, distImportMapPath),
|
|
131
125
|
featureFlags,
|
package/dist/lib/spinner.d.ts
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
|
+
import { Ora } from 'ora';
|
|
1
2
|
/**
|
|
2
3
|
* Creates a spinner with the following text
|
|
3
|
-
* @param {object} config
|
|
4
|
-
* @param {string} config.text
|
|
5
|
-
* @returns {ora.Ora}
|
|
6
4
|
*/
|
|
7
5
|
export declare const startSpinner: ({ text }: {
|
|
8
|
-
text:
|
|
9
|
-
}) =>
|
|
6
|
+
text: string;
|
|
7
|
+
}) => Ora;
|
|
10
8
|
/**
|
|
11
9
|
* Stops the spinner with the following text
|
|
12
|
-
* @param {object} config
|
|
13
|
-
* @param {ora.Ora} config.spinner
|
|
14
|
-
* @param {boolean} [config.error]
|
|
15
|
-
* @param {string} [config.text]
|
|
16
|
-
* @returns {void}
|
|
17
10
|
*/
|
|
18
11
|
export declare const stopSpinner: ({ error, spinner, text }: {
|
|
19
|
-
error:
|
|
20
|
-
spinner:
|
|
21
|
-
text
|
|
12
|
+
error: boolean;
|
|
13
|
+
spinner: Ora;
|
|
14
|
+
text?: string | undefined;
|
|
22
15
|
}) => void;
|
|
23
16
|
/**
|
|
24
17
|
* Clears the spinner
|
|
25
|
-
* @param {object} config
|
|
26
|
-
* @param {ora.Ora} config.spinner
|
|
27
|
-
* @returns {void}
|
|
28
18
|
*/
|
|
29
19
|
export declare const clearSpinner: ({ spinner }: {
|
|
30
|
-
spinner:
|
|
20
|
+
spinner: Ora;
|
|
31
21
|
}) => void;
|
|
32
22
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"names":[],"mappings":"AACA,OAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B;;GAEG;AACH,eAAO,MAAM,YAAY;UAAsB,MAAM;SAGzC,CAAA;AAEZ;;GAEG;AACH,eAAO,MAAM,WAAW;WAAuC,OAAO;aAAW,GAAG;;UAUnF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;aAA4B,GAAG;UAIvD,CAAA"}
|
package/dist/lib/spinner.js
CHANGED
|
@@ -2,23 +2,13 @@ import logSymbols from 'log-symbols';
|
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a spinner with the following text
|
|
5
|
-
* @param {object} config
|
|
6
|
-
* @param {string} config.text
|
|
7
|
-
* @returns {ora.Ora}
|
|
8
5
|
*/
|
|
9
|
-
// @ts-expect-error TS(7031) FIXME: Binding element 'text' implicitly has an 'any' typ... Remove this comment to see the full error message
|
|
10
6
|
export const startSpinner = ({ text }) => ora({
|
|
11
7
|
text,
|
|
12
8
|
}).start();
|
|
13
9
|
/**
|
|
14
10
|
* Stops the spinner with the following text
|
|
15
|
-
* @param {object} config
|
|
16
|
-
* @param {ora.Ora} config.spinner
|
|
17
|
-
* @param {boolean} [config.error]
|
|
18
|
-
* @param {string} [config.text]
|
|
19
|
-
* @returns {void}
|
|
20
11
|
*/
|
|
21
|
-
// @ts-expect-error TS(7031) FIXME: Binding element 'error' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
22
12
|
export const stopSpinner = ({ error, spinner, text }) => {
|
|
23
13
|
if (!spinner) {
|
|
24
14
|
return;
|
|
@@ -32,11 +22,7 @@ export const stopSpinner = ({ error, spinner, text }) => {
|
|
|
32
22
|
};
|
|
33
23
|
/**
|
|
34
24
|
* Clears the spinner
|
|
35
|
-
* @param {object} config
|
|
36
|
-
* @param {ora.Ora} config.spinner
|
|
37
|
-
* @returns {void}
|
|
38
25
|
*/
|
|
39
|
-
// @ts-expect-error TS(7031) FIXME: Binding element 'spinner' implicitly has an 'any' ... Remove this comment to see the full error message
|
|
40
26
|
export const clearSpinner = ({ spinner }) => {
|
|
41
27
|
if (spinner) {
|
|
42
28
|
spinner.stop();
|