qrlkit 0.5.2 → 0.6.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/qrlkit.cjs CHANGED
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require('node:child_process');
3
- const platforms = require('../platforms.cjs');
3
+ const { optionalDependencies } = require('../package.json');
4
4
 
5
5
  const platform = `${process.platform}-${process.arch}`;
6
- if (!platforms[platform]) {
7
- console.error(`qrlkit: unsupported platform ${platform}. Supported: ${Object.keys(platforms).join(', ')}.`);
6
+ const packageName = `qrlkit-${platform}`;
7
+ if (!Object.hasOwn(optionalDependencies, packageName)) {
8
+ const supported = Object.keys(optionalDependencies).map((name) => name.slice('qrlkit-'.length));
9
+ console.error(`qrlkit: unsupported platform ${platform}. Supported: ${supported.join(', ')}.`);
8
10
  process.exit(1);
9
11
  }
10
12
 
11
- const packageName = `qrlkit-${platform}`;
12
13
  let binary;
13
14
  try {
14
15
  binary = require.resolve(`${packageName}/bin/qrlkit`);
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "qrlkit",
3
- "version": "0.5.2",
4
3
  "description": "Quick Resource Locator CLI",
5
4
  "bin": {
6
5
  "qrlkit": "bin/qrlkit.cjs"
7
6
  },
8
7
  "files": [
9
- "bin/qrlkit.cjs",
10
- "platforms.cjs"
8
+ "bin/qrlkit.cjs"
11
9
  ],
10
+ "optionalDependencies": {
11
+ "qrlkit-darwin-arm64": "0.6.0",
12
+ "qrlkit-darwin-x64": "0.6.0",
13
+ "qrlkit-linux-arm64": "0.6.0",
14
+ "qrlkit-linux-x64": "0.6.0"
15
+ },
12
16
  "os": [
13
17
  "linux",
14
18
  "darwin"
@@ -29,10 +33,5 @@
29
33
  "bugs": {
30
34
  "url": "https://github.com/qrlkit/qrlkit-rs/issues"
31
35
  },
32
- "optionalDependencies": {
33
- "qrlkit-linux-x64": "0.5.2",
34
- "qrlkit-linux-arm64": "0.5.2",
35
- "qrlkit-darwin-x64": "0.5.2",
36
- "qrlkit-darwin-arm64": "0.5.2"
37
- }
36
+ "version": "0.6.0"
38
37
  }
package/platforms.cjs DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- 'linux-x64': 'x86_64-unknown-linux-musl',
3
- 'linux-arm64': 'aarch64-unknown-linux-musl',
4
- 'darwin-x64': 'x86_64-apple-darwin',
5
- 'darwin-arm64': 'aarch64-apple-darwin',
6
- };