Skip to content

Commit 1209ce0

Browse files
committed
Upgrade modules
1 parent 6bb15ce commit 1209ce0

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"version": "tsds version"
4545
},
4646
"dependencies": {
47-
"cross-spawn-cb": "^2.0.13",
47+
"cross-spawn-cb": "^2.1.0",
4848
"exit": "^0.1.2",
4949
"getopts-compat": "^2.2.5",
5050
"queue-cb": "^1.4.10",

src/filterExperimental.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// https://github.com/yarnpkg/berry/blob/2cf0a8fe3e4d4bd7d4d344245d24a85a45d4c5c9/packages/yarnpkg-pnp/sources/loader/applyPatch.ts#L414-L435
2+
const originalEmit = process.emit;
3+
process.emit = (name, data) => {
4+
if (name === 'warning' && typeof data === 'object' && data.name === 'ExperimentalWarning' && (data.message.includes('--experimental-loader') || data.message.includes('Custom ESM Loaders is an experimental feature'))) return false;
5+
// biome-ignore lint/style/noArguments: <explanation>
6+
return originalEmit.apply(process, arguments);
7+
};

src/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './filterExperimental.cjs';
12
import worker from './worker';
23

34
export default function disDat(commands, options, callback) {

src/worker.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ const spawn = require('cross-spawn-cb');
44

55
const bracketsRegEx = /\{([\s\S]*)\}/;
66

7+
// https://github.com/yarnpkg/berry/blob/2cf0a8fe3e4d4bd7d4d344245d24a85a45d4c5c9/packages/yarnpkg-pnp/sources/loader/applyPatch.ts#L414-L435
8+
const originalEmit = process.emit;
9+
// @ts-expect-error - TS complains about the return type of originalEmit.apply
10+
process.emit = (name, data, ..._args) => {
11+
if (name === 'warning' && typeof data === 'object' && data.name === 'ExperimentalWarning' && (data.message.includes('--experimental-loader') || data.message.includes('Custom ESM Loaders is an experimental feature'))) return false;
12+
13+
return originalEmit.call(process, name, data, ..._args);
14+
};
15+
716
module.exports = function run(commands, options, callback) {
817
const spawnOptions = { cwd: process.cwd(), ...options };
918
let results = [];

0 commit comments

Comments
 (0)