@vercel/container 0.0.4 → 0.0.5
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 +14 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
version: () => version
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
var import_build_utils3 = require("@vercel/build-utils");
|
|
39
40
|
var import_node_fs6 = require("fs");
|
|
40
41
|
var import_node_path6 = __toESM(require("path"));
|
|
41
42
|
|
|
@@ -1482,6 +1483,13 @@ async function prepareCache(_options) {
|
|
|
1482
1483
|
|
|
1483
1484
|
// src/index.ts
|
|
1484
1485
|
var version = 2;
|
|
1486
|
+
function resolveFunctionSourceFile(options) {
|
|
1487
|
+
const entrypoint = readString(options.entrypoint) ?? "";
|
|
1488
|
+
if (entrypoint === "<detect>") {
|
|
1489
|
+
return findDockerfile(options.workPath) ?? entrypoint;
|
|
1490
|
+
}
|
|
1491
|
+
return entrypoint;
|
|
1492
|
+
}
|
|
1485
1493
|
function normalizeCommand2(command) {
|
|
1486
1494
|
if (typeof command === "string") {
|
|
1487
1495
|
return [command];
|
|
@@ -1726,6 +1734,10 @@ async function build(options) {
|
|
|
1726
1734
|
{ "service.name": options.service?.name },
|
|
1727
1735
|
(span) => resolveImageHandler(options, span)
|
|
1728
1736
|
);
|
|
1737
|
+
const lambdaOptions = await (0, import_build_utils3.getLambdaOptionsFromFunction)({
|
|
1738
|
+
sourceFile: resolveFunctionSourceFile(options),
|
|
1739
|
+
config: options.config
|
|
1740
|
+
});
|
|
1729
1741
|
const command = normalizeCommand2(options.config.command);
|
|
1730
1742
|
const routes = [
|
|
1731
1743
|
{ handle: "filesystem" },
|
|
@@ -1743,7 +1755,8 @@ async function build(options) {
|
|
|
1743
1755
|
handler: image,
|
|
1744
1756
|
runtime: "container",
|
|
1745
1757
|
environment: {},
|
|
1746
|
-
...command ? { command } : {}
|
|
1758
|
+
...command ? { command } : {},
|
|
1759
|
+
...lambdaOptions
|
|
1747
1760
|
}
|
|
1748
1761
|
}
|
|
1749
1762
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/container",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "20.11.0",
|
|
17
17
|
"vitest": "2.0.3",
|
|
18
|
-
"@vercel/build-utils": "13.32.
|
|
18
|
+
"@vercel/build-utils": "13.32.3"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|