Pārlūkot izejas kodu

fix(entropy-tester): adjust cli execution and tsconfigs (#2773)

* fix(entropy-tester): adjust cli execution and tsconfigs
Amin Moghaddam 5 mēneši atpakaļ
vecāks
revīzija
117981d40b

+ 1 - 1
apps/entropy-tester/.gitignore

@@ -1 +1 @@
-lib
+dist

+ 1 - 1
apps/entropy-tester/cli/run.js

@@ -1,3 +1,3 @@
 #!/usr/bin/env node
 import { main } from "../dist/index.js";
-main();
+main().argv;

+ 4 - 3
apps/entropy-tester/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/entropy-tester",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "description": "Utility to test entropy provider callbacks",
   "type": "module",
   "main": "dist/index.js",
@@ -16,13 +16,14 @@
     "cli/**/*"
   ],
   "scripts": {
-    "build": "tsc",
+    "build": "tsc --project tsconfig.build.json",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
     "test:format": "prettier --check .",
     "test:lint": "eslint . --max-warnings 0",
     "test:types": "tsc",
-    "start": "tsc && node cli/run.js"
+    "start:dev": "tsc --project tsconfig.build.json && node cli/run.js",
+    "start:prod": "node cli/run.js"
   },
   "repository": {
     "type": "git",

+ 1 - 1
apps/entropy-tester/src/index.ts

@@ -153,7 +153,7 @@ const RUN_OPTIONS = {
 } as const;
 
 export const main = function () {
-  yargs(hideBin(process.argv))
+  return yargs(hideBin(process.argv))
     .parserConfiguration({
       "parse-numbers": false,
     })

+ 7 - 0
apps/entropy-tester/tsconfig.build.json

@@ -0,0 +1,7 @@
+{
+  "extends": "./tsconfig.json",
+  "compilerOptions": {
+    "outDir": "./dist",
+    "noEmit": false
+  }
+}

+ 1 - 1
apps/entropy-tester/tsconfig.json

@@ -1,5 +1,5 @@
 {
   "extends": "@cprussin/tsconfig/nextjs.json",
-  "include": ["**/*.ts", "**/*.tsx"],
+  "include": ["**/*.ts"],
   "exclude": ["node_modules"]
 }