@vercel/rust 2.0.0 → 4.0.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.
Binary file
Binary file
package/dist/index.js CHANGED
@@ -728,6 +728,16 @@ function excludeCargoTargetDir(files, env = process.env, workPath) {
728
728
  }
729
729
  return filtered;
730
730
  }
731
+ function missingEntrypointError(entrypoint, isApiHandler) {
732
+ if (!isApiHandler) {
733
+ return new Error(
734
+ `This project depends on \`vercel_runtime\` but \`${entrypoint}\` was not found. To deploy a standalone server, add a \`src/main.rs\` and remove the \`vercel_runtime\` dependency.`
735
+ );
736
+ }
737
+ return new Error(
738
+ `Entrypoint "${entrypoint}" was not found. Make sure the file exists, or set the entrypoint to the Rust source file you want to deploy.`
739
+ );
740
+ }
731
741
  function getExecutableName(binName) {
732
742
  return process.platform === "win32" ? `${binName}.exe` : binName;
733
743
  }
@@ -1566,9 +1576,7 @@ async function buildHandler(options) {
1566
1576
  }
1567
1577
  const downloadedEntry = downloadedFiles[entrypoint];
1568
1578
  if (!downloadedEntry) {
1569
- throw new Error(
1570
- `Entrypoint "${entrypoint}" was not found. Make sure the file exists, or set the entrypoint to the Rust source file you want to deploy.`
1571
- );
1579
+ throw missingEntrypointError(entrypoint, isApiHandlerBuild(entrypoint));
1572
1580
  }
1573
1581
  const entryPath = downloadedEntry.fsPath;
1574
1582
  const cargoWorkspace = await findCargoWorkspace({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/rust",
3
- "version": "2.0.0",
3
+ "version": "4.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/rust",
@@ -19,7 +19,7 @@
19
19
  "get-port": "5.1.1"
20
20
  },
21
21
  "peerDependencies": {
22
- "@vercel/build-utils": "14.3.0"
22
+ "@vercel/build-utils": "14.5.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/ms": "^0.7.31",
@@ -31,7 +31,7 @@
31
31
  "prettier": "^2.8.4",
32
32
  "rimraf": "^4.1.1",
33
33
  "vitest": "4.1.10",
34
- "@vercel/build-utils": "14.3.0",
34
+ "@vercel/build-utils": "14.5.0",
35
35
  "@vercel-internals/ipc-proxy": "1.0.0",
36
36
  "@vercel/routing-utils": "6.5.0"
37
37
  },