@atlaspack/node-resolver-core 3.4.2-dev.3666 → 3.4.2-dev.3674
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/lib/Wrapper.js +23 -8
- package/package.json +7 -7
package/lib/Wrapper.js
CHANGED
@@ -61,6 +61,13 @@ function _module() {
|
|
61
61
|
};
|
62
62
|
return data;
|
63
63
|
}
|
64
|
+
function _featureFlags() {
|
65
|
+
const data = require("@atlaspack/feature-flags");
|
66
|
+
_featureFlags = function () {
|
67
|
+
return data;
|
68
|
+
};
|
69
|
+
return data;
|
70
|
+
}
|
64
71
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
65
72
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
66
73
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
@@ -86,10 +93,17 @@ class NodeResolver {
|
|
86
93
|
let resolver = this.resolversByEnv.get(options.env.id);
|
87
94
|
if (!resolver) {
|
88
95
|
await (_rust().init === null || _rust().init === void 0 ? void 0 : (0, _rust().init)());
|
96
|
+
const useNativeFs = this.options.fs instanceof _fs().NodeFS && process.versions.pnp == null &&
|
97
|
+
// For Wasm builds
|
98
|
+
!_rust().init;
|
99
|
+
if (!useNativeFs && process.env.NODE_ENV !== 'test') {
|
100
|
+
var _this$options$logger;
|
101
|
+
(_this$options$logger = this.options.logger) === null || _this$options$logger === void 0 || _this$options$logger.warn({
|
102
|
+
message: 'Using JavaScript file system for resolution. This should not be used in other than internal atlaspack tests.'
|
103
|
+
});
|
104
|
+
}
|
89
105
|
resolver = new (_rust().Resolver)(this.options.projectRoot, {
|
90
|
-
fs:
|
91
|
-
// For Wasm builds
|
92
|
-
!_rust().init ? undefined : {
|
106
|
+
fs: useNativeFs ? undefined : {
|
93
107
|
canonicalize: path => this.options.fs.realpathSync(path),
|
94
108
|
read: path => this.options.fs.readFileSync(path),
|
95
109
|
isFile: path => this.options.fs.statSync(path).isFile(),
|
@@ -107,7 +121,8 @@ class NodeResolver {
|
|
107
121
|
return pnp.resolveToUnqualified(
|
108
122
|
// append slash to force loading builtins from npm
|
109
123
|
module + '/', from);
|
110
|
-
} : undefined
|
124
|
+
} : undefined,
|
125
|
+
reduceStringCreation: (0, _featureFlags().getFeatureFlag)('reduceResolverStringCreation')
|
111
126
|
});
|
112
127
|
this.resolversByEnv.set(options.env.id, resolver);
|
113
128
|
}
|
@@ -225,8 +240,8 @@ class NodeResolver {
|
|
225
240
|
if ((resolved === null || resolved === void 0 ? void 0 : resolved.filePath) == null) {
|
226
241
|
// Auto install the Node builtin polyfills
|
227
242
|
if (this.options.shouldAutoInstall && packageManager) {
|
228
|
-
var _this$options$
|
229
|
-
(_this$options$
|
243
|
+
var _this$options$logger2;
|
244
|
+
(_this$options$logger2 = this.options.logger) === null || _this$options$logger2 === void 0 || _this$options$logger2.warn({
|
230
245
|
message: (0, _diagnostic().md)`Auto installing polyfill for Node builtin module "${packageName}"...`,
|
231
246
|
codeFrames: options.loc ? [{
|
232
247
|
filePath: options.loc.filePath,
|
@@ -273,8 +288,8 @@ class NodeResolver {
|
|
273
288
|
range: builtin.range
|
274
289
|
}));
|
275
290
|
} catch (e) {
|
276
|
-
var _this$options$
|
277
|
-
(_this$options$
|
291
|
+
var _this$options$logger3;
|
292
|
+
(_this$options$logger3 = this.options.logger) === null || _this$options$logger3 === void 0 || _this$options$logger3.warn((0, _diagnostic().errorToDiagnostic)(e));
|
278
293
|
}
|
279
294
|
}
|
280
295
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/node-resolver-core",
|
3
|
-
"version": "3.4.2-dev.
|
3
|
+
"version": "3.4.2-dev.3674+d7732a10a",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -21,11 +21,11 @@
|
|
21
21
|
"lib"
|
22
22
|
],
|
23
23
|
"dependencies": {
|
24
|
-
"@atlaspack/diagnostic": "2.13.2-dev.
|
25
|
-
"@atlaspack/feature-flags": "2.13.2-dev.
|
26
|
-
"@atlaspack/fs": "2.13.2-dev.
|
27
|
-
"@atlaspack/rust": "2.13.2-dev.
|
28
|
-
"@atlaspack/utils": "2.13.2-dev.
|
24
|
+
"@atlaspack/diagnostic": "2.13.2-dev.3674+d7732a10a",
|
25
|
+
"@atlaspack/feature-flags": "2.13.2-dev.3674+d7732a10a",
|
26
|
+
"@atlaspack/fs": "2.13.2-dev.3674+d7732a10a",
|
27
|
+
"@atlaspack/rust": "2.13.2-dev.3674+d7732a10a",
|
28
|
+
"@atlaspack/utils": "2.13.2-dev.3674+d7732a10a",
|
29
29
|
"@mischnic/json-sourcemap": "^0.1.0",
|
30
30
|
"nullthrows": "^1.1.1",
|
31
31
|
"semver": "^7.5.2"
|
@@ -57,5 +57,5 @@
|
|
57
57
|
"browser": {
|
58
58
|
"./src/builtins.js": "./src/builtins.browser.js"
|
59
59
|
},
|
60
|
-
"gitHead": "
|
60
|
+
"gitHead": "d7732a10a9a123de06d5eedcf9800d621e740229"
|
61
61
|
}
|