@rspack/test-tools 2.0.6 → 2.0.7
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/runner/node/index.js +20 -1
- package/package.json +5 -5
|
@@ -375,8 +375,27 @@ var __webpack_exports__ = {};
|
|
|
375
375
|
meta.dirname = external_node_path_default().dirname(file.path);
|
|
376
376
|
meta.filename = file.path;
|
|
377
377
|
},
|
|
378
|
-
importModuleDynamically: async (specifier, module)=>{
|
|
378
|
+
importModuleDynamically: async (specifier, module, importAttributes)=>{
|
|
379
379
|
this.log(`import: ${specifier} from ${file?.path}`);
|
|
380
|
+
if (importAttributes?.type === 'bytes') {
|
|
381
|
+
const request = String(specifier).split('?')[0];
|
|
382
|
+
const importedFile = this.getFile(request, external_node_path_default().dirname(file.path));
|
|
383
|
+
if (!importedFile) throw new Error(`Bytes import not found: ${request}`);
|
|
384
|
+
const Uint8ArrayInContext = external_node_vm_default().runInContext('Uint8Array', module.context);
|
|
385
|
+
const bytes = new Uint8ArrayInContext(external_node_fs_default().readFileSync(importedFile.path));
|
|
386
|
+
const bytesModule = new (external_node_vm_default()).SyntheticModule([
|
|
387
|
+
'default'
|
|
388
|
+
], function() {
|
|
389
|
+
this.setExport('default', bytes);
|
|
390
|
+
}, {
|
|
391
|
+
context: module.context
|
|
392
|
+
});
|
|
393
|
+
await bytesModule.link(()=>{
|
|
394
|
+
throw new Error('Unexpected import in bytes module');
|
|
395
|
+
});
|
|
396
|
+
await bytesModule.evaluate();
|
|
397
|
+
return bytesModule;
|
|
398
|
+
}
|
|
380
399
|
const result = await _require(external_node_path_default().dirname(file.path), specifier, {
|
|
381
400
|
esmMode: external_type_js_namespaceObject.EEsmMode.Evaluated
|
|
382
401
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/test-tools",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Test tools for rspack",
|
|
5
5
|
"homepage": "https://rspack.rs",
|
|
6
6
|
"bugs": "https://github.com/web-infra-dev/rspack/issues",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"fs-extra": "^11.3.5",
|
|
44
44
|
"iconv-lite": "^0.7.2",
|
|
45
45
|
"javascript-stringify": "^2.1.0",
|
|
46
|
-
"jest-diff": "^30.
|
|
46
|
+
"jest-diff": "^30.4.1",
|
|
47
47
|
"jsdom": "^26.1.0",
|
|
48
|
-
"memfs": "4.57.
|
|
48
|
+
"memfs": "4.57.6",
|
|
49
49
|
"path-serializer": "0.6.0",
|
|
50
|
-
"pretty-format": "30.
|
|
50
|
+
"pretty-format": "30.4.1",
|
|
51
51
|
"rimraf": "^5.0.10",
|
|
52
52
|
"rspack-merge": "0.1.1",
|
|
53
53
|
"source-map": "^0.7.6",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@types/fs-extra": "11.0.4",
|
|
63
63
|
"@types/jsdom": "^21.1.7",
|
|
64
64
|
"typescript": "^6.0.3",
|
|
65
|
-
"@rspack/core": "2.0.
|
|
65
|
+
"@rspack/core": "2.0.7"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@rspack/core": ">=1.0.0"
|