Addressed minor pr comments

This commit is contained in:
vzhang03 2024-06-27 14:58:35 -04:00
parent c2ee292b56
commit e7a4ad9156
4 changed files with 5 additions and 30 deletions

View File

@ -14,19 +14,9 @@
const metadata_options = { const metadata_options = {
randomField: "this is a field", randomField: "this is a field",
author: { author: {
"John Cena": { "John": {
name: "John Cena", name: "John",
givenName: "Sammy Salami", givenName: "Johnathan",
},
"Darnell": {
givenName: "bob",
},
"Bob": "Bob",
"Joe": {
name: "Joe",
},
"Ostrich": {
bbqblaster: 10,
}, },
}, },
variables: { variables: {
@ -35,21 +25,9 @@
"chat-plugin": "this chat plugin allows you to talk to gpt!", "chat-plugin": "this chat plugin allows you to talk to gpt!",
} }
}, },
"time_elapsed": {
bbq: "indicates the number of barbeques",
description: {
"chat-plugin": "this chat plugin allows you to talk to gpt!",
"donut-plugin": "this plugin lets you eat donuts!",
"bbq-plugin": "this plugin lets you spell barbeque",
}
},
"trial_index": { "trial_index": {
value: "NEW VALUE",
bbq: "number of barbeques per sq ft",
name: "index", name: "index",
donuts: "Number of donuts",
}, },
}, },
} }

View File

@ -144,9 +144,7 @@ export type UniversalPluginParameters = InferredParameters<typeof universalPlugi
export interface PluginInfo { export interface PluginInfo {
name: string; name: string;
version?: string;
parameters: ParameterInfos; parameters: ParameterInfos;
data?: ParameterInfos;
} }
export interface JsPsychPlugin<I extends PluginInfo> { export interface JsPsychPlugin<I extends PluginInfo> {

View File

@ -1,7 +1,7 @@
{ {
"name": "@jspsych/metadata", "name": "@jspsych/metadata",
"version": "0.0.1", "version": "0.0.1",
"description": "jsPsych plugin for creating and customizing metadata according to Psych-DS standards.", "description": "jsPsych package for creating and customizing metadata according to Psych-DS standards.",
"type": "module", "type": "module",
"main": "dist/index.cjs", "main": "dist/index.cjs",
"exports": { "exports": {

View File

@ -18,7 +18,6 @@ export class PluginCache {
async getPluginInfo(pluginType: string, variableName: string) { async getPluginInfo(pluginType: string, variableName: string) {
// fetches if it doesn't exist // fetches if it doesn't exist
if (!(pluginType in this.pluginFields)) { if (!(pluginType in this.pluginFields)) {
console.log("doesn't exist -- plugintype:", pluginType, "variableName:", variableName); // checking search
const fields = await this.generatePluginFields(pluginType); const fields = await this.generatePluginFields(pluginType);
this.pluginFields[pluginType] = fields; this.pluginFields[pluginType] = fields;
} }
@ -57,7 +56,7 @@ export class PluginCache {
pluginType, pluginType,
"with error", "with error",
error, error,
"If you are using a plugin not in the main JsPsych branch it will not automatically fetch." "Note: if you are using a plugin not in the main JsPsych branch this will always fail."
); );
return undefined; return undefined;
} }