Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": "dist/lib/workers/worker.js"
},
"scripts": {
"build": "tsc -p ./tsconfig.build.json",
"build": "rm -r ./dist || true; tsc -p ./tsconfig.build.json",
"ts-node": "ts-node -r tsconfig-paths/register",
"test": "jest",
"lint": "eslint '{src,tests}/**/*.{js,ts}'",
Expand Down
3 changes: 3 additions & 0 deletions src/bin/typescript-demo-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import NumPair from '../lib/NumPair';
import testLevel from '../lib/test-level';
import testUtpNative from '../lib/test-utp-native';
import testWorkers from '../lib/workers/test-workers';
import { version } from '../utils';

async function main(argv = process.argv): Promise<number> {
// Print out command-line arguments
Expand All @@ -34,6 +35,8 @@ async function main(argv = process.argv): Promise<number> {
await testWorkers();
await testUtpNative();

process.stdout.write(version);

process.exitCode = 0;
return process.exitCode;
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"test": true
}
6 changes: 5 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { test } from './utils.json';
// @ts-ignore package.json is outside rootDir
import { version } from '../package.json';

async function sleep(ms: number) {
return await new Promise((r) => setTimeout(r, ms));
}

export { sleep };
export { sleep, version, test };
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
Expand All @@ -8,6 +9,7 @@
"noImplicitAny": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"module": "CommonJS",
"target": "ES2020",
Expand Down