update plugins index.ts

This commit is contained in:
Cherrie Chang 2024-11-01 17:45:19 -04:00
parent f0bc8ae3ac
commit 575346846c
57 changed files with 79 additions and 7 deletions

12
package-lock.json generated
View File

@ -11,7 +11,7 @@
"@changesets/changelog-github": "^0.4.7", "@changesets/changelog-github": "^0.4.7",
"@changesets/cli": "^2.25.2", "@changesets/cli": "^2.25.2",
"@jspsych/config": "^3.0.0", "@jspsych/config": "^3.0.0",
"husky": "^8.0.2", "husky": "^8.0.3",
"import-sort-style-module": "^6.0.0", "import-sort-style-module": "^6.0.0",
"lint-staged": "^13.0.3", "lint-staged": "^13.0.3",
"prettier": "^2.7.1", "prettier": "^2.7.1",
@ -4567,6 +4567,15 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/app-root-path": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz",
"integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==",
"license": "MIT",
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/aproba": { "node_modules/aproba": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
@ -16066,6 +16075,7 @@
"@types/gulp": "4.0.17", "@types/gulp": "4.0.17",
"@types/jest": "29.5.8", "@types/jest": "29.5.8",
"alias-hq": "6.2.4", "alias-hq": "6.2.4",
"app-root-path": "^3.1.0",
"canvas": "^2.11.2", "canvas": "^2.11.2",
"esbuild": "0.23.1", "esbuild": "0.23.1",
"gulp": "5.0.0", "gulp": "5.0.0",

View File

@ -28,7 +28,7 @@
"@changesets/changelog-github": "^0.4.7", "@changesets/changelog-github": "^0.4.7",
"@changesets/cli": "^2.25.2", "@changesets/cli": "^2.25.2",
"@jspsych/config": "^3.0.0", "@jspsych/config": "^3.0.0",
"husky": "^8.0.2", "husky": "^8.0.3",
"import-sort-style-module": "^6.0.0", "import-sort-style-module": "^6.0.0",
"lint-staged": "^13.0.3", "lint-staged": "^13.0.3",
"prettier": "^2.7.1", "prettier": "^2.7.1",

View File

@ -3,8 +3,10 @@ import "@citation-js/plugin-software-formats";
import "@citation-js/plugin-csl"; import "@citation-js/plugin-csl";
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path";
import { Cite } from "@citation-js/core"; import { Cite } from "@citation-js/core";
import appRootPath from "app-root-path";
import yaml from "yaml"; import yaml from "yaml";
/** /**
@ -18,19 +20,25 @@ export default function generateCitations() {
// Try to find CITATION.cff file and look for preferred-citation // Try to find CITATION.cff file and look for preferred-citation
const citationCff = (() => { const citationCff = (() => {
let rawCff;
try { try {
const rawCff = fs.readFileSync("./CITATION.cff", "utf-8").toString(); rawCff = fs.readFileSync("./CITATION.cff", "utf-8").toString();
const cffData = yaml.parse(rawCff); const cffData = yaml.parse(rawCff);
if (cffData["preferred-citation"]) { if (cffData["preferred-citation"]) {
preferredCitation = true; preferredCitation = true;
} }
return yaml.stringify(rawCff); return yaml.stringify(rawCff);
} catch (error) { } catch (error) {
console.log( try {
rawCff = fs.readFileSync(path.join(appRootPath.path, "CITATION.cff"), "utf-8").toString();
return yaml.stringify(rawCff);
} catch (error) {
console.warn(
`No CITATION.cff file found: ${error.message}. If you would like to include a citation, please create a CITATION.cff file in the root of your repository.` `No CITATION.cff file found: ${error.message}. If you would like to include a citation, please create a CITATION.cff file in the root of your repository.`
); );
return null; return null;
} }
}
})(); })();
if (!citationCff) { if (!citationCff) {

View File

@ -46,6 +46,7 @@
"@types/gulp": "4.0.17", "@types/gulp": "4.0.17",
"@types/jest": "29.5.8", "@types/jest": "29.5.8",
"alias-hq": "6.2.4", "alias-hq": "6.2.4",
"app-root-path": "^3.1.0",
"canvas": "^2.11.2", "canvas": "^2.11.2",
"esbuild": "0.23.1", "esbuild": "0.23.1",
"gulp": "5.0.0", "gulp": "5.0.0",

View File

@ -16,6 +16,7 @@ class RecordVideoExtension implements JsPsychExtension {
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
constructor(private jsPsych: JsPsych) { constructor(private jsPsych: JsPsych) {

View File

@ -91,6 +91,7 @@ class WebGazerExtension implements JsPsychExtension {
}, },
}, },
}, },
citations: "__CITATIONS__",
}; };
constructor(private jsPsych: JsPsych) {} constructor(private jsPsych: JsPsych) {}

View File

@ -96,6 +96,7 @@ const info = <const>{
}, },
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -110,6 +110,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -82,6 +82,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -117,6 +117,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -173,6 +173,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -27,6 +27,7 @@ const info = <const>{
default: undefined, default: undefined,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -113,6 +113,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -78,6 +78,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -90,6 +90,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -90,6 +90,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -95,6 +95,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -96,6 +96,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -39,6 +39,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -48,6 +48,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -167,6 +167,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -46,6 +46,7 @@ const info = <const>{
description: "Time in milliseconds until the user entered fullscreen mode.", description: "Time in milliseconds until the user entered fullscreen mode.",
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -75,6 +75,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -85,6 +85,7 @@ const info = <const>{
type: ParameterType.HTML_STRING, type: ParameterType.HTML_STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -92,6 +92,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -80,6 +80,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -111,6 +111,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -111,6 +111,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -124,6 +124,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -88,6 +88,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -128,6 +128,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -48,6 +48,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -23,6 +23,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -92,6 +92,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -75,6 +75,7 @@ const info = <const>{
}, },
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -38,6 +38,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -52,6 +52,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -50,6 +50,7 @@ const info = <const>{
type: ParameterType.FLOAT, type: ParameterType.FLOAT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -76,6 +76,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -78,6 +78,7 @@ const info = <const>{
type: ParameterType.STRING, type: ParameterType.STRING,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -88,6 +88,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -98,6 +98,7 @@ const info = <const>{
type: ParameterType.BOOL, type: ParameterType.BOOL,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -255,6 +255,7 @@ const info = <const>{
}, },
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -60,6 +60,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -88,6 +88,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -105,6 +105,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -110,6 +110,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -108,6 +108,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -66,6 +66,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -162,6 +162,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -109,6 +109,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -164,6 +164,7 @@ const info = <const>{
type: ParameterType.FLOAT, type: ParameterType.FLOAT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -170,6 +170,7 @@ const info = <const>{
type: ParameterType.FLOAT, type: ParameterType.FLOAT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -133,6 +133,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -62,6 +62,7 @@ const info = <const>{
data: { data: {
// no data collected // no data collected
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -30,6 +30,7 @@ const info = <const>{
type: ParameterType.INT, type: ParameterType.INT,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;

View File

@ -103,6 +103,7 @@ const info = <const>{
array: true, array: true,
}, },
}, },
citations: "__CITATIONS__",
}; };
type Info = typeof info; type Info = typeof info;