@vercel/static-build 13.0.0 → 13.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +62 -40
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -7165,18 +7165,15 @@ var require_frameworks = __commonJS({
7165
7165
  var { readdir, readFile, unlink } = import_fs5.promises;
7166
7166
  var frameworks2 = [
7167
7167
  {
7168
- // A `Dockerfile.vercel` / `Containerfile.vercel` is an explicit opt-in to
7169
- // deploy a project as a container, regardless of any other framework that
7170
- // may also be detected. It is listed first so that framework detection
7171
- // (which returns the first match in list order) selects it over everything
7172
- // else — e.g. a Next.js app shipping a `Dockerfile.vercel` deploys as a
7173
- // container, not via `@vercel/next`.
7168
+ // Versioned container files are an explicit opt-in and remain eager. Plain
7169
+ // Dockerfile and Containerfile matches are fallback-only so they do not
7170
+ // override a project's actual framework preset.
7174
7171
  name: "Container",
7175
7172
  slug: "container",
7176
7173
  runtimeFramework: true,
7177
7174
  logo: "https://api-frameworks.vercel.sh/framework-logos/container.svg",
7178
7175
  tagline: "Deploy any project as a container image built from a Dockerfile.",
7179
- description: "A project deployed as a container image, built from a Dockerfile.vercel or Containerfile.vercel.",
7176
+ description: "A project deployed as a container image, built from a Dockerfile or Containerfile.",
7180
7177
  website: "https://docs.docker.com/reference/dockerfile/",
7181
7178
  useRuntime: { src: "<detect>", use: "@vercel/container" },
7182
7179
  detectors: {
@@ -7186,6 +7183,14 @@ var require_frameworks = __commonJS({
7186
7183
  },
7187
7184
  {
7188
7185
  path: "Containerfile.vercel"
7186
+ },
7187
+ {
7188
+ path: "Dockerfile",
7189
+ fallback: true
7190
+ },
7191
+ {
7192
+ path: "Containerfile",
7193
+ fallback: true
7189
7194
  }
7190
7195
  ]
7191
7196
  },
@@ -32276,6 +32281,7 @@ var require_detect_builders = __commonJS({
32276
32281
  var import_constants2 = require_constants3();
32277
32282
  var PYTHON_MODULE_ATTR_RE = /^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/;
32278
32283
  var NODE_FILE_ENTRYPOINT_RE = /^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))(?:[\w@+.-]+\/)*[\w@+.-]+\.[cm]?[jt]s$/;
32284
+ var PYTHON_FILE_ENTRYPOINT_RE = /^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))(?:[\w@+.-]+\/)*[\w@+.-]+\.py$/;
32279
32285
  var NODE_DECLARATION_ENTRYPOINT_RE = /\.d\.[cm]?ts$/;
32280
32286
  function parsePyModuleAttrEntrypoint2(entrypoint) {
32281
32287
  const match = PYTHON_MODULE_ATTR_RE.exec(entrypoint);
@@ -32290,11 +32296,10 @@ var require_detect_builders = __commonJS({
32290
32296
  moduleName: modulePart
32291
32297
  };
32292
32298
  }
32293
- var SCHEDULE_ENTRYPOINT_FORMS_HINT = 'Use a source file path like "jobs/nightly.ts" or a Python "module.path:function" reference.';
32299
+ var SCHEDULE_ENTRYPOINT_FORMS_HINT = 'Use a source file path like "jobs/nightly.py" or "jobs/nightly.ts".';
32294
32300
  function parseScheduleEntrypoint(entrypoint) {
32295
- const python = parsePyModuleAttrEntrypoint2(entrypoint);
32296
- if (python) {
32297
- return { runtime: "python", ...python };
32301
+ if (PYTHON_FILE_ENTRYPOINT_RE.test(entrypoint)) {
32302
+ return { runtime: "python", filePath: entrypoint };
32298
32303
  }
32299
32304
  if (NODE_FILE_ENTRYPOINT_RE.test(entrypoint) && !NODE_DECLARATION_ENTRYPOINT_RE.test(entrypoint)) {
32300
32305
  return { runtime: "node", filePath: entrypoint };
@@ -37677,7 +37682,8 @@ var require_detect_framework = __commonJS({
37677
37682
  const check = async ({
37678
37683
  path: path6,
37679
37684
  matchContent,
37680
- matchPackage
37685
+ matchPackage,
37686
+ fallback = false
37681
37687
  }) => {
37682
37688
  if (matchPackage && matchContent) {
37683
37689
  throw new Error(
@@ -37716,12 +37722,14 @@ var require_detect_framework = __commonJS({
37716
37722
  if (matchPackage && match[3]) {
37717
37723
  return {
37718
37724
  framework,
37719
- detectedVersion: match[3]
37725
+ detectedVersion: match[3],
37726
+ fallback
37720
37727
  };
37721
37728
  }
37722
37729
  }
37723
37730
  return {
37724
- framework
37731
+ framework,
37732
+ fallback
37725
37733
  };
37726
37734
  };
37727
37735
  const result = [];
@@ -37748,7 +37756,8 @@ var require_detect_framework = __commonJS({
37748
37756
  )?.detectedVersion;
37749
37757
  return {
37750
37758
  framework,
37751
- detectedVersion
37759
+ detectedVersion,
37760
+ fallback: result.some((match) => match?.fallback)
37752
37761
  };
37753
37762
  }
37754
37763
  function removeSupersededFramework(matches2, slug) {
@@ -37772,6 +37781,31 @@ var require_detect_framework = __commonJS({
37772
37781
  }
37773
37782
  }
37774
37783
  }
37784
+ function orderFrameworkMatches(matches2) {
37785
+ const normalMatches = matches2.filter(
37786
+ (match) => Boolean(match && !match.fallback)
37787
+ );
37788
+ const fallbackMatches = matches2.filter(
37789
+ (match) => Boolean(match?.fallback)
37790
+ );
37791
+ const normalFrameworks = normalMatches.map((match) => match.framework);
37792
+ removeSupersededFrameworks(normalFrameworks);
37793
+ const fallbackFrameworks = fallbackMatches.map((match) => match.framework);
37794
+ for (const framework of normalFrameworks) {
37795
+ for (const slug of framework.supersedes ?? []) {
37796
+ removeSupersededFramework(fallbackFrameworks, slug);
37797
+ }
37798
+ }
37799
+ removeSupersededFrameworks(fallbackFrameworks);
37800
+ return [
37801
+ ...normalMatches.filter(
37802
+ (match) => normalFrameworks.includes(match.framework)
37803
+ ),
37804
+ ...fallbackMatches.filter(
37805
+ (match) => fallbackFrameworks.includes(match.framework)
37806
+ )
37807
+ ];
37808
+ }
37775
37809
  async function detectFramework2({
37776
37810
  fs: fs5,
37777
37811
  frameworkList,
@@ -37782,15 +37816,12 @@ var require_detect_framework = __commonJS({
37782
37816
  useExperimentalFrameworks
37783
37817
  );
37784
37818
  const result = await Promise.all(
37785
- filteredList.map(async (frameworkMatch) => {
37786
- if (await matches(fs5, frameworkMatch)) {
37787
- return frameworkMatch;
37788
- }
37789
- return null;
37819
+ filteredList.map(async (framework) => {
37820
+ const match = await matches(fs5, framework);
37821
+ return match ? { ...match, framework } : null;
37790
37822
  })
37791
37823
  );
37792
- removeSupersededFrameworks(result);
37793
- return result.find((res) => res !== null)?.slug ?? null;
37824
+ return orderFrameworkMatches(result)[0]?.framework.slug ?? null;
37794
37825
  }
37795
37826
  async function detectFrameworks2({
37796
37827
  fs: fs5,
@@ -37802,15 +37833,12 @@ var require_detect_framework = __commonJS({
37802
37833
  useExperimentalFrameworks
37803
37834
  );
37804
37835
  const result = await Promise.all(
37805
- filteredList.map(async (frameworkMatch) => {
37806
- if (await matches(fs5, frameworkMatch)) {
37807
- return frameworkMatch;
37808
- }
37809
- return null;
37836
+ filteredList.map(async (framework) => {
37837
+ const match = await matches(fs5, framework);
37838
+ return match ? { ...match, framework } : null;
37810
37839
  })
37811
37840
  );
37812
- removeSupersededFrameworks(result);
37813
- return result.filter((res) => res !== null);
37841
+ return orderFrameworkMatches(result).map((match) => match.framework);
37814
37842
  }
37815
37843
  async function detectFrameworkRecord3({
37816
37844
  fs: fs5,
@@ -37822,19 +37850,13 @@ var require_detect_framework = __commonJS({
37822
37850
  useExperimentalFrameworks
37823
37851
  );
37824
37852
  const result = await Promise.all(
37825
- filteredList.map(async (frameworkMatch) => {
37826
- const matchResult = await matches(fs5, frameworkMatch);
37827
- if (matchResult) {
37828
- return {
37829
- ...frameworkMatch,
37830
- detectedVersion: matchResult?.detectedVersion
37831
- };
37832
- }
37833
- return null;
37853
+ filteredList.map(async (framework) => {
37854
+ const match2 = await matches(fs5, framework);
37855
+ return match2 ? { ...match2, framework } : null;
37834
37856
  })
37835
37857
  );
37836
- removeSupersededFrameworks(result);
37837
- return result.find((res) => res !== null) ?? null;
37858
+ const match = orderFrameworkMatches(result)[0];
37859
+ return match ? { ...match.framework, detectedVersion: match.detectedVersion } : null;
37838
37860
  }
37839
37861
  function detectFrameworkVersion2(frameworkRecord) {
37840
37862
  const allDetectors = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -15,11 +15,11 @@
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
17
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.12",
18
- "@vercel/gatsby-plugin-vercel-builder": "2.2.61",
19
- "@vercel/static-config": "3.4.3"
18
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.63",
19
+ "@vercel/static-config": "3.4.4"
20
20
  },
21
21
  "peerDependencies": {
22
- "@vercel/build-utils": "14.13.0"
22
+ "@vercel/build-utils": "14.13.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/aws-lambda": "8.10.64",
@@ -40,10 +40,10 @@
40
40
  "semver": "7.5.2",
41
41
  "tree-kill": "1.2.2",
42
42
  "vitest": "4.1.10",
43
- "@vercel/frameworks": "3.34.0",
44
43
  "@vercel/error-utils": "2.2.1",
45
- "@vercel/build-utils": "14.13.0",
46
- "@vercel/fs-detectors": "7.7.2",
44
+ "@vercel/build-utils": "14.13.2",
45
+ "@vercel/frameworks": "3.35.0",
46
+ "@vercel/fs-detectors": "7.8.0",
47
47
  "@vercel/routing-utils": "6.6.0"
48
48
  },
49
49
  "scripts": {