Skip to content

Commit d86c5db

Browse files
committed
Merge branch 'pull48'
2 parents e9b7568 + 4db255b commit d86c5db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+11876
-268
lines changed

.travis.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
1+
---
12
language: node_js
23
node_js:
3-
- "0.11"
4+
- "lts/*"
5+
6+
sudo: false
7+
8+
env:
9+
- CXX=g++-4.8
10+
11+
addons:
12+
apt:
13+
sources:
14+
- ubuntu-toolchain-r-test
15+
packages:
16+
- g++-4.8
17+
18+
branches:
19+
only:
20+
- master
21+
- develop
22+
23+
git:
24+
depth: 10
25+
26+
cache:
27+
directories:
28+
- node_modules
29+
430
before_script:
531
- npm install -g grunt-cli
6-
sudo: false
32+
33+
install:
34+
- npm config set spin false
35+
- npm install
36+
37+
matrix:
38+
fast_finish: true
39+
40+
notifications:
41+
webhooks:
42+
urls:
43+
- https://webhooks.gitter.im/e/2b42e20cf5f5550c1dc0
44+
on_success: change # options: [always|never|change] default: always
45+
on_failure: always # options: [always|never|change] default: always
46+
on_start: never # options: [always|never|change] default: always

README.md

Lines changed: 72 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,119 @@
11
Adapt Command Line Interface
22
============================
33

4-
[![Build Status](https://travis-ci.org/adaptlearning/adapt-cli.png?branch=master)](https://travis-ci.org/adaptlearning/adapt-cli)
4+
[![Build Status](https://travis-ci.org/adaptlearning/adapt-cli.png?branch=master)](https://travis-ci.org/adaptlearning/adapt-cli) [![Join the chat at https://gitter.im/adaptlearning/adapt-cli](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/adaptlearning/adapt-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

66
Installation
77
------------
88

99
To install the Adapt CLI, first be sure to install [NodeJS](http://nodejs.org) and [git](http://git-scm.com/downloads), then from the command line run:-
10-
11-
12-
npm install -g adapt-cli
13-
10+
```
11+
npm install -g adapt-cli
12+
```
1413

1514
Usage
1615
-----
1716

1817
##### Creating an Adapt course
19-
20-
adapt create {type} {path} [{branch}]
21-
22-
type - What to create. Only the value "course" is currently supported.
23-
path - The directory of the new course.
24-
branch - Optional - The branch of the framework to be downlaoded.
18+
```
19+
adapt create {type} {path} [{branch}]
20+
```
21+
`type` What to create. The only types currently supported are `course` and `component`. If you want to create a new Adapt course, use `course`. If you want to develop a new Adapt component, use `component` to download a component template.
22+
`path` The name of the directory you'd like the course to be downloaded to (relative to the current directory)
23+
`branch` (optional) The branch of the framework you'd like to use as the basis for your course. If your needs to support Internet Explorer v8, 9 or 10 then set this to `legacy`. If not, leave blank or set to `master`.
2524

2625
For example...
27-
28-
adapt create course "My Course"
29-
26+
```
27+
adapt create course "My Course"
28+
```
3029
This will download the Adapt framework and create an new course in the directory "My Course", in your current directory.
3130

3231
##### Searching for an Adapt plugin.
33-
34-
adapt search {name or partial name of plugin to search for}
35-
32+
```
33+
adapt search {name or partial name of plugin to search for}
34+
```
3635

3736
##### Installing a plugin into your current directory
38-
39-
adapt install {name of plugin}
40-
37+
```
38+
adapt install {name of plugin}
39+
```
4140
Additionally you can install a specific version of a plugin.
42-
43-
adapt install {name of plugin}#{version}
44-
41+
```
42+
adapt install {name of plugin}#{version}
43+
```
4544
Anywhere that you are required to provide a name of a plugin it can be either fully qualified with 'adapt-' or optionally you can omit the prefix an just use the plugin name.
4645

4746
Therefore these commands are equivalent:
48-
49-
adapt install adapt-my-plugin
50-
adapt install my-plugin
51-
52-
Installed plugins are saved to `adapt.json`.
47+
```
48+
adapt install adapt-my-plugin
49+
adapt install my-plugin
50+
```
51+
Installed plugins are saved to `adapt.json`.
5352

5453
##### Installing plugins previously saved in adapt.json
55-
56-
adapt install
57-
54+
```
55+
adapt install
56+
```
5857

5958
##### Uninstalling a plugin from your current directory
60-
61-
adapt uninstall {name of plugin}
62-
59+
```
60+
adapt uninstall {name of plugin}
61+
```
6362

6463
The Plugin Registry
6564
-------------------
6665

6766
The plugin system is powered by [Bower](http://bower.io/). Each plugin should be a valid bower package and they should be registered with the Adapt registry.
68-
69-
http://adapt-bower-repository.herokuapp.com/packages/
70-
67+
```
68+
http://adapt-bower-repository.herokuapp.com/packages/
69+
```
7170
See [Developing plugins](https://github.com/adaptlearning/adapt_framework/wiki/Developing-plugins) for more information on defining your plugins package.
7271

7372
##### Registering a plugin
7473

7574
From within a plugin directory
76-
77-
adapt register
78-
75+
```
76+
adapt register
77+
```
7978
`name` and `repository` will be read from `bower.json` in the current directory.
8079

8180
The package will be registered with the registry on a first come first serve basis.
8281

82+
##### Unregister a plugin
83+
84+
From within a plugin directory
85+
```
86+
adapt unregister
87+
```
88+
`name` will be read from `bower.json` in the current directory
89+
90+
Alternatively, from any directory
91+
```
92+
adapt unregister <plugin name>
93+
```
94+
You will be prompted to authenticate with GitHub.
95+
96+
The package will be unregistered with the registry if the authenticated user is a collaborator on the given endpoint or a collaborator on the Adapt framework.
97+
98+
##### Rename a plugin
99+
100+
From any directory
101+
```
102+
adapt rename <plugin name> <new plugin name>
103+
```
104+
You will be prompted to authenticate with GitHub.
105+
106+
The package will be renamed if the authenticated user is a collaborator on the endpoint registered with the plugin or a collaborator on the Adapt framework.
107+
83108
Release History
84109
===============
110+
- 2.1.1 - Integrated PR 48 and fixed issue with adapt create command
111+
- 2.1.0 - Fully updated update and install commands
112+
- 2.0.7 - Added update command, rewritten install command and updated dependencies; targetting Node v8+
113+
- 2.0.6 - Dependencies updated, registry now targeted consistently, fixed issue #49, CI target set to all Node LTS versions
114+
- 2.0.5 - Added rename and unregister commands and corrected some typos
115+
- 2.0.4 - Corrected version numbers
116+
- 2.0.3 - Fixed issue#53 - npm dependency is git url
85117
- 2.0.2 - Fixed issue#32 - Error: Cannot find module 'Q' on case sensitive file systems
86118
- 2.0.1 - Fixed an issue with installing dependencies (https://github.com/adaptlearning/adapt-cli/tree/hotfix/has-no-method-install)
87119
- 2.0.0 - version bump to 2.0.0

TESTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### Instructions for testing the adapt-cli update command
2+
3+
- Use the current LTS version of Node (v8.11.1) as per the [guidance](https://github.com/adaptlearning/adapt_framework/wiki/Setting-up-your-development-environment). Don’t forget to have `grunt` installed globally (`npm install –g grunt-cli`) when you install a new version of Node.
4+
- Install globally the latest pre-release of adapt-cli (`npm install -g adapt-cli@next`)
5+
- Select an Adapt project to test against. At this point you may find it useful to add the contents of the Adapt installation to version control if you haven't already. This will allow you test the functionality and be able to see easily any changes made to the file system and also be able to revert changes and test alternative commands.
6+
- Run `adapt help update` for guidance using the `update` command and for command syntax.
7+
- Now run `adapt update`. If you installed the latest version of the framework together with all the latest plugins there should not have been any changes to the installed plugins and you will see a summary of your installed plugins.
8+
- You can add the `--check` option to review installed plugins without making changes. For each plugin the output will give its name, the version installed and indicate whether the plugin can be updated.
9+
- The update can be limited to specific plugins by providing their names, or to specific groups of plugins by specifying one or more of `components`, `extensions`, `menu`, `theme`.
10+
- Attempt to install different versions of various plugins; e.g. `adapt update adapt-contrib-media@>=3`. Observe the changes (if any).
11+
- Explore different scenarios; for example updating multiple plugins or groups of plugins together, try different semver ranges and also try the above with older versions of the Adapt framework.
12+
13+
### Important Notes
14+
15+
The outcome of an `update` command ensures that all updated plugins reflect the requested versions held on the server. As such **any local changes will be overwritten**.
16+
17+
The `update` command does **not** use or modify the Adapt manifest (`adapt.json`).
18+
19+
Occasionally the command may report that one or more plugins cannot be found at the repository. This is a known limitation. The command will attempt to query the repository mulitple times before giving up. The issue is usually resolved by running the command again.
20+
21+
### Issue logging
22+
23+
Log issues to the adapt-cli [issue list](https://github.com/adaptlearning/adapt-cli/issues) on GitHub. Please check the list before submission to see if the issue has already been reported.
24+
25+
As always please report any problems with full steps to reproduce; including what version of Adapt you are using, list of plugins being updated (giving current and target version numbers), the `update` command, the environment (platform, version of Node etc) and of course the error (with stack trace if available).

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.2
1+
2.1.1

json/help-create.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"command": "create",
3+
"description": "Create a new adapt course",
4+
"usage": [
5+
"create <command>"
6+
],
7+
"commands": {
8+
"course": "Create new adapt course",
9+
"component": "Create new componentn using template adapt-component"
10+
}
11+
}

json/help-create/component.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"command": "create component",
3+
"description": "create new component",
4+
"usage": [
5+
"create component",
6+
"create component <component-name>",
7+
"create component <component-name> <branch-name>"
8+
]
9+
}

json/help-create/course.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"command": "create course",
3+
"description": "to create new course",
4+
"usage": [
5+
"create course",
6+
"create course <course-name>",
7+
"create course <course-name> <branch-name>"
8+
]
9+
}

json/help-devinstall.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"command": "devinstall",
3+
"description": "This command will clone the adapt_framework and all the plugins defined in adapt.json as git repos. For more info visit: https://github.com/adaptlearning/adapt-cli/pull/46",
4+
"usage": [
5+
"devinstall",
6+
"devinstall <plugin-name>",
7+
"devinstall <plugin-name>#<tag-name>"
8+
]
9+
}

json/help-install.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"command": "install",
3+
"description": "Install plugins according to the Adapt manifest (adapt.json). You can also specify which plugins to install as arguments. When specifying arguments you can provide an optional semantic version (semver). If a semver is not given the command will attempt to install the latest compatible version. Add the --dry-run option to simulate an installation without making any changes. Add the --compatible option to override any given semvers: the command will attempt to install the latest compatible version for all requested plugins.",
4+
"usage": [
5+
"install [--dry-run, --compatible]",
6+
"install <plugin-name>",
7+
"install <plugin-name>#<semver>",
8+
"install <plugin-name>@<semver>",
9+
]
10+
}

json/help-ls.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"command": "ls",
3+
"description": "List the plugin(s) name with version number mentioned in adapt.json file.",
4+
"usage": [
5+
"ls"
6+
]
7+
}

0 commit comments

Comments
 (0)