Skip to content

Commit 4971b42

Browse files
committed
chore: setup build scripts, make tests run
1 parent 9065bd6 commit 4971b42

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
"name": "@code4rena/typed-client",
33
"version": "1.0.0",
44
"main": "lib/index.js",
5+
"types": "lib/index.d.ts",
6+
"files": ["lib/**/*.js", "lib/**/*.d.ts"],
57
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1",
8+
"clean": "rm -f lib/*.js lib/*.d.ts lib/**/*.js lib/**/*.d.ts",
9+
"test": "node --experimental-strip-types --test",
10+
"posttest": "npm run lint",
711
"lint": "eslint .",
8-
"prelint": "tsc --noEmit"
12+
"prelint": "tsc",
13+
"prepack": "tsc -p tsconfig.build.json",
14+
"postpublish": "npm run clean"
915
},
1016
"keywords": [],
1117
"author": "",

test/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Hapi, { type Request } from "@hapi/hapi";
22
import Joi from "joi";
33
import { test, type TestContext } from "node:test";
4-
import { Client } from "../lib/index.js";
4+
import { Client } from "../lib/index.ts";
55

66
const expectType = <T>(_: T): void => void 0;
77
type TypeEqual<Target, Value> = (<T>() => T extends Target ? 1 : 2) extends <T>() => T extends Value ? 1 : 2 ? true : false;

tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["lib/**/*.ts"],
4+
"compilerOptions": {
5+
"declaration": true,
6+
"noEmit": false
7+
}
8+
}

tsconfig.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
"verbatimModuleSyntax": true,
1515
"erasableSyntaxOnly": true,
1616
"esModuleInterop": false,
17-
"typeRoots": [
18-
"./node_modules/@types",
19-
"./lib/types/**"
20-
]
21-
},
22-
"//": "This file is partially managed by code-skeleton. Changes may be overwritten."
17+
"rewriteRelativeImportExtensions": true
18+
}
2319
}

0 commit comments

Comments
 (0)