@vercel/build-utils 13.2.12 → 13.2.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.2.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [python] experimental python runtime framework preset ([#14646](https://github.com/vercel/vercel/pull/14646))
8
+
3
9
  ## 13.2.12
4
10
 
5
11
  ### Patch Changes
@@ -3,12 +3,16 @@ import { Builder } from '.';
3
3
  * List of backend frameworks supported by the experimental backends feature
4
4
  */
5
5
  export declare const BACKEND_FRAMEWORKS: readonly ["express", "hono", "h3", "koa", "nestjs", "fastify", "elysia"];
6
+ export declare const PYTHON_FRAMEWORKS: readonly ["fastapi", "flask", "python"];
7
+ export declare const RUNTIME_FRAMEWORKS: readonly ["python"];
6
8
  export declare const BACKEND_BUILDERS: readonly ["@vercel/express", "@vercel/hono", "@vercel/h3", "@vercel/koa", "@vercel/nestjs", "@vercel/fastify", "@vercel/elysia"];
7
9
  export type BackendFramework = (typeof BACKEND_FRAMEWORKS)[number];
10
+ export type PythonFramework = (typeof PYTHON_FRAMEWORKS)[number];
8
11
  /**
9
12
  * Checks if the given framework is a backend framework
10
13
  */
11
14
  export declare function isBackendFramework(framework: string | null | undefined): framework is BackendFramework;
15
+ export declare function isPythonFramework(framework: string | null | undefined): framework is (typeof PYTHON_FRAMEWORKS)[number];
12
16
  export declare function isExperimentalBackendsWithoutIntrospectionEnabled(): boolean;
13
17
  export declare function isExperimentalBackendsEnabled(): boolean;
14
18
  export declare function isBackendBuilder(builder: Builder | null | undefined): boolean;
@@ -20,10 +20,13 @@ var framework_helpers_exports = {};
20
20
  __export(framework_helpers_exports, {
21
21
  BACKEND_BUILDERS: () => BACKEND_BUILDERS,
22
22
  BACKEND_FRAMEWORKS: () => BACKEND_FRAMEWORKS,
23
+ PYTHON_FRAMEWORKS: () => PYTHON_FRAMEWORKS,
24
+ RUNTIME_FRAMEWORKS: () => RUNTIME_FRAMEWORKS,
23
25
  isBackendBuilder: () => isBackendBuilder,
24
26
  isBackendFramework: () => isBackendFramework,
25
27
  isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
26
28
  isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
29
+ isPythonFramework: () => isPythonFramework,
27
30
  shouldUseExperimentalBackends: () => shouldUseExperimentalBackends
28
31
  });
29
32
  module.exports = __toCommonJS(framework_helpers_exports);
@@ -36,6 +39,13 @@ const BACKEND_FRAMEWORKS = [
36
39
  "fastify",
37
40
  "elysia"
38
41
  ];
42
+ const PYTHON_FRAMEWORKS = [
43
+ "fastapi",
44
+ "flask",
45
+ "python"
46
+ // Generic Python framework preset
47
+ ];
48
+ const RUNTIME_FRAMEWORKS = ["python"];
39
49
  const BACKEND_BUILDERS = [
40
50
  "@vercel/express",
41
51
  "@vercel/hono",
@@ -50,6 +60,11 @@ function isBackendFramework(framework) {
50
60
  return false;
51
61
  return BACKEND_FRAMEWORKS.includes(framework);
52
62
  }
63
+ function isPythonFramework(framework) {
64
+ if (!framework)
65
+ return false;
66
+ return PYTHON_FRAMEWORKS.includes(framework);
67
+ }
53
68
  function isExperimentalBackendsWithoutIntrospectionEnabled() {
54
69
  return process.env.VERCEL_BACKENDS_BUILDS === "1";
55
70
  }
@@ -70,9 +85,12 @@ function shouldUseExperimentalBackends(framework) {
70
85
  0 && (module.exports = {
71
86
  BACKEND_BUILDERS,
72
87
  BACKEND_FRAMEWORKS,
88
+ PYTHON_FRAMEWORKS,
89
+ RUNTIME_FRAMEWORKS,
73
90
  isBackendBuilder,
74
91
  isBackendFramework,
75
92
  isExperimentalBackendsEnabled,
76
93
  isExperimentalBackendsWithoutIntrospectionEnabled,
94
+ isPythonFramework,
77
95
  shouldUseExperimentalBackends
78
96
  });
package/dist/index.d.ts CHANGED
@@ -32,5 +32,5 @@ export { NODE_VERSIONS } from './fs/node-version';
32
32
  export { getInstalledPackageVersion } from './get-installed-package-version';
33
33
  export { defaultCachePathGlob } from './default-cache-path-glob';
34
34
  export { generateNodeBuilderFunctions } from './generate-node-builder-functions';
35
- export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, isExperimentalBackendsWithoutIntrospectionEnabled, shouldUseExperimentalBackends, } from './framework-helpers';
35
+ export { BACKEND_FRAMEWORKS, BackendFramework, isBackendFramework, isBackendBuilder, isExperimentalBackendsEnabled, isExperimentalBackendsWithoutIntrospectionEnabled, shouldUseExperimentalBackends, PYTHON_FRAMEWORKS, PythonFramework, isPythonFramework, } from './framework-helpers';
36
36
  export * from './python';
package/dist/index.js CHANGED
@@ -23728,6 +23728,7 @@ __export(src_exports, {
23728
23728
  NodeVersion: () => NodeVersion,
23729
23729
  NodejsLambda: () => NodejsLambda,
23730
23730
  NowBuildError: () => NowBuildError,
23731
+ PYTHON_FRAMEWORKS: () => PYTHON_FRAMEWORKS,
23731
23732
  Prerender: () => Prerender,
23732
23733
  Span: () => Span,
23733
23734
  Version: () => Version,
@@ -23774,6 +23775,7 @@ __export(src_exports, {
23774
23775
  isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
23775
23776
  isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
23776
23777
  isPythonEntrypoint: () => isPythonEntrypoint,
23778
+ isPythonFramework: () => isPythonFramework,
23777
23779
  isSymbolicLink: () => isSymbolicLink,
23778
23780
  normalizePath: () => normalizePath,
23779
23781
  readConfigFile: () => readConfigFile,
@@ -26745,6 +26747,12 @@ var BACKEND_FRAMEWORKS = [
26745
26747
  "fastify",
26746
26748
  "elysia"
26747
26749
  ];
26750
+ var PYTHON_FRAMEWORKS = [
26751
+ "fastapi",
26752
+ "flask",
26753
+ "python"
26754
+ // Generic Python framework preset
26755
+ ];
26748
26756
  var BACKEND_BUILDERS = [
26749
26757
  "@vercel/express",
26750
26758
  "@vercel/hono",
@@ -26759,6 +26767,11 @@ function isBackendFramework(framework) {
26759
26767
  return false;
26760
26768
  return BACKEND_FRAMEWORKS.includes(framework);
26761
26769
  }
26770
+ function isPythonFramework(framework) {
26771
+ if (!framework)
26772
+ return false;
26773
+ return PYTHON_FRAMEWORKS.includes(framework);
26774
+ }
26762
26775
  function isExperimentalBackendsWithoutIntrospectionEnabled() {
26763
26776
  return process.env.VERCEL_BACKENDS_BUILDS === "1";
26764
26777
  }
@@ -26837,6 +26850,7 @@ async function isPythonEntrypoint(file) {
26837
26850
  NodeVersion,
26838
26851
  NodejsLambda,
26839
26852
  NowBuildError,
26853
+ PYTHON_FRAMEWORKS,
26840
26854
  Prerender,
26841
26855
  Span,
26842
26856
  Version,
@@ -26883,6 +26897,7 @@ async function isPythonEntrypoint(file) {
26883
26897
  isExperimentalBackendsEnabled,
26884
26898
  isExperimentalBackendsWithoutIntrospectionEnabled,
26885
26899
  isPythonEntrypoint,
26900
+ isPythonFramework,
26886
26901
  isSymbolicLink,
26887
26902
  normalizePath,
26888
26903
  readConfigFile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.2.12",
3
+ "version": "13.2.13",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",