Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cli code to match contrib latest #11

Merged
merged 18 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,683 changes: 3,757 additions & 926 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"changeset": "changeset",
"changeset:version": "changeset version && npm install && npm run update-unpkg-links",
"changeset:publish": "npm run build && changeset publish",
"create-task": "node templates/cli/src/index.js"
"new": "node templates/cli/src/index.js"
cherriechang marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.0",
Expand Down Expand Up @@ -48,13 +48,7 @@
},
"dependencies": {
"chokidar": "^3.6.0",
"gulp": "^5.0.0",
"gulp-cli": "^3.0.0",
"braces": "^3.0.3",
cherriechang marked this conversation as resolved.
Show resolved Hide resolved
"jspsych": "^8.0.1"
},

"overrides": {
"braces": "^3.0.3"
}

}
4 changes: 2 additions & 2 deletions packages/arrow-flanker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@jspsych/plugin-html-keyboard-response": "^2.0.0"
},
"devDependencies": {
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"tsup": "^8.0.1",
"typescript": "^5.5.4"
}
}
14 changes: 7 additions & 7 deletions packages/false-memory-task/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jspsych/timeline-template",
"name": "@jspsych/false-memory-task",
"version": "0.0.1",
"description": "A template for a shareable, configurable false memory jsPsych experiment",
"description": "False memory task for jsPsych",
"type": "module",
"main": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand All @@ -11,17 +11,17 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/open-cognition-lab/false-memory-module.git"
"url": "git+https://github.com/jspsych/jspsych-timelines.git"
},
"keywords": [
"jsPsych"
],
"author": "Cherrie Chang",
"license": "MIT",
"bugs": {
"url": "https://github.com/open-cognition-lab/false-memory-module/issues"
"url": "https://github.com/jspsych/jspsych-timelines/issues"
},
"homepage": "https://github.com/open-cognition-lab/false-memory-module#readme",
"homepage": "https://github.com/jspsych/jspsych-timelines/packages/false-memory-task#readme",
"peerDependencies": {
"jspsych": "^8.0.1"
},
Expand All @@ -30,7 +30,7 @@
"@jspsych/plugin-survey-text": "^2.0.0"
},
"devDependencies": {
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"tsup": "^8.2.4",
"typescript": "^5.5.4"
}
}
6 changes: 3 additions & 3 deletions packages/spatial-cueing-task/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
},
"homepage": "https://github.com/jspsych/jspsych-timelines/packages/spatial-cueing-task#readme",
"peerDependencies": {
"jspsych": "^7.3.3"
"jspsych": "^8.0.1"
},
"dependencies": {
},
"devDependencies": {
"tsup": "^6.7.0",
"typescript": "^5.0.2"
"tsup": "^8.2.4",
"typescript": "^5.5.4"
}
}
32 changes: 16 additions & 16 deletions packages/spatial-cueing-task/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ function makeEndogenousCue(jsPsych: JsPsych, cue_period: number) {
const endogenous_cue = {
type: jsPsychHtmlKeyboardResponse,
stimulus: () => {
const validity = jsPsych.timelineVariable("validity");
const stimulus_direction = jsPsych.timelineVariable("stimulus_direction");
const validity = jsPsych.evaluateTimelineVariable("validity");
const stimulus_direction = jsPsych.evaluateTimelineVariable("stimulus_direction");
const cue_direction = cueDirectionMapper(validity, stimulus_direction);

var stimulus = `<div class="jspsych-spatial-cueing-container">` + StimulusBox.Default;
Expand Down Expand Up @@ -157,8 +157,8 @@ function makeExogenousCue(jsPsych: JsPsych, cue_period: number) {
const exogenous_cue = {
type: jsPsychHtmlKeyboardResponse,
stimulus: () => {
const validity = jsPsych.timelineVariable("validity");
const stimulus_direction = jsPsych.timelineVariable("stimulus_direction");
const validity = jsPsych.evaluateTimelineVariable("validity");
const stimulus_direction = jsPsych.evaluateTimelineVariable("stimulus_direction");
const cue_direction = cueDirectionMapper(validity, stimulus_direction);

var stimulus = `<div class="jspsych-spatial-cueing-container">`
Expand Down Expand Up @@ -186,15 +186,15 @@ function makeExogenousStimulus(jsPsych: JsPsych) {
const exogenous_stimulus = {
type: jsPsychHtmlKeyboardResponse,
stimulus: () => {
const validity = jsPsych.timelineVariable("validity");
const stimulus_direction = jsPsych.timelineVariable("stimulus_direction");
const validity = jsPsych.evaluateTimelineVariable("validity");
const stimulus_direction = jsPsych.evaluateTimelineVariable("stimulus_direction");
const cue_direction = cueDirectionMapper(validity, stimulus_direction);

var stimulus = `<div class="jspsych-spatial-cueing-container">`;
if (cue_direction == Direction.Left || cue_direction == Direction.Bi) {
stimulus += jsPsych.timelineVariable("stimulus_direction") == Direction.Left ? StimulusBox.WithStimulusHighlighted : StimulusBox.Highlighted;
stimulus += jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Left ? StimulusBox.WithStimulusHighlighted : StimulusBox.Highlighted;
}
else if (jsPsych.timelineVariable("stimulus_direction") == Direction.Left) {
else if (jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Left) {
stimulus += StimulusBox.WithStimulus;
}
else {
Expand All @@ -204,9 +204,9 @@ function makeExogenousStimulus(jsPsych: JsPsych) {
stimulus += FixationBox.NoCue;

if (cue_direction == Direction.Right || cue_direction == Direction.Bi) {
stimulus += jsPsych.timelineVariable("stimulus_direction") == Direction.Right ? StimulusBox.WithStimulusHighlighted : StimulusBox.Highlighted;
stimulus += jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Right ? StimulusBox.WithStimulusHighlighted : StimulusBox.Highlighted;
}
else if (jsPsych.timelineVariable("stimulus_direction") == Direction.Right) {
else if (jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Right) {
stimulus += StimulusBox.WithStimulus;
}
else {
Expand All @@ -222,7 +222,7 @@ function makeExogenousStimulus(jsPsych: JsPsych) {
task: "stimulus",
cue_type: "exogenous",
correct_response: () => {
return jsPsych.timelineVariable("stimulus_direction") == Direction.Left ? 'f' : 'j';
return jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Left ? 'f' : 'j';
}
},
on_finish: function (data: any) {
Expand All @@ -241,11 +241,11 @@ function makeEndogenousStimulus(jsPsych: JsPsych) {
const endogenous_stimulus = {
type: jsPsychHtmlKeyboardResponse,
stimulus: () => {
const validity = jsPsych.timelineVariable("validity");
const stimulus_direction = jsPsych.timelineVariable("stimulus_direction");
const validity = jsPsych.evaluateTimelineVariable("validity");
const stimulus_direction = jsPsych.evaluateTimelineVariable("stimulus_direction");
const cue_direction = cueDirectionMapper(validity, stimulus_direction);

var stimulus = `<div class="jspsych-spatial-cueing-container">` + (jsPsych.timelineVariable("stimulus_direction") == Direction.Left ? StimulusBox.WithStimulus : StimulusBox.Default);
var stimulus = `<div class="jspsych-spatial-cueing-container">` + (jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Left ? StimulusBox.WithStimulus : StimulusBox.Default);
switch (cue_direction) {
case Direction.Left:
stimulus += FixationBox.LeftCue;
Expand All @@ -261,7 +261,7 @@ function makeEndogenousStimulus(jsPsych: JsPsych) {
break;
};

stimulus += (jsPsych.timelineVariable("stimulus_direction") == Direction.Right ? StimulusBox.WithStimulus : StimulusBox.Default) + `</div>`;
stimulus += (jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Right ? StimulusBox.WithStimulus : StimulusBox.Default) + `</div>`;

return stimulus;
},
Expand All @@ -270,7 +270,7 @@ function makeEndogenousStimulus(jsPsych: JsPsych) {
task: "stimulus",
cue_type: "endogenous",
correct_response: () => {
return jsPsych.timelineVariable("stimulus_direction") == Direction.Left ? 'f' : 'j';
return jsPsych.evaluateTimelineVariable("stimulus_direction") == Direction.Left ? 'f' : 'j';
}
},
on_finish: function (data: any) {
Expand Down
Loading
Loading