vercel 33.2.0 → 33.4.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/builder-worker.js +12 -0
- package/dist/index.js +87 -16
- package/package.json +4 -4
package/dist/builder-worker.js
CHANGED
@@ -42,6 +42,18 @@ async function processMessage(message) {
|
|
42
42
|
// structure to JSON" errors, so delete the property...
|
43
43
|
delete result.childProcesses;
|
44
44
|
|
45
|
+
if (builder.version === 3) {
|
46
|
+
if (result.output.type === 'Lambda') {
|
47
|
+
result.output.zipBuffer = await result.output.createZip();
|
48
|
+
}
|
49
|
+
} else {
|
50
|
+
for (const output of Object.values(result.output)) {
|
51
|
+
if (output.type === 'Lambda') {
|
52
|
+
output.zipBuffer = await output.createZip();
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
45
57
|
process.send({ type: 'buildResult', result });
|
46
58
|
}
|
47
59
|
|
package/dist/index.js
CHANGED
@@ -52621,8 +52621,8 @@ var GA_TRACKING_ID, SENTRY_DSN;
|
|
52621
52621
|
var init_constants = __esm({
|
52622
52622
|
"src/util/constants.ts"() {
|
52623
52623
|
"use strict";
|
52624
|
-
GA_TRACKING_ID =
|
52625
|
-
SENTRY_DSN =
|
52624
|
+
GA_TRACKING_ID = "UA-117491914-3";
|
52625
|
+
SENTRY_DSN = "https://26a24e59ba954011919a524b341b6ab5@sentry.io/1323225";
|
52626
52626
|
}
|
52627
52627
|
});
|
52628
52628
|
|
@@ -62513,7 +62513,7 @@ var require_package = __commonJS2({
|
|
62513
62513
|
"../client/package.json"(exports2, module2) {
|
62514
62514
|
module2.exports = {
|
62515
62515
|
name: "@vercel/client",
|
62516
|
-
version: "13.0
|
62516
|
+
version: "13.1.0",
|
62517
62517
|
main: "dist/index.js",
|
62518
62518
|
typings: "dist/index.d.ts",
|
62519
62519
|
homepage: "https://vercel.com",
|
@@ -63590,6 +63590,26 @@ var require_utils8 = __commonJS2({
|
|
63590
63590
|
return ignored;
|
63591
63591
|
};
|
63592
63592
|
fileList = await (0, import_readdir_recursive.default)(path11, [ignores2]);
|
63593
|
+
if (prebuilt) {
|
63594
|
+
const refs = /* @__PURE__ */ new Set();
|
63595
|
+
const vcConfigFilePaths = fileList.filter(
|
63596
|
+
(file) => (0, import_path44.basename)(file) === ".vc-config.json"
|
63597
|
+
);
|
63598
|
+
await Promise.all(
|
63599
|
+
vcConfigFilePaths.map(async (p) => {
|
63600
|
+
const configJson = await (0, import_fs_extra24.readFile)(p, "utf8");
|
63601
|
+
const config3 = JSON.parse(configJson);
|
63602
|
+
if (!config3.filePathMap)
|
63603
|
+
return;
|
63604
|
+
for (const v of Object.values(config3.filePathMap)) {
|
63605
|
+
refs.add((0, import_path44.join)(path11, v));
|
63606
|
+
}
|
63607
|
+
})
|
63608
|
+
);
|
63609
|
+
if (refs.size > 0) {
|
63610
|
+
fileList = fileList.concat(Array.from(refs));
|
63611
|
+
}
|
63612
|
+
}
|
63593
63613
|
debug3(`Found ${fileList.length} files in the specified directory`);
|
63594
63614
|
} else if (Array.isArray(path11)) {
|
63595
63615
|
fileList = path11;
|
@@ -168500,10 +168520,11 @@ var init_unzip = __esm({
|
|
168500
168520
|
});
|
168501
168521
|
|
168502
168522
|
// src/util/build/write-build-result.ts
|
168503
|
-
async function writeBuildResult(outputDir, buildResult, build2, builder, builderPkg, vercelConfig) {
|
168523
|
+
async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, builder, builderPkg, vercelConfig) {
|
168504
168524
|
const { version: version2 } = builder;
|
168505
168525
|
if (typeof version2 !== "number" || version2 === 2) {
|
168506
168526
|
return writeBuildResultV2(
|
168527
|
+
repoRootPath,
|
168507
168528
|
outputDir,
|
168508
168529
|
buildResult,
|
168509
168530
|
build2,
|
@@ -168511,6 +168532,7 @@ async function writeBuildResult(outputDir, buildResult, build2, builder, builder
|
|
168511
168532
|
);
|
168512
168533
|
} else if (version2 === 3) {
|
168513
168534
|
return writeBuildResultV3(
|
168535
|
+
repoRootPath,
|
168514
168536
|
outputDir,
|
168515
168537
|
buildResult,
|
168516
168538
|
build2,
|
@@ -168537,7 +168559,7 @@ function isFile(v) {
|
|
168537
168559
|
function stripDuplicateSlashes(path11) {
|
168538
168560
|
return normalize2(path11).replace(/(^\/|\/$)/g, "");
|
168539
168561
|
}
|
168540
|
-
async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig) {
|
168562
|
+
async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2, vercelConfig) {
|
168541
168563
|
if ("buildOutputPath" in buildResult) {
|
168542
168564
|
await mergeBuilderOutput(outputDir, buildResult);
|
168543
168565
|
return;
|
@@ -168555,6 +168577,7 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
|
|
168555
168577
|
const normalizedPath = stripDuplicateSlashes(path11);
|
168556
168578
|
if (isLambda(output2)) {
|
168557
168579
|
await writeLambda(
|
168580
|
+
repoRootPath,
|
168558
168581
|
outputDir,
|
168559
168582
|
output2,
|
168560
168583
|
normalizedPath,
|
@@ -168568,6 +168591,7 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
|
|
168568
168591
|
);
|
168569
168592
|
}
|
168570
168593
|
await writeLambda(
|
168594
|
+
repoRootPath,
|
168571
168595
|
outputDir,
|
168572
168596
|
output2.lambda,
|
168573
168597
|
normalizedPath,
|
@@ -168620,6 +168644,7 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
|
|
168620
168644
|
);
|
168621
168645
|
} else if (isEdgeFunction(output2)) {
|
168622
168646
|
await writeEdgeFunction(
|
168647
|
+
repoRootPath,
|
168623
168648
|
outputDir,
|
168624
168649
|
output2,
|
168625
168650
|
normalizedPath,
|
@@ -168633,7 +168658,7 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
|
|
168633
168658
|
}
|
168634
168659
|
return Object.keys(overrides).length > 0 ? overrides : void 0;
|
168635
168660
|
}
|
168636
|
-
async function writeBuildResultV3(outputDir, buildResult, build2, vercelConfig) {
|
168661
|
+
async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2, vercelConfig) {
|
168637
168662
|
const { output: output2 } = buildResult;
|
168638
168663
|
const src = build2.src;
|
168639
168664
|
if (typeof src !== "string") {
|
@@ -168648,9 +168673,15 @@ async function writeBuildResultV3(outputDir, buildResult, build2, vercelConfig)
|
|
168648
168673
|
build2.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
|
168649
168674
|
);
|
168650
168675
|
if (isLambda(output2)) {
|
168651
|
-
await writeLambda(
|
168676
|
+
await writeLambda(
|
168677
|
+
repoRootPath,
|
168678
|
+
outputDir,
|
168679
|
+
output2,
|
168680
|
+
path11,
|
168681
|
+
functionConfiguration
|
168682
|
+
);
|
168652
168683
|
} else if (isEdgeFunction(output2)) {
|
168653
|
-
await writeEdgeFunction(outputDir, output2, path11);
|
168684
|
+
await writeEdgeFunction(repoRootPath, outputDir, output2, path11);
|
168654
168685
|
} else {
|
168655
168686
|
throw new Error(
|
168656
168687
|
`Unsupported output type: "${output2.type}" for ${build2.src}`
|
@@ -168701,7 +168732,7 @@ async function writeFunctionSymlink(outputDir, dest, fn2, existingFunctions) {
|
|
168701
168732
|
await import_fs_extra15.default.symlink(target, dest);
|
168702
168733
|
return true;
|
168703
168734
|
}
|
168704
|
-
async function writeEdgeFunction(outputDir, edgeFunction, path11, existingFunctions) {
|
168735
|
+
async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11, existingFunctions) {
|
168705
168736
|
const dest = (0, import_path24.join)(outputDir, "functions", `${path11}.func`);
|
168706
168737
|
if (existingFunctions) {
|
168707
168738
|
if (await writeFunctionSymlink(
|
@@ -168716,11 +168747,16 @@ async function writeEdgeFunction(outputDir, edgeFunction, path11, existingFuncti
|
|
168716
168747
|
}
|
168717
168748
|
await import_fs_extra15.default.mkdirp(dest);
|
168718
168749
|
const ops = [];
|
168719
|
-
|
168750
|
+
const { files, filePathMap } = filesWithoutFsRefs(
|
168751
|
+
edgeFunction.files,
|
168752
|
+
repoRootPath
|
168753
|
+
);
|
168754
|
+
ops.push((0, import_build_utils8.download)(files, dest));
|
168720
168755
|
const config3 = {
|
168721
168756
|
runtime: "edge",
|
168722
168757
|
...edgeFunction,
|
168723
168758
|
entrypoint: (0, import_build_utils8.normalizePath)(edgeFunction.entrypoint),
|
168759
|
+
filePathMap,
|
168724
168760
|
files: void 0,
|
168725
168761
|
type: void 0
|
168726
168762
|
};
|
@@ -168732,7 +168768,7 @@ async function writeEdgeFunction(outputDir, edgeFunction, path11, existingFuncti
|
|
168732
168768
|
);
|
168733
168769
|
await Promise.all(ops);
|
168734
168770
|
}
|
168735
|
-
async function writeLambda(outputDir, lambda, path11, functionConfiguration, existingFunctions) {
|
168771
|
+
async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConfiguration, existingFunctions) {
|
168736
168772
|
const dest = (0, import_path24.join)(outputDir, "functions", `${path11}.func`);
|
168737
168773
|
if (existingFunctions) {
|
168738
168774
|
if (await writeFunctionSymlink(outputDir, dest, lambda, existingFunctions)) {
|
@@ -168742,8 +168778,11 @@ async function writeLambda(outputDir, lambda, path11, functionConfiguration, exi
|
|
168742
168778
|
}
|
168743
168779
|
await import_fs_extra15.default.mkdirp(dest);
|
168744
168780
|
const ops = [];
|
168781
|
+
let filePathMap;
|
168745
168782
|
if (lambda.files) {
|
168746
|
-
|
168783
|
+
const f = filesWithoutFsRefs(lambda.files, repoRootPath);
|
168784
|
+
filePathMap = f.filePathMap;
|
168785
|
+
ops.push((0, import_build_utils8.download)(f.files, dest));
|
168747
168786
|
} else if (lambda.zipBuffer) {
|
168748
168787
|
ops.push(unzip(lambda.zipBuffer, dest));
|
168749
168788
|
} else {
|
@@ -168756,6 +168795,7 @@ async function writeLambda(outputDir, lambda, path11, functionConfiguration, exi
|
|
168756
168795
|
handler: (0, import_build_utils8.normalizePath)(lambda.handler),
|
168757
168796
|
memory,
|
168758
168797
|
maxDuration,
|
168798
|
+
filePathMap,
|
168759
168799
|
type: void 0,
|
168760
168800
|
files: void 0,
|
168761
168801
|
zipBuffer: void 0
|
@@ -168828,6 +168868,20 @@ async function* findDirs(name, dir, root = dir) {
|
|
168828
168868
|
}
|
168829
168869
|
}
|
168830
168870
|
}
|
168871
|
+
function filesWithoutFsRefs(files, repoRootPath) {
|
168872
|
+
let filePathMap;
|
168873
|
+
const out = {};
|
168874
|
+
for (const [path11, file] of Object.entries(files)) {
|
168875
|
+
if (file.type === "FileFsRef") {
|
168876
|
+
if (!filePathMap)
|
168877
|
+
filePathMap = {};
|
168878
|
+
filePathMap[path11] = (0, import_path24.relative)(repoRootPath, file.fsPath);
|
168879
|
+
} else {
|
168880
|
+
out[path11] = file;
|
168881
|
+
}
|
168882
|
+
}
|
168883
|
+
return { files: out, filePathMap };
|
168884
|
+
}
|
168831
168885
|
var import_fs_extra15, import_mime_types, import_path24, import_build_utils8, import_promisepipe2, import_client6, normalize2, OUTPUT_DIR;
|
168832
168886
|
var init_write_build_result = __esm({
|
168833
168887
|
"src/util/build/write-build-result.ts"() {
|
@@ -170658,6 +170712,7 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
|
|
170658
170712
|
buildResults.set(build2, buildResult);
|
170659
170713
|
ops.push(
|
170660
170714
|
writeBuildResult(
|
170715
|
+
repoRootPath,
|
170661
170716
|
outputDir,
|
170662
170717
|
buildResult,
|
170663
170718
|
build2,
|
@@ -185759,8 +185814,9 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
|
|
185759
185814
|
if (oldAsset && oldAsset.type === "Lambda" && oldAsset.fn) {
|
185760
185815
|
await oldAsset.fn.destroy();
|
185761
185816
|
}
|
185817
|
+
const ZipFile2 = asset.zipBuffer || await asset.createZip();
|
185762
185818
|
asset.fn = await (0, import_fun.createFunction)({
|
185763
|
-
Code: { ZipFile:
|
185819
|
+
Code: { ZipFile: ZipFile2 },
|
185764
185820
|
Handler: asset.handler,
|
185765
185821
|
Runtime: asset.runtime,
|
185766
185822
|
MemorySize: asset.memory || 3008,
|
@@ -191518,6 +191574,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
191518
191574
|
});
|
191519
191575
|
envGitBranch = inputValue || "";
|
191520
191576
|
}
|
191577
|
+
const type = opts["--sensitive"] ? "sensitive" : "encrypted";
|
191521
191578
|
const addStamp = stamp_default();
|
191522
191579
|
try {
|
191523
191580
|
output2.spinner("Saving");
|
@@ -191525,7 +191582,7 @@ async function add5(client2, project, opts, args2, output2) {
|
|
191525
191582
|
output2,
|
191526
191583
|
client2,
|
191527
191584
|
project.id,
|
191528
|
-
|
191585
|
+
type,
|
191529
191586
|
envName,
|
191530
191587
|
envValue,
|
191531
191588
|
envTargets,
|
@@ -191847,7 +191904,16 @@ var init_command10 = __esm({
|
|
191847
191904
|
required: false
|
191848
191905
|
}
|
191849
191906
|
],
|
191850
|
-
options: [
|
191907
|
+
options: [
|
191908
|
+
{
|
191909
|
+
name: "sensitive",
|
191910
|
+
description: "Add a sensitive Environment Variable",
|
191911
|
+
shorthand: null,
|
191912
|
+
type: "string",
|
191913
|
+
deprecated: false,
|
191914
|
+
multi: false
|
191915
|
+
}
|
191916
|
+
],
|
191851
191917
|
examples: []
|
191852
191918
|
},
|
191853
191919
|
{
|
@@ -191927,6 +191993,10 @@ var init_command10 = __esm({
|
|
191927
191993
|
`${packageName} env add DB_PASS production`
|
191928
191994
|
]
|
191929
191995
|
},
|
191996
|
+
{
|
191997
|
+
name: "Add a sensitive Environment Variable",
|
191998
|
+
value: `${packageName} env add API_TOKEN --sensitive`
|
191999
|
+
},
|
191930
192000
|
{
|
191931
192001
|
name: "Add a new variable for a specific Environment and Git Branch",
|
191932
192002
|
value: [
|
@@ -191980,7 +192050,8 @@ async function main6(client2) {
|
|
191980
192050
|
"--yes": Boolean,
|
191981
192051
|
"-y": "--yes",
|
191982
192052
|
"--environment": String,
|
191983
|
-
"--git-branch": String
|
192053
|
+
"--git-branch": String,
|
192054
|
+
"--sensitive": Boolean
|
191984
192055
|
});
|
191985
192056
|
} catch (error4) {
|
191986
192057
|
handleError(error4);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "33.
|
3
|
+
"version": "33.4.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -27,10 +27,10 @@
|
|
27
27
|
"@vercel/hydrogen": "1.0.2",
|
28
28
|
"@vercel/next": "4.1.0",
|
29
29
|
"@vercel/node": "3.0.17",
|
30
|
-
"@vercel/python": "4.1.
|
30
|
+
"@vercel/python": "4.1.1",
|
31
31
|
"@vercel/redwood": "2.0.6",
|
32
32
|
"@vercel/remix-builder": "2.0.18",
|
33
|
-
"@vercel/ruby": "2.0.
|
33
|
+
"@vercel/ruby": "2.0.5",
|
34
34
|
"@vercel/static-build": "2.1.0",
|
35
35
|
"chokidar": "3.3.1"
|
36
36
|
},
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"@vercel-internals/constants": "1.0.4",
|
80
80
|
"@vercel-internals/get-package-json": "1.0.0",
|
81
81
|
"@vercel-internals/types": "1.0.21",
|
82
|
-
"@vercel/client": "13.0
|
82
|
+
"@vercel/client": "13.1.0",
|
83
83
|
"@vercel/error-utils": "2.0.2",
|
84
84
|
"@vercel/frameworks": "2.0.6",
|
85
85
|
"@vercel/fs-detectors": "5.1.6",
|