@tsonic/tsbindgen 0.7.5 → 0.7.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.
package/bin.js CHANGED
@@ -1,56 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
- import { existsSync } from "node:fs";
5
4
  import { dirname, join } from "node:path";
6
5
  import { fileURLToPath } from "node:url";
7
6
 
8
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const dllPath = join(__dirname, "lib", "tsbindgen.dll");
9
9
 
10
- const PLATFORMS = {
11
- "darwin-arm64": "tsbindgen-darwin-arm64",
12
- "darwin-x64": "tsbindgen-darwin-x64",
13
- "linux-arm64": "tsbindgen-linux-arm64",
14
- "linux-x64": "tsbindgen-linux-x64",
15
- };
16
-
17
- const getPlatformKey = () => `${process.platform}-${process.arch}`;
18
-
19
- const findBinary = () => {
20
- const key = getPlatformKey();
21
- const packageName = PLATFORMS[key];
22
-
23
- if (!packageName) {
24
- console.error(`Unsupported platform: ${key}`);
25
- console.error("tsbindgen supports: darwin-arm64, darwin-x64, linux-arm64, linux-x64");
26
- process.exit(1);
27
- }
28
-
29
- const binaryName = "tsbindgen";
30
-
31
- // Search paths for the platform-specific binary
32
- const paths = [
33
- // Nested in this package's node_modules
34
- join(__dirname, "node_modules", "@tsonic", packageName, binaryName),
35
- // Sibling in @tsonic scope (hoisted)
36
- join(__dirname, "..", packageName, binaryName),
37
- // At root node_modules level
38
- join(__dirname, "..", "..", "@tsonic", packageName, binaryName),
39
- ];
40
-
41
- for (const p of paths) {
42
- if (existsSync(p)) {
43
- return p;
44
- }
45
- }
46
-
47
- console.error(`Could not find tsbindgen binary for ${key}`);
48
- console.error(`Package @tsonic/${packageName} may not be installed.`);
49
- process.exit(1);
50
- };
51
-
52
- const binaryPath = findBinary();
53
- const result = spawnSync(binaryPath, process.argv.slice(2), {
10
+ const result = spawnSync("dotnet", [dllPath, ...process.argv.slice(2)], {
54
11
  stdio: "inherit",
55
12
  });
56
13
 
Binary file
@@ -0,0 +1,98 @@
1
+ {
2
+ "runtimeTarget": {
3
+ "name": ".NETCoreApp,Version=v10.0",
4
+ "signature": ""
5
+ },
6
+ "compilationOptions": {},
7
+ "targets": {
8
+ ".NETCoreApp,Version=v10.0": {
9
+ "tsbindgen/1.0.0": {
10
+ "dependencies": {
11
+ "System.CommandLine": "2.0.0-beta4.22272.1",
12
+ "System.Reflection.MetadataLoadContext": "8.0.0"
13
+ },
14
+ "runtime": {
15
+ "tsbindgen.dll": {}
16
+ }
17
+ },
18
+ "System.CommandLine/2.0.0-beta4.22272.1": {
19
+ "runtime": {
20
+ "lib/net6.0/System.CommandLine.dll": {
21
+ "assemblyVersion": "2.0.0.0",
22
+ "fileVersion": "2.0.22.27201"
23
+ }
24
+ },
25
+ "resources": {
26
+ "lib/net6.0/cs/System.CommandLine.resources.dll": {
27
+ "locale": "cs"
28
+ },
29
+ "lib/net6.0/de/System.CommandLine.resources.dll": {
30
+ "locale": "de"
31
+ },
32
+ "lib/net6.0/es/System.CommandLine.resources.dll": {
33
+ "locale": "es"
34
+ },
35
+ "lib/net6.0/fr/System.CommandLine.resources.dll": {
36
+ "locale": "fr"
37
+ },
38
+ "lib/net6.0/it/System.CommandLine.resources.dll": {
39
+ "locale": "it"
40
+ },
41
+ "lib/net6.0/ja/System.CommandLine.resources.dll": {
42
+ "locale": "ja"
43
+ },
44
+ "lib/net6.0/ko/System.CommandLine.resources.dll": {
45
+ "locale": "ko"
46
+ },
47
+ "lib/net6.0/pl/System.CommandLine.resources.dll": {
48
+ "locale": "pl"
49
+ },
50
+ "lib/net6.0/pt-BR/System.CommandLine.resources.dll": {
51
+ "locale": "pt-BR"
52
+ },
53
+ "lib/net6.0/ru/System.CommandLine.resources.dll": {
54
+ "locale": "ru"
55
+ },
56
+ "lib/net6.0/tr/System.CommandLine.resources.dll": {
57
+ "locale": "tr"
58
+ },
59
+ "lib/net6.0/zh-Hans/System.CommandLine.resources.dll": {
60
+ "locale": "zh-Hans"
61
+ },
62
+ "lib/net6.0/zh-Hant/System.CommandLine.resources.dll": {
63
+ "locale": "zh-Hant"
64
+ }
65
+ }
66
+ },
67
+ "System.Reflection.MetadataLoadContext/8.0.0": {
68
+ "runtime": {
69
+ "lib/net8.0/System.Reflection.MetadataLoadContext.dll": {
70
+ "assemblyVersion": "8.0.0.0",
71
+ "fileVersion": "8.0.23.53103"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "libraries": {
78
+ "tsbindgen/1.0.0": {
79
+ "type": "project",
80
+ "serviceable": false,
81
+ "sha512": ""
82
+ },
83
+ "System.CommandLine/2.0.0-beta4.22272.1": {
84
+ "type": "package",
85
+ "serviceable": true,
86
+ "sha512": "sha512-1uqED/q2H0kKoLJ4+hI2iPSBSEdTuhfCYADeJrAqERmiGQ2NNacYKRNEQ+gFbU4glgVyK8rxI+ZOe1onEtr/Pg==",
87
+ "path": "system.commandline/2.0.0-beta4.22272.1",
88
+ "hashPath": "system.commandline.2.0.0-beta4.22272.1.nupkg.sha512"
89
+ },
90
+ "System.Reflection.MetadataLoadContext/8.0.0": {
91
+ "type": "package",
92
+ "serviceable": true,
93
+ "sha512": "sha512-SZxrQ4sQYnIcdwiO3G/lHZopbPYQ2lW0ioT4JezgccWUrKaKbHLJbAGZaDfkYjWcta1pWssAo3MOXLsR0ie4tQ==",
94
+ "path": "system.reflection.metadataloadcontext/8.0.0",
95
+ "hashPath": "system.reflection.metadataloadcontext.8.0.0.nupkg.sha512"
96
+ }
97
+ }
98
+ }
Binary file
@@ -0,0 +1,13 @@
1
+ {
2
+ "runtimeOptions": {
3
+ "tfm": "net10.0",
4
+ "framework": {
5
+ "name": "Microsoft.NETCore.App",
6
+ "version": "10.0.0"
7
+ },
8
+ "configProperties": {
9
+ "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
10
+ "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
11
+ }
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/tsbindgen",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Generate TypeScript declarations from .NET assemblies",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,21 +8,17 @@
8
8
  },
9
9
  "main": "./index.js",
10
10
  "exports": {
11
- ".": "./index.js"
11
+ ".": "./index.js",
12
+ "./bin.js": "./bin.js"
12
13
  },
13
14
  "files": [
14
15
  "bin.js",
15
16
  "index.js",
17
+ "lib",
16
18
  "README.md"
17
19
  ],
18
20
  "scripts": {
19
- "build": "./scripts/build-native.sh"
20
- },
21
- "optionalDependencies": {
22
- "@tsonic/tsbindgen-darwin-arm64": "0.7.4",
23
- "@tsonic/tsbindgen-darwin-x64": "0.7.4",
24
- "@tsonic/tsbindgen-linux-arm64": "0.7.4",
25
- "@tsonic/tsbindgen-linux-x64": "0.7.4"
21
+ "build": "dotnet publish src/tsbindgen/tsbindgen.csproj -c Release -o lib/"
26
22
  },
27
23
  "keywords": [
28
24
  "tsonic",