sandpack
sandpack copied to clipboard
Feature request: task manager
Bug report
Packages affected
- [ ] sandpack-client
- [*] sandpack-react
Description of the problem
"scripts": {
"start": "tsc -p . && node index.js"
},
works in normal codesandbox but not in sandpack.
In your opinion, @DeMoorJasper, what sandpack must do for these cases?
- Spawn two processes synchronously using the same shell instance;
- Create a queue for processes and create multiples shell instances;
It sounds like a big challenge since we need to wait for one process to be finished and spawn another one, so I'm not absolutely sure what's the correct way to go here.
Ideally we would have a command parser that takes into account env variables and these operators. We could create a very basic ast type structure from a command and some CommandRunners.
In this case it would be run tsc -p . wait for process to exit and than run node index.js using the same shell instance. This is a fairly simple one, there's a couple more complex ones like the pipe operator |
I spent some time working on a command parser: https://codesandbox.io/s/command-shell-parser-4pknfv?file=/src/index.ts
What do you think @DeMoorJasper?
@danilowoz Looks very good, just fixed something where or is actually pipe and added the symbol for or