-
Notifications
You must be signed in to change notification settings - Fork 8
Auto-fetch missing packages. #17
Comments
That would be neat. Manipulating npm itself 😈 |
Some ideas. Feel free to ignore if your are better. Local install is a great idea so you'll consistently use the same version of the scaffold throughout. But you should also cache globally, even if you install local. Before you do anything, check local cache, global cache, then npm and record the following logic results as a list of tasks to perform. If there is no global cache hit, install global. If npm is newer than global, update global. If npm is newer than local, notify in console, but don't update local. If there is no local install, install from global cache. Example scenario: global cache found, outdated, local cache not found. After the logic steps are complete, it should create the following command sequence: const instructions = [
'update global',
'install local'
]; Once you have the sequence, running them is basically a map over the instructions: const responses = instructions.map(runCommand); If there are errors, don't dump an error log to disk. Just log to |
p.s. - local install always installs from global cache. |
The issue with auto-install globally is that you may need root for that. Not everyone uses nvm. So I'd suggest not to write global deps at all. Taking scaffold from global dep is okay, writing local is okay, writing global is not okay. Caching is something npm is taking care of, so we do not need to mess with it at all. Just run internal npm command to install dependency should be more then enough. |
OK. |
Is this done? |
What about having a This also brings up the question if CF should respect semver. I only mention this because there was some mention here about auto-updating (in addition to auto-fetch). Sample {
"react": {
"cf-react": "^2.4.0",
"cf-cerebral": "^1.1.3"
},
"express": {
"cf-express": "^1.6.2",
"cf-passport": "^2.1.4",
"cf-lodash": "^3.2.1"
}
} Running Just thinking out loud here. |
@ericelliott, no it is not done yet, still in todo. It is blocked by "Search for packages locally #33" (just created). When it is completed, we can then quite easily auto-install packages to the local @therealklanni I would prefer no to add any additional configs. Any configuration adds complexity and conventions. Very often - unnecessary. This task can be quite easily solved without any additional configuration. |
Great. =) |
As soon as #33 is there, I'm going to close this one soon. |
We can close this now, right? |
No, I haven't done it yet :)
|
Oh. =) |
🎸 🔥
See also: stampit-org/stampit#147
The text was updated successfully, but these errors were encountered: