@m2c2kit/cli 0.1.1 → 0.1.6

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.
@@ -1,15 +1,17 @@
1
- # {{appName}}
2
-
3
- This project was generated with the m2c2kit CLI.
4
-
5
- ## Development server
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.
8
-
9
- ## Debugging
10
-
11
- With the file `.vscode/launch.json`, the project has been configured for debugging with Visual Studio Code and Chrome. If the development server is running, debugging in Visual Studio Code is available by pressing `F5` or selecting Run --> Start Debugging
12
-
13
- ## Build
14
-
15
- Run `npm run build` from the command line to build the project. Build artifacts will be stored in the `dist/` directory.
1
+ # {{appName}}
2
+
3
+ This project was generated with the m2c2kit CLI version {{cliVersion}}.
4
+
5
+ ## Development server
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.js` and increase the delay parameter (unit is milliseconds) in this line:
8
+
9
+ livereload({ watch: "build", delay: 0 })
10
+
11
+ ## Debugging
12
+
13
+ With the file `.vscode/launch.json`, the project has been configured for debugging with Visual Studio Code and Chrome. If the development server is running, debugging in Visual Studio Code is available by pressing `F5` or selecting Run --> Start Debugging
14
+
15
+ ## Build
16
+
17
+ Run `npm run build` from the command line to build the project. Build artifacts will be stored in the `dist/` directory.
@@ -1,41 +1,41 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>{{appName}}</title>
5
- <style type="text/css">
6
- body {
7
- margin: 0;
8
- }
9
- </style>
10
- <meta charset="UTF-8" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- </head>
13
3
 
14
- <body style="background: white">
15
- <div
16
- style="
4
+ <head>
5
+ <title>{{appName}}</title>
6
+ <style type="text/css">
7
+ body {
8
+ margin: 0;
9
+ }
10
+ </style>
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
17
  display: flex;
18
18
  justify-content: center;
19
19
  align-items: center;
20
20
  height: 100vh;
21
21
  width: 100vw;
22
- "
23
- >
24
- <canvas style="height: 100vh; width: 100vw"></canvas>
25
- <!-- If you don't want the game to start immediately, remove game.start()
26
- from the code and call game.start() somehow else, such as with
22
+ ">
23
+ <canvas style="height: 100vh; width: 100vw"></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
27
26
  the button shown below or a programmatic call -->
28
27
  <!-- <button
29
28
  style="position: absolute; bottom: 8px; left: 8px"
30
29
  id="startButton"
31
30
  onclick="{
32
31
  document.getElementById('startButton').disabled = true;
33
- window.game.start();
32
+ window.session.start();
34
33
  }"
35
34
  >
36
35
  Start
37
36
  </button> -->
38
- </div>
39
- <script type="module" src="./{{appName}}.bundle.js"></script>
40
- </body>
41
- </html>
37
+ </div>
38
+ <script type="module" src="./{{appName}}.bundle.js"></script>
39
+ </body>
40
+
41
+ </html>
@@ -1,15 +1,15 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "pwa-chrome",
9
- "request": "launch",
10
- "name": "Launch Chrome against localhost",
11
- "url": "http://localhost:3000",
12
- "webRoot": "${workspaceFolder}/build"
13
- }
14
- ]
15
- }
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "pwa-chrome",
9
+ "request": "launch",
10
+ "name": "Launch Chrome against localhost",
11
+ "url": "http://localhost:3000",
12
+ "webRoot": "${workspaceFolder}/build"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "server": {
3
+ "studyCode": "{{studyCode}}"
4
+ }
5
+ }
@@ -1,21 +1,24 @@
1
- {
2
- "name": "{{appName}}",
3
- "version": "1.0.0",
4
- "scripts": {
5
- "serve": "rollup -c --watch --configServe",
6
- "build": "rollup -c --configProd"
7
- },
8
- "private": true,
9
- "dependencies": {
10
- "@m2c2kit/core": "^0.1.0",
11
- "typescript": "^4.5.2",
12
- "rollup": "^2.60.2",
13
- "@rollup/plugin-typescript": "^8.3.0",
14
- "rollup-plugin-shim": "^1.0.0",
15
- "@rollup/plugin-node-resolve": "^13.0.6",
16
- "@rollup/plugin-commonjs": "^21.0.1",
17
- "rollup-plugin-copy": "^3.4.0",
18
- "rollup-plugin-serve": "^1.1.0",
19
- "rollup-plugin-livereload": "^2.0.5"
20
- }
1
+ {
2
+ "name": "{{appName}}",
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "serve": "rollup -c --watch --configServe",
6
+ "build": "rollup -c --configProd"
7
+ },
8
+ "private": true,
9
+ "dependencies": {
10
+ "@m2c2kit/core": "0.1.5",
11
+ "@m2c2kit/addons": "0.1.5"
12
+ },
13
+ "devDependencies": {
14
+ "rollup": "2.63.0",
15
+ "@rollup/plugin-typescript": "8.3.0",
16
+ "@rollup/plugin-node-resolve": "13.1.3",
17
+ "@rollup/plugin-commonjs": "21.0.1",
18
+ "rollup-plugin-shim": "1.0.0",
19
+ "rollup-plugin-copy": "3.4.0",
20
+ "rollup-plugin-delete": "2.0.0",
21
+ "rollup-plugin-serve": "1.1.0",
22
+ "rollup-plugin-livereload": "2.0.5"
23
+ }
21
24
  }
@@ -1,10 +1,11 @@
1
1
  import typescript from "@rollup/plugin-typescript";
2
- import shim from "rollup-plugin-shim";
3
2
  import nodeResolve from "@rollup/plugin-node-resolve";
4
3
  import commonjs from "@rollup/plugin-commonjs";
4
+ import shim from "rollup-plugin-shim";
5
5
  import copy from "rollup-plugin-copy";
6
6
  import serve from "rollup-plugin-serve";
7
7
  import livereload from "rollup-plugin-livereload";
8
+ import del from "rollup-plugin-delete";
8
9
 
9
10
  let sharedPlugins = [
10
11
  // canvaskit-wasm references these node.js functions
@@ -37,6 +38,7 @@ export default (commandLineArgs) => {
37
38
  },
38
39
  ],
39
40
  plugins: [
41
+ commandLineArgs.configProd && del({ targets: [outputFolder] }),
40
42
  ...sharedPlugins,
41
43
  typescript({
42
44
  inlineSourceMap: commandLineArgs.configServe && true,
@@ -49,8 +51,16 @@ export default (commandLineArgs) => {
49
51
  src: "node_modules/canvaskit-wasm/bin/canvaskit.wasm",
50
52
  dest: outputFolder,
51
53
  },
54
+ {
55
+ src: "fonts/*",
56
+ dest: `${outputFolder}/fonts`,
57
+ },
58
+ {
59
+ src: "img/*",
60
+ dest: `${outputFolder}/img`,
61
+ },
52
62
  ],
53
- copyOnce: true,
63
+ copyOnce: false,
54
64
  hook: "writeBundle",
55
65
  }),
56
66
  copy({
@@ -65,7 +75,9 @@ export default (commandLineArgs) => {
65
75
  }),
66
76
  commandLineArgs.configServe &&
67
77
  serve({
68
- open: false,
78
+ // we can start development server and automatically open browser by running
79
+ // npm run serve -- --configOpen
80
+ open: commandLineArgs.configOpen && true,
69
81
  verbose: true,
70
82
  contentBase: [`./${outputFolder}`],
71
83
  historyApiFallback: true,
@@ -73,7 +85,7 @@ export default (commandLineArgs) => {
73
85
  port: 3000,
74
86
  }),
75
87
  commandLineArgs.configServe &&
76
- livereload(),
88
+ livereload({ watch: "build", delay: 0 }),
77
89
  ],
78
90
  },
79
91
  ];