Skip to content

Commit

Permalink
Skeleton for the ts rewrite of r2pipe.js
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 16, 2023
1 parent 6c3968b commit 955a6da
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 0 deletions.
4 changes: 4 additions & 0 deletions typescript/r2pipe/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all:
tsc -d index.ts
tsc
make -C examples/hello
7 changes: 7 additions & 0 deletions typescript/r2pipe/examples/hello/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all:
rm -f r2pipe
ln -fs ../.. r2pipe
r2frida-compile -So index.r2.js index.ts
r2 -qi index.r2.js -
tsc index.ts
r2 -qi index.js -
4 changes: 4 additions & 0 deletions typescript/r2pipe/examples/hello/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as r2pipe from "@r2pipe";

const r2 = r2pipe.open();
console.log(r2.cmd("?e hello"));
23 changes: 23 additions & 0 deletions typescript/r2pipe/examples/hello/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "r2pipe-example-hello",
"version": "0.0.1",
"description": "example using the new r2pipe",
"type": "module",
"main": "./index.js",
"types": "./index.d.js",
"license": "LGPL-3.0",
"module": "es2020",
"engines": {
"node": ">=14.16"
},
"devDependencies": {
"@frida/events": "^4.0.4",
"@types/frida-gum": "^18.3.1",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.34.0",
"frida-compile": "^16.1.5",
"typescript": "^5.0.0"
}
}
20 changes: 20 additions & 0 deletions typescript/r2pipe/examples/hello/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es6",
"module": "esnext",
"lib": ["es6"],
"declaration": true,
"esModuleInterop": true,
"moduleResolution": "nodenext",
"strict": true,
"skipLibCheck": true,
"outDir": "./dist",
"paths": {
"@r2pipe": ["./r2pipe/index.js"]
}
},
"include": [
"index.ts"
]
}
22 changes: 22 additions & 0 deletions typescript/r2pipe/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "r2pipe-example-hello",
"version": "0.0.6",
"description": "example using the new r2pipe",
"type": "module",
"main": "./index.js",
"types": "./index.d.js",
"license": "LGPL-3.0",
"engines": {
"node": ">=14.16"
},
"devDependencies": {
"@frida/events": "^4.0.4",
"@types/frida-gum": "^18.3.1",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.34.0",
"frida-compile": "^16.1.5",
"typescript": "^5.0.0"
}
}
15 changes: 15 additions & 0 deletions typescript/r2pipe/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"baseUrl": ".",
"moduleResolution": "node",
"target": "es2020",
"lib": ["es2020"],
"declaration": true,
"strict": true,
"skipLibCheck": true,
"outDir": "./dist"
},
"include": [
"index.ts"
]
}

0 comments on commit 955a6da

Please sign in to comment.