fuigo 1.0.1 → 1.0.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.
@@ -31,10 +31,22 @@ function readLocalVersion() {
31
31
  try { return require('../package.json').version; } catch { return undefined; }
32
32
  }
33
33
 
34
+ // npm's spam filter refuses to CREATE any unscoped package name containing the
35
+ // token `win32-arm64`: 403 "Package name triggered spam detection". Measured,
36
+ // not guessed -- `fuigo-win32-x64`, `fuigo-darwin-arm64` and `fuigo-linux-arm64`
37
+ // all publish fine from the same account, and `fuigo-windows-arm64` with
38
+ // identical os/cpu metadata published minutes after `fuigo-win32-arm64` was
39
+ // refused. So this one package's npm NAME cannot be derived from
40
+ // process.platform/process.arch, and every place that derives it needs this map.
41
+ const PLATFORM_PACKAGE_OVERRIDES = {
42
+ 'win32-arm64': 'fuigo-windows-arm64',
43
+ };
44
+ const platformPackageName = (k) => PLATFORM_PACKAGE_OVERRIDES[k] ?? `fuigo-${k}`;
45
+
34
46
  // Returns null when npm skipped the matching optional dependency
35
47
  // (unsupported platform, or --no-optional).
36
48
  function resolvePlatformPackageDir() {
37
- const platformPkg = `fuigo-${process.platform}-${process.arch}`;
49
+ const platformPkg = platformPackageName(`${process.platform}-${process.arch}`);
38
50
  try {
39
51
  return path.dirname(require.resolve(`${platformPkg}/package.json`));
40
52
  } catch {
@@ -108,7 +120,7 @@ function resolveBinary() {
108
120
  const platformDir = resolvePlatformPackageDir();
109
121
  if (!platformDir) {
110
122
  console.error(`${pkgName}: no platform binary installed for ${process.platform}-${process.arch}.`);
111
- console.error(` Expected sibling package fuigo-${process.platform}-${process.arch}.`);
123
+ console.error(` Expected sibling package ${platformPackageName(`${process.platform}-${process.arch}`)}.`);
112
124
  console.error(` This usually means npm skipped optionalDependencies (e.g. --no-optional)`);
113
125
  console.error(` or the platform is not supported.`);
114
126
  process.exit(1);
@@ -40,12 +40,24 @@ if (!SUPPORTED.has(key)) {
40
40
  process.exit(0);
41
41
  }
42
42
 
43
+ // npm's spam filter refuses to CREATE any unscoped package name containing the
44
+ // token `win32-arm64`: 403 "Package name triggered spam detection". Measured,
45
+ // not guessed -- `fuigo-win32-x64`, `fuigo-darwin-arm64` and `fuigo-linux-arm64`
46
+ // all publish fine from the same account, and `fuigo-windows-arm64` with
47
+ // identical os/cpu metadata published minutes after `fuigo-win32-arm64` was
48
+ // refused. So this one package's npm NAME cannot be derived from
49
+ // process.platform/process.arch, and every place that derives it needs this map.
50
+ const PLATFORM_PACKAGE_OVERRIDES = {
51
+ 'win32-arm64': 'fuigo-windows-arm64',
52
+ };
53
+ const platformPackageName = (k) => PLATFORM_PACKAGE_OVERRIDES[k] ?? `fuigo-${k}`;
54
+
43
55
  // Resolve the per-platform sibling package's directory. The matching
44
56
  // optionalDependency is installed by npm based on `os`/`cpu` filters; the
45
57
  // other five are silently skipped. If the matching one is missing, npm was
46
58
  // likely invoked with --no-optional or the platform is unsupported.
47
59
  function resolvePlatformPackageDir() {
48
- const platformPkg = `fuigo-${key}`;
60
+ const platformPkg = platformPackageName(key);
49
61
  try {
50
62
  return path.dirname(require.resolve(`${platformPkg}/package.json`));
51
63
  } catch {
@@ -180,7 +192,7 @@ function cleanupOldVersions(binName) {
180
192
 
181
193
  const platformDir = resolvePlatformPackageDir();
182
194
  if (!platformDir) {
183
- console.error(`fuigo: platform package fuigo-${key} not installed.`);
195
+ console.error(`fuigo: platform package ${platformPackageName(key)} not installed.`);
184
196
  console.error(' This usually means npm was invoked with --no-optional, or the install failed.');
185
197
  console.error(' Try: npm install -g fuigo');
186
198
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuigo",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Bring Fuigo into your terminal",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -35,11 +35,11 @@
35
35
  "@iarna/toml": "^3.0.0"
36
36
  },
37
37
  "optionalDependencies": {
38
- "fuigo-darwin-arm64": "1.0.1",
39
- "fuigo-darwin-x64": "1.0.1",
40
- "fuigo-linux-arm64": "1.0.1",
41
- "fuigo-linux-x64": "1.0.1",
42
- "fuigo-win32-arm64": "1.0.1",
43
- "fuigo-win32-x64": "1.0.1"
38
+ "fuigo-darwin-arm64": "1.0.3",
39
+ "fuigo-darwin-x64": "1.0.3",
40
+ "fuigo-linux-arm64": "1.0.3",
41
+ "fuigo-linux-x64": "1.0.3",
42
+ "fuigo-windows-arm64": "1.0.3",
43
+ "fuigo-win32-x64": "1.0.3"
44
44
  }
45
45
  }