@coreason-ai/coreason-urn-authority 0.44.0 → 0.44.7

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 (3) hide show
  1. package/README.md +15 -0
  2. package/bin/run.js +43 -0
  3. package/package.json +27 -8
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @coreason-ai/coreason-urn-authority
2
+
3
+ NPM wrapper for the CoReason URN Authority CLI.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @coreason-ai/coreason-urn-authority
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ urn-authority --help
15
+ ```
package/bin/run.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const platform = os.platform();
8
+ const arch = os.arch();
9
+
10
+ let packageName = '';
11
+ let binaryName = 'urn-authority';
12
+
13
+ if (platform === 'linux' && arch === 'x64') {
14
+ packageName = '@coreason-ai/coreason-urn-authority-linux-x64';
15
+ } else if (platform === 'darwin' && arch === 'x64') {
16
+ packageName = '@coreason-ai/coreason-urn-authority-darwin-x64';
17
+ } else if (platform === 'darwin' && arch === 'arm64') {
18
+ packageName = '@coreason-ai/coreason-urn-authority-darwin-arm64';
19
+ } else if (platform === 'win32' && arch === 'x64') {
20
+ packageName = '@coreason-ai/coreason-urn-authority-win32-x64';
21
+ binaryName = 'urn-authority.exe';
22
+ } else {
23
+ console.error(`Unsupported platform/architecture: ${platform}/${arch}`);
24
+ process.exit(1);
25
+ }
26
+
27
+ let binaryPath;
28
+ try {
29
+ binaryPath = require.resolve(`${packageName}/bin/${binaryName}`);
30
+ } catch (e) {
31
+ // Fallback for local development or missing optionalDependencies
32
+ binaryPath = path.join(__dirname, '..', '..', '..', 'target', 'release', binaryName);
33
+ }
34
+
35
+ const args = process.argv.slice(2);
36
+ const result = spawnSync(binaryPath, args, { stdio: 'inherit' });
37
+
38
+ if (result.error) {
39
+ console.error(`Failed to execute binary at ${binaryPath}:`, result.error.message);
40
+ process.exit(1);
41
+ }
42
+
43
+ process.exit(result.status ?? 0);
package/package.json CHANGED
@@ -1,8 +1,27 @@
1
- {
2
- "publishConfig": {
3
- "access": "public",
4
- "registry": "https://registry.npmjs.org/"
5
- },
6
- "name": "@coreason-ai/coreason-urn-authority",
7
- "version": "0.44.0"
8
- }
1
+ {
2
+ "name": "@coreason-ai/coreason-urn-authority",
3
+ "version": "0.44.7",
4
+ "description": "NPM wrapper for the CoReason URN Authority CLI",
5
+ "main": "bin/run.js",
6
+ "bin": {
7
+ "urn-authority": "bin/run.js"
8
+ },
9
+ "files": [
10
+ "bin/run.js"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/CoReason-AI/coreason-urn-authority.git",
15
+ "directory": "bindings/npm"
16
+ },
17
+ "homepage": "https://github.com/CoReason-AI/coreason-urn-authority",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "optionalDependencies": {
22
+ "@coreason-ai/coreason-urn-authority-linux-x64": "0.44.7",
23
+ "@coreason-ai/coreason-urn-authority-darwin-x64": "0.44.7",
24
+ "@coreason-ai/coreason-urn-authority-darwin-arm64": "0.44.7",
25
+ "@coreason-ai/coreason-urn-authority-win32-x64": "0.44.7"
26
+ }
27
+ }