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

closing old template mechanism branch #19

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6997f81
add false-memory-task
cherriechang Jun 19, 2023
abfa815
add spatial cueing package
cherriechang Jun 20, 2023
6af0a04
first attempt at passing previously failed tests
cherriechang Jun 21, 2023
6078789
Delete tender-deers-chew.md
jodeleeuw Jun 21, 2023
440c7d3
switch to node 18, npm 9
jodeleeuw Jun 22, 2023
7e56592
update to jspsych config 1.3.3
jodeleeuw Jun 22, 2023
d2d5168
Merge branch 'main' into false_memory_import
jodeleeuw Jun 22, 2023
308a929
fix package-lock.json
jodeleeuw Jun 22, 2023
9c4ef13
override braces to 3.0.3
cherriechang Aug 6, 2024
3297231
Merge pull request #7 from jspsych/spatial_cueing_import
cherriechang Aug 6, 2024
13f54ea
update cli code to match contrib latest
cherriechang Aug 7, 2024
faa7bfc
change "create-task" npm script to "new"
cherriechang Aug 7, 2024
6717f9e
update false memory task package.json
cherriechang Aug 8, 2024
1c43e1b
Merge branch 'main' into add-js-cli
cherriechang Aug 8, 2024
c07877c
update spatial cueing task package.json
cherriechang Aug 8, 2024
1dc7e46
update package-lock.json
cherriechang Aug 8, 2024
bf650a0
use evaluateTimelineVariable
cherriechang Aug 8, 2024
871bfdd
add method to change comment about alt loading in index.html
cherriechang Aug 8, 2024
52d45a6
fix ts to be before js
cherriechang Aug 8, 2024
1eadb2d
update "create-task" to "new" in README
cherriechang Aug 8, 2024
6e7e9c2
delete braces from package.json
cherriechang Aug 12, 2024
1a7a610
add missing cac dependency
cherriechang Aug 12, 2024
094cf9a
add missing load-tsconfig devdependency
cherriechang Aug 12, 2024
6e2d320
add tree-kill dependency
cherriechang Aug 12, 2024
0d964f2
add authorUrl prompting in cli
cherriechang Aug 13, 2024
c9851f8
add package.json and readme for js template
cherriechang Aug 14, 2024
d9a22e3
fix tsup dependency
cherriechang Aug 14, 2024
1439091
delete extra load-tsconfig dependency
cherriechang Aug 14, 2024
e4a712e
Merge pull request #11 from jspsych/add-js-cli
cherriechang Aug 20, 2024
ab66fa0
merge with remote branch
cherriechang Sep 3, 2024
1cfedef
Merge branch 'main' of github.com:jspsych/jspsych-timelines
cherriechang Sep 3, 2024
7efed0e
push package-lock
cherriechang Sep 3, 2024
5c0b7a4
update jspsych dependency to v8.0.2
cherriechang Sep 5, 2024
0de5056
add changeset
cherriechang Sep 5, 2024
740464e
run npm i again
cherriechang Sep 5, 2024
eabd1c0
Merge pull request #13 from jspsych/sync-main-with-npm
cherriechang Sep 5, 2024
8ee2e51
add gulpfile
cherriechang Sep 6, 2024
d6a0e3b
add changeset
cherriechang Sep 6, 2024
c03f13b
Merge pull request #14 from jspsych/sync-main-with-npm
cherriechang Sep 6, 2024
9be5563
use node for update readme
cherriechang Sep 6, 2024
0b18198
add changeset
cherriechang Sep 6, 2024
0ca62f4
Merge pull request #15 from jspsych/sync-main-with-npm
cherriechang Sep 6, 2024
5b16a4d
chore(release): version packages
github-actions[bot] Sep 6, 2024
bfe8aa3
Merge pull request #16 from jspsych/changeset-release/main
cherriechang Sep 6, 2024
22c0236
delete -task suffix
cherriechang Sep 6, 2024
751d6d5
Merge pull request #17 from jspsych/rename-false-memory-task-and-spat…
cherriechang Sep 6, 2024
45bcc6c
chore(release): version packages
github-actions[bot] Sep 6, 2024
45abd7c
Merge pull request #18 from jspsych/changeset-release/main
cherriechang Sep 6, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.x, 16.x]
node: [18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,8 +22,8 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Install npm@v7
run: npm install -g npm@7
- name: Install npm@v9
run: npm install -g npm@9

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup Node.js 16.x
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

# Logs
logs
*.log
Expand Down
71 changes: 51 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,87 @@
# jspsych-timelines

This is an open repository of timelines for jsPsych. The goal of this repository is to provide a place for researchers to share their jsPsych tasks with the community. Packages in this repository all implement a [uniform structure](#structure) that makes it easy to use them in your own experiments and combine them with other code.
This is an open repository of timelines for jsPsych. The goal of this repository is to provide a place for researchers to share their jsPsych timelines with the community. Packages in this repository all implement a [uniform structure](#structure) that makes it easy to use them in your own experiments and combine them with other code.

## Using tasks from this repository
## List of available timelines

The modules in this repository can be loaded via a CDN or via NPM. The CDN is the easiest way to get started. For example, to load the [arrow-flanker]() task from the CDN, you would add the following script tag to your HTML document:
The jsPsych timelines that have been contributed by community members can be found in the `/packages` directory.
The `/packages` directory also contains two template sub-folders that can be used as a starting point for contributing a timeline (see the [Guidelines for contributing new timelines](#guidelines-for-contributing-new-timelines) section).





### Timelines

Timeline | Contributor | Description
----------- | ----------- | -----------
[arrow-flanker](https://github.com/jspsych/jspsych-timelines/blob/main/packages/@jspsych-timelines/arrow-flanker/README.md) | [Josh de Leeuw](https://github.com/jodeleeuw) | Arrow flanker task for jsPsych
[false-memory](https://github.com/jspsych/jspsych-timelines/blob/main/packages/@jspsych-timelines/false-memory/README.md) | [Cherrie Chang](https://github.com/cchang-vassar) | False memory task for jsPsych
[spatial-cueing](https://github.com/jspsych/jspsych-timelines/blob/main/packages/@jspsych-timelines/spatial-cueing/README.md) | [Cherrie Chang](https://github.com/cchang-vassar) | A shareable timeline of the Posner spatial cueing task.
## Using timelines from this repository
















The modules in this repository can be loaded via a CDN or via NPM. The CDN is the easiest way to get started. For example, to load the [arrow-flanker]() timeline from the CDN, you would add the following script tag to your HTML document:

```html
<script src="https://unpkg.com/@jspsych-timelines/arrow-flanker"></script>
```

This will load the task into the global namespace as `jsPsychTimelineArrowFlanker`. You can then use the task in your experiment like this:
This will load the timeline into the global namespace as `jsPsychTimelineArrowFlanker`. You can then use the timeline in your experiment like this:

```js
const jsPsych = initJsPsych();
const task = jsPsychTimelineArrowFlanker.createTimeline(jsPsych, {options});
jsPsych.run([task]);
const timeline = jsPsychTimelineArrowFlanker.createTimeline(jsPsych, {options});
jsPsych.run([timeline]);
```

In the above example, `task` is a jsPsych timeline object that can be added to other timelines or used as the main timeline. The `options` parameter is an object that contains options for the task. The options are described in the documentation for each task.
In the above example, `timeline` is a jsPsych timeline object that can be added to other timelines or used as the main timeline. The `options` parameter is an object that contains options for the timeline. The options are described in the documentation for each timeline.

## Structure

Each timeline module exports a `createTimeline()` method. This method returns an object with a `timeline` property that can be inserted into a jsPsych timeline.

```js
const task = jsPsychTimelineModule.createTimeline(jsPsych, {options})
jsPsych.run([task])
const timeline = jsPsychTimelineModule.createTimeline(jsPsych, {options})
jsPsych.run([timeline])
```

Timeline modules may also export a `timelineUnits` objects and a `utils` object.

The `timelineUnits` object contains functions that create smaller units of a timeline than the main `createTimeline()` method. For example, if the main timeline contains two phases (e.g., memorization and test) then there could be `timelineUnits.createTestTimeline()` and `timelineUnits.createMemorizationTimeline()`. These functions could then be used for assembling the overall task in a different way than `createTimeline()` allows. There are no constraints on what kinds of timeline creation methods can be exported in `timelineUnits`, other than the requirement that all methods return an object that can be added to a jsPsych timeline. Some modules may export methods to create units as small as a single trial, while others export no methods at all.
The `timelineUnits` object contains functions that create smaller units of a timeline than the main `createTimeline()` method. For example, if the main timeline contains two phases (e.g., memorization and test) then there could be `timelineUnits.createTestTimeline()` and `timelineUnits.createMemorizationTimeline()`. These functions could then be used for assembling the overall timeline in a different way than `createTimeline()` allows. There are no constraints on what kinds of timeline creation methods can be exported in `timelineUnits`, other than the requirement that all methods return an object that can be added to a jsPsych timeline. Some modules may export methods to create units as small as a single trial, while others export no methods at all.

The `utils` object contains miscellaneous functions that may be useful when using the module. For example, if a task requires creating a complex stimulus that can be procedurally generated there could be a `utils.createStimulus()` method that returns HTML. Or if there is a task that involves a particular scoring system like a questionnaire with validated indicies then there could be a `utils.generateScore()` method. There are no constraints on what methods can be exported as part of the `utils` object.
The `utils` object contains miscellaneous functions that may be useful when using the module. For example, if a timeline requires creating a complex stimulus that can be procedurally generated there could be a `utils.createStimulus()` method that returns HTML. Or if there is a timeline that involves a particular scoring system like a questionnaire with validated indicies then there could be a `utils.generateScore()` method. There are no constraints on what methods can be exported as part of the `utils` object.

## Contributing new tasks
## Guidelines for contributing new timelines

If you would like to contribute a new task to this repository, please follow these steps:
If you would like to contribute a new timeline to this repository, please follow these steps:

1. Fork this repository
2. Create a new branch for your task (e.g., 'new-task-arrow-flanker')
2. Create a new branch for your timeline (e.g., 'new-timeline-arrow-flanker')
3. Run `npm install` in the root directory of the repository to install dependencies.
4. Run `npm run create-task` and answer the prompts to create a new task template in the `packages` directory.
5. Edit the files in the new task directory to implement your task. `src/index.ts` is the main file that will be loaded when the task is used. `README.md` is the documentation for the task. `examples/index.html` is a basic jsPsych experiment template that you can modify to illustrate how your task works.
6. Run `npm run build` to build the task. This will create a `dist` directory with the compiled task.
4. Run `npm run new` and answer the prompts to create a new timeline template in the `packages` directory.
5. Edit the files in the new timeline directory to implement your timeline. `src/index.ts` is the main file that will be loaded when the timeline is used. `README.md` is the documentation for the timeline. `examples/index.html` is a basic jsPsych experiment template that you can modify to illustrate how your timeline works.
6. Run `npm run build` to build the timeline. This will create a `dist` directory with the compiled timeline.
7. Verify that the example works by opening `examples/index.html` in your browser.
8. Add a changeset by running `npm run changeset` in the main directory of the repository. This will prompt you for a description of the changes you made. This will create a new changeset file in the `changesets` directory.
8. Open a pull request to merge your branch into the `main` branch of this repository.

We welcome tasks of all kinds!
We welcome timelines of all kinds!

### What if my task requires a custom plugin?
### What if my timeline requires a custom plugin?

If your task requires a custom plugin, we'd recommend adding the plugin to [jspsych-contrib](https://github.com/jspsych/jspsych-contrib) before submitting the task here. This will make it easier for other researchers to use your plugin in their own experiments. Currently, this repository is aimed at tasks that use plugins that are published on `npm`.
If your timeline requires a custom plugin, we'd recommend adding the plugin to [jspsych-contrib](https://github.com/jspsych/jspsych-contrib) before submitting the timeline here. This will make it easier for other researchers to use your plugin in their own experiments. Currently, this repository is aimed at timelines that use plugins that are published on `npm`.
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { updateUnpkgLinks } from "@jspsych/config/gulp";
Loading
Loading