Skip to content

Commit

Permalink
Release 0.1.1, using dist/ and few strict fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Mar 21, 2024
1 parent 4fa9b67 commit a77d3b4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions typescript/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
all:
tsc
tsc -d r2pipe/index.ts
# tsc
tsc test-spawn.ts
Expand Down
14 changes: 9 additions & 5 deletions typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "r2pipe-ts",
"version": "0.1.0",
"version": "0.1.1",
"description": "TypeScript r2pipe API",
"type": "commonjs",
"main": "./r2pipe/index.js",
Expand All @@ -18,10 +18,14 @@
},
"files": [
"README.md",
"r2pipe/base.js",
"r2pipe/index.js",
"r2pipe/http.js",
"r2pipe/spawn.js"
"package.json",
"package-lock.json",
"dist/base.js",
"dist/index.js",
"dist/http.js",
"dist/queue.js",
"dist/local.js",
"dist/spawn.js"
],
"keywords": [
"radare",
Expand Down
9 changes: 7 additions & 2 deletions typescript/r2pipe/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ export class R2PipeLocal extends R2PipeBase {
// TODO: we just need the read and write methods, but net.Socket doesnt have path or close()
this.stream = new R2PipeQueue(client, client);
} else {
const IN = parseInt(process.env.R2PIPE_IN);
const OUT = parseInt(process.env.R2PIPE_OUT);
const envIn = process.env.R2PIPE_IN;
const envOut = process.env.R2PIPE_OUT;
if (!envIn || !envOut) {
throw new Error('This script must be executed from r2 -c "#!pipe node foo.js"');
}
const IN = parseInt(envIn);
const OUT = parseInt(envOut);
if (!IN || !OUT) {
throw new Error('This script must be executed from r2 -c "#!pipe node foo.js"');
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/test-http.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tsc test-http.ts
// node --insecure-http-parser test-http.js

import * as r2pipe from "./r2pipe/index.js";
import * as r2pipe from "./dist/index.js";
// import * as r2pipe from "r2pipe-ts";

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion typescript/test-local.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as r2pipe from "./r2pipe/index.js";
import * as r2pipe from "./dist/index.js";
// import * as r2pipe from "r2pipe-ts";

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion typescript/test-spawn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as r2pipe from "./r2pipe/index.js";
import * as r2pipe from "./dist/index.js";
// import * as r2pipe from "r2pipe-ts";

async function main() {
Expand Down
5 changes: 3 additions & 2 deletions typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"compilerOptions": {
"baseUrl": "r2pipe",
"moduleResolution": "nodenext",
"target": "esnext",
"target": "es5",
"esModuleInterop": true,
"resolveJsonModule": true,
"module": "commonjs",
"lib": ["es2017"],
"declaration": true,
"strict": false,
"skipLibCheck": true,
"outDir": "./dist"
"outDir": "./dist",
"rootDir": "./r2pipe"
},
"paths": {
"*": ["node_modules/*", "src/types/*"]
Expand Down

0 comments on commit a77d3b4

Please sign in to comment.