From 9b7242293f65d972f1c57b074b5aff2b5c685b0b Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:11:07 -0400 Subject: [PATCH 1/4] changed "plugin templates" section to a "setting up a plugin" section, with ref to CLI tool, relocated templates, and updates jspsych-contrib docs --- docs/developers/plugin-development.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/plugin-development.md b/docs/developers/plugin-development.md index fca0e2e020..7c26f465c7 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -8,11 +8,11 @@ As of version 7.0, plugins are [JavaScript Classes](https://developer.mozilla.or * [A `trial()` method](#trial) that accepts an `HTMLElement` as its first argument and an `object` of trial parameters as its second argument. There is an optional third argument to [handle the `on_load` event](#asynchronous-loading) in certain cirumstances. The `trial()` method should *either* invoke `jsPsych.finishTrial()` or should be an `async` function that returns a data object to [end the trial and save data](#save-data). * [A static `info` property](#static-info) on the class that contains an object describing the plugin's parameters, data generated, and version. -## Plugin templates +## Setting up a new plugin -Templates for plugins are available in the [jspsych-contrib](https://github.com/jspsych/jspsych-contrib) repository. Plugins can be written in either plain [JavaScript](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js) or in [TypeScript](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts). +To develop a new plugin for contribution, we recommend using the CLI tool that we have published in jspsych-contrib. This automates the setup of a new plugin in either JavaScript or TypeScript. For more information about this CLI tool, as well as step-by-step instructions on how to make a contribution to jsPsych, is available in the [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions) of jspsych-contrib. -To get started with a template, we recommend using the CLI tool that we have published in jspsych-contrib. This automates the setup of a new plugin in either JavaScript or TypeScript. Additional information about the CLI tool is available in the [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#creating-a-new-plugin-or-extension) of jspsych-contrib. +If for any reason you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. These are set up for either plain [JavaScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js) or in [TypeScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts). ## Plugin components From 6bd013e4d5e4b52e866ef31971bb84d29a4bec29 Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:18:24 -0400 Subject: [PATCH 2/4] clarified language on Typescript versus Javascript CLI setup and tempaltes --- docs/developers/plugin-development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developers/plugin-development.md b/docs/developers/plugin-development.md index 7c26f465c7..0c0164aedf 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -10,9 +10,9 @@ As of version 7.0, plugins are [JavaScript Classes](https://developer.mozilla.or ## Setting up a new plugin -To develop a new plugin for contribution, we recommend using the CLI tool that we have published in jspsych-contrib. This automates the setup of a new plugin in either JavaScript or TypeScript. For more information about this CLI tool, as well as step-by-step instructions on how to make a contribution to jsPsych, is available in the [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions) of jspsych-contrib. +To develop a new plugin for contribution, we recommend using the CLI tool that we have published in jspsych-contrib. This automates the setup of a new plugin in either JavaScript or TypeScript, depepending on how you answer the commandline prompts. For more information about this CLI tool, as well as step-by-step instructions on how to make a contribution to jsPsych, is available in the [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions) of jspsych-contrib. -If for any reason you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. These are set up for either plain [JavaScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js) or in [TypeScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts). +If for any reason you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. Here is the template in plain [Javascript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js), and here is the template in [Typescript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts). ## Plugin components From ac0aa189bcf1fee47ddf3c63c0aa39cf38269e72 Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 10 Jun 2025 20:01:08 -0400 Subject: [PATCH 3/4] fixed typos --- docs/developers/plugin-development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers/plugin-development.md b/docs/developers/plugin-development.md index 0c0164aedf..09004307a0 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -10,7 +10,7 @@ As of version 7.0, plugins are [JavaScript Classes](https://developer.mozilla.or ## Setting up a new plugin -To develop a new plugin for contribution, we recommend using the CLI tool that we have published in jspsych-contrib. This automates the setup of a new plugin in either JavaScript or TypeScript, depepending on how you answer the commandline prompts. For more information about this CLI tool, as well as step-by-step instructions on how to make a contribution to jsPsych, is available in the [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions) of jspsych-contrib. +To develop a new plugin for contribution, we recommend using the CLI tool we've published for jspsych-contrib. This automates setup for a new plugin in either JavaScript or TypeScript, depending on how you answer the commandline prompts. For more information about this tool, as well as step-by-step instructions on how to make a contribution to jsPsych, check out jspsych-contrib's [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions). If for any reason you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. Here is the template in plain [Javascript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js), and here is the template in [Typescript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts). From 823ffa4a2be77bbfdfa8f388135d10e1347771fd Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Thu, 12 Jun 2025 09:24:43 -0400 Subject: [PATCH 4/4] some edits --- docs/developers/plugin-development.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/plugin-development.md b/docs/developers/plugin-development.md index 09004307a0..1af863b33e 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -8,11 +8,11 @@ As of version 7.0, plugins are [JavaScript Classes](https://developer.mozilla.or * [A `trial()` method](#trial) that accepts an `HTMLElement` as its first argument and an `object` of trial parameters as its second argument. There is an optional third argument to [handle the `on_load` event](#asynchronous-loading) in certain cirumstances. The `trial()` method should *either* invoke `jsPsych.finishTrial()` or should be an `async` function that returns a data object to [end the trial and save data](#save-data). * [A static `info` property](#static-info) on the class that contains an object describing the plugin's parameters, data generated, and version. -## Setting up a new plugin +## Creating a new plugin -To develop a new plugin for contribution, we recommend using the CLI tool we've published for jspsych-contrib. This automates setup for a new plugin in either JavaScript or TypeScript, depending on how you answer the commandline prompts. For more information about this tool, as well as step-by-step instructions on how to make a contribution to jsPsych, check out jspsych-contrib's [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions). +To create a new plugin, we recommend using the CLI tool `npx @jspsych/new-plugin`. This automates setup for a new plugin in either JavaScript or TypeScript. For more information about this tool, as well as step-by-step instructions on how to make a contribution to jsPsych, check out jspsych-contrib's [`README`](https://github.com/jspsych/jspsych-contrib?tab=readme-ov-file#guidelines-for-contributions). -If for any reason you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. Here is the template in plain [Javascript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js), and here is the template in [Typescript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts). +If you want access to the templates themselves, without running the CLI tool, they are still available in the [jspsych-dev](https://github.com/jspsych/jspsych-dev) repository. There are [JavaScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-js) and [TypeScript](https://github.com/jspsych/jspsych-dev/tree/main/packages/new-plugin/templates/plugin-template-ts) templates available. ## Plugin components