@vercel/container 0.1.1 → 1.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.
- package/dist/index.js +18 -2
- package/package.json +9 -5
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
CONTAINER_OUTPUT_PATH: () => CONTAINER_OUTPUT_PATH,
|
|
33
34
|
build: () => build,
|
|
34
35
|
diagnostics: () => diagnostics,
|
|
35
36
|
prepareCache: () => prepareCache,
|
|
@@ -1507,6 +1508,7 @@ async function prepareCache(_options) {
|
|
|
1507
1508
|
|
|
1508
1509
|
// src/index.ts
|
|
1509
1510
|
var version = 2;
|
|
1511
|
+
var CONTAINER_OUTPUT_PATH = "container";
|
|
1510
1512
|
function resolveFunctionSourceFile(options) {
|
|
1511
1513
|
const entrypoint = readString(options.entrypoint) ?? "";
|
|
1512
1514
|
if (entrypoint === "<detect>") {
|
|
@@ -1770,12 +1772,25 @@ async function build(options) {
|
|
|
1770
1772
|
});
|
|
1771
1773
|
const routes = [
|
|
1772
1774
|
{ handle: "filesystem" },
|
|
1773
|
-
|
|
1775
|
+
// This route matches the resolved destination after rewrites. Copy that
|
|
1776
|
+
// path into the runtime request before dispatching the container so its
|
|
1777
|
+
// application routing observes the rewrite.
|
|
1778
|
+
{
|
|
1779
|
+
src: "/(.*)",
|
|
1780
|
+
dest: `/${CONTAINER_OUTPUT_PATH}`,
|
|
1781
|
+
transforms: [
|
|
1782
|
+
{
|
|
1783
|
+
type: "request.path",
|
|
1784
|
+
op: "set",
|
|
1785
|
+
args: "/$1"
|
|
1786
|
+
}
|
|
1787
|
+
]
|
|
1788
|
+
}
|
|
1774
1789
|
];
|
|
1775
1790
|
return {
|
|
1776
1791
|
routes,
|
|
1777
1792
|
output: {
|
|
1778
|
-
|
|
1793
|
+
[CONTAINER_OUTPUT_PATH]: {
|
|
1779
1794
|
type: "Lambda",
|
|
1780
1795
|
files: {},
|
|
1781
1796
|
// For `runtime: 'container'` the OCI image reference is carried in
|
|
@@ -1792,6 +1807,7 @@ async function build(options) {
|
|
|
1792
1807
|
}
|
|
1793
1808
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1794
1809
|
0 && (module.exports = {
|
|
1810
|
+
CONTAINER_OUTPUT_PATH,
|
|
1795
1811
|
build,
|
|
1796
1812
|
diagnostics,
|
|
1797
1813
|
prepareCache,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/container",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -12,10 +12,14 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
|
+
"dependencies": {},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@vercel/build-utils": "14.3.0"
|
|
18
|
+
},
|
|
15
19
|
"devDependencies": {
|
|
16
20
|
"@types/node": "20.11.0",
|
|
17
|
-
"vitest": "
|
|
18
|
-
"@vercel/build-utils": "14.0
|
|
21
|
+
"vitest": "4.1.10",
|
|
22
|
+
"@vercel/build-utils": "14.3.0"
|
|
19
23
|
},
|
|
20
24
|
"publishConfig": {
|
|
21
25
|
"access": "public"
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
"scripts": {
|
|
24
28
|
"build": "node ../../utils/build-builder.mjs",
|
|
25
29
|
"type-check": "tsc --noEmit",
|
|
26
|
-
"test
|
|
27
|
-
"
|
|
30
|
+
"test": "vitest run --config ../../vitest.config.mts",
|
|
31
|
+
"test-unit": "vitest run --config ../../vitest.config.mts test/unit.test.ts test/diagnostics.test.ts"
|
|
28
32
|
}
|
|
29
33
|
}
|