@vercel/nft 0.17.5 → 0.18.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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { NodeFileTraceOptions, NodeFileTraceResult, NodeFileTraceReasons, Stats } from './types';
2
+ import { NodeFileTraceOptions, NodeFileTraceResult, NodeFileTraceReasons, Stats, NodeFileTraceReasonType } from './types';
3
3
  export declare function nodeFileTrace(files: string[], opts?: NodeFileTraceOptions): Promise<NodeFileTraceResult>;
4
4
  export declare class Job {
5
5
  ts: boolean;
@@ -33,7 +33,7 @@ export declare class Job {
33
33
  resolve(id: string, parent: string, job: Job, cjsResolve: boolean): Promise<string | string[]>;
34
34
  readFile(path: string): Promise<string | Buffer | null>;
35
35
  realpath(path: string, parent?: string, seen?: Set<unknown>): Promise<string>;
36
- emitFile(path: string, reason: string, parent?: string, isRealpath?: boolean): Promise<boolean>;
36
+ emitFile(path: string, reasonType: NodeFileTraceReasonType, parent?: string, isRealpath?: boolean): Promise<boolean>;
37
37
  getPjsonBoundary(path: string): Promise<string | undefined>;
38
38
  emitDependency(path: string, parent?: string): Promise<void>;
39
39
  }
@@ -208,7 +208,7 @@ class Job {
208
208
  return path;
209
209
  return path_2.join(await this.realpath(path_1.dirname(path), parent, seen), path_1.basename(path));
210
210
  }
211
- async emitFile(path, reason, parent, isRealpath = false) {
211
+ async emitFile(path, reasonType, parent, isRealpath = false) {
212
212
  if (!isRealpath) {
213
213
  path = await this.realpath(path, parent);
214
214
  }
@@ -219,12 +219,15 @@ class Job {
219
219
  let reasonEntry = this.reasons.get(path);
220
220
  if (!reasonEntry) {
221
221
  reasonEntry = {
222
- type: reason,
222
+ type: [reasonType],
223
223
  ignored: false,
224
224
  parents: new Set()
225
225
  };
226
226
  this.reasons.set(path, reasonEntry);
227
227
  }
228
+ else if (!reasonEntry.type.includes(reasonType)) {
229
+ reasonEntry.type.push(reasonType);
230
+ }
228
231
  if (parent && this.ignoreFn(path, parent)) {
229
232
  if (!this.fileList.has(path) && reasonEntry) {
230
233
  reasonEntry.ignored = true;
package/out/types.d.ts CHANGED
@@ -49,8 +49,9 @@ export interface NodeFileTraceOptions {
49
49
  readlink?: (path: string) => Promise<string | null>;
50
50
  resolve?: (id: string, parent: string, job: Job, cjsResolve: boolean) => Promise<string | string[]>;
51
51
  }
52
+ export declare type NodeFileTraceReasonType = 'initial' | 'resolve' | 'dependency' | 'asset' | 'sharedlib';
52
53
  export interface NodeFileTraceReasons extends Map<string, {
53
- type: string;
54
+ type: NodeFileTraceReasonType[];
54
55
  ignored: boolean;
55
56
  parents: Set<string>;
56
57
  }> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/nft",
3
- "version": "0.17.5",
3
+ "version": "0.18.0",
4
4
  "repository": "vercel/nft",
5
5
  "license": "MIT",
6
6
  "main": "./out/index.js",
@@ -55,6 +55,7 @@
55
55
  "bcrypt": "^5.0.1",
56
56
  "browserify-middleware": "^8.1.1",
57
57
  "bull": "^3.10.0",
58
+ "bullmq": "^1.74.2",
58
59
  "camaro": "^6.1.0",
59
60
  "canvas": "^2.9.0",
60
61
  "chromeless": "^1.5.2",
@@ -102,13 +103,14 @@
102
103
  "phantomjs-prebuilt": "^2.1.16",
103
104
  "playwright-core": "^1.17.1",
104
105
  "polyfill-library": "3.93.0",
105
- "prismjs": "^1.25.0",
106
+ "prismjs": "^1.27.0",
106
107
  "pug": "^3.0.1",
107
108
  "react": "^16.14.0",
108
109
  "react-dom": "^16.14.0",
109
110
  "redis": "^3.1.1",
110
111
  "remark-parse": "^10.0.0",
111
112
  "remark-prism": "^1.3.6",
113
+ "rimraf": "^3.0.2",
112
114
  "rxjs": "^6.5.2",
113
115
  "saslprep": "^1.0.3",
114
116
  "semver": "^7.1.1",
@@ -123,7 +125,7 @@
123
125
  "typescript": "^3.9.6",
124
126
  "uglify-js": "^3.6.0",
125
127
  "unified": "^10.1.0",
126
- "vm2": "^3.9.4",
128
+ "vm2": "^3.9.6",
127
129
  "vue": "^2.6.10",
128
130
  "vue-server-renderer": "^2.6.10",
129
131
  "when": "^3.7.8"