diff --git a/examples/example.binc b/examples/example.jrpc similarity index 95% rename from examples/example.binc rename to examples/example.jrpc index 24915f2..f58b4e6 100644 --- a/examples/example.binc +++ b/examples/example.jrpc @@ -1,4 +1,4 @@ -import "./import.binc"; +import "./import"; enum TestEnum { VAL1, diff --git a/examples/import.binc b/examples/import.jrpc similarity index 100% rename from examples/import.binc rename to examples/import.jrpc diff --git a/package.json b/package.json index 94f9722..56d7cc4 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "@hibas123/SimpleRPC", + "name": "@hibas123/jrpcgen", "version": "1.0.0", "main": "lib/index.js", "license": "MIT", "packageManager": "yarn@3.1.1", "scripts": { "start": "ts-node src/index.ts", - "test": "npm run start -- compile examples/example.binc -o=ts-node:examples/out && ts-node examples/test.ts" + "test": "npm run start -- compile examples/example.jrpc -o=ts-node:examples/out && ts-node examples/test.ts" }, "devDependencies": { "@types/debug": "^4.1.7", diff --git a/src/process.ts b/src/process.ts index 35fed2c..fea6c1e 100644 --- a/src/process.ts +++ b/src/process.ts @@ -96,7 +96,7 @@ function processFile(ctx: ProcessContext, file: string): Parsed | null { .map((statement) => { if (statement.type == "import") { const base = Path.dirname(file); - const resolved = Path.resolve(Path.join(base, statement.path)); + const resolved = Path.resolve(Path.join(base, statement.path + ".jrpc")); return processFile(ctx, resolved); } else { return statement;