@stryke/capnp 0.2.6 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/capnp",
3
- "version": "0.2.6",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "A package to assist in running the Cap'n Proto compiler and creating Cap'n Proto serialization protocol schemas.",
6
6
  "repository": {
@@ -8,37 +8,11 @@
8
8
  "url": "https://github.com/storm-software/stryke",
9
9
  "directory": "packages/capnp"
10
10
  },
11
- "private": false,
12
- "keywords": [
13
- "capnp",
14
- "capnproto",
15
- "serialization",
16
- "protocol",
17
- "compiler",
18
- "storm-software",
19
- "stryke"
20
- ],
21
- "peerDependencies": { "typescript": ">=4.0.0" },
22
- "peerDependenciesMeta": { "typescript": { "optional": false } },
23
- "dependencies": {
24
- "@stryke/fs": "^0.20.5",
25
- "@stryke/path": "^0.7.5",
26
- "capnp-es": "^0.0.9"
27
- },
28
- "devDependencies": { "@types/node": "^22.14.0" },
29
- "publishConfig": { "access": "public" },
30
- "sideEffects": false,
31
- "files": ["dist/**/*"],
32
11
  "homepage": "https://stormsoftware.com",
33
12
  "bugs": {
34
13
  "url": "https://stormsoftware.com/support",
35
14
  "email": "support@stormsoftware.com"
36
15
  },
37
- "license": "Apache-2.0",
38
- "funding": {
39
- "type": "github",
40
- "url": "https://github.com/sponsors/storm-software"
41
- },
42
16
  "author": {
43
17
  "name": "Storm Software",
44
18
  "email": "contact@stormsoftware.com",
@@ -58,48 +32,89 @@
58
32
  "url": "https://stormsoftware.com"
59
33
  }
60
34
  ],
35
+ "funding": {
36
+ "type": "github",
37
+ "url": "https://github.com/sponsors/storm-software"
38
+ },
39
+ "license": "Apache-2.0",
40
+ "private": false,
41
+ "bin": {
42
+ "storm-capnpc": "bin/capnpc.js",
43
+ "storm-capnpc-cjs": "bin/capnpc.cjs",
44
+ "storm-capnpc-esm": "bin/capnpc.js"
45
+ },
46
+ "main": "./dist/index.cjs",
47
+ "module": "./dist/index.js",
61
48
  "exports": {
62
- "./types": {
63
- "import": { "types": "./dist/types.d.ts", "default": "./dist/types.mjs" },
49
+ ".": {
50
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
64
51
  "require": {
65
- "types": "./dist/types.d.ts",
66
- "default": "./dist/types.cjs"
52
+ "types": "./dist/index.d.cts",
53
+ "default": "./dist/index.cjs"
67
54
  },
68
- "default": { "types": "./dist/types.d.ts", "default": "./dist/types.mjs" }
55
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
69
56
  },
70
57
  "./index": {
71
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
58
+ "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
72
59
  "require": {
73
- "types": "./dist/index.d.ts",
60
+ "types": "./dist/index.d.cts",
74
61
  "default": "./dist/index.cjs"
75
62
  },
76
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
63
+ "default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
77
64
  },
78
65
  "./compile": {
79
66
  "import": {
80
67
  "types": "./dist/compile.d.ts",
81
- "default": "./dist/compile.mjs"
68
+ "default": "./dist/compile.js"
82
69
  },
83
70
  "require": {
84
- "types": "./dist/compile.d.ts",
71
+ "types": "./dist/compile.d.cts",
85
72
  "default": "./dist/compile.cjs"
86
73
  },
87
74
  "default": {
88
75
  "types": "./dist/compile.d.ts",
89
- "default": "./dist/compile.mjs"
76
+ "default": "./dist/compile.js"
90
77
  }
91
78
  },
92
- ".": {
93
- "import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" },
79
+ "./rpc": {
80
+ "import": { "types": "./dist/rpc.d.ts", "default": "./dist/rpc.js" },
81
+ "require": { "types": "./dist/rpc.d.cts", "default": "./dist/rpc.cjs" },
82
+ "default": { "types": "./dist/rpc.d.ts", "default": "./dist/rpc.js" }
83
+ },
84
+ "./types": {
85
+ "import": { "types": "./dist/types.d.ts", "default": "./dist/types.js" },
94
86
  "require": {
95
- "types": "./dist/index.d.ts",
96
- "default": "./dist/index.cjs"
87
+ "types": "./dist/types.d.cts",
88
+ "default": "./dist/types.cjs"
97
89
  },
98
- "default": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }
90
+ "default": { "types": "./dist/types.d.ts", "default": "./dist/types.js" }
99
91
  },
100
92
  "./package.json": "./package.json"
101
93
  },
102
- "main": "./dist/index.cjs",
103
- "module": "./dist/index.mjs",
104
- "types": "./dist/index.d.ts"
94
+ "types": "./dist/index.d.ts",
95
+ "files": ["dist/**/*"],
96
+ "keywords": [
97
+ "capnp",
98
+ "capnproto",
99
+ "serialization",
100
+ "protocol",
101
+ "compiler",
102
+ "storm-software",
103
+ "stryke"
104
+ ],
105
+ "peerDependencies": { "typescript": ">=4.0.0" },
106
+ "peerDependenciesMeta": { "typescript": { "optional": false } },
107
+ "dependencies": {
108
+ "@stryke/fs": "^0.20.6",
109
+ "@stryke/path": "^0.7.5",
110
+ "capnp-es": "^0.0.11"
111
+ },
112
+ "devDependencies": {
113
+ "@storm-software/config": "latest",
114
+ "@storm-software/config-tools": "latest",
115
+ "@types/node": "^22.14.0",
116
+ "chalk": "^5.4.1",
117
+ "commander": "^14.0.0"
118
+ },
119
+ "publishConfig": { "access": "public" }
105
120
  }
package/dist/compile.mjs DELETED
@@ -1 +0,0 @@
1
- import{createDirectory as w}from"@stryke/fs/helpers";import{writeFile as y}from"@stryke/fs/write-file";import{findFilePath as p}from"@stryke/path/file-path-fns";import{joinPaths as g}from"@stryke/path/join-paths";import{compileAll as B}from"capnp-es/compiler";import{Buffer as m}from"node:buffer";import{exec as P}from"node:child_process";import{existsSync as h}from"node:fs";async function k(){if(process.stdin.isTTY)return m.alloc(0);const i=[];process.stdin.on("data",t=>{i.push(t)}),await new Promise(t=>{process.stdin.on("end",t)});const e=m.alloc(i.reduce((t,n)=>t+n.byteLength,0));let c=0;for(const t of i)t.copy(e,c),c+=t.byteLength;return e}export async function capnpc(i){try{const{ts:e=!0,js:c=!1,dts:t=!1,outDir:n,tsconfig:d}=i;let f=await k();if(f.byteLength===0){const o=[];n?o.push(`-o-:${n}`):o.push("-o-"),f=await new Promise(a=>{P(`capnpc ${o.join(" ")} ${o.join(" ")}`,{encoding:"buffer"},(r,s,u)=>{if(u.length>0&&process.stderr.write(u),r)throw r;a(s)})})}const l=await B(f,{ts:e,js:c,dts:t,tsconfig:d});for(const[o,a]of l.files){let r=o;if(!h(p(r))){const s=`/${r}`;h(p(s))&&(r=s)}n&&(r=g(n,o)),await w(p(r)),await y(r,a.replace(/^\s+/gm,s=>" ".repeat(s.length/2)))}return l}catch(e){throw e instanceof Error?(console.error(`Error: ${e.message}`),e.stack&&console.error(e.stack)):console.error("An unknown error occurred:",e),e}}
package/dist/index.mjs DELETED
@@ -1 +0,0 @@
1
- export*from"./compile";export*from"./types";
File without changes