From 472519ef3ac4a82bc80a6efa600d23427896c5f2 Mon Sep 17 00:00:00 2001 From: Lunarmagpie Date: Wed, 8 Mar 2023 22:18:34 -0500 Subject: [PATCH] ts-node --- .github/workflows/package-pr.yaml | 2 +- api/package.json | 5 +++-- api/tsconfig.json | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 7f1849d..c6be24d 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -126,7 +126,7 @@ jobs: do TEST_RUNTIME=$(awk -F. '{print $2}' <<< $(basename $tscript)) echo Running $tscript with runtime=$TEST_RUNTIME - docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME -l $PKG_VERSION /pkg/$(basename $tscript) > test_output + docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" npx ts-node /app/src/index.ts run $TEST_RUNTIME -l $PKG_VERSION /pkg/$(basename $tscript) > test_output cat test_output grep "OK" test_output done diff --git a/api/package.json b/api/package.json index 53d8ba6..07ccd64 100644 --- a/api/package.json +++ b/api/package.json @@ -2,10 +2,10 @@ "name": "piston-api", "version": "3.2.0", "description": "API for piston - a high performance code execution engine", - "module": "./dist/index.js", + "module": "./dist/src/index.ts", "type": "module", "scripts": { - "api": "node ./dist/index.js", + "api": "node ./dist/src/index.ts", "build": "npx tsc" }, "dependencies": { @@ -24,6 +24,7 @@ "devDependencies": { "@types/express": "^4.17.17", "@types/node-fetch": "^2.6.2", + "ts-node": "^10.9.1", "typescript": "^4.9.5" } } diff --git a/api/tsconfig.json b/api/tsconfig.json index ca4d1bd..9195f3b 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -11,6 +11,9 @@ "rootDir": "src", // "declaration": true }, + "ts-node": { + "esm": true + }, "include": ["src"], "exclude": ["dist", "node_modules"] }