fzyzcjy / dart_interactive

REPL (interactive shell) for Dart, supporting 3rd party packages, hot reload, and full grammar
https://github.com/fzyzcjy/dart_interactive
MIT License
217 stars 13 forks source link

allow use as a globally installable executable #41

Closed maks closed 1 year ago

maks commented 1 year ago

One issue I ran into with dart_repl was that it's difficult to accommodate usage with dart pub global activate, especially in relation to scratchpad file paths. I suspect this package will run into the same issue when you get to the point of implementing a executable in your pubspec.

welcome[bot] commented 1 year ago

Hi! Thanks for opening your first issue here! :smile:

fzyzcjy commented 1 year ago

I have done it an hour ago :) Thanks anyway


dart pub global activate /Users/tom/RefCode/dart_interactive/packages/interactive --source path && interactive
Resolving dependencies in /Users/tom/RefCode/dart_interactive/packages/interactive... 
Got dependencies in /Users/tom/RefCode/dart_interactive/packages/interactive!
Package interactive is currently active at path "/Users/tom/RefCode/dart_interactive/packages/interactive".
Installed executable interactive.
Activated interactive 1.0.0 at path "/Users/tom/RefCode/dart_interactive/packages/interactive".
Building package executable... (3.9s)
Built interactive:interactive.
Run: /Users/tom/fvm/versions/3.3.1/bin/cache/dart-sdk/bin/dart [--enable-vm-service, file:///Users/tom/RefCode/dart_interactive/packages/interactive/.dart_tool/pub/bin/interactive/interactive.dart-2.18.0.snapshot, --vm-service-was-enabled]
The Dart VM service is listening on http://127.0.0.1:8181/W_XVDJ9MkU0=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/W_XVDJ9MkU0=/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FW_XVDJ9MkU0%3D%2Fws
>>> 1+1
2
fzyzcjy commented 1 year ago

as for scratchpad, I use a temp directory and a blank package

maks commented 1 year ago

that's great news! Glad you were able to get it working 👍🏻