Skip to content

Commit 75e153c

Browse files
committed
fix(tinyexec): replace require statements to support cjs
- Updated the patch hash for tinyexec@1.0.1 in pnpm-lock.yaml to reflect the latest changes. - Refactored require statements in the tinyexec patch to use standard require syntax for better compatibility and clarity. Signed-off-by: Innei <tukon479@gmail.com>
1 parent 89013ed commit 75e153c

File tree

2 files changed

+88
-6
lines changed

2 files changed

+88
-6
lines changed

patches/tinyexec@1.0.1.patch

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,92 @@
11
diff --git a/dist/main.js b/dist/main.js
2-
index cba25835975aa12fb3e01ee463bc89d7cf51ab92..d13e398b929b329c4f4664b38db6b897b31a257f 100644
2+
index cba25835975aa12fb3e01ee463bc89d7cf51ab92..469896780a581f69e18868a0bdb2c22af1a0ff36 100644
33
--- a/dist/main.js
44
+++ b/dist/main.js
5-
@@ -1,4 +1,4 @@
5+
@@ -1,15 +1,8 @@
66
-import { createRequire as __tinyexec_cr } from "node:module";const require = __tinyexec_cr(import.meta.url);
7-
+
87
var St = Object.create;
98
var $ = Object.defineProperty;
109
var kt = Object.getOwnPropertyDescriptor;
10+
var Tt = Object.getOwnPropertyNames;
11+
var At = Object.getPrototypeOf, Rt = Object.prototype.hasOwnProperty;
12+
-var h = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(t, {
13+
- get: (e, n) => (typeof require < "u" ? require : e)[n]
14+
-}) : t)(function(t) {
15+
- if (typeof require < "u") return require.apply(this, arguments);
16+
- throw Error('Dynamic require of "' + t + '" is not supported');
17+
-});
18+
var l = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
19+
var $t = (t, e, n, r) => {
20+
if (e && typeof e == "object" || typeof e == "function")
21+
@@ -31,7 +24,7 @@ var W = l((Se, H) => {
22+
"use strict";
23+
H.exports = z;
24+
z.sync = Wt;
25+
- var j = h("fs");
26+
+ var j = require("fs");
27+
function Ht(t, e) {
28+
var n = e.pathExt !== void 0 ? e.pathExt : process.env.PATHEXT;
29+
if (!n || (n = n.split(";"), n.indexOf("") !== -1))
30+
@@ -61,7 +54,7 @@ var X = l((ke, B) => {
31+
"use strict";
32+
B.exports = K;
33+
K.sync = Dt;
34+
- var D = h("fs");
35+
+ var D = require("fs");
36+
function K(t, e, n) {
37+
D.stat(t, function(r, s) {
38+
n(r, r ? !1 : M(s, e));
39+
@@ -82,7 +75,7 @@ var X = l((ke, B) => {
40+
// node_modules/isexe/index.js
41+
var U = l((Ae, G) => {
42+
"use strict";
43+
- var Te = h("fs"), v;
44+
+ var Te = require("fs"), v;
45+
process.platform === "win32" || global.TESTING_WINDOWS ? v = W() : v = X();
46+
G.exports = y;
47+
y.sync = Mt;
48+
@@ -114,7 +107,7 @@ var U = l((Ae, G) => {
49+
// node_modules/which/which.js
50+
var et = l((Re, tt) => {
51+
"use strict";
52+
- var g = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = h("path"), Bt = g ? ";" : ":", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: "ENOENT" }), Q = (t, e) => {
53+
+ var g = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = require("path"), Bt = g ? ";" : ":", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: "ENOENT" }), Q = (t, e) => {
54+
let n = e.colon || Bt, r = t.match(/\//) || g && t.match(/\\/) ? [""] : [
55+
// windows always checks the cwd first
56+
...g ? [process.cwd()] : [],
57+
@@ -188,7 +181,7 @@ var rt = l(($e, _) => {
58+
// node_modules/cross-spawn/lib/util/resolveCommand.js
59+
var ct = l((Ne, it) => {
60+
"use strict";
61+
- var st = h("path"), Gt = et(), Ut = rt();
62+
+ var st = require("path"), Gt = et(), Ut = rt();
63+
function ot(t, e) {
64+
let n = t.options.env || process.env, r = process.cwd(), s = t.options.cwd != null, o = s && process.chdir !== void 0 && !process.chdir.disabled;
65+
if (o)
66+
@@ -250,7 +243,7 @@ var dt = l((Le, pt) => {
67+
// node_modules/cross-spawn/lib/util/readShebang.js
68+
var ht = l((je, ft) => {
69+
"use strict";
70+
- var O = h("fs"), Zt = dt();
71+
+ var O = require("fs"), Zt = dt();
72+
function te(t) {
73+
let n = Buffer.alloc(150), r;
74+
try {
75+
@@ -265,7 +258,7 @@ var ht = l((je, ft) => {
76+
// node_modules/cross-spawn/lib/parse.js
77+
var wt = l((Fe, Et) => {
78+
"use strict";
79+
- var ee = h("path"), mt = ct(), gt = ut(), ne = ht(), re = process.platform === "win32", se = /\.(?:com|exe)$/i, oe = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
80+
+ var ee = require("path"), mt = ct(), gt = ut(), ne = ht(), re = process.platform === "win32", se = /\.(?:com|exe)$/i, oe = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
81+
function ie(t) {
82+
t.file = mt(t);
83+
let e = t.file && ne(t.file);
84+
@@ -343,7 +336,7 @@ var bt = l((ze, vt) => {
85+
// node_modules/cross-spawn/index.js
86+
var Ct = l((He, E) => {
87+
"use strict";
88+
- var yt = h("child_process"), T = wt(), A = bt();
89+
+ var yt = require("child_process"), T = wt(), A = bt();
90+
function _t(t, e, n) {
91+
let r = T(t, e, n), s = yt.spawn(r.command, r.args, r.options);
92+
return A.hookChildProcess(s, r), s;

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)