Skip to content
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

Added update command and rewritten install command #93

Merged
merged 33 commits into from
Oct 2, 2018

Conversation

chris-steele
Copy link
Contributor

@chris-steele chris-steele commented Jul 11, 2018

Changes in this PR:

New command update

  • resolves feature request: ability to update plugins via the CLI #61
  • allows users to update/change installed plugins
  • switch --check allows user to see what updates are available
  • user is warned if attempting to use incompatible or out of date plugins and prompted to choose course of action
  • provides progress info and summary

Command install rewritten

  • new switch --compatible ensures only the latest compatible plugins are installed
  • new switch --dry-run allows user to see what the command will do without making any changes
  • user is warned if attempting to install incompatible or out of date plugins and prompted to choose course of action
  • provides progress info and summary

Rationale for install rewrite

If the master version of manifest (adapt.json) is kept up-to-date then appropriate versions will be installed when adapt install is run in a new project. When installing an older version of the framework (for testing purposes, for legacy plugin/browser support etc) the manifest may not be appropriate and so incompatible plugins may be installed. Manually determining appropriate versions of plugins for a project is tedious and error prone (and equally for the master version).

With these changes the manifest is still respected; so if a plugin is constrained to a semver then the command will attempt to install an applicable version. If '*' is specified then the latest compatible version is installed.

A consequence of these changes is that it will be no longer necessary to amend the master version of the manifest and we can return to using the wildcard '*'.

Notes

Install the prerelease that contains these changes by doing npm install -g adapt-cli@next

Copy link
Contributor

@moloko moloko left a comment

Choose a reason for hiding this comment

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

indentation needs a bit of a sort-out...

@tomgreenfield
Copy link
Contributor

Just a reminder to ensure that the install command will still pull down the default branch if there are no tagged versions.

@chris-steele
Copy link
Contributor Author

@moloko, @tomgreenfield install command now runs with untagged plugins. Is there anything else needed before requesting +1s?

@moloko
Copy link
Contributor

moloko commented Sep 27, 2018

@chris-steele just a bit of an indentation sort out if you don't mind? currently a mix of tabs & spaces

@chris-steele
Copy link
Contributor Author

@moloko checked update and install scripts - they're all using space indentation as far as I can see. Did you mean globally rather than these two scripts?

@moloko
Copy link
Contributor

moloko commented Sep 28, 2018

as far as I can see all the files in this PR are using a mix of tabs and spaces - sometimes in the same line! I'll mark a few with comments so you can see what I mean.

Copy link
Contributor

@moloko moloko left a comment

Choose a reason for hiding this comment

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

hope this helps show what I mean

logProgress:function(str) {
lastProgressStr = str;
isLoggingProgress = true;
readline.cursorTo(process.stdout, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

tab indentation

lastProgressStr = str;
isLoggingProgress = true;
readline.cursorTo(process.stdout, 0);
process.stdout.write(str);
Copy link
Contributor

Choose a reason for hiding this comment

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

space indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@moloko hopefully caught all the files I've edited in this PR


Plugin.call(this, ep.name || ep.source, version);

if (this.version !== any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

tabs AND spaces!

Copy link
Contributor Author

@chris-steele chris-steele Sep 28, 2018

Choose a reason for hiding this comment

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

@moloko sorry I was literally just looking at the big two files in this PR (install and update) and forgot about the dependencies. Is there a preference - tabs or spaces?

@moloko moloko merged commit 65e5a49 into adaptlearning:develop Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants