esbuild 0.20.2 → 0.21.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/bin/esbuild +3 -5
- package/install.js +3 -6
- package/lib/main.js +241 -450
- package/package.json +24 -24
package/bin/esbuild
CHANGED
|
@@ -87,16 +87,14 @@ function pkgForSomeOtherPlatform() {
|
|
|
87
87
|
for (const unixKey in knownUnixlikePackages) {
|
|
88
88
|
try {
|
|
89
89
|
const pkg = knownUnixlikePackages[unixKey];
|
|
90
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
|
|
91
|
-
return pkg;
|
|
90
|
+
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
92
91
|
} catch {
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
for (const windowsKey in knownWindowsPackages) {
|
|
96
95
|
try {
|
|
97
96
|
const pkg = knownWindowsPackages[windowsKey];
|
|
98
|
-
if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
|
|
99
|
-
return pkg;
|
|
97
|
+
if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
|
|
100
98
|
} catch {
|
|
101
99
|
}
|
|
102
100
|
}
|
|
@@ -200,7 +198,7 @@ for your current platform.`);
|
|
|
200
198
|
"node_modules",
|
|
201
199
|
".cache",
|
|
202
200
|
"esbuild",
|
|
203
|
-
`pnpapi-${pkg.replace("/", "-")}-${"0.
|
|
201
|
+
`pnpapi-${pkg.replace("/", "-")}-${"0.21.0"}-${path.basename(subpath)}`
|
|
204
202
|
);
|
|
205
203
|
if (!fs.existsSync(binTargetPath)) {
|
|
206
204
|
fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
|
package/install.js
CHANGED
|
@@ -167,8 +167,7 @@ function extractFileFromTarGzip(buffer, subpath) {
|
|
|
167
167
|
let size = parseInt(str(offset + 124, 12), 8);
|
|
168
168
|
offset += 512;
|
|
169
169
|
if (!isNaN(size)) {
|
|
170
|
-
if (name === subpath)
|
|
171
|
-
return buffer.subarray(offset, offset + size);
|
|
170
|
+
if (name === subpath) return buffer.subarray(offset, offset + size);
|
|
172
171
|
offset += size + 511 & ~511;
|
|
173
172
|
}
|
|
174
173
|
}
|
|
@@ -203,10 +202,8 @@ function removeRecursive(dir) {
|
|
|
203
202
|
} catch {
|
|
204
203
|
continue;
|
|
205
204
|
}
|
|
206
|
-
if (stats.isDirectory())
|
|
207
|
-
|
|
208
|
-
else
|
|
209
|
-
fs2.unlinkSync(entryPath);
|
|
205
|
+
if (stats.isDirectory()) removeRecursive(entryPath);
|
|
206
|
+
else fs2.unlinkSync(entryPath);
|
|
210
207
|
}
|
|
211
208
|
fs2.rmdirSync(dir);
|
|
212
209
|
}
|