@vercel/client 18.4.6 → 18.4.8
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/utils/index.js +31 -8
- package/package.json +2 -2
package/dist/utils/index.js
CHANGED
|
@@ -119,6 +119,7 @@ async function getUserIgnore(cwd) {
|
|
|
119
119
|
}
|
|
120
120
|
return {
|
|
121
121
|
ig: (0, import_ignore.default)().add(clearRelative(ignoreFile)),
|
|
122
|
+
ignoreFile,
|
|
122
123
|
ignoreFileName: vercelignore ? ".vercelignore" : ".nowignore"
|
|
123
124
|
};
|
|
124
125
|
}
|
|
@@ -138,10 +139,28 @@ const filePathMapVercelignoreExceptions = (0, import_ignore.default)().add(
|
|
|
138
139
|
function isFilePathMapIgnoreException(posixRel) {
|
|
139
140
|
return filePathMapVercelignoreExceptions.ignores(posixRel);
|
|
140
141
|
}
|
|
141
|
-
const
|
|
142
|
+
const FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT = 100;
|
|
143
|
+
function findMatchingIgnoreRule(ignoreFile, posixRel) {
|
|
144
|
+
const matcher = (0, import_ignore.default)();
|
|
145
|
+
let wasIgnored = false;
|
|
146
|
+
let match = {};
|
|
147
|
+
for (const [index, rule] of ignoreFile.split(/\r?\n/).entries()) {
|
|
148
|
+
matcher.add(clearRelative(rule));
|
|
149
|
+
const isIgnored = matcher.ignores(posixRel);
|
|
150
|
+
if (!wasIgnored && isIgnored) {
|
|
151
|
+
match = { rule, line: index + 1 };
|
|
152
|
+
} else if (wasIgnored && !isIgnored) {
|
|
153
|
+
match = {};
|
|
154
|
+
}
|
|
155
|
+
wasIgnored = isIgnored;
|
|
156
|
+
}
|
|
157
|
+
return match;
|
|
158
|
+
}
|
|
142
159
|
function formatFilePathMapIgnoreWarning(entries, ignoreFileName, truncated = false) {
|
|
143
|
-
const shown = entries.slice(0,
|
|
144
|
-
const lines = shown.map(
|
|
160
|
+
const shown = entries.slice(0, FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT);
|
|
161
|
+
const lines = shown.map(
|
|
162
|
+
({ path, rule, line }) => rule && line ? ` ${path} (matched \`${ignoreFileName}:${line}\`: \`${rule}\`)` : ` ${path}`
|
|
163
|
+
);
|
|
145
164
|
if (truncated) {
|
|
146
165
|
lines.push(" \u2026and more");
|
|
147
166
|
}
|
|
@@ -149,7 +168,7 @@ function formatFilePathMapIgnoreWarning(entries, ignoreFileName, truncated = fal
|
|
|
149
168
|
const fileWord = !truncated && entries.length === 1 ? "file" : "files";
|
|
150
169
|
const ignoreFileLabel = ignoreFileName === ".nowignore" ? `\`${ignoreFileName}\` (deprecated)` : `\`${ignoreFileName}\``;
|
|
151
170
|
return [
|
|
152
|
-
`${ignoreFileLabel} excludes ${count} ${fileWord} the prebuilt functions need.
|
|
171
|
+
`${ignoreFileLabel} excludes ${count} ${fileWord} the prebuilt functions need. Uploading without them may fail with ENOENT.`,
|
|
153
172
|
"",
|
|
154
173
|
...lines,
|
|
155
174
|
"",
|
|
@@ -186,7 +205,7 @@ async function buildFileTree(path, {
|
|
|
186
205
|
(file) => (0, import_path.basename)(file) === ".vc-config.json"
|
|
187
206
|
);
|
|
188
207
|
const userIg = await getUserIgnore(path);
|
|
189
|
-
const ignoredFilePathMap = /* @__PURE__ */ new
|
|
208
|
+
const ignoredFilePathMap = /* @__PURE__ */ new Map();
|
|
190
209
|
let ignoredFilePathMapTruncated = false;
|
|
191
210
|
const vcConfigs = await Promise.all(
|
|
192
211
|
vcConfigFilePaths.map(async (p) => {
|
|
@@ -219,11 +238,14 @@ async function buildFileTree(path, {
|
|
|
219
238
|
`Skipping "filePathMap" entry "${v}": already in the upload set`
|
|
220
239
|
);
|
|
221
240
|
continue;
|
|
222
|
-
} else if (ignoredFilePathMap.size >=
|
|
241
|
+
} else if (ignoredFilePathMap.size >= FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT) {
|
|
223
242
|
ignoredFilePathMapTruncated = true;
|
|
224
243
|
continue;
|
|
225
244
|
} else {
|
|
226
|
-
ignoredFilePathMap.
|
|
245
|
+
ignoredFilePathMap.set(
|
|
246
|
+
posixRel,
|
|
247
|
+
findMatchingIgnoreRule(userIg.ignoreFile, posixRel)
|
|
248
|
+
);
|
|
227
249
|
continue;
|
|
228
250
|
}
|
|
229
251
|
}
|
|
@@ -231,8 +253,9 @@ async function buildFileTree(path, {
|
|
|
231
253
|
}
|
|
232
254
|
}
|
|
233
255
|
if (ignoredFilePathMap.size > 0) {
|
|
256
|
+
const violations = [...ignoredFilePathMap.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([ignoredPath, match]) => ({ path: ignoredPath, ...match }));
|
|
234
257
|
warning = formatFilePathMapIgnoreWarning(
|
|
235
|
-
|
|
258
|
+
violations,
|
|
236
259
|
userIg?.ignoreFileName || ".vercelignore",
|
|
237
260
|
ignoredFilePathMapTruncated
|
|
238
261
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/client",
|
|
3
|
-
"version": "18.4.
|
|
3
|
+
"version": "18.4.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://vercel.com",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"querystring": "^0.2.0",
|
|
38
38
|
"sleep-promise": "8.0.1",
|
|
39
39
|
"tar-fs": "1.16.3",
|
|
40
|
-
"@vercel/build-utils": "14.13.
|
|
40
|
+
"@vercel/build-utils": "14.13.2",
|
|
41
41
|
"@vercel/routing-utils": "6.6.0",
|
|
42
42
|
"@vercel/error-utils": "2.2.1"
|
|
43
43
|
},
|