-
-
Notifications
You must be signed in to change notification settings - Fork 23
Add option to install from a local file #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
await UTIL.e_call( | ||
argv, | ||
"core/install", | ||
UTIL.def_flag(argv.local, "--local"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would probably need to add this to eask--option-switches
too. :)
Edit: I saw you added it. Great! :)
Another issue is a naming conflict between this flag and the function eask-local-p
. 😅 We might need to change this to something else. 🤔
@@ -345,6 +346,41 @@ and INHERIT-INPUT-METHOD see function `read-string' for more information." | |||
(declare (indent 0) (debug t)) | |||
`(eask-with-buffer (erase-buffer) ,@body)) | |||
|
|||
(defvar eask--state-alist '() | |||
"Alist mapping symbols to values which will be persisted between sessions.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to set it as nil
when '()
. :)
Maybe we should have a new command I recommend we store How about? (depends-on "foo-mode" :local "/path/to/foo-mode") And handle local packages right before https://github.com/emacs-eask/cli/blob/master/lisp/_prepare.el#L1514. |
Could you check out #317? I hope it's what you're looking for! 😋 You can now install it with: # directory
eask install-file /path/to/foo-mode
# .tar file
eask install-file /path/to/foo-mode.tar
# .el file
eask install-file /path/to/foo-mode.el In Eask-file: (depends-on "foo-mode" :file "/path/to/foo-mode") Now it becomes the dependency to your project, then do |
Haha this is a complex feature... because it's really 3 related features:
I think we should use both #316 and #317, but should work out the naming of commands and options to present all these features to the user in the least confusing way. I'll refer to these use cases below:
So, this PR enables local override (and perhaps npm link), but #317 enables local install -- both are useful features, but how do we organize them? Local Install by LinkingFirst let's look at the "npm link" use case. I think this is optional to support. (We could implement it by using the # in ./json-mode
eask link # json-mode -> ./path/to/json-mode stored in ~/.eask/eask-state.el
# in ./foo-mode
# local install
# user manually add (depends-on json-mode) to Easkfile
eask install-deps # fails to install json-mode
eask link add json-mode
eask install-deps # succeeds, but is not required after link add
# local override
# no depends-on in Easkfile, link is temporary
eask link add json-mode Note that there are no necessary changes to It might make sense to expose the "reinstalled every run" feature by having, say, Commands or OptionsNow assume we are not using the "npm link" use case, and just consider the remaining two use cases. How should the commands and options be organized? The most flexible choice is to use options for the Here's how the use cases would look when using options:
New cases that are possible with these options:
The other alternative (suggested in #317) is to use separate commands per install source. This is a good choice if we want to focus the functionality of the commands. For example, if we decide that a local install must always reinstall, it makes no sense to have
If you think of commands like SummaryI think these are the decisions:
I hope you enjoyed my essay ;) |
Let's break this down a little. There are too many features at a time right now. 😬 Things to clarify:
I'm confuse here. What I currently have in mind:
Furthermore, you only need to change Eask-file when you want your users to install via (depends-on "foo-mode" :file "/path/to/foo-mode") ; Force your users to install it so it cannot go wrong! Not mentioning |
Fair enough, I'm trying to think of features we might want so that changes we make now don't block other possibilities. It is definitely possible to just make "adds a file package" as a feature and "automatic reinstall" a later feature. This PR was mainly about showing that both are possible.
Again, I'm trying to think of how it should work. So I'm ignoring how commands work for now and thinking about how a user, looking only at the docs, will think that they work. Sorry for not clarifying that.
This reads as though you are reinstalling the file just once? Or do you mean it will make Eask automatically install it every run?
Putting on my "silly user" hat 🧢, I would ask these questions:
|
Oops, I meant to install it just once. Use
What do you mean temporarily? 🤔 My definition in this context means you install it once but cannot install it with Assuming we have the exact definition, you have these options:
It does not. I hope I have this feature, but it's not easy to implement with my current implementation. 😅🥲 I can explain why, but this is currently out of scope.
It lets you overwrite installed packages (reinstall). If the package is not installed, just install it. ——- No worries! I am trying to understand your needs. 😀👍 |
This might not be exactly the same, but I wanted to let you know that global scope packages are now treated as system packages by default (via the The commit changes is in e0732f2. |
Rationale
eask install --local ./some/path
../some/path
, do I reinstall for every change?package-initialize
is run!Changes
Adds
--local
option toeask install
. All args are interpreted as paths in that case.Adds a few functions that save data in
.eask/ver/eask-state.el
:Reinstalls saved
'local-packages
whenevereask-pkg-init
is called.Notes
eask-pkg-init
if performance is badTODOs
eask list