@m2c2kit/assessment-color-shapes 0.8.4 → 0.8.5

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/dist/index.js CHANGED
@@ -107,7 +107,7 @@ class ColorShapes extends Game {
107
107
  },
108
108
  instruction_type: {
109
109
  default: "long",
110
- description: "Type of intructions to show, 'short' or 'long'.",
110
+ description: "Type of instructions to show, 'short' or 'long'.",
111
111
  type: "string",
112
112
  enum: ["short", "long"]
113
113
  },
@@ -238,7 +238,7 @@ class ColorShapes extends Game {
238
238
  const options = {
239
239
  name: "Color Shapes",
240
240
  id: "color-shapes",
241
- version: "0.8.4",
241
+ version: "0.8.5",
242
242
  shortDescription: "Color Shapes is a visual array change detection task, measuring intra-item feature binding, where participants determine if shapes change color across two sequential presentations of shape stimuli.",
243
243
  longDescription: `Color Shapes is a change detection paradigm used to measure visual short-term memory binding (Parra et al., 2009). Participants are asked to memorize the shapes and colors of three different polygons for 3 seconds. The three polygons are then removed from the screen and re-displayed at different locations, either having the same or different colors. Participants are then asked to decide whether the combination of colors and shapes are the "Same" or "Different" between the study and test phases.`,
244
244
  showFps: defaultParameters.show_fps.default,
@@ -246,25 +246,30 @@ class ColorShapes extends Game {
246
246
  height: 800,
247
247
  trialSchema: colorShapesTrialSchema,
248
248
  parameters: defaultParameters,
249
- fontUrls: ["assets/color-shapes/fonts/roboto/Roboto-Regular.ttf"],
249
+ fonts: [
250
+ {
251
+ fontName: "roboto",
252
+ url: "fonts/roboto/Roboto-Regular.ttf"
253
+ }
254
+ ],
250
255
  images: [
251
256
  {
252
257
  imageName: "instructions-1",
253
258
  height: 256,
254
259
  width: 256,
255
- url: "assets/color-shapes/img/cs-instructions-1.png"
260
+ url: "images/cs-instructions-1.png"
256
261
  },
257
262
  {
258
263
  imageName: "instructions-2",
259
264
  height: 256,
260
265
  width: 256,
261
- url: "assets/color-shapes/img/cs-instructions-2.png"
266
+ url: "images/cs-instructions-2.png"
262
267
  },
263
268
  {
264
269
  imageName: "instructions-3",
265
270
  height: 330,
266
271
  width: 256,
267
- url: "assets/color-shapes/img/cs-instructions-3.png"
272
+ url: "images/cs-instructions-3.png"
268
273
  },
269
274
  {
270
275
  imageName: "circle-x",
@@ -272,7 +277,7 @@ class ColorShapes extends Game {
272
277
  width: 32,
273
278
  // the svg is from evericons and is licensed under CC0 1.0
274
279
  // Universal (Public Domain). see https://www.patreon.com/evericons
275
- url: "assets/color-shapes/img/circle-x.svg"
280
+ url: "images/circle-x.svg"
276
281
  }
277
282
  ]
278
283
  };
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@m2c2kit/assessment-color-shapes",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "scripts": {
5
5
  "build": "npm run clean && tsc && rollup -c",
6
- "clean": "rimraf build build-nobundler dist .rollup.cache tsconfig.tsbuildinfo",
7
- "postinstall": "node post-install.mjs"
6
+ "clean": "rimraf build build-nobundler dist .rollup.cache tsconfig.tsbuildinfo"
8
7
  },
9
8
  "main": "dist/index.js",
10
9
  "module": "dist/index.js",
@@ -16,8 +15,7 @@
16
15
  "files": [
17
16
  "dist/index.js",
18
17
  "dist/index.d.ts",
19
- "assets/**",
20
- "post-install.mjs"
18
+ "assets/**"
21
19
  ],
22
20
  "dependencies": {
23
21
  "@m2c2kit/addons": "^0.3.3",
@@ -27,7 +25,7 @@
27
25
  "@rollup/plugin-node-resolve": "15.0.2",
28
26
  "@rollup/plugin-replace": "5.0.2",
29
27
  "rimraf": "5.0.0",
30
- "rollup": "3.20.6",
28
+ "rollup": "3.22.0",
31
29
  "rollup-plugin-copy": "3.4.0",
32
30
  "rollup-plugin-esbuild": "5.0.0",
33
31
  "typescript": "5.0.4"
package/post-install.mjs DELETED
@@ -1,72 +0,0 @@
1
- #!/usr/bin/env node
2
- import { readFileSync, existsSync } from "fs";
3
- import { resolve, join, dirname } from "path";
4
- import { env, exit } from "process";
5
- import { readdir, readFile, mkdir, writeFile } from "fs/promises";
6
-
7
- /**
8
- * Our current working directory for this postinstall script is the
9
- * package's root folder in node_modules, e.g., node_modules/{packageName}
10
- */
11
-
12
- /**
13
- * The folder in which npm command was executed -- this differs from the
14
- * current working directory.
15
- */
16
- const npmCwd = env.INIT_CWD;
17
-
18
- /**
19
- * If the full m2c2kit repo has been cloned and "npm install" is executed,
20
- * when this package is installed it will run this post-install script.
21
- * But, we should run this only when the package is being installed in a
22
- * new m2c2kit project, because it will copy assets to the
23
- * appropriate location in the project root. The below code will check if
24
- * npm install is being run on the entire m2c2kit repo, and if so, exit this
25
- * script before copying any assets.
26
- * Note: this will cause problems if someone decides to name their m2c2kit
27
- * project "m2c2kit".
28
- */
29
- const { name } = JSON.parse(readFileSync(join(npmCwd, "package.json")));
30
- if (name === "m2c2kit") {
31
- exit(0);
32
- }
33
-
34
- async function copyFolderRecursive(options) {
35
- async function getFilePathsRecursive(dir) {
36
- const dirents = await readdir(dir, { withFileTypes: true });
37
- const files = await Promise.all(
38
- dirents.map((dirent) => {
39
- const res = resolve(dir, dirent.name);
40
- return dirent.isDirectory() ? getFilePathsRecursive(res) : res;
41
- })
42
- );
43
- return Array.prototype.concat(...files);
44
- }
45
-
46
- const filePaths = await getFilePathsRecursive(options.sourceFolder);
47
-
48
- filePaths.forEach(async (filePath) => {
49
- const destinationFilePath = join(
50
- options.destinationFolder,
51
- filePath.replace(resolve(options.sourceFolder), options.baseFolder)
52
- );
53
- if (!options.overwrite && existsSync(destinationFilePath)) {
54
- return;
55
- }
56
-
57
- const folder = dirname(destinationFilePath);
58
- if (!existsSync(folder)) {
59
- await mkdir(folder, { recursive: true });
60
- }
61
-
62
- const content = await readFile(filePath);
63
- await writeFile(destinationFilePath, content);
64
- });
65
- }
66
-
67
- copyFolderRecursive({
68
- sourceFolder: "assets",
69
- destinationFolder: join(npmCwd, "src"),
70
- baseFolder: "assets",
71
- overwrite: false,
72
- });