@vercel/node 1.14.0 → 1.14.2-canary.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 +25 -17
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -236968,8 +236968,8 @@ async function analyze(id, code, job) {
|
|
|
236968
236968
|
return;
|
|
236969
236969
|
const wildcardIndex = wildcardPath.indexOf(static_eval_1.WILDCARD);
|
|
236970
236970
|
const dirIndex = wildcardIndex === -1 ? wildcardPath.length : wildcardPath.lastIndexOf(path_1.default.sep, wildcardIndex);
|
|
236971
|
-
const assetDirPath = wildcardPath.
|
|
236972
|
-
const patternPath = wildcardPath.
|
|
236971
|
+
const assetDirPath = wildcardPath.substring(0, dirIndex);
|
|
236972
|
+
const patternPath = wildcardPath.slice(dirIndex);
|
|
236973
236973
|
const wildcardPattern = patternPath.replace(static_eval_1.wildcardRegEx, (_match, index) => {
|
|
236974
236974
|
return patternPath[index - 1] === path_1.default.sep ? '**/*' : '*';
|
|
236975
236975
|
}).replace(repeatGlobRegEx, '/**/*') || '/**/*';
|
|
@@ -237117,8 +237117,8 @@ async function analyze(id, code, job) {
|
|
|
237117
237117
|
wildcardRequire = path_1.default.resolve(dir, wildcardRequire);
|
|
237118
237118
|
const wildcardIndex = wildcardRequire.indexOf(static_eval_1.WILDCARD);
|
|
237119
237119
|
const dirIndex = wildcardIndex === -1 ? wildcardRequire.length : wildcardRequire.lastIndexOf(path_1.default.sep, wildcardIndex);
|
|
237120
|
-
const wildcardDirPath = wildcardRequire.
|
|
237121
|
-
const patternPath = wildcardRequire.
|
|
237120
|
+
const wildcardDirPath = wildcardRequire.substring(0, dirIndex);
|
|
237121
|
+
const patternPath = wildcardRequire.slice(dirIndex);
|
|
237122
237122
|
let wildcardPattern = patternPath.replace(static_eval_1.wildcardRegEx, (_match, index) => {
|
|
237123
237123
|
return patternPath[index - 1] === path_1.default.sep ? '**/*' : '*';
|
|
237124
237124
|
}) || '/**/*';
|
|
@@ -237519,7 +237519,7 @@ async function analyze(id, code, job) {
|
|
|
237519
237519
|
// verify the asset file / directory exists
|
|
237520
237520
|
const wildcardIndex = assetPath.indexOf(static_eval_1.WILDCARD);
|
|
237521
237521
|
const dirIndex = wildcardIndex === -1 ? assetPath.length : assetPath.lastIndexOf(path_1.default.sep, wildcardIndex);
|
|
237522
|
-
const basePath = assetPath.
|
|
237522
|
+
const basePath = assetPath.substring(0, dirIndex);
|
|
237523
237523
|
try {
|
|
237524
237524
|
var stats = await job.stat(basePath);
|
|
237525
237525
|
if (stats === null) {
|
|
@@ -237557,11 +237557,11 @@ async function analyze(id, code, job) {
|
|
|
237557
237557
|
if (assetPath.endsWith(path_1.default.sep + 'node_modules' + wildcardSuffix))
|
|
237558
237558
|
return false;
|
|
237559
237559
|
// do not emit directories above __dirname
|
|
237560
|
-
if (dir.startsWith(assetPath.
|
|
237560
|
+
if (dir.startsWith(assetPath.slice(0, assetPath.length - wildcardSuffix.length) + path_1.default.sep))
|
|
237561
237561
|
return false;
|
|
237562
237562
|
// do not emit asset directories higher than the node_modules base if a package
|
|
237563
237563
|
if (pkgBase) {
|
|
237564
|
-
const nodeModulesBase = id.
|
|
237564
|
+
const nodeModulesBase = id.substring(0, id.indexOf(path_1.default.sep + 'node_modules')) + path_1.default.sep + 'node_modules' + path_1.default.sep;
|
|
237565
237565
|
if (!assetPath.startsWith(nodeModulesBase)) {
|
|
237566
237566
|
if (job.log)
|
|
237567
237567
|
console.log('Skipping asset emission of ' + assetPath.replace(static_eval_1.wildcardRegEx, '*') + ' for ' + id + ' as it is outside the package base ' + pkgBase);
|
|
@@ -237858,7 +237858,7 @@ class Job {
|
|
|
237858
237858
|
return path;
|
|
237859
237859
|
return path_2.join(await this.realpath(path_1.dirname(path), parent, seen), path_1.basename(path));
|
|
237860
237860
|
}
|
|
237861
|
-
async emitFile(path,
|
|
237861
|
+
async emitFile(path, reasonType, parent, isRealpath = false) {
|
|
237862
237862
|
if (!isRealpath) {
|
|
237863
237863
|
path = await this.realpath(path, parent);
|
|
237864
237864
|
}
|
|
@@ -237869,12 +237869,15 @@ class Job {
|
|
|
237869
237869
|
let reasonEntry = this.reasons.get(path);
|
|
237870
237870
|
if (!reasonEntry) {
|
|
237871
237871
|
reasonEntry = {
|
|
237872
|
-
type:
|
|
237872
|
+
type: [reasonType],
|
|
237873
237873
|
ignored: false,
|
|
237874
237874
|
parents: new Set()
|
|
237875
237875
|
};
|
|
237876
237876
|
this.reasons.set(path, reasonEntry);
|
|
237877
237877
|
}
|
|
237878
|
+
else if (!reasonEntry.type.includes(reasonType)) {
|
|
237879
|
+
reasonEntry.type.push(reasonType);
|
|
237880
|
+
}
|
|
237878
237881
|
if (parent && this.ignoreFn(path, parent)) {
|
|
237879
237882
|
if (!this.fileList.has(path) && reasonEntry) {
|
|
237880
237883
|
reasonEntry.ignored = true;
|
|
@@ -237891,7 +237894,7 @@ class Job {
|
|
|
237891
237894
|
const rootSeparatorIndex = path.indexOf(path_1.sep);
|
|
237892
237895
|
let separatorIndex;
|
|
237893
237896
|
while ((separatorIndex = path.lastIndexOf(path_1.sep)) > rootSeparatorIndex) {
|
|
237894
|
-
path = path.
|
|
237897
|
+
path = path.slice(0, separatorIndex);
|
|
237895
237898
|
if (await this.isFile(path + path_1.sep + 'package.json'))
|
|
237896
237899
|
return path;
|
|
237897
237900
|
}
|
|
@@ -237938,7 +237941,7 @@ class Job {
|
|
|
237938
237941
|
...[...assets].map(async (asset) => {
|
|
237939
237942
|
const ext = path_1.extname(asset);
|
|
237940
237943
|
if (ext === '.js' || ext === '.mjs' || ext === '.node' || ext === '' ||
|
|
237941
|
-
this.ts && (ext === '.ts' || ext === '.tsx') && asset.startsWith(this.base) && asset.
|
|
237944
|
+
this.ts && (ext === '.ts' || ext === '.tsx') && asset.startsWith(this.base) && asset.slice(this.base.length).indexOf(path_1.sep + 'node_modules' + path_1.sep) === -1)
|
|
237942
237945
|
await this.emitDependency(asset, path);
|
|
237943
237946
|
else
|
|
237944
237947
|
await this.emitFile(asset, 'asset', path);
|
|
@@ -238044,9 +238047,9 @@ async function resolveFile(path, parent, job) {
|
|
|
238044
238047
|
path = await job.realpath(path, parent);
|
|
238045
238048
|
if (await job.isFile(path))
|
|
238046
238049
|
return path;
|
|
238047
|
-
if (job.ts && path.startsWith(job.base) && path.
|
|
238050
|
+
if (job.ts && path.startsWith(job.base) && path.slice(job.base.length).indexOf(path_1.sep + 'node_modules' + path_1.sep) === -1 && await job.isFile(path + '.ts'))
|
|
238048
238051
|
return path + '.ts';
|
|
238049
|
-
if (job.ts && path.startsWith(job.base) && path.
|
|
238052
|
+
if (job.ts && path.startsWith(job.base) && path.slice(job.base.length).indexOf(path_1.sep + 'node_modules' + path_1.sep) === -1 && await job.isFile(path + '.tsx'))
|
|
238050
238053
|
return path + '.tsx';
|
|
238051
238054
|
if (await job.isFile(path + '.js'))
|
|
238052
238055
|
return path + '.js';
|
|
@@ -238208,7 +238211,7 @@ async function resolvePackage(name, parent, job, cjsResolve) {
|
|
|
238208
238211
|
let separatorIndex;
|
|
238209
238212
|
const rootSeparatorIndex = packageParent.indexOf(path_1.sep);
|
|
238210
238213
|
while ((separatorIndex = packageParent.lastIndexOf(path_1.sep)) > rootSeparatorIndex) {
|
|
238211
|
-
packageParent = packageParent.
|
|
238214
|
+
packageParent = packageParent.slice(0, separatorIndex);
|
|
238212
238215
|
const nodeModulesDir = packageParent + path_1.sep + 'node_modules';
|
|
238213
238216
|
const stat = await job.stat(nodeModulesDir);
|
|
238214
238217
|
if (!stat || !stat.isDirectory())
|
|
@@ -238438,9 +238441,9 @@ function getPackageBase(id) {
|
|
|
238438
238441
|
if (pkgIndex !== -1 &&
|
|
238439
238442
|
(id[pkgIndex - 1] === '/' || id[pkgIndex - 1] === '\\') &&
|
|
238440
238443
|
(id[pkgIndex + 12] === '/' || id[pkgIndex + 12] === '\\')) {
|
|
238441
|
-
const pkgNameMatch = id.
|
|
238444
|
+
const pkgNameMatch = id.slice(pkgIndex + 13).match(pkgNameRegEx);
|
|
238442
238445
|
if (pkgNameMatch)
|
|
238443
|
-
return id.
|
|
238446
|
+
return id.slice(0, pkgIndex + 13 + pkgNameMatch[0].length);
|
|
238444
238447
|
}
|
|
238445
238448
|
return undefined;
|
|
238446
238449
|
}
|
|
@@ -238450,7 +238453,7 @@ function getPackageName(id) {
|
|
|
238450
238453
|
if (pkgIndex !== -1 &&
|
|
238451
238454
|
(id[pkgIndex - 1] === '/' || id[pkgIndex - 1] === '\\') &&
|
|
238452
238455
|
(id[pkgIndex + 12] === '/' || id[pkgIndex + 12] === '\\')) {
|
|
238453
|
-
const pkgNameMatch = id.
|
|
238456
|
+
const pkgNameMatch = id.slice(pkgIndex + 13).match(pkgNameRegEx);
|
|
238454
238457
|
if (pkgNameMatch && pkgNameMatch.length > 0) {
|
|
238455
238458
|
return pkgNameMatch[0].replace(/\\/g, '/');
|
|
238456
238459
|
}
|
|
@@ -238770,6 +238773,11 @@ const specialCases = {
|
|
|
238770
238773
|
emitAsset(path_1.resolve(path_1.dirname(id), '../data/geo.dat'));
|
|
238771
238774
|
}
|
|
238772
238775
|
},
|
|
238776
|
+
'pixelmatch'({ id, emitAsset }) {
|
|
238777
|
+
if (id.endsWith('pixelmatch/index.js')) {
|
|
238778
|
+
emitAsset(path_1.resolve(path_1.dirname(id), 'bin/pixelmatch'));
|
|
238779
|
+
}
|
|
238780
|
+
}
|
|
238773
238781
|
};
|
|
238774
238782
|
async function handleSpecialCases({ id, ast, emitAsset, emitAssetDirectory, job }) {
|
|
238775
238783
|
const pkgName = get_package_base_1.getPackageName(id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/node",
|
|
3
|
-
"version": "1.14.0",
|
|
3
|
+
"version": "1.14.2-canary.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@types/cookie": "0.3.3",
|
|
33
33
|
"@types/etag": "1.8.0",
|
|
34
34
|
"@types/test-listen": "1.1.0",
|
|
35
|
-
"@vercel/build-utils": "2.15.0",
|
|
35
|
+
"@vercel/build-utils": "2.15.2-canary.0",
|
|
36
36
|
"@vercel/ncc": "0.24.0",
|
|
37
|
-
"@vercel/nft": "0.
|
|
37
|
+
"@vercel/nft": "0.18.1",
|
|
38
38
|
"content-type": "1.0.4",
|
|
39
39
|
"cookie": "0.4.0",
|
|
40
40
|
"etag": "1.8.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"source-map-support": "0.5.12",
|
|
44
44
|
"test-listen": "1.1.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e7f524defba3bbf2db750dea3235e6699584c424"
|
|
47
47
|
}
|