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

Lookit's jsPsych Video Extensions and Plugins #25

Merged
merged 25 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 23 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
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
dist
coverage
Procfile
Procfile
.env
site
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"plugins": [
"prettier-plugin-packagejson",
"prettier-plugin-sort-json",
"prettier-plugin-organize-imports"
"prettier-plugin-organize-imports",
"prettier-plugin-jsdoc"
]
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Edit `tsconfig.json`:
"baseUrl": ".",
"strict": true
},
"extends": "@jspsych/config/tsconfig.core.json",
"extends": "@jspsych/config/tsconfig.json",
"include": ["src"]
}
```
Expand All @@ -82,9 +82,7 @@ export default makeDevConfig(rollupConfig, port);
Edit `jest.config.cjs`

```cjs
const config = require("@jspsych/config/jest").makePackageConfig(__dirname);
config.moduleNameMapper = {};
module.exports = config;
module.exports = require("../../jest.cjs").makePackageConfig();
```

You will need `@jspsych/config` to build your new package:
Expand Down
44 changes: 44 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import pluginJs from "@eslint/js";
import prettierConfig from "eslint-config-prettier";
import jsdoc from "eslint-plugin-jsdoc";
import globals from "globals";
import tseslint from "typescript-eslint";

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
jsdoc.configs["flat/recommended-typescript-error"],
{
rules: {
"require-await": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
"func-style": ["error", "expression", { allowArrowFunctions: true }],
},
},
{
plugins: {
jsdoc,
},
rules: {
"jsdoc/tag-lines": "off",
"jsdoc/require-description-complete-sentence": "error",
"jsdoc/require-description": "error",
"jsdoc/require-hyphen-before-param-description": "error",
"jsdoc/require-jsdoc": [
"error",
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: true,
FunctionExpression: true,
},
},
],
},
},
prettierConfig,
];
12 changes: 12 additions & 0 deletions jest.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports.makePackageConfig = () => {
return {
...require("@jspsych/config/jest").makePackageConfig(__dirname),
moduleNameMapper: { "@lookit/data": "<rootDir>/../../packages/data/src" },
coverageThreshold: {
global: {
lines: 100,
statements: 0,
},
},
};
};
12 changes: 12 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
serve: poetry
poetry run mkdocs serve

build: poetry
poetry run mkdocs build --strict

poetry:
poetry install --no-root --sync

clean:
rm -rf ./site $(shell poetry env info -p)

27 changes: 27 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
site_name: CHS jsPsych
docs_dir: ./packages
repo_url: https://github.com/lookit/lookit-jspsych

nav:
- Home: index.md
- CHS's initJsPsych: lookit-initjspsych/README.md
- Data: data/README.md
- Record: record/README.md
- Surveys: surveys/README.md
validation:
omitted_files: warn
absolute_links: warn
unrecognized_links: warn
anchors: warn
exclude_docs: |
node_modules
lookit-initjspsych/CHANGELOG.md
theme:
name: mkdocs
color_mode: auto
user_color_mode_toggle: auto
plugins:
- search
- macros
extra:
jsPsych: https://www.jspsych.org/7.3/
Loading
Loading