diff --git a/example.ts b/example.ts deleted file mode 100644 index a201bd7..0000000 --- a/example.ts +++ /dev/null @@ -1 +0,0 @@ -console.log('Some .ts code reproducing a bug'); diff --git a/package.json b/package.json index 4d56496..2439baf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { - "dependencies": { - "ts-node": "latest", - "typescript": "latest" - } + "version": "1.0.0", + "private": true, + "workspaces": [ + "workspace-a" + ] } diff --git a/run.sh b/run.sh index d553b44..2284eea 100644 --- a/run.sh +++ b/run.sh @@ -7,7 +7,8 @@ n lts yarn # Run ts-node -yarn ts-node ./example.ts +yarn workspace workspace-a start +yarn workspace workspace-a start:throng echo "Process exited with code: $?" echo diff --git a/workspace-a/bin/example.ts b/workspace-a/bin/example.ts new file mode 100644 index 0000000..513825f --- /dev/null +++ b/workspace-a/bin/example.ts @@ -0,0 +1,17 @@ +const throng = require('throng') + +console.log('Launching exmple.ts') + +if (process.env.USE_THRONG) { + throng({ + worker: startServer, + count: 1 + }) +} else { + startServer() +} + +function startServer() { + console.log('server starting') +} + diff --git a/workspace-a/package.json b/workspace-a/package.json new file mode 100644 index 0000000..f11987c --- /dev/null +++ b/workspace-a/package.json @@ -0,0 +1,15 @@ +{ + "version": "1.0.0", + "name": "workspace-a", + "private": true, + "scripts": { + "start": "TS_NODE_DEBUG=1 ts-node-transpile-only bin/example", + "start:throng": "TS_NODE_DEBUG=1 USE_THRONG=1 ts-node-transpile-only bin/example" + }, + "dependencies": { + "@types/node": "^15.12.1", + "throng": "^5.0.0", + "ts-node": "latest", + "typescript": "latest" + } +}