From cc6035eef0e70f07d02da444e7aa1a773bf1e2c9 Mon Sep 17 00:00:00 2001 From: K35 Date: Fri, 31 Dec 2021 21:42:24 +0000 Subject: [PATCH] Fixing some small things. And making some design decisions. --- examples/{example.binc => example.jrpc} | 2 +- examples/{import.binc => import.jrpc} | 0 package.json | 4 ++-- src/process.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename examples/{example.binc => example.jrpc} (95%) rename examples/{import.binc => import.jrpc} (100%) 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;