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

Jsdoc Comments #26

Merged
merged 34 commits into from
May 7, 2024
Merged

Jsdoc Comments #26

merged 34 commits into from
May 7, 2024

Conversation

okaycj
Copy link
Collaborator

@okaycj okaycj commented Apr 26, 2024

Summary

We, tentatively, have decided to use code documentation to generate user documentation. This decision prompted that we don't have any comments within this code base. This PR adds a first pass at comments and the supporting linters.

Additional Changes

I also added a linter to check for arrow functions and updated the code.

Copy link

changeset-bot bot commented Apr 26, 2024

⚠️ No Changeset found

Latest commit: a95d102

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@okaycj okaycj force-pushed the video branch 3 times, most recently from 4bfb9ac to dc6dd44 Compare May 6, 2024 18:35
packages/surveys/src/utils.spec.ts Outdated Show resolved Hide resolved
packages/surveys/src/exit.json Outdated Show resolved Hide resolved
packages/lookit-initjspsych/src/utils.spec.ts Outdated Show resolved Hide resolved
packages/data/src/s3.ts Outdated Show resolved Hide resolved
Comment on lines 25 to 31
* Load data from API that would be used by researchers and jsPsych.
*
* @param response_uuid - Response UUID.
*/
const load = async (response_uuid: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this doesn't return the CHS object, right?
In that case, maybe we should note in the description that it attaches the following to the window: 'chs' object with properties:

  • 'study' (object)
  • 'child' (object)
  • 'pastSessions' (array of objects, where each object is a past session/response)
  • 'response' (object)

packages/lookit-initjspsych/src/utils.ts Outdated Show resolved Hide resolved
@becky-gilbert
Copy link
Contributor

becky-gilbert commented May 6, 2024

@okaycj this all looks great! Approved pending a few minor comments. Though some of the comments aren't related to JSDoc, sorry. I can put move my comments somewhere else if you prefer.

I did make some minor edits to the comments - see the last two commits on this branch.

Also, I see that we're getting a bunch of merge conflicts, some of which come from my updates to our Surveys branch that was merged into main. Happy to help resolve those. I'm wondering if it would help to merge main into this branch and video?

@okaycj okaycj force-pushed the jsdoc-comments branch from cabf521 to a95d102 Compare May 7, 2024 15:03
@okaycj okaycj merged commit 4a6ea9b into video May 7, 2024
2 checks passed
@okaycj okaycj deleted the jsdoc-comments branch May 7, 2024 15:07
okaycj added a commit that referenced this pull request May 22, 2024
* Update eslint package to fix warning message

* Add exit survey pacakge

* exit survey

* se survey_function to format survey text

* edit exit survey question titles and descriptions

* change question names and MC values to match EFP names

* add withdrawal and feedback questions

* Change package name, exit survey parameters

* Added privacy and databrary params

* Get study to add to withdraw copu

* disable the video sharing questions if video withdrawal is true

* Add MD link

* Add global data store

* fix withdrawal question value in data and logic for enabling/disabling the other video-related questions

* add validation for child birthdate: cannot be a future date

* Update root package

* Update survey to use new data structure

* First pass at tests

* Add data finish function

* Update tests

* Update versions of deps

* freeze loaded data

* Add s3 from EFP

* Add s3 class

* Update linters to support jsdoc comments

* First pass at code documentation

* Change functions to arrow functions

* Fix tests

* fix typos

* minor edits to JSdoc comments

* Format and comment changes

* Test updates

* Moved user function to run first

* A few rebase errors

---------

Co-authored-by: Becky Gilbert <[email protected]>
okaycj added a commit that referenced this pull request Jul 23, 2024
* Rebase fixes

* Fix a few mistakes found from rebasing

* init video package

* Add s3 from EFP

* Update eslint config

* Update packages

* Add s3 class

* Add empty test to video

* Fix deepfreeze import

* Fix test

* Jsdoc Comments (#26)

* Update eslint package to fix warning message

* Add exit survey pacakge

* exit survey

* se survey_function to format survey text

* edit exit survey question titles and descriptions

* change question names and MC values to match EFP names

* add withdrawal and feedback questions

* Change package name, exit survey parameters

* Added privacy and databrary params

* Get study to add to withdraw copu

* disable the video sharing questions if video withdrawal is true

* Add MD link

* Add global data store

* fix withdrawal question value in data and logic for enabling/disabling the other video-related questions

* add validation for child birthdate: cannot be a future date

* Update root package

* Update survey to use new data structure

* First pass at tests

* Add data finish function

* Update tests

* Update versions of deps

* freeze loaded data

* Add s3 from EFP

* Add s3 class

* Update linters to support jsdoc comments

* First pass at code documentation

* Change functions to arrow functions

* Fix tests

* fix typos

* minor edits to JSdoc comments

* Format and comment changes

* Test updates

* Moved user function to run first

* A few rebase errors

---------

Co-authored-by: Becky Gilbert <[email protected]>

* Another Video PR (#27)

* Update eslint package to fix warning message

* Add exit survey pacakge

* exit survey

* Use survey_function to format survey text

* edit exit survey question titles and descriptions

* change question names and MC values to match EFP names

* add withdrawal and feedback questions

* Change package name, exit survey parameters

* Added privacy and databrary params

* Get study to add to withdraw copu

* disable the video sharing questions if video withdrawal is true

* Add MD link

* Add global data store

* fix withdrawal question value in data and logic for enabling/disabling the other video-related questions

* add validation for child birthdate: cannot be a future date

* Update root package

* First pass at tests

* Add data finish function

* Update tests

* Update versions of deps

* freeze loaded data

* Add s3 from EFP

* Add s3 class

* First pass at code documentation

* add auto bind dependency

* Add trial recorder

* Session recording

* More package updates

* Add comments to code

---------

Co-authored-by: Becky Gilbert <[email protected]>

* Change package name to record

* Monorepo jest config function

* Update tsconfig to extend correct jspsych resource

* Update package jest config

* Update install instructions

* Add support environment file in data package

* fix formatting

* Update rollup config

This commit will do two things.  First, this will only bundle iife configs. Second, it adds the data package as an external dependency.

* Researcher Documentation (#32)

* Set up mkdocs

* Add markdown files

* move to mocros plugin

* Format changes

* Finish parameters table for surveys

* Add strict to build

* Add validation, git repo url, and exclude docs to config

* Link to change log wasn't working

* Grammar mistake in record docs

* Add AWS S3 upload to Record extension (#29)

* Rebase fixes

* Fix a few mistakes found from rebasing

* adapt EFP S3 class for AWS SDK v3

* rename S3 class/file to LookitS3

* add AWS S3 region to Env type

* import S3 class into Recorder and add S3 upload (keep local download option for now)

* move creation of Recorder instance from trial constructor to on_start

* set strictPropertyInitialization:false to give the Recorder an s3 property that is not always set in constructor (can remove this if we remove local download option)

* fix formatting error

* call jsPsych finishTrial in stop plugin, give the recorder a second to stop before finishing

* add optional filename param to Recorder constructor and util to create filename

* remove strictPropertyInitialization: false

* mark vars as optional so that they do not need to be defined in constructor

* make s3 optional so that it does not need to be definitely assigned in constructor

* remove the getFilename util and replace with class create filename method and filename getter

* store recorder instance on window, call stop on that existing recorder, and throw errors based on existence/absence of recorder

* S3 tests

* fix file path for recorder import

* make the recorder stop method async and have stop plugin wait for upload to finish

* Change type of sessionRecorder to "unknown"

To facilitate the typing for our window storage, I've added an interface that extends Window.  Additionally, there's a new script in the root of this repo that will clean out "dist" directories.

* fix JSDoc and linting errors

* formatting fix

* Fix broken tests after data went external

* Remove prettier ignore file

* Add typing for env values and update how s3 uses them

* Add local down env value to record

---------

Co-authored-by: CJ Green <[email protected]>

* Update record tests

* Fixed tests for node v18

* Fixed typos

---------

Co-authored-by: Becky Gilbert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants