adapt-cli 3.3.1 → 3.3.3
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.
@@ -0,0 +1 @@
|
|
1
|
+
blank_issues_enabled: false
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
name: Issue template
|
3
|
+
about: Create an issue to help us improve
|
4
|
+
---
|
5
|
+
|
6
|
+
### Subject of the issue/enhancement/features
|
7
|
+
Describe your issue here.
|
8
|
+
|
9
|
+
### Your environment
|
10
|
+
* version (AT/Framework)
|
11
|
+
* which browser and its version
|
12
|
+
* device(s) + operating system(s)
|
13
|
+
|
14
|
+
### Steps to reproduce
|
15
|
+
Tell us how to reproduce this issue.
|
16
|
+
|
17
|
+
### Expected behaviour
|
18
|
+
Tell us what should happen
|
19
|
+
|
20
|
+
### Actual behaviour
|
21
|
+
Tell us what happens instead
|
22
|
+
|
23
|
+
### Screenshots (if you can)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import component from 'adapt-cli/lib/commands/create/component.js'
|
2
|
+
import { ADAPT_EXTENSION } from 'adapt-cli/lib/util/constants.js'
|
3
|
+
|
4
|
+
export default async function extension ({
|
5
|
+
name,
|
6
|
+
repository = ADAPT_EXTENSION,
|
7
|
+
cwd,
|
8
|
+
branch,
|
9
|
+
logger
|
10
|
+
}) {
|
11
|
+
return component({
|
12
|
+
name,
|
13
|
+
repository,
|
14
|
+
cwd,
|
15
|
+
branch,
|
16
|
+
logger
|
17
|
+
})
|
18
|
+
}
|
package/lib/commands/create.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import inquirer from 'inquirer'
|
2
2
|
import component from './create/component.js'
|
3
3
|
import question from './create/question.js'
|
4
|
+
import extension from './create/extension.js'
|
4
5
|
import course from './create/course.js'
|
5
6
|
import { ADAPT_FRAMEWORK } from '../util/constants.js'
|
6
7
|
import { getLatestVersion as getAdaptLatestVersion } from '../integration/AdaptFramework.js'
|
@@ -8,6 +9,7 @@ import { getLatestVersion as getAdaptLatestVersion } from '../integration/AdaptF
|
|
8
9
|
const subTasks = {
|
9
10
|
component,
|
10
11
|
question,
|
12
|
+
extension,
|
11
13
|
course
|
12
14
|
}
|
13
15
|
|
@@ -17,7 +19,8 @@ const subTasks = {
|
|
17
19
|
export const DEFAULT_TYPE_NAME = {
|
18
20
|
course: 'my-adapt-course',
|
19
21
|
component: 'myAdaptComponent',
|
20
|
-
question: 'myAdaptQuestion'
|
22
|
+
question: 'myAdaptQuestion',
|
23
|
+
extension: 'myAdaptExtension'
|
21
24
|
}
|
22
25
|
|
23
26
|
export default async function create (logger, type = 'course', name, branch, bypassPrompts) {
|
@@ -55,7 +58,7 @@ async function confirmOptions ({ logger, type, name, branch }) {
|
|
55
58
|
const typeSchema = [
|
56
59
|
{
|
57
60
|
name: 'type',
|
58
|
-
choices: ['course', 'component', 'question'],
|
61
|
+
choices: ['course', 'component', 'question', 'extension'],
|
59
62
|
type: 'list',
|
60
63
|
default: type
|
61
64
|
}
|
@@ -289,6 +289,8 @@ export default class Plugin {
|
|
289
289
|
return await perform()
|
290
290
|
}
|
291
291
|
const getMatchingVersion = async () => {
|
292
|
+
if (!this.isPresent) return null
|
293
|
+
|
292
294
|
if (this.isLocalSource) {
|
293
295
|
const info = this.projectVersion ? this._projectInfo : this._sourceInfo
|
294
296
|
const satisfiesConstraint = !this.hasValidRequestVersion || semver.satisfies(info.version, this.requestedVersion, semverOptions)
|
@@ -297,8 +299,6 @@ export default class Plugin {
|
|
297
299
|
return info.version
|
298
300
|
}
|
299
301
|
|
300
|
-
if (!this.isPresent) return null
|
301
|
-
|
302
302
|
// check if the latest version is compatible
|
303
303
|
const satisfiesConstraint = !this.hasValidRequestVersion || semver.satisfies(this._sourceInfo.version, this.requestedVersion, semverOptions)
|
304
304
|
const satisfiesFramework = semver.satisfies(framework, this.frameworkVersion, semverOptions)
|
package/lib/util/constants.js
CHANGED
@@ -8,6 +8,8 @@ export const ADAPT_COMPONENT = process.env.ADAPT_COMPONENT || 'https://github.co
|
|
8
8
|
|
9
9
|
export const ADAPT_QUESTION = process.env.ADAPT_QUESTION || 'https://github.com/adaptlearning/adapt-questionComponent'
|
10
10
|
|
11
|
+
export const ADAPT_EXTENSION = process.env.ADAPT_EXTENSION || 'https://github.com/adaptlearning/adapt-extension'
|
12
|
+
|
11
13
|
export const ADAPT_DEFAULT_USER_AGENT = process.env.ADAPT_DEFAULT_USER_AGENT || 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36'
|
12
14
|
|
13
15
|
export const HOME_DIRECTORY = [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "adapt-cli",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.3",
|
4
4
|
"description": "Command line tools for Adapt",
|
5
5
|
"main": "./lib/api.js",
|
6
6
|
"type": "module",
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"bower-endpoint-parser": "^0.2.2",
|
11
11
|
"chalk": "^2.4.1",
|
12
12
|
"decompress": "^4.2.1",
|
13
|
-
"download": "^
|
13
|
+
"download": "^8.0.0",
|
14
14
|
"find-up": "^6.2.0",
|
15
15
|
"fs-extra": "^10.0.0",
|
16
16
|
"globs": "^0.1.4",
|