@vercel/rust 1.0.4 → 1.0.6
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/index.js +12 -6
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -63,15 +63,16 @@ var installRustToolchain = async () => {
|
|
|
63
63
|
try {
|
|
64
64
|
await (0, import_execa.default)(`rustup -V`, [], { shell: true, stdio: "ignore" });
|
|
65
65
|
(0, import_build_utils.debug)("Rust Toolchain is already installed, skipping download");
|
|
66
|
-
} catch (
|
|
66
|
+
} catch (_err) {
|
|
67
67
|
await downloadRustToolchain();
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
// src/lib/cargo.ts
|
|
72
|
-
var
|
|
72
|
+
var import_promises = require("fs/promises");
|
|
73
|
+
var import_node_fs = require("fs");
|
|
73
74
|
var import_node_path = __toESM(require("path"));
|
|
74
|
-
var
|
|
75
|
+
var import_smol_toml = require("smol-toml");
|
|
75
76
|
var import_execa2 = __toESM(require("execa"));
|
|
76
77
|
async function getCargoMetadata(options) {
|
|
77
78
|
const { stdout: cargoMetaData } = await (0, import_execa2.default)(
|
|
@@ -89,7 +90,7 @@ async function findCargoWorkspace(config) {
|
|
|
89
90
|
);
|
|
90
91
|
const projectDescription = JSON.parse(projectDescriptionStr);
|
|
91
92
|
return {
|
|
92
|
-
toml:
|
|
93
|
+
toml: (0, import_smol_toml.parse)(await (0, import_promises.readFile)(projectDescription.root, "utf8")),
|
|
93
94
|
root: projectDescription.root
|
|
94
95
|
};
|
|
95
96
|
}
|
|
@@ -98,10 +99,10 @@ async function findCargoBuildConfiguration(workspace) {
|
|
|
98
99
|
import_node_path.default.dirname(workspace.root),
|
|
99
100
|
".cargo/config.toml"
|
|
100
101
|
);
|
|
101
|
-
if (!import_node_fs.
|
|
102
|
+
if (!(0, import_node_fs.existsSync)(configPath)) {
|
|
102
103
|
return null;
|
|
103
104
|
}
|
|
104
|
-
const config =
|
|
105
|
+
const config = (0, import_smol_toml.parse)(await (0, import_promises.readFile)(configPath, "utf8"));
|
|
105
106
|
return config;
|
|
106
107
|
}
|
|
107
108
|
function findBinaryName(workspace, entryPath) {
|
|
@@ -321,6 +322,11 @@ async function buildHandler(options) {
|
|
|
321
322
|
const isVercelBuild = Boolean(process.env.VERCEL_BUILD_IMAGE ?? false);
|
|
322
323
|
const { files, entrypoint, workPath, config, meta } = options;
|
|
323
324
|
const crossCompilationEnabled = !isVercelBuild && !meta?.isDev;
|
|
325
|
+
if (crossCompilationEnabled && process.platform === "win32") {
|
|
326
|
+
throw new Error(
|
|
327
|
+
"Production prebuilt deployments for @vercel/rust are not yet supported on Windows. Please use a Linux or macOS environment, or deploy directly on Vercel."
|
|
328
|
+
);
|
|
329
|
+
}
|
|
324
330
|
await installRustToolchain();
|
|
325
331
|
(0, import_build_utils6.debug)("Creating file system");
|
|
326
332
|
const downloadedFiles = await (0, import_build_utils6.download)(files, workPath, meta);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/rust",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/rust",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"
|
|
16
|
+
"smol-toml": "1.5.2",
|
|
17
17
|
"execa": "5"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/jest": "^29.4.0",
|
|
21
21
|
"@types/ms": "^0.7.31",
|
|
22
|
-
"@types/node": "
|
|
22
|
+
"@types/node": "20.11.0",
|
|
23
23
|
"@vercel/style-guide": "^4.0.2",
|
|
24
24
|
"eslint": "^8.35.0",
|
|
25
25
|
"husky": "^8.0.3",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"rimraf": "^4.1.1",
|
|
30
30
|
"ts-jest": "^29.0.5",
|
|
31
31
|
"typescript": "^4.9.4",
|
|
32
|
-
"@vercel/build-utils": "13.
|
|
33
|
-
"@vercel/routing-utils": "
|
|
32
|
+
"@vercel/build-utils": "13.12.1",
|
|
33
|
+
"@vercel/routing-utils": "6.1.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "node ../../utils/build-builder.mjs",
|