From 81beca4c3accb80a5ce59fdc4c315a0ca2a1614d Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:18:26 -0500 Subject: [PATCH 1/7] Update contributing.md Fixed it to include link to CLI tools in contrib repo. In total changes include: (1) fixed links to templates, (2) references to CLI tools `npm run new`, (3) contextualized link to developer documentation on site, (4) and some description of the different application for each template. --- docs/developers/contributing.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/developers/contributing.md b/docs/developers/contributing.md index bf5b28d765..37452fe919 100644 --- a/docs/developers/contributing.md +++ b/docs/developers/contributing.md @@ -37,7 +37,11 @@ If you are developing a new plugin or extension there are two different reposito The main `jspsych` repository is open to new plugins and extensions that are likely to be widely used. We require that contributions to main repository are well documented and tested before they are merged. Contributions to the main repository must use TypeScript. We limit contributions to this repository because once a plugin or extension is in the main codebase we are generally committed to providing updates as we develop new versions of jsPsych. Each new plugin and extension potentially increases the amount of development work that we will need to do in the future, so we are somewhat selective about what we will merge. If you have an idea that you'd like to discuss please [open a discussion thread](https://github.com/jspsych/jsPsych/discussions/new) and we'd love to chat about it! -The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/tree/main/packages/plugin-template-ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/tree/main/packages/plugin-template). Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). +The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). + +Our [`README.md` in the `jspsych-contrib` repository](https://github.com/jspsych/jspsych-contrib) offers more detailed information for each approach, alongside the CLI tools needed to get started. For example, those relying on the Typescript template can use the `npm run build` command to compile their `index.ts` code into Javascript files. Those templating already in Javascript can meanwhile run their trial code directly using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). + +Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). From 3002063939512aa032346c448bfbc66d3605470a Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:25:39 -0500 Subject: [PATCH 2/7] Update contributing.md --- docs/developers/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers/contributing.md b/docs/developers/contributing.md index 37452fe919..0fa6760543 100644 --- a/docs/developers/contributing.md +++ b/docs/developers/contributing.md @@ -39,7 +39,7 @@ The main `jspsych` repository is open to new plugins and extensions that are lik The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). -Our [`README.md` in the `jspsych-contrib` repository](https://github.com/jspsych/jspsych-contrib) offers more detailed information for each approach, alongside the CLI tools needed to get started. For example, those relying on the Typescript template can use the `npm run build` command to compile their `index.ts` code into Javascript files. Those templating already in Javascript can meanwhile run their trial code directly using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). +Our [`README.md`](https://github.com/jspsych/jspsych-contrib) in the `jspsych-contrib` repository offers more detailed information for each approach, alongside the CLI tools needed to get started. For example, those relying on the Typescript template can use the `npm run build` command to compile their `index.ts` code into Javascript files. Those templating already in Javascript can meanwhile run their trial code directly using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). From 60a9a58833f3bdc38b04525016bd69ee4c37ee8f Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:30:05 -0500 Subject: [PATCH 3/7] Update contributing.md --- docs/developers/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers/contributing.md b/docs/developers/contributing.md index 0fa6760543..e0d0fd1b3a 100644 --- a/docs/developers/contributing.md +++ b/docs/developers/contributing.md @@ -39,7 +39,7 @@ The main `jspsych` repository is open to new plugins and extensions that are lik The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). -Our [`README.md`](https://github.com/jspsych/jspsych-contrib) in the `jspsych-contrib` repository offers more detailed information for each approach, alongside the CLI tools needed to get started. For example, those relying on the Typescript template can use the `npm run build` command to compile their `index.ts` code into Javascript files. Those templating already in Javascript can meanwhile run their trial code directly using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). +The [`README.md`](https://github.com/jspsych/jspsych-contrib) in our `jspsych-contrib` repository offers detailed information for each approach, as well as how to start each process using CLI tools like `npm run new`. Those relying on the Typescript template can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). From 4971d129f6dcd8c7b8afd0507084331427d09576 Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:44:02 -0500 Subject: [PATCH 4/7] Update contributing.md --- docs/developers/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers/contributing.md b/docs/developers/contributing.md index e0d0fd1b3a..bf58cad121 100644 --- a/docs/developers/contributing.md +++ b/docs/developers/contributing.md @@ -39,7 +39,7 @@ The main `jspsych` repository is open to new plugins and extensions that are lik The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). -The [`README.md`](https://github.com/jspsych/jspsych-contrib) in our `jspsych-contrib` repository offers detailed information for each approach, as well as how to start each process using CLI tools like `npm run new`. Those relying on the Typescript template can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed in our [plugin developer documentation](github.com/jspsych/jspsych-contrib). +The [`README.md`](https://github.com/jspsych/jspsych-contrib) in our `jspsych-contrib` repository offers guidance for each approach. This repo is also (for now) the exclusive home for CLI tools like `npm run new`, which we've built to get you started with either. Those relying on the Typescript template can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed in our [plugin developer documentation](https://www.jspsych.org/latest/developers/plugin-development/). Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). From b560575dc1e7a93c748c09149d85361460c9893c Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:08:57 -0500 Subject: [PATCH 5/7] Update plugin-development.md --- docs/developers/plugin-development.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/developers/plugin-development.md b/docs/developers/plugin-development.md index a6487e40d9..0fca6baa84 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -8,9 +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. -### Templates +## Plugin templates + +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). -Plugins can be written in either plain JavaScript or in TypeScript. Template files for both [JavaScript](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js) and [TypeScript](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) are available in the [jspsych-contrib repository](https://github.com/jspsych/jspsych-contrib/). +Additionally, `jspsych-contrib` offers guidance for either approach in its [`README`](https://github.com/jspsych/jspsych-contrib) file. It is likewise (for now) the exclusive home for CLI tools like `npm run new`, which we've built to help developers get started. Those relying on Typescript can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed below. ## Plugin components @@ -328,8 +330,4 @@ If you are developing a plugin with the aim of including it in the main jsPsych We also recommend that you make your plugin *as general as possible*. Consider using parameters to give the user of the plugin as many options for customization as possible. For example, if you have any text that displays in the plugin including things like button labels, implement the text as a parameter. This allows users running experiments in other languages to replace text values as needed. -## Plugin templates - -Templates for plugins are available in the [jspsych-contrib](https://github.com/jspsych/jspsych-contrib) repository. There is a command-line tool for generating a new plugin from these templates in that repository. See the README file in the jspsych-contrib repository for more information. - From 35c125e54695ab0c44fc733c1c2283e2232b3b36 Mon Sep 17 00:00:00 2001 From: Val <59147281+vminojosa@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:14:41 -0500 Subject: [PATCH 6/7] Update contributing.md --- docs/developers/contributing.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/developers/contributing.md b/docs/developers/contributing.md index bf58cad121..afd87e6611 100644 --- a/docs/developers/contributing.md +++ b/docs/developers/contributing.md @@ -37,9 +37,7 @@ If you are developing a new plugin or extension there are two different reposito The main `jspsych` repository is open to new plugins and extensions that are likely to be widely used. We require that contributions to main repository are well documented and tested before they are merged. Contributions to the main repository must use TypeScript. We limit contributions to this repository because once a plugin or extension is in the main codebase we are generally committed to providing updates as we develop new versions of jsPsych. Each new plugin and extension potentially increases the amount of development work that we will need to do in the future, so we are somewhat selective about what we will merge. If you have an idea that you'd like to discuss please [open a discussion thread](https://github.com/jspsych/jsPsych/discussions/new) and we'd love to chat about it! -The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). - -The [`README.md`](https://github.com/jspsych/jspsych-contrib) in our `jspsych-contrib` repository offers guidance for each approach. This repo is also (for now) the exclusive home for CLI tools like `npm run new`, which we've built to get you started with either. Those relying on the Typescript template can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed in our [plugin developer documentation](https://www.jspsych.org/latest/developers/plugin-development/). +The `jspsych-contrib` repository is open to any contributions that are complete and working code. There are some minimal guidelines in place about basic documentation that should be provided. Contributors can choose whether to develop their plugin or extension using our [TypeScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-ts/src/index.ts) or using our [JavaScript template](https://github.com/jspsych/jspsych-contrib/blob/main/templates/plugin-template-js/src/index.js). Check our [plugin developer documentation](https://www.jspsych.org/latest/developers/plugin-development/) for additional guidance. Contributions to `jspsych-contrib` are not evaluated for general usefulness in the same way that contributions to the main repository are. We also periodically consider whether to move contributions into the main repository from `jspsych-contrib` based on their popularity and completeness (documentation and testing). From 0b107b9147f1a7eaf9adc1e16d2c494c06aae4a1 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Thu, 19 Dec 2024 14:26:24 -0500 Subject: [PATCH 7/7] Update plugin-development.md --- 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 0fca6baa84..858e343cf6 100644 --- a/docs/developers/plugin-development.md +++ b/docs/developers/plugin-development.md @@ -12,7 +12,7 @@ As of version 7.0, plugins are [JavaScript Classes](https://developer.mozilla.or 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). -Additionally, `jspsych-contrib` offers guidance for either approach in its [`README`](https://github.com/jspsych/jspsych-contrib) file. It is likewise (for now) the exclusive home for CLI tools like `npm run new`, which we've built to help developers get started. Those relying on Typescript can then use the `npm run build` command to compile their `index.ts` code into Javascript files. Meanwhile, those templating directly in Javascript can run their trial code using the `trial()` method, as detailed below. +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. ## Plugin components