adapt-cli 3.0.0 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bowerrc +2 -2
- package/.eslintignore +1 -1
- package/.eslintrc.json +14 -14
- package/.github/CONTRIBUTING.md +8 -0
- package/.github/ISSUE_TEMPLATE.md +17 -0
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/addtomainproject.yml +19 -0
- package/.github/workflows/releases.yml +25 -0
- package/.travis.yml +46 -46
- package/README.md +266 -266
- package/bin/adapt.js +3 -3
- package/json/help-create/component.json +9 -9
- package/json/help-create/course.json +9 -9
- package/json/help-create/question.json +9 -9
- package/json/help-create.json +12 -12
- package/json/help-devinstall.json +9 -9
- package/json/help-install.json +10 -10
- package/json/help-ls.json +7 -7
- package/json/help-register.json +7 -7
- package/json/help-rename.json +7 -7
- package/json/help-search.json +8 -8
- package/json/help-uninstall.json +7 -7
- package/json/help-unregister.json +8 -8
- package/json/help-update.json +12 -12
- package/json/help-version.json +7 -7
- package/json/help.json +19 -19
- package/lib/api.js +273 -260
- package/lib/cli.js +70 -69
- package/lib/commands/authenticate.js +18 -18
- package/lib/commands/create/component.js +64 -64
- package/lib/commands/create/course.js +26 -26
- package/lib/commands/create/question.js +18 -18
- package/lib/commands/create.js +94 -85
- package/lib/commands/devinstall.js +35 -35
- package/lib/commands/help.js +31 -31
- package/lib/commands/install.js +16 -16
- package/lib/commands/ls.js +35 -9
- package/lib/commands/register.js +11 -11
- package/lib/commands/rename.js +14 -14
- package/lib/commands/search.js +11 -11
- package/lib/commands/uninstall.js +9 -9
- package/lib/commands/unregister.js +12 -12
- package/lib/commands/update.js +12 -12
- package/lib/commands/version.js +13 -13
- package/lib/econnreset.js +8 -0
- package/lib/integration/AdaptFramework/build.js +42 -39
- package/lib/integration/AdaptFramework/clone.js +27 -27
- package/lib/integration/AdaptFramework/deleteSrcCore.js +9 -9
- package/lib/integration/AdaptFramework/deleteSrcCourse.js +9 -9
- package/lib/integration/AdaptFramework/download.js +21 -21
- package/lib/integration/AdaptFramework/erase.js +34 -34
- package/lib/integration/AdaptFramework/getLatestVersion.js +74 -79
- package/lib/integration/AdaptFramework/npmInstall.js +21 -21
- package/lib/integration/AdaptFramework.js +19 -19
- package/lib/integration/Plugin.js +404 -403
- package/lib/integration/PluginManagement/autenticate.js +47 -56
- package/lib/integration/PluginManagement/install.js +224 -222
- package/lib/integration/PluginManagement/print.js +52 -52
- package/lib/integration/PluginManagement/register.js +130 -130
- package/lib/integration/PluginManagement/rename.js +95 -101
- package/lib/integration/PluginManagement/schemas.js +8 -8
- package/lib/integration/PluginManagement/search.js +37 -46
- package/lib/integration/PluginManagement/uninstall.js +141 -141
- package/lib/integration/PluginManagement/unregister.js +91 -101
- package/lib/integration/PluginManagement/update.js +224 -224
- package/lib/integration/PluginManagement.js +21 -21
- package/lib/integration/Project.js +146 -146
- package/lib/integration/Target.js +299 -296
- package/lib/integration/getBowerRegistryConfig.js +34 -34
- package/lib/logger.js +28 -28
- package/lib/util/JSONReadValidate.js +34 -34
- package/lib/util/constants.js +38 -38
- package/lib/util/createPromptTask.js +7 -7
- package/lib/util/download.js +45 -45
- package/lib/util/errors.js +58 -58
- package/lib/util/extract.js +24 -24
- package/lib/util/getDirNameFromImportMeta.js +6 -6
- package/lib/util/promises.js +36 -36
- package/package.json +74 -40
package/README.md
CHANGED
@@ -1,266 +1,266 @@
|
|
1
|
-
Adapt Command Line Interface (CLI)
|
2
|
-
============================
|
3
|
-
|
4
|
-
[](https://travis-ci.org/adaptlearning/adapt-cli) [](https://gitter.im/adaptlearning/adapt-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
|
-
|
6
|
-
The **Adapt CLI** is a command line interface for use with the [Adapt framework](https://github.com/adaptlearning/adapt_framework). Its primary usefulness is to install, update, and uninstall Adapt plug-ins. In doing so, it references the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/). Consequently, the CLI includes several commands for working with this plug-in registry.
|
7
|
-
|
8
|
-
>IMPORTANT: The **Adapt CLI** is not intended to be used with courses in the [Adapt authoring tool](https://github.com/adaptlearning/adapt_authoring). The authoring tool tracks versions of plug-ins in its database. Using the CLI bypasses this tracking.
|
9
|
-
|
10
|
-
## Installation
|
11
|
-
|
12
|
-
Before installing the Adapt CLI, you must install [NodeJS](http://nodejs.org) and [git](http://git-scm.com/downloads).
|
13
|
-
To install the Adapt CLI globally, run the following command:
|
14
|
-
|
15
|
-
`npm install -g adapt-cli`
|
16
|
-
|
17
|
-
Some systems may require elevated permissions in order to install a script globally.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
##### Model:
|
50
|
-
`adapt create [<type> <path> <branch|tag>]`
|
51
|
-
|
52
|
-
**type**: What to create. Acceptable values are `course` and `component`.
|
53
|
-
**path**: The directory of the new course. Enclose in quotes if the path/name includes spaces.
|
54
|
-
**branch|tag**: The branch or tag name of the framework to be downloaded. This is optional. If not specified, the master branch will be used.
|
55
|
-
|
56
|
-
##### Examples:
|
57
|
-
|
58
|
-
1. To create an Adapt course *(do not use in conjunction with the Adapt authoring tool)*:
|
59
|
-
`adapt create course "My Course"`
|
60
|
-
This will create a new directory named "My Course" in your current working directory. It will download the Adapt framework from its master branch, including the default course, into the new directory. Before using the course, run:
|
61
|
-
`grunt build`
|
62
|
-
|
63
|
-
1. To create an Adapt course from a specific branch:
|
64
|
-
`adapt create course "My Course" legacy`
|
65
|
-
This is the same as example 1 except that the framework will be downloaded from the 'legacy' branch, not from the default master branch.
|
66
|
-
|
67
|
-
1. To create an Adapt course from a specific tag:
|
68
|
-
`adapt create course "My Course" v3.5.1`
|
69
|
-
This is the same as example 1 except that v3.5.1 of the framework will be downloaded, rather than the master branch.
|
70
|
-
|
71
|
-
1. To create an empty component:
|
72
|
-
`adapt create component "test-component"`
|
73
|
-
This command is useful for developing new components. It will create a new directory named "test-component" in the current working directory. It will populate the directory with files required for an Adapt component and insert "test-component" into the code where required.
|
74
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
75
|
-
|
76
|
-
### adapt search
|
77
|
-
|
78
|
-
##### Model:
|
79
|
-
`adapt search [<plug-in>]`
|
80
|
-
|
81
|
-
**plug-in**: The optional name of the plug-in that you want to search for. Any part of the name may be used; multiple results may be returned if the partial name is not unique.
|
82
|
-
|
83
|
-
The **search** command searches within [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/). It will return the plug-in's complete name and its source repository only if the plug-in is registered.
|
84
|
-
|
85
|
-
##### Examples:
|
86
|
-
1. To view the name and repository of all plug-ins registered with the Adapt Plugin Browser:
|
87
|
-
`adapt search`
|
88
|
-
|
89
|
-
1. To locate the repository of a known plug-in that is registered:
|
90
|
-
`adapt search adapt-contrib-pageLevelProgress` OR
|
91
|
-
`adapt search contrib-pageLevelProgress` OR
|
92
|
-
`adapt search pageLevel`
|
93
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
94
|
-
|
95
|
-
### adapt install
|
96
|
-
|
97
|
-
##### Models:
|
98
|
-
`adapt install <plug-in>[#|@<version>]`
|
99
|
-
`adapt install [--dry-run|--compatible]`
|
100
|
-
|
101
|
-
**plug-in**: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.
|
102
|
-
**version**: A specific version number of the plug-in. This is optional.
|
103
|
-
|
104
|
-
##### Examples:
|
105
|
-
1. To install all plug-ins listed in *adapt.json*:
|
106
|
-
`adapt install`
|
107
|
-
This command must be run in the root directory of an Adapt framework installation.
|
108
|
-
|
109
|
-
1. To report the plug-ins that will be installed if `adapt install` is run:
|
110
|
-
`adapt install --dry-run`
|
111
|
-
This command must be run in the root directory of an Adapt framework installation.
|
112
|
-
|
113
|
-
1. To install versions of all plug-ins listed in *adapt.json* that are compatible with the installed framework version. This overrides any incompatible settings provided on the command line or in *adapt.json*.
|
114
|
-
`adapt install --compatible`
|
115
|
-
This command must be run in the root directory of an Adapt framework installation.
|
116
|
-
|
117
|
-
1. To install a plug-in that has been registered with the [Adapt Plug-in Browser](https://www.adaptlearning.org/index.php/plugin-browser/) registry:
|
118
|
-
`adapt install adapt-contrib-pageLevelProgress` OR
|
119
|
-
`adapt install contrib-pageLevelProgress`
|
120
|
-
|
121
|
-
1. To install a specific version of a registered plug-in:
|
122
|
-
`adapt install adapt-contrib-pageLevelProgress#1.1.0` OR
|
123
|
-
`adapt install adapt-contrib-pageLevelProgress@1.1.0` OR
|
124
|
-
`adapt install contrib-pageLevelProgress#1.1.0` OR
|
125
|
-
`adapt install contrib-pageLevelProgress@1.1.0`
|
126
|
-
|
127
|
-
1. To use the CLI to install a plug-in that is not registered with [Adapt Plug-in Browser](https://www.adaptlearning.org/index.php/plugin-browser/) registry:
|
128
|
-
1. Copy the uncompressed folder to the proper location for the type of plug-in. Components: *src/components*. Extensions: *src/extensions*. Menu: *src/menu*. Theme: *src/theme*. Note: The Adapt framework allows only one theme. Uninstall the current before replacing it with an alternative. More than one menu is allowed.
|
129
|
-
1. Open *adapt.json* in an editor and add the full name of the new component to the list.
|
130
|
-
1. Run the following command from the course root:
|
131
|
-
`adapt install`
|
132
|
-
After installation, most CLI commands will operate on the plug-in with the exception of `adapt update`. Plug-ins must be registered with the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/) for `adapt update` to succeed.
|
133
|
-
|
134
|
-
1. To update all registered plug-ins to their most recent public release:
|
135
|
-
`adapt update`
|
136
|
-
Since no plug-in name is specified in this command, all plug-ins listed in *adapt.json* are reinstalled. Whether the plug-in is updated will be determined by the compatible framework versions specified in *adapt.json*. If it includes a plug-in that is not registered, it will not be updated.
|
137
|
-
**Note to developers:** The CLI determines newest version by comparing release tags in the GitHub repo. Be sure to use a tag when you release a new version.
|
138
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
139
|
-
|
140
|
-
### adapt ls
|
141
|
-
|
142
|
-
##### Model:
|
143
|
-
`adapt ls`
|
144
|
-
|
145
|
-
This command lists the name and version number of all plug-ins listed in the *adapt.json* file of the current directory.
|
146
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
147
|
-
|
148
|
-
### adapt uninstall
|
149
|
-
|
150
|
-
##### Model:
|
151
|
-
`adapt uninstall <plug-in>`
|
152
|
-
|
153
|
-
**plug-in**: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.
|
154
|
-
|
155
|
-
##### Examples:
|
156
|
-
1. To uninstall a plug-in:
|
157
|
-
`adapt uninstall adapt-contrib-pageLevelProgress` OR
|
158
|
-
`adapt uninstall contrib-pageLevelProgress`
|
159
|
-
Because the plug-in registry is not referenced during the uninstall process, this command will work whether or not the plug-in is registered with the Adapt Plugin Browser..
|
160
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
161
|
-
|
162
|
-
### adapt devinstall
|
163
|
-
|
164
|
-
##### Model:
|
165
|
-
`adapt devinstall [<plug-in>[#<version>]]`
|
166
|
-
|
167
|
-
**plug-in**: Name of the plug-in to be cloned.
|
168
|
-
**version**: Version of the plug-in to be installed.
|
169
|
-
|
170
|
-
##### Examples:
|
171
|
-
|
172
|
-
1. To clone as git repositories the Adapt framework and all the plug-ins listed in *adapt.json* of the current directory:
|
173
|
-
`adapt devinstall`
|
174
|
-
|
175
|
-
1. To clone a specific plug-in listed in the *adapt.json*:
|
176
|
-
`adapt devinstall adapt-contrib-matching`
|
177
|
-
|
178
|
-
1. To clone a specific version of a plug-in listed in the *adapt.json*:
|
179
|
-
`adapt devinstall adapt-contrib-matching#v2.2.0`
|
180
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
181
|
-
|
182
|
-
### adapt update
|
183
|
-
|
184
|
-
##### Models:
|
185
|
-
`adapt update [<plug-in>[#|@<version>]][--check]`
|
186
|
-
`adapt update [components|extensions|menu|theme|all][--check]`
|
187
|
-
|
188
|
-
**plug-in**: Name of the plug-in to be cloned.
|
189
|
-
**version**: Version of the plug-in to be installed.
|
190
|
-
Before running the update command, ensure that there is no *bower.json* file in your project directory.
|
191
|
-
|
192
|
-
##### Examples:
|
193
|
-
|
194
|
-
1. To report the latest compatible version for each plug-in in the current directory (plug-ins are not updated):
|
195
|
-
`adapt update --check`
|
196
|
-
Note: The `--check` option may be used to report on a specific plug-in or on a complete plug-in group (components, extensions, theme, menu):
|
197
|
-
`adapt update adapt-contrib-matching --check`
|
198
|
-
`adapt update extensions --check`
|
199
|
-
|
200
|
-
1. To update a registered plug-in:
|
201
|
-
`adapt update adapt-contrib-pageLevelProgress` OR
|
202
|
-
`adapt update contrib-pageLevelProgress`
|
203
|
-
|
204
|
-
1. To update a specific version of a registered plug-in:
|
205
|
-
`adapt update adapt-contrib-pageLevelProgress#1.1.0` OR
|
206
|
-
`adapt update adapt-contrib-pageLevelProgress@1.1.0` OR
|
207
|
-
`adapt update contrib-pageLevelProgress#1.1.0` OR
|
208
|
-
`adapt update contrib-pageLevelProgress@1.1.0`
|
209
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
210
|
-
|
211
|
-
### adapt register
|
212
|
-
|
213
|
-
##### Command:
|
214
|
-
`adapt register`
|
215
|
-
|
216
|
-
This command must be run from within the root directory of the plug-in you want to register. "name" and "repository" will be read from *bower.json* in the current directory. The plug-in name must be prefixed with "adapt-" and each word separated with a hyphen (-). Plug-in names are checked against those already registered to avoid duplicates.
|
217
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
218
|
-
|
219
|
-
URL format must be of the form `https://github.com/<user>/<repo_name>.git`
|
220
|
-
|
221
|
-
### adapt rename
|
222
|
-
|
223
|
-
##### Command:
|
224
|
-
`adapt rename <current-name> <new-name>`
|
225
|
-
|
226
|
-
**current-name**: Name of the plug-in currently used in the plug-in registry.
|
227
|
-
**new-name**: Name proposed to replace the current plug-in name.
|
228
|
-
|
229
|
-
Please note that you must authenticate with GitHub to use **rename**. You must be a collaborator on the endpoint registered with the plug-in or a collaborator on the Adapt framework. Access to GitHub is for authentication only.
|
230
|
-
|
231
|
-
##### Example:
|
232
|
-
|
233
|
-
1. To rename a plug-in:
|
234
|
-
`adapt rename adapt-incorrectName adapt-betterName`
|
235
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
236
|
-
|
237
|
-
### adapt unregister
|
238
|
-
|
239
|
-
##### Command:
|
240
|
-
`adapt unregister [<plug-in>]`
|
241
|
-
|
242
|
-
**plug-in**: Name of the plug-in currently used in the plug-in registry.
|
243
|
-
|
244
|
-
Please note that you must authenticate with GitHub to use **unregister**. You must be a collaborator on the endpoint registered with the plug-in or a collaborator on the Adapt framework. Access to GitHub is for authentication only.
|
245
|
-
|
246
|
-
##### Examples:
|
247
|
-
|
248
|
-
1. To unregister a plug-in while in the root directory of the plug-in:
|
249
|
-
`adapt unregister`
|
250
|
-
|
251
|
-
1. To unregister a plug-in by name:
|
252
|
-
`adapt unregister adapt-myMistake`
|
253
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
254
|
-
|
255
|
-
|
256
|
-
The Plug-in Registry
|
257
|
-
-------------------
|
258
|
-
|
259
|
-
The Adapt community maintains the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/) as a convenient registry of components, extensions, themes, and menus. The plug-in system is powered by [Bower](http://bower.io/): http://adapt-bower-repository.herokuapp.com/packages/. To register, a plug-in must be a valid bower package with *bower.json*, and have a unique name that is prefixed with "adapt-".
|
260
|
-
|
261
|
-
See [Developing plug-ins](https://github.com/adaptlearning/adapt_framework/wiki/Developing-plugins) for more information on defining your plug-in's package and on [registering your plug-in](https://github.com/adaptlearning/adapt_framework/wiki/Registering-a-plugin).
|
262
|
-
<div float align=right><a href="#top">Back to Top</a></div>
|
263
|
-
|
264
|
-
----------------------------
|
265
|
-
<a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
|
266
|
-
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-hotgraphic/graphs/contributors)
|
1
|
+
Adapt Command Line Interface (CLI)
|
2
|
+
============================
|
3
|
+
|
4
|
+
[](https://travis-ci.org/adaptlearning/adapt-cli) [](https://gitter.im/adaptlearning/adapt-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
5
|
+
|
6
|
+
The **Adapt CLI** is a command line interface for use with the [Adapt framework](https://github.com/adaptlearning/adapt_framework). Its primary usefulness is to install, update, and uninstall Adapt plug-ins. In doing so, it references the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/). Consequently, the CLI includes several commands for working with this plug-in registry.
|
7
|
+
|
8
|
+
>IMPORTANT: The **Adapt CLI** is not intended to be used with courses in the [Adapt authoring tool](https://github.com/adaptlearning/adapt_authoring). The authoring tool tracks versions of plug-ins in its database. Using the CLI bypasses this tracking.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Before installing the Adapt CLI, you must install [NodeJS](http://nodejs.org) and [git](http://git-scm.com/downloads).
|
13
|
+
To install the Adapt CLI globally, run the following command:
|
14
|
+
|
15
|
+
`npm install -g adapt-cli`
|
16
|
+
|
17
|
+
Some systems may require elevated permissions in order to install a script globally.
|
18
|
+
|
19
|
+
## Commands
|
20
|
+
|
21
|
+
### adapt version
|
22
|
+
|
23
|
+
##### Model:
|
24
|
+
`adapt version`
|
25
|
+
|
26
|
+
This command reports both the version of the CLI and the version of the Adapt framework. The version of the framework is reported as "0.0.0" unless the command is run from the root directory of an installed framework.
|
27
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
28
|
+
|
29
|
+
### adapt help
|
30
|
+
|
31
|
+
##### Model:
|
32
|
+
`adapt help [<command>]`
|
33
|
+
|
34
|
+
**command**: A CLI command.
|
35
|
+
|
36
|
+
##### Examples:
|
37
|
+
|
38
|
+
1. To list all the CLI commands with a brief description of each:
|
39
|
+
`adapt help`
|
40
|
+
|
41
|
+
1. To report a brief description of a specific command:
|
42
|
+
`adapt help create`
|
43
|
+
|
44
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
45
|
+
|
46
|
+
### adapt create
|
47
|
+
|
48
|
+
|
49
|
+
##### Model:
|
50
|
+
`adapt create [<type> <path> <branch|tag>]`
|
51
|
+
|
52
|
+
**type**: What to create. Acceptable values are `course` and `component`.
|
53
|
+
**path**: The directory of the new course. Enclose in quotes if the path/name includes spaces.
|
54
|
+
**branch|tag**: The branch or tag name of the framework to be downloaded. This is optional. If not specified, the master branch will be used.
|
55
|
+
|
56
|
+
##### Examples:
|
57
|
+
|
58
|
+
1. To create an Adapt course *(do not use in conjunction with the Adapt authoring tool)*:
|
59
|
+
`adapt create course "My Course"`
|
60
|
+
This will create a new directory named "My Course" in your current working directory. It will download the Adapt framework from its master branch, including the default course, into the new directory. Before using the course, run:
|
61
|
+
`grunt build`
|
62
|
+
|
63
|
+
1. To create an Adapt course from a specific branch:
|
64
|
+
`adapt create course "My Course" legacy`
|
65
|
+
This is the same as example 1 except that the framework will be downloaded from the 'legacy' branch, not from the default master branch.
|
66
|
+
|
67
|
+
1. To create an Adapt course from a specific tag:
|
68
|
+
`adapt create course "My Course" v3.5.1`
|
69
|
+
This is the same as example 1 except that v3.5.1 of the framework will be downloaded, rather than the master branch.
|
70
|
+
|
71
|
+
1. To create an empty component:
|
72
|
+
`adapt create component "test-component"`
|
73
|
+
This command is useful for developing new components. It will create a new directory named "test-component" in the current working directory. It will populate the directory with files required for an Adapt component and insert "test-component" into the code where required.
|
74
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
75
|
+
|
76
|
+
### adapt search
|
77
|
+
|
78
|
+
##### Model:
|
79
|
+
`adapt search [<plug-in>]`
|
80
|
+
|
81
|
+
**plug-in**: The optional name of the plug-in that you want to search for. Any part of the name may be used; multiple results may be returned if the partial name is not unique.
|
82
|
+
|
83
|
+
The **search** command searches within [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/). It will return the plug-in's complete name and its source repository only if the plug-in is registered.
|
84
|
+
|
85
|
+
##### Examples:
|
86
|
+
1. To view the name and repository of all plug-ins registered with the Adapt Plugin Browser:
|
87
|
+
`adapt search`
|
88
|
+
|
89
|
+
1. To locate the repository of a known plug-in that is registered:
|
90
|
+
`adapt search adapt-contrib-pageLevelProgress` OR
|
91
|
+
`adapt search contrib-pageLevelProgress` OR
|
92
|
+
`adapt search pageLevel`
|
93
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
94
|
+
|
95
|
+
### adapt install
|
96
|
+
|
97
|
+
##### Models:
|
98
|
+
`adapt install <plug-in>[#|@<version>]`
|
99
|
+
`adapt install [--dry-run|--compatible]`
|
100
|
+
|
101
|
+
**plug-in**: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.
|
102
|
+
**version**: A specific version number of the plug-in. This is optional.
|
103
|
+
|
104
|
+
##### Examples:
|
105
|
+
1. To install all plug-ins listed in *adapt.json*:
|
106
|
+
`adapt install`
|
107
|
+
This command must be run in the root directory of an Adapt framework installation.
|
108
|
+
|
109
|
+
1. To report the plug-ins that will be installed if `adapt install` is run:
|
110
|
+
`adapt install --dry-run`
|
111
|
+
This command must be run in the root directory of an Adapt framework installation.
|
112
|
+
|
113
|
+
1. To install versions of all plug-ins listed in *adapt.json* that are compatible with the installed framework version. This overrides any incompatible settings provided on the command line or in *adapt.json*.
|
114
|
+
`adapt install --compatible`
|
115
|
+
This command must be run in the root directory of an Adapt framework installation.
|
116
|
+
|
117
|
+
1. To install a plug-in that has been registered with the [Adapt Plug-in Browser](https://www.adaptlearning.org/index.php/plugin-browser/) registry:
|
118
|
+
`adapt install adapt-contrib-pageLevelProgress` OR
|
119
|
+
`adapt install contrib-pageLevelProgress`
|
120
|
+
|
121
|
+
1. To install a specific version of a registered plug-in:
|
122
|
+
`adapt install adapt-contrib-pageLevelProgress#1.1.0` OR
|
123
|
+
`adapt install adapt-contrib-pageLevelProgress@1.1.0` OR
|
124
|
+
`adapt install contrib-pageLevelProgress#1.1.0` OR
|
125
|
+
`adapt install contrib-pageLevelProgress@1.1.0`
|
126
|
+
|
127
|
+
1. To use the CLI to install a plug-in that is not registered with [Adapt Plug-in Browser](https://www.adaptlearning.org/index.php/plugin-browser/) registry:
|
128
|
+
1. Copy the uncompressed folder to the proper location for the type of plug-in. Components: *src/components*. Extensions: *src/extensions*. Menu: *src/menu*. Theme: *src/theme*. Note: The Adapt framework allows only one theme. Uninstall the current before replacing it with an alternative. More than one menu is allowed.
|
129
|
+
1. Open *adapt.json* in an editor and add the full name of the new component to the list.
|
130
|
+
1. Run the following command from the course root:
|
131
|
+
`adapt install`
|
132
|
+
After installation, most CLI commands will operate on the plug-in with the exception of `adapt update`. Plug-ins must be registered with the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/) for `adapt update` to succeed.
|
133
|
+
|
134
|
+
1. To update all registered plug-ins to their most recent public release:
|
135
|
+
`adapt update`
|
136
|
+
Since no plug-in name is specified in this command, all plug-ins listed in *adapt.json* are reinstalled. Whether the plug-in is updated will be determined by the compatible framework versions specified in *adapt.json*. If it includes a plug-in that is not registered, it will not be updated.
|
137
|
+
**Note to developers:** The CLI determines newest version by comparing release tags in the GitHub repo. Be sure to use a tag when you release a new version.
|
138
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
139
|
+
|
140
|
+
### adapt ls
|
141
|
+
|
142
|
+
##### Model:
|
143
|
+
`adapt ls`
|
144
|
+
|
145
|
+
This command lists the name and version number of all plug-ins listed in the *adapt.json* file of the current directory.
|
146
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
147
|
+
|
148
|
+
### adapt uninstall
|
149
|
+
|
150
|
+
##### Model:
|
151
|
+
`adapt uninstall <plug-in>`
|
152
|
+
|
153
|
+
**plug-in**: The name of the plug-in to be installed. The name may be fully qualified with "adapt-" or the prefix may be omitted. Parts of names are not acceptable.
|
154
|
+
|
155
|
+
##### Examples:
|
156
|
+
1. To uninstall a plug-in:
|
157
|
+
`adapt uninstall adapt-contrib-pageLevelProgress` OR
|
158
|
+
`adapt uninstall contrib-pageLevelProgress`
|
159
|
+
Because the plug-in registry is not referenced during the uninstall process, this command will work whether or not the plug-in is registered with the Adapt Plugin Browser..
|
160
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
161
|
+
|
162
|
+
### adapt devinstall
|
163
|
+
|
164
|
+
##### Model:
|
165
|
+
`adapt devinstall [<plug-in>[#<version>]]`
|
166
|
+
|
167
|
+
**plug-in**: Name of the plug-in to be cloned.
|
168
|
+
**version**: Version of the plug-in to be installed.
|
169
|
+
|
170
|
+
##### Examples:
|
171
|
+
|
172
|
+
1. To clone as git repositories the Adapt framework and all the plug-ins listed in *adapt.json* of the current directory:
|
173
|
+
`adapt devinstall`
|
174
|
+
|
175
|
+
1. To clone a specific plug-in listed in the *adapt.json*:
|
176
|
+
`adapt devinstall adapt-contrib-matching`
|
177
|
+
|
178
|
+
1. To clone a specific version of a plug-in listed in the *adapt.json*:
|
179
|
+
`adapt devinstall adapt-contrib-matching#v2.2.0`
|
180
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
181
|
+
|
182
|
+
### adapt update
|
183
|
+
|
184
|
+
##### Models:
|
185
|
+
`adapt update [<plug-in>[#|@<version>]][--check]`
|
186
|
+
`adapt update [components|extensions|menu|theme|all][--check]`
|
187
|
+
|
188
|
+
**plug-in**: Name of the plug-in to be cloned.
|
189
|
+
**version**: Version of the plug-in to be installed.
|
190
|
+
Before running the update command, ensure that there is no *bower.json* file in your project directory.
|
191
|
+
|
192
|
+
##### Examples:
|
193
|
+
|
194
|
+
1. To report the latest compatible version for each plug-in in the current directory (plug-ins are not updated):
|
195
|
+
`adapt update --check`
|
196
|
+
Note: The `--check` option may be used to report on a specific plug-in or on a complete plug-in group (components, extensions, theme, menu):
|
197
|
+
`adapt update adapt-contrib-matching --check`
|
198
|
+
`adapt update extensions --check`
|
199
|
+
|
200
|
+
1. To update a registered plug-in:
|
201
|
+
`adapt update adapt-contrib-pageLevelProgress` OR
|
202
|
+
`adapt update contrib-pageLevelProgress`
|
203
|
+
|
204
|
+
1. To update a specific version of a registered plug-in:
|
205
|
+
`adapt update adapt-contrib-pageLevelProgress#1.1.0` OR
|
206
|
+
`adapt update adapt-contrib-pageLevelProgress@1.1.0` OR
|
207
|
+
`adapt update contrib-pageLevelProgress#1.1.0` OR
|
208
|
+
`adapt update contrib-pageLevelProgress@1.1.0`
|
209
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
210
|
+
|
211
|
+
### adapt register
|
212
|
+
|
213
|
+
##### Command:
|
214
|
+
`adapt register`
|
215
|
+
|
216
|
+
This command must be run from within the root directory of the plug-in you want to register. "name" and "repository" will be read from *bower.json* in the current directory. The plug-in name must be prefixed with "adapt-" and each word separated with a hyphen (-). Plug-in names are checked against those already registered to avoid duplicates.
|
217
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
218
|
+
|
219
|
+
URL format must be of the form `https://github.com/<user>/<repo_name>.git`
|
220
|
+
|
221
|
+
### adapt rename
|
222
|
+
|
223
|
+
##### Command:
|
224
|
+
`adapt rename <current-name> <new-name>`
|
225
|
+
|
226
|
+
**current-name**: Name of the plug-in currently used in the plug-in registry.
|
227
|
+
**new-name**: Name proposed to replace the current plug-in name.
|
228
|
+
|
229
|
+
Please note that you must authenticate with GitHub to use **rename**. You must be a collaborator on the endpoint registered with the plug-in or a collaborator on the Adapt framework. Access to GitHub is for authentication only.
|
230
|
+
|
231
|
+
##### Example:
|
232
|
+
|
233
|
+
1. To rename a plug-in:
|
234
|
+
`adapt rename adapt-incorrectName adapt-betterName`
|
235
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
236
|
+
|
237
|
+
### adapt unregister
|
238
|
+
|
239
|
+
##### Command:
|
240
|
+
`adapt unregister [<plug-in>]`
|
241
|
+
|
242
|
+
**plug-in**: Name of the plug-in currently used in the plug-in registry.
|
243
|
+
|
244
|
+
Please note that you must authenticate with GitHub to use **unregister**. You must be a collaborator on the endpoint registered with the plug-in or a collaborator on the Adapt framework. Access to GitHub is for authentication only.
|
245
|
+
|
246
|
+
##### Examples:
|
247
|
+
|
248
|
+
1. To unregister a plug-in while in the root directory of the plug-in:
|
249
|
+
`adapt unregister`
|
250
|
+
|
251
|
+
1. To unregister a plug-in by name:
|
252
|
+
`adapt unregister adapt-myMistake`
|
253
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
254
|
+
|
255
|
+
|
256
|
+
The Plug-in Registry
|
257
|
+
-------------------
|
258
|
+
|
259
|
+
The Adapt community maintains the [Adapt Plugin Browser](https://www.adaptlearning.org/index.php/plugin-browser/) as a convenient registry of components, extensions, themes, and menus. The plug-in system is powered by [Bower](http://bower.io/): http://adapt-bower-repository.herokuapp.com/packages/. To register, a plug-in must be a valid bower package with *bower.json*, and have a unique name that is prefixed with "adapt-".
|
260
|
+
|
261
|
+
See [Developing plug-ins](https://github.com/adaptlearning/adapt_framework/wiki/Developing-plugins) for more information on defining your plug-in's package and on [registering your plug-in](https://github.com/adaptlearning/adapt_framework/wiki/Registering-a-plugin).
|
262
|
+
<div float align=right><a href="#top">Back to Top</a></div>
|
263
|
+
|
264
|
+
----------------------------
|
265
|
+
**Version number:** 3.0.2 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
|
266
|
+
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-hotgraphic/graphs/contributors)
|
package/bin/adapt.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
import cli from '../lib/cli.js'
|
3
|
-
cli.withOptions().execute()
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import cli from '../lib/cli.js'
|
3
|
+
cli.withOptions().execute()
|
@@ -1,9 +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
|
-
}
|
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
|
+
}
|
@@ -1,9 +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
|
-
}
|
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
|
+
}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
{
|
2
|
-
"command": "create question",
|
3
|
-
"description": "create new question component",
|
4
|
-
"usage": [
|
5
|
-
"create question",
|
6
|
-
"create question <component-name>",
|
7
|
-
"create question <component-name> <branch-name>"
|
8
|
-
]
|
9
|
-
}
|
1
|
+
{
|
2
|
+
"command": "create question",
|
3
|
+
"description": "create new question component",
|
4
|
+
"usage": [
|
5
|
+
"create question",
|
6
|
+
"create question <component-name>",
|
7
|
+
"create question <component-name> <branch-name>"
|
8
|
+
]
|
9
|
+
}
|
package/json/help-create.json
CHANGED
@@ -1,12 +1,12 @@
|
|
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 component using template adapt-component",
|
10
|
-
"question": "Create new question component using template adapt-questionComponent"
|
11
|
-
}
|
12
|
-
}
|
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 component using template adapt-component",
|
10
|
+
"question": "Create new question component using template adapt-questionComponent"
|
11
|
+
}
|
12
|
+
}
|