@m2c2kit/cli 0.3.8 → 0.3.10
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/LICENSE +21 -0
- package/README.md +14 -64
- package/package.json +20 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Scott T. Yabiku
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,72 +1,22 @@
|
|
|
1
1
|
# @m2c2kit/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://github.com/m2c2-project/m2c2kit/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@m2c2kit/cli)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
This package contains the command line interface (CLI) for developing m2c2kit apps.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- [Visual Studio Code](https://code.visualstudio.com/download). Recommended.
|
|
9
|
-
- [Google Chrome](https://www.google.com/chrome). Recommended.
|
|
10
|
-
- [Git](https://git-scm.com/downloads). Recommended.
|
|
9
|
+
**m2c2kit** is a library for cross-platform cognitive assessments. Features:
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
- **Mobile first**. Optimized for touch and mobile devices while also usable on desktops.
|
|
12
|
+
- **Portable**. Use on browsers, compile within native apps using web views, or embed in products like Qualtrics. A shared assessment codebase reduces development time and promotes experiment standardization across devices and services.
|
|
13
|
+
- **Rapid iteration**. Quickly develop and test new assessments with the JavaScript-based library and deploy them in studies.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## Resources
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
npm install -g @m2c2kit/cli
|
|
18
|
-
m2 new myapp
|
|
19
|
-
cd myapp
|
|
20
|
-
npm run serve
|
|
21
|
-
```
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Note: if you execute `npm run build`, it will create a production build in `dist` that is suitable for deploying to a web server. In a production build, all build artifacts (except for `index.html`) will have hashes added to their filenames to promote cache busting upon repeated deployments.
|
|
28
|
-
|
|
29
|
-
## Visual Studio Code
|
|
30
|
-
|
|
31
|
-
When creating a project with `m2 new`, the CLI will configure the project for debugging with Visual Studio Code and Chrome. When the app is served locally (`npm run serve`), debugging in Visual Studio Code is available by pressing `F5` or selecting Run, Start Debugging.
|
|
32
|
-
|
|
33
|
-
<img src=".github/images/m2c2kit-vscode-debugging.gif" />
|
|
34
|
-
|
|
35
|
-
## Adding more cognitive assessments
|
|
36
|
-
|
|
37
|
-
m2c2kit has a rich API for writing your own cognitive assessments. In addition, the m2c2kit team has developed cognitive assessments in ready-to-use form, which are available as separate packages (`@m2c2kit/assessment-symbol-search`, `@m2c2kit/assessment-color-dots`, `@m2c2kit/assessment-grid-memory`, `@m2c2kit/assessment-color-shapes`). Once you have scaffolded the demo app, to add additional assessments:
|
|
38
|
-
|
|
39
|
-
1. Install the package for the assessment. For example, if you scaffolded your app above with `m2 new myapp`, and now you want to add the m2c2kit Symbol Search assessment, execute the following from the `myapp` directory: `npm install @m2c2kit/assessment-symbol-search`.
|
|
40
|
-
2. Update your app's source code to import the Symbol Search assessment. In the file `src/index.ts`, add to the top: `import { SymbolSearch } from '@m2c2kit/assessment-symbol-search';`
|
|
41
|
-
3. Update your app's source code to create and use an instance of Symbol Search. In the file `src/index.ts`, find these lines:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
const activity = new Myapp();
|
|
45
|
-
const session = new Session({
|
|
46
|
-
activities: [activity],
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
and change to
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
const activity = new Myapp();
|
|
53
|
-
const ss = new SymbolSearch();
|
|
54
|
-
const session = new Session({
|
|
55
|
-
activities: [ss, activity],
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Now your app will run Symbol Search before it runs the demo assessment (Stroop).
|
|
59
|
-
|
|
60
|
-
## Configuring cognitive assessments
|
|
61
|
-
|
|
62
|
-
The assessments built by the m2c2kit team have reasonable default parameters, but assessments are also configurable. For example, the Symbol Search assessment has a default of 5 trials. To increase that to 10, find the code in `src/index.ts` that creates the `SymbolSearch` object and change it to:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
const ss = new SymbolSearch({ "number_of_trials": 10 });
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
A full listing of the parameters for each assessments, and their default values, is available in repository for each assessment.
|
|
69
|
-
|
|
70
|
-
## License
|
|
71
|
-
|
|
72
|
-
MIT
|
|
19
|
+
- [Website](https://m2c2-project.github.io/m2c2kit/)
|
|
20
|
+
- [Live Examples](https://m2c2-project.github.io/m2c2kit/docs/category/examples)
|
|
21
|
+
- [Getting Started](https://m2c2-project.github.io/m2c2kit/docs/getting-started)
|
|
22
|
+
- [Interactive Tutorials](https://m2c2-project.github.io/m2c2kit/docs/category/tutorials)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m2c2kit/cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.10",
|
|
4
|
+
"description": "Command line interface to create new m2c2kit apps",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**"
|
|
7
7
|
],
|
|
@@ -13,21 +13,33 @@
|
|
|
13
13
|
"compile": "tsc",
|
|
14
14
|
"clean": "rimraf dist"
|
|
15
15
|
},
|
|
16
|
-
"author": "",
|
|
17
16
|
"license": "MIT",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Scott T. Yabiku",
|
|
19
|
+
"email": "syabiku@gmail.com"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/m2c2-project/m2c2kit.git",
|
|
24
|
+
"directory": "packages/cli"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://m2c2-project.github.io/m2c2kit",
|
|
18
27
|
"dependencies": {
|
|
19
|
-
"@angular-devkit/core": "^16.
|
|
20
|
-
"@angular-devkit/schematics": "^16.
|
|
28
|
+
"@angular-devkit/core": "^16.1.3",
|
|
29
|
+
"@angular-devkit/schematics": "^16.1.3",
|
|
21
30
|
"@m2c2kit/schematics": "^0.1.0",
|
|
22
|
-
"@schematics/angular": "^16.
|
|
23
|
-
"@types/inquirer": "^8.2.4",
|
|
31
|
+
"@schematics/angular": "^16.1.3",
|
|
24
32
|
"ansi-colors": "4.1.3",
|
|
25
33
|
"inquirer": "8.2.4",
|
|
26
34
|
"symbol-observable": "4.0.0",
|
|
27
35
|
"yargs-parser": "21.1.1"
|
|
28
36
|
},
|
|
29
37
|
"devDependencies": {
|
|
38
|
+
"@types/inquirer": "8.2.6",
|
|
30
39
|
"rimraf": "5.0.1",
|
|
31
|
-
"typescript": "5.1.
|
|
40
|
+
"typescript": "5.1.6"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
32
44
|
}
|
|
33
45
|
}
|