@m2c2kit/cli 0.1.12 → 0.3.4
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/README.md +69 -2
- package/dist/.env +1 -1
- package/dist/assets/cli-starter/img/assessmentExample.png +0 -0
- package/dist/assets/css/bootstrap-datepicker.standalone.css +539 -0
- package/dist/assets/css/bootstrap-slider.css +328 -0
- package/dist/assets/css/defaultV2.css +3655 -0
- package/dist/assets/css/m2c2kit.css +72 -0
- package/dist/assets/css/modern.css +2564 -0
- package/dist/assets/css/nouislider.css +309 -0
- package/dist/assets/css/select2.css +712 -0
- package/dist/assets/css/survey.css +1006 -0
- package/dist/cli.js +428 -488
- package/dist/isReservedWord.js +98 -0
- package/dist/templates/README.md.handlebars +2 -2
- package/dist/templates/index.html.handlebars +26 -38
- package/dist/templates/index.ts.handlebars +579 -0
- package/dist/templates/launch.json.handlebars +1 -1
- package/dist/templates/package.json.handlebars +15 -14
- package/dist/templates/rollup.config.mjs.handlebars +73 -0
- package/dist/templates/tsconfig.json.handlebars +6 -15
- package/package.json +16 -16
- package/dist/scripts/post-install.mjs +0 -27
- package/dist/templates/rollup.config.js.handlebars +0 -97
- package/dist/templates/starter.ts.handlebars +0 -426
- /package/dist/{fonts → assets/cli-starter/fonts}/roboto/LICENSE.txt +0 -0
- /package/dist/{fonts → assets/cli-starter/fonts}/roboto/Roboto-Regular.ttf +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export function isReservedWord(name) {
|
|
2
|
+
const reserved = [
|
|
3
|
+
"abstract",
|
|
4
|
+
"arguments",
|
|
5
|
+
"await",
|
|
6
|
+
"boolean",
|
|
7
|
+
"break",
|
|
8
|
+
"byte",
|
|
9
|
+
"case",
|
|
10
|
+
"catch",
|
|
11
|
+
"char",
|
|
12
|
+
"class",
|
|
13
|
+
"const",
|
|
14
|
+
"continue",
|
|
15
|
+
"debugger",
|
|
16
|
+
"default",
|
|
17
|
+
"delete",
|
|
18
|
+
"do",
|
|
19
|
+
"double",
|
|
20
|
+
"else",
|
|
21
|
+
"enum",
|
|
22
|
+
"eval",
|
|
23
|
+
"export",
|
|
24
|
+
"extends",
|
|
25
|
+
"false",
|
|
26
|
+
"final",
|
|
27
|
+
"finally",
|
|
28
|
+
"float",
|
|
29
|
+
"for",
|
|
30
|
+
"function",
|
|
31
|
+
"goto",
|
|
32
|
+
"if",
|
|
33
|
+
"implements",
|
|
34
|
+
"import",
|
|
35
|
+
"in",
|
|
36
|
+
"instanceof",
|
|
37
|
+
"int",
|
|
38
|
+
"interface",
|
|
39
|
+
"let",
|
|
40
|
+
"long",
|
|
41
|
+
"native",
|
|
42
|
+
"new",
|
|
43
|
+
"null",
|
|
44
|
+
"package",
|
|
45
|
+
"private",
|
|
46
|
+
"protected",
|
|
47
|
+
"public",
|
|
48
|
+
"return",
|
|
49
|
+
"short",
|
|
50
|
+
"static",
|
|
51
|
+
"super",
|
|
52
|
+
"switch",
|
|
53
|
+
"synchronized",
|
|
54
|
+
"this",
|
|
55
|
+
"throw",
|
|
56
|
+
"throws",
|
|
57
|
+
"transient",
|
|
58
|
+
"true",
|
|
59
|
+
"try",
|
|
60
|
+
"typeof",
|
|
61
|
+
"var",
|
|
62
|
+
"void",
|
|
63
|
+
"volatile",
|
|
64
|
+
"while",
|
|
65
|
+
"with",
|
|
66
|
+
"yield",
|
|
67
|
+
];
|
|
68
|
+
const builtin = [
|
|
69
|
+
"Array",
|
|
70
|
+
"Date",
|
|
71
|
+
"eval",
|
|
72
|
+
"function",
|
|
73
|
+
"hasOwnProperty",
|
|
74
|
+
"Infinity",
|
|
75
|
+
"isFinite",
|
|
76
|
+
"isNaN",
|
|
77
|
+
"isPrototypeOf",
|
|
78
|
+
"length",
|
|
79
|
+
"Math",
|
|
80
|
+
"name",
|
|
81
|
+
"NaN",
|
|
82
|
+
"Number",
|
|
83
|
+
"Object",
|
|
84
|
+
"prototype",
|
|
85
|
+
"String",
|
|
86
|
+
"toString",
|
|
87
|
+
"undefined",
|
|
88
|
+
"valueOf",
|
|
89
|
+
];
|
|
90
|
+
if (reserved.includes(name) || builtin.includes(name)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
const re = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
|
|
94
|
+
if (!re.test(name)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
@@ -4,9 +4,9 @@ This project was generated with the m2c2kit CLI version {{cliVersion}}.
|
|
|
4
4
|
|
|
5
5
|
## Development server
|
|
6
6
|
|
|
7
|
-
Run `npm run serve` from the command line for a development server. Browse to `http://localhost:3000/`. The app will automatically compile and reload when you change source files. If you get an error on the reload, edit `rollup.config.
|
|
7
|
+
Run `npm run serve` from the command line for a development server. Browse to `http://localhost:3000/`. The app will automatically compile and reload when you change source files. If you get an error on the reload, edit `rollup.config.mjs` and increase the delay parameter (unit is milliseconds) in this line:
|
|
8
8
|
|
|
9
|
-
livereload({ watch: "build", delay:
|
|
9
|
+
livereload({ watch: "build", delay: 250 })
|
|
10
10
|
|
|
11
11
|
## Debugging
|
|
12
12
|
|
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>{{appName}}</title>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta http-equiv="Cache-Control" content="no-store, max-age=0" />
|
|
7
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
|
8
|
+
<meta http-equiv="Expires" content="0" />
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<link href="assets/css/m2c2kit.css" rel="preload" as="style" />
|
|
11
|
+
<link href="assets/css/m2c2kit.css" rel="stylesheet" />
|
|
12
|
+
<link href="assets/css/defaultV2.css" rel="stylesheet" />
|
|
13
|
+
<link href="assets/css/nouislider.css" rel="stylesheet" />
|
|
14
|
+
<link href="assets/css/select2.css" rel="stylesheet" />
|
|
15
|
+
<link
|
|
16
|
+
href="assets/css/bootstrap-datepicker.standalone.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
/>
|
|
19
|
+
<link href="assets/css/bootstrap-slider.css" rel="stylesheet" />
|
|
20
|
+
<script type="module" src="./index.js" defer></script>
|
|
21
|
+
</head>
|
|
3
22
|
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<meta charset="UTF-8" />
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
-
</head>
|
|
14
|
-
|
|
15
|
-
<body style="background: white">
|
|
16
|
-
<div style="
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
align-items: center;
|
|
20
|
-
height: 100vh;
|
|
21
|
-
width: 100vw;
|
|
22
|
-
">
|
|
23
|
-
<canvas style="height: 100vh; width: 100vw" id="m2c2-canvas"></canvas>
|
|
24
|
-
<!-- If you don't want the game to start immediately, remove session.start()
|
|
25
|
-
from the code and call session.start() somehow else, such as with
|
|
26
|
-
the button shown below or a programmatic call -->
|
|
27
|
-
<!-- <button
|
|
28
|
-
style="position: absolute; bottom: 8px; left: 8px"
|
|
29
|
-
id="startButton"
|
|
30
|
-
onclick="{
|
|
31
|
-
document.getElementById('startButton').disabled = true;
|
|
32
|
-
window.session.start();
|
|
33
|
-
}"
|
|
34
|
-
>
|
|
35
|
-
Start
|
|
36
|
-
</button> -->
|
|
37
|
-
</div>
|
|
38
|
-
<script type="module" src="./{{appName}}.bundle.js"></script>
|
|
39
|
-
</body>
|
|
40
|
-
|
|
41
|
-
</html>
|
|
23
|
+
<body class="m2c2kit-background-color m2c2kit-no-margin">
|
|
24
|
+
<div id="m2c2kit-survey-div"></div>
|
|
25
|
+
<div class="m2c2kit-full-viewport m2c2kit-flex-container" id="m2c2kit-container-div">
|
|
26
|
+
<canvas class="m2c2kit-full-viewport" id="m2c2kit-canvas"></canvas>
|
|
27
|
+
</div>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|