Skip to content

Install with no arguments#45

Merged
gigabo merged 1 commit intoasini:masterfrom
gigabo:install-no-args
Oct 25, 2016
Merged

Install with no arguments#45
gigabo merged 1 commit intoasini:masterfrom
gigabo:install-no-args

Conversation

@gigabo
Copy link
Copy Markdown
Contributor

@gigabo gigabo commented Oct 25, 2016

Use temporary package.json files.

This is groundwork for:

  • Pluggable npm clients (yarn).
  • An asini upgrade command.

Use temporary package.json files.

This is groundwork for:

- Pluggable npm clients (yarn).
- An `asini upgrade` command.
Comment thread src/NpmUtilities.js
// We have a few housekeeping tasks to take care of whether we succeed or fail.
const done = (err) => {
cleanup();
unregister();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is cleanup() not guaranteed to run in unregister()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unregister() unschedules the onExit() cleanup, which we only need if we wind up exiting before this done() function is called.

Comment thread src/NpmUtilities.js
// Handles scoped packages.
// Returns undefined for version if none specified.
static splitVersion(dep) {
return dep.match(/^(@?[^@]+)(?:@(.+))?/).slice(1, 3);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just love regexs 😖

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I originally used a simple .split("@"), but then I remembered scoped packages. 😖

@rygine
Copy link
Copy Markdown
Contributor

rygine commented Oct 25, 2016

so no more npm install [email protected] [email protected] quu@blah, right?

edit: sorry, this was slightly rhetorical. i see that this is the case. just npm install is run. 👍

@gigabo
Copy link
Copy Markdown
Contributor Author

gigabo commented Oct 25, 2016

so no more npm install [email protected] [email protected] quu@blah, right?

Right! This is important for yarn, which won't install anything that's not in the package.json.

@gigabo gigabo merged commit a25a106 into asini:master Oct 25, 2016
gigabo added a commit to gigabo/lerna that referenced this pull request Feb 3, 2017
Use temporary package.json files.

This is groundwork for:

- Pluggable npm clients (yarn).
- A `lerna upgrade` command.

This is a port of asini/asini#45.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants