Skip to content

Commit

Permalink
update plugins index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cherriechang committed Nov 1, 2024
1 parent f0bc8ae commit 5753468
Show file tree
Hide file tree
Showing 57 changed files with 79 additions and 7 deletions.
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@changesets/changelog-github": "^0.4.7",
"@changesets/cli": "^2.25.2",
"@jspsych/config": "^3.0.0",
"husky": "^8.0.2",
"husky": "^8.0.3",
"import-sort-style-module": "^6.0.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
Expand Down
18 changes: 13 additions & 5 deletions packages/config/generateCitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import "@citation-js/plugin-software-formats";
import "@citation-js/plugin-csl";

import fs from "node:fs";
import path from "node:path";

import { Cite } from "@citation-js/core";
import appRootPath from "app-root-path";
import yaml from "yaml";

/**
Expand All @@ -18,18 +20,24 @@ export default function generateCitations() {

// Try to find CITATION.cff file and look for preferred-citation
const citationCff = (() => {
let rawCff;
try {
const rawCff = fs.readFileSync("./CITATION.cff", "utf-8").toString();
rawCff = fs.readFileSync("./CITATION.cff", "utf-8").toString();
const cffData = yaml.parse(rawCff);
if (cffData["preferred-citation"]) {
preferredCitation = true;
}
return yaml.stringify(rawCff);
} catch (error) {
console.log(
`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;
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.`
);
return null;
}
}
})();

Expand Down
1 change: 1 addition & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@types/gulp": "4.0.17",
"@types/jest": "29.5.8",
"alias-hq": "6.2.4",
"app-root-path": "^3.1.0",
"canvas": "^2.11.2",
"esbuild": "0.23.1",
"gulp": "5.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/extension-record-video/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class RecordVideoExtension implements JsPsychExtension {
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

constructor(private jsPsych: JsPsych) {
Expand Down
1 change: 1 addition & 0 deletions packages/extension-webgazer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class WebGazerExtension implements JsPsychExtension {
},
},
},
citations: "__CITATIONS__",
};

constructor(private jsPsych: JsPsych) {}
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-animation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const info = <const>{
},
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-audio-button-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-audio-keyboard-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-audio-slider-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-browser-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-call-function/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const info = <const>{
default: undefined,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-canvas-button-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-canvas-keyboard-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-canvas-slider-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-categorize-animation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-categorize-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-categorize-image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-cloze/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const info = <const>{
array: true,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-external-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-free-sort/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-fullscreen/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const info = <const>{
description: "Time in milliseconds until the user entered fullscreen mode.",
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-html-audio-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-html-button-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const info = <const>{
type: ParameterType.HTML_STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-html-slider-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-html-video-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-iat-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-iat-image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-image-button-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-image-keyboard-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-image-slider-response/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-initialize-camera/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-initialize-microphone/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-instructions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-maxdiff/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const info = <const>{
},
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-mirror-camera/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-reconstruction/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const info = <const>{
type: ParameterType.INT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-resize/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const info = <const>{
type: ParameterType.FLOAT,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-same-different-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-same-different-image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const info = <const>{
type: ParameterType.STRING,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-serial-reaction-time-mouse/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-serial-reaction-time/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const info = <const>{
type: ParameterType.BOOL,
},
},
citations: "__CITATIONS__",
};

type Info = typeof info;
Expand Down
Loading

0 comments on commit 5753468

Please sign in to comment.