codemod 1.15.1 → 1.15.3

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.
Files changed (2) hide show
  1. package/codemod +9 -4
  2. package/package.json +8 -6
package/codemod CHANGED
@@ -7,8 +7,11 @@ const path = require("path");
7
7
  const binaryName = process.platform === "win32" ? "codemod.exe" : "codemod";
8
8
  const CODEMOD_BOOTSTRAPPED_ENV = "CODEMOD_BOOTSTRAPPED";
9
9
 
10
- function detectPackageName() {
11
- const { platform, arch } = process;
10
+ function detectPackageName({
11
+ platform = process.platform,
12
+ arch = process.arch,
13
+ libcFamily,
14
+ } = {}) {
12
15
 
13
16
  switch (platform) {
14
17
  case "darwin":
@@ -20,9 +23,10 @@ function detectPackageName() {
20
23
  }
21
24
  break;
22
25
  case "linux": {
23
- const { family, MUSL } = require("detect-libc");
26
+ const { familySync, MUSL } = require("detect-libc");
27
+ const detectedLibcFamily = libcFamily ?? familySync();
24
28
  const libcSuffix =
25
- family === MUSL ? "musl" : arch === "arm" ? "gnueabihf" : "gnu";
29
+ detectedLibcFamily === MUSL ? "musl" : arch === "arm" ? "gnueabihf" : "gnu";
26
30
  if (arch === "x64") {
27
31
  return `@codemod.com/cli-linux-x64-${libcSuffix}`;
28
32
  }
@@ -234,6 +238,7 @@ if (require.main === module) {
234
238
 
235
239
  module.exports = {
236
240
  CODEMOD_BOOTSTRAPPED_ENV,
241
+ detectPackageName,
237
242
  latestBootstrapArgs,
238
243
  npmExecutable,
239
244
  shouldBootstrapLatestNoCommand,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemod",
3
- "version": "1.15.1",
3
+ "version": "1.15.3",
4
4
  "description": "Codemod platform for semantic code transformations",
5
5
  "keywords": [
6
6
  "ast",
@@ -26,11 +26,13 @@
26
26
  "detect-libc": "^2.0.3"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@codemod.com/cli-darwin-arm64": "1.15.1",
30
- "@codemod.com/cli-darwin-x64": "1.15.1",
31
- "@codemod.com/cli-linux-arm64-gnu": "1.15.1",
32
- "@codemod.com/cli-linux-x64-gnu": "1.15.1",
33
- "@codemod.com/cli-win32-x64-msvc": "1.15.1"
29
+ "@codemod.com/cli-darwin-arm64": "1.15.3",
30
+ "@codemod.com/cli-darwin-x64": "1.15.3",
31
+ "@codemod.com/cli-linux-arm64-gnu": "1.15.3",
32
+ "@codemod.com/cli-linux-arm64-musl": "1.15.3",
33
+ "@codemod.com/cli-linux-x64-gnu": "1.15.3",
34
+ "@codemod.com/cli-linux-x64-musl": "1.15.3",
35
+ "@codemod.com/cli-win32-x64-msvc": "1.15.3"
34
36
  },
35
37
  "engines": {
36
38
  "node": ">= 16.0.0"