@vercel/client 17.2.63 → 17.2.64
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/continue.d.ts +2 -1
- package/dist/continue.js +15 -1
- package/dist/create-deployment.js +2 -29
- package/dist/utils/archive.d.ts +2 -0
- package/dist/utils/archive.js +61 -0
- package/package.json +2 -2
package/dist/continue.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Agent } from 'http';
|
|
3
|
-
import type { DeploymentEventType } from './types';
|
|
3
|
+
import type { ArchiveFormat, DeploymentEventType } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Continues a manual deployment by uploading build outputs and calling the
|
|
6
6
|
* continue endpoint. Waits for READY state unless the caller stops consuming
|
|
@@ -16,6 +16,7 @@ export declare function continueDeployment(options: {
|
|
|
16
16
|
token: string;
|
|
17
17
|
userAgent?: string;
|
|
18
18
|
vercelOutputDir?: string;
|
|
19
|
+
archive?: ArchiveFormat;
|
|
19
20
|
}): AsyncIterableIterator<{
|
|
20
21
|
type: DeploymentEventType;
|
|
21
22
|
payload: any;
|
package/dist/continue.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_hashes = require("./utils/hashes");
|
|
|
39
39
|
var import_ready_state = require("./utils/ready-state");
|
|
40
40
|
var import_upload = require("./upload");
|
|
41
41
|
var import_errors = require("./errors");
|
|
42
|
+
var import_archive = require("./utils/archive");
|
|
42
43
|
async function* continueDeployment(options) {
|
|
43
44
|
const debug = (0, import_utils.createDebug)(options.debug);
|
|
44
45
|
debug(`Continuing deployment: ${options.deploymentId}`);
|
|
@@ -57,7 +58,20 @@ async function* continueDeployment(options) {
|
|
|
57
58
|
{ isDirectory: true, prebuilt: true, vercelOutputDir: outputDir },
|
|
58
59
|
debug
|
|
59
60
|
);
|
|
60
|
-
const
|
|
61
|
+
const provisionJsonPath = (0, import_path.join)(outputDir, "provision.json");
|
|
62
|
+
const unbundledFiles = fileList.filter((f) => f === provisionJsonPath);
|
|
63
|
+
let files;
|
|
64
|
+
if (options.archive === "tgz") {
|
|
65
|
+
files = await (0, import_archive.createTgzFiles)(options.path, fileList, debug, unbundledFiles);
|
|
66
|
+
if (unbundledFiles.length > 0) {
|
|
67
|
+
const individualFiles = await (0, import_hashes.hashes)(unbundledFiles);
|
|
68
|
+
for (const [sha, entry] of individualFiles) {
|
|
69
|
+
files.set(sha, entry);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
files = await (0, import_hashes.hashes)(fileList);
|
|
74
|
+
}
|
|
61
75
|
debug(`Calculated ${files.size} unique hashes`);
|
|
62
76
|
yield { type: "hashes-calculated", payload: (0, import_hashes.mapToObject)(files) };
|
|
63
77
|
let deployment;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var create_deployment_exports = {};
|
|
30
20
|
__export(create_deployment_exports, {
|
|
@@ -39,9 +29,7 @@ var import_upload = require("./upload");
|
|
|
39
29
|
var import_utils = require("./utils");
|
|
40
30
|
var import_errors = require("./errors");
|
|
41
31
|
var import_error_utils = require("@vercel/error-utils");
|
|
42
|
-
var
|
|
43
|
-
var import_tar_fs = __toESM(require("tar-fs"));
|
|
44
|
-
var import_zlib = require("zlib");
|
|
32
|
+
var import_archive = require("./utils/archive");
|
|
45
33
|
function buildCreateDeployment() {
|
|
46
34
|
return async function* createDeployment(clientOptions, deploymentOptions = {}) {
|
|
47
35
|
const { path } = clientOptions;
|
|
@@ -116,22 +104,7 @@ function buildCreateDeployment() {
|
|
|
116
104
|
let files;
|
|
117
105
|
try {
|
|
118
106
|
if (clientOptions.archive === "tgz") {
|
|
119
|
-
|
|
120
|
-
const tarStream = import_tar_fs.default.pack(workPath, {
|
|
121
|
-
entries: fileList.map((file) => (0, import_path.relative)(workPath, file))
|
|
122
|
-
}).pipe((0, import_zlib.createGzip)());
|
|
123
|
-
const chunkedTarBuffers = await (0, import_build_utils.streamToBufferChunks)(tarStream);
|
|
124
|
-
debug(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
125
|
-
files = new Map(
|
|
126
|
-
chunkedTarBuffers.map((chunk, index) => [
|
|
127
|
-
(0, import_hashes.hash)(chunk),
|
|
128
|
-
{
|
|
129
|
-
names: [(0, import_path.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
130
|
-
data: chunk,
|
|
131
|
-
mode: 438
|
|
132
|
-
}
|
|
133
|
-
])
|
|
134
|
-
);
|
|
107
|
+
files = await (0, import_archive.createTgzFiles)(workPath, fileList, debug);
|
|
135
108
|
} else {
|
|
136
109
|
files = await (0, import_hashes.hashes)(fileList);
|
|
137
110
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var archive_exports = {};
|
|
30
|
+
__export(archive_exports, {
|
|
31
|
+
createTgzFiles: () => createTgzFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(archive_exports);
|
|
34
|
+
var import_node_path = require("node:path");
|
|
35
|
+
var import_node_zlib = require("node:zlib");
|
|
36
|
+
var import_build_utils = require("@vercel/build-utils");
|
|
37
|
+
var import_tar_fs = __toESM(require("tar-fs"));
|
|
38
|
+
var import_hashes = require("./hashes");
|
|
39
|
+
async function createTgzFiles(workPath, fileList, debug, exclude) {
|
|
40
|
+
const filesToArchive = exclude ? fileList.filter((file) => !exclude.includes(file)) : fileList;
|
|
41
|
+
debug?.("Packing tarball");
|
|
42
|
+
const tarStream = import_tar_fs.default.pack(workPath, {
|
|
43
|
+
entries: filesToArchive.map((file) => (0, import_node_path.relative)(workPath, file))
|
|
44
|
+
}).pipe((0, import_node_zlib.createGzip)());
|
|
45
|
+
const chunkedTarBuffers = await (0, import_build_utils.streamToBufferChunks)(tarStream);
|
|
46
|
+
debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
47
|
+
return new Map(
|
|
48
|
+
chunkedTarBuffers.map((chunk, index) => [
|
|
49
|
+
(0, import_hashes.hash)(chunk),
|
|
50
|
+
{
|
|
51
|
+
names: [(0, import_node_path.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
52
|
+
data: chunk,
|
|
53
|
+
mode: 438
|
|
54
|
+
}
|
|
55
|
+
])
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
createTgzFiles
|
|
61
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/client",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.64",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://vercel.com",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"querystring": "^0.2.0",
|
|
43
43
|
"sleep-promise": "8.0.1",
|
|
44
44
|
"tar-fs": "1.16.3",
|
|
45
|
-
"@vercel/build-utils": "13.
|
|
45
|
+
"@vercel/build-utils": "13.11.0",
|
|
46
46
|
"@vercel/error-utils": "2.0.3",
|
|
47
47
|
"@vercel/routing-utils": "6.1.1"
|
|
48
48
|
},
|