@vercel/nft 0.22.6 → 0.23.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/out/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './types';
2
2
  export { nodeFileTrace } from './node-file-trace';
3
+ import resolveDependency from './resolve-dependency';
4
+ export { resolveDependency as resolve };
package/out/index.js CHANGED
@@ -13,8 +13,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
16
19
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.nodeFileTrace = void 0;
20
+ exports.resolve = exports.nodeFileTrace = void 0;
18
21
  __exportStar(require("./types"), exports);
19
22
  var node_file_trace_1 = require("./node-file-trace");
20
23
  Object.defineProperty(exports, "nodeFileTrace", { enumerable: true, get: function () { return node_file_trace_1.nodeFileTrace; } });
24
+ const resolve_dependency_1 = __importDefault(require("./resolve-dependency"));
25
+ exports.resolve = resolve_dependency_1.default;
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,8EAAqD;AACvB,kBADvB,4BAAiB,CACa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/nft",
3
- "version": "0.22.6",
3
+ "version": "0.23.0",
4
4
  "repository": "vercel/nft",
5
5
  "license": "MIT",
6
6
  "main": "./out/index.js",
@@ -12,8 +12,7 @@
12
12
  "build": "tsc",
13
13
  "prepublishOnly": "tsc && rm out/utils/*.d.ts && rm out/tsconfig.tsbuildinfo",
14
14
  "test": "jest --verbose",
15
- "test-verbose": "tsc --sourceMap && jest --verbose --coverage --globals \"{\\\"coverage\\\":true}\"",
16
- "codecov": "codecov"
15
+ "test-verbose": "tsc --sourceMap && jest --verbose --coverage --globals \"{\\\"coverage\\\":true}\""
17
16
  },
18
17
  "files": [
19
18
  "out"
@@ -49,7 +48,7 @@
49
48
  "analytics-node": "^3.4.0-beta.1",
50
49
  "apollo-server-express": "^2.14.2",
51
50
  "argon2": "^0.27.2",
52
- "auth0": "^2.27.1",
51
+ "auth0": "^3.0.1",
53
52
  "axios": "^0.21.2",
54
53
  "azure-storage": "^2.10.3",
55
54
  "bcrypt": "^5.0.1",
@@ -59,7 +58,6 @@
59
58
  "camaro": "^6.1.0",
60
59
  "canvas": "^2.10.2",
61
60
  "chromeless": "^1.5.2",
62
- "codecov": "^3.8.1",
63
61
  "consolidate": "^0.15.1",
64
62
  "copy": "^0.3.2",
65
63
  "cowsay": "^1.4.0",
@@ -70,7 +68,7 @@
70
68
  "fast-glob": "^3.1.1",
71
69
  "fetch-h2": "^2.2.0",
72
70
  "firebase": "^7",
73
- "firebase-admin": "^9.7.0",
71
+ "firebase-admin": "^11.4.1",
74
72
  "fluent-ffmpeg": "^2.1.2",
75
73
  "geo-tz": "^7.0.1",
76
74
  "graphql": "^14.4.2",
@@ -89,7 +87,7 @@
89
87
  "mariadb": "^2.0.5",
90
88
  "memcached": "^2.2.2",
91
89
  "microtime": "^3.0.0",
92
- "mongoose": "^5.7.5",
90
+ "mongoose": "^5.13.15",
93
91
  "mysql": "^2.17.1",
94
92
  "npm": "^6.14.6",
95
93
  "oracledb": "^4.2.0",
@@ -115,19 +113,19 @@
115
113
  "rimraf": "^3.0.2",
116
114
  "rxjs": "^6.5.2",
117
115
  "saslprep": "^1.0.3",
118
- "semver": "^7.1.1",
119
- "sequelize": "^5.9.3",
116
+ "semver": "^7.5.2",
117
+ "sequelize": "^6.29.0",
120
118
  "sharp": "^0.30.5",
121
119
  "socket.io": "^2.4.0",
122
120
  "socket.io-client": "^2.2.0",
123
121
  "stripe": "^7.4.0",
124
122
  "swig": "^1.4.2",
125
123
  "tiny-json-http": "^7.1.2",
126
- "twilio": "^3.33.0",
124
+ "twilio": "^3.84.0",
127
125
  "typescript": "^4.8.4",
128
126
  "uglify-js": "^3.6.0",
129
127
  "unified": "^10.1.0",
130
- "vm2": "^3.9.11",
128
+ "vm2": "^3.9.18",
131
129
  "vue": "^2.6.10",
132
130
  "vue-server-renderer": "^2.6.10",
133
131
  "when": "^3.7.8"
package/readme.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Node File Trace
2
2
 
3
3
  [![CI Status](https://github.com/vercel/nft/actions/workflows/ci.yml/badge.svg)](https://github.com/vercel/nft/actions/workflows/ci.yml)
4
- [![Code Coverage](https://badgen.net/codecov/c/github/vercel/nft)](https://codecov.io/gh/vercel/nft)
5
4
 
6
5
  Used to determine exactly which files (including `node_modules`) are necessary for the application runtime.
7
6
 
@@ -110,6 +109,25 @@ The following FS functions can be hooked by passing them as options:
110
109
  * `readlink(path): Promise<string>`
111
110
  * `resolve(id: string, parent: string): Promise<string | string[]>`
112
111
 
112
+ ##### Advanced Resolving
113
+
114
+ When providing a custom resolve hook you are responsible for returning one or more absolute paths to resolved files based on the `id` input. However it may be the case that you only want to augment or override the resolve behavior in certain cases. You can use `nft`'s underlying resolver by importing it. The builtin `resolve` function expects additional arguments that need to be forwarded from the hook
115
+
116
+ * `resolve(id: string, parent: string, job: Job, isCjs: boolean): Promise<string | string[]>`
117
+
118
+ Here is an example showing one id being resolved to a bespoke path while all other paths being resolved by the built-in resolver
119
+ ```js
120
+ const { nodeFileTrace, resolve } = require('@vercel/nft');
121
+ const files = ['./src/main.js', './src/second.js'];
122
+ const { fileList } = await nodeFileTrace(files, { resolve: async (id, parent, job, isCjs) => {
123
+ if (id === './src/main.js') {
124
+ return '/path/to/some/resolved/main/file.js'
125
+ } else {
126
+ return resolve(id, parent, job, isCjs)
127
+ }
128
+ }});
129
+ ```
130
+
113
131
  #### TypeScript
114
132
 
115
133
  The internal resolution supports resolving `.ts` files in traces by default.