diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..8ef76a4 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,36 @@ +name: Scorecard + +on: + workflow_dispatch: + pull_request: + push: + branches: + -main + +permissions: read-all + +jobs: + scorecard: + name: Run OpenSSF Scorecard + runs-on: ubuntu-latest + + permissions: + contents: read + security-events: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run OpenSSF Scorecard + uses: ossf/scorecard-action@v2.4.0 + with: + results_file: results.sarif + results_format: sarif + publish_results: false + + - name: Upload Scorecard results to code scanning + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 17bfbec..2d9e8cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "devDependencies": { "@changesets/changelog-github": "^0.4.7", "@changesets/cli": "^2.25.2", + "@types/jest": "^30.0.0", "turbo": "^1.6.3" }, "engines": { @@ -2447,7 +2448,6 @@ "integrity": "sha512-zOpzlfUs45l6u7jm39qr87JCHUDsaeCtvL+kQe/Vn9jSnRB4/5IPXISm0h9I1vZW/o00Kn4UTJ2MOlhnUGwv3g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -2521,7 +2521,6 @@ "integrity": "sha512-ZBn5CglH8fBsQsvs4VWNzD4aWfUYks+IdOOQU3MEK71ol/BcVm+P+rtb1KpiFBpSWSCE27uOahyyf1vfqOVbcQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/get-type": "30.1.0" }, @@ -2764,7 +2763,6 @@ "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -2824,7 +2822,6 @@ "integrity": "sha512-RAWn3+f9u8BsHijKJ71uHcFp6vmyEt6VvoWXkl6hKF3qVIuWNmudVjg12DlBPGup/frIl5UcUlH5HfEuvHpEXg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*", "jest-regex-util": "30.4.0" @@ -2839,7 +2836,6 @@ "integrity": "sha512-mWlvLviKIgIQ8VCuM1xRdD0TWp3zlzionlmDBjuXVBs+VkmXq6FgW9T4Emr7oGz/Rk6feDCGyiugolcQEyp3mg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -4191,7 +4187,6 @@ "integrity": "sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "expect": "^30.0.0", "pretty-format": "^30.0.0" @@ -6100,7 +6095,6 @@ "integrity": "sha512-PMARsyh/JtqC20HoGqlFcIlQAyqUtW4PlI1rup1uhYJtKuwAjbvWi3GQMAn+STdHum/dk8xrKfUM1+5SAwpolA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/expect-utils": "30.4.1", "@jest/get-type": "30.1.0", @@ -8162,7 +8156,6 @@ "integrity": "sha512-CRpFK0RtLriVDGcPPAnR6HMVI8bSR2jnUIgralhauzYQZIb4RH9AtEInTuQr65LmmGggGcRT6HIASxwqsVsmlA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/diff-sequences": "30.4.0", "@jest/get-type": "30.1.0", @@ -8463,7 +8456,6 @@ "integrity": "sha512-zvYfX5CaeEkFrrLS9suWe9rvJrm9J1Iv3ua8kIBv9GEPzcnsfBf0bob37la7s67fs0nlBC3EuvkOLnXQKxtx4A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/get-type": "30.1.0", "chalk": "^4.1.2", @@ -8480,7 +8472,6 @@ "integrity": "sha512-kwCKIvq0MCW1HzLoGola9Te6JUdzgV0loyKJ3Qghrkz9i5/RRIHsL95BMQc2HBBhlBKC4j22K9p11TGHH8RBpQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@jest/types": "30.4.1", @@ -8503,7 +8494,6 @@ "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -8517,7 +8507,6 @@ "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/pattern": "30.4.0", "@jest/schemas": "30.4.1", @@ -8536,8 +8525,7 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.49.tgz", "integrity": "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jest-message-util/node_modules/picomatch": { "version": "4.0.4", @@ -8545,7 +8533,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -8559,7 +8546,6 @@ "integrity": "sha512-/i8SVb8/NSB7RfNi8gfqu8gxLV23KaL5EpAttyb9iz8qWRIqXRLflycz/32wXsYkOnaUlx8NAKnJYtpsmXUmfw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "30.4.1", "@types/node": "*", @@ -8575,7 +8561,6 @@ "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -8589,7 +8574,6 @@ "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/pattern": "30.4.0", "@jest/schemas": "30.4.1", @@ -8608,8 +8592,7 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.49.tgz", "integrity": "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", @@ -9101,7 +9084,6 @@ "integrity": "sha512-vjQb1sACEiv13DKJMDToJpzVW0joCsIQrmbg0fi7CyOOt+g9jTuQl2A216pWRBYhOVt53XbL/2LbMKg1BECWOw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "30.4.1", "@types/node": "*", @@ -9120,7 +9102,6 @@ "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -9134,7 +9115,6 @@ "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/pattern": "30.4.0", "@jest/schemas": "30.4.1", @@ -9153,8 +9133,7 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.49.tgz", "integrity": "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jest-util/node_modules/ci-info": { "version": "4.4.0", @@ -9168,7 +9147,6 @@ } ], "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -9179,7 +9157,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -10434,7 +10411,6 @@ "integrity": "sha512-K6KiKMHTL4jjX4u3Kir2EW07nRfcqVTXIImx50wbjHQTcZPgg+gjVeNTIT3l3L1Rd4UefxfogquC9J37SoFyyw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/schemas": "30.4.1", "ansi-styles": "^5.2.0", @@ -10451,7 +10427,6 @@ "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -10464,8 +10439,7 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.49.tgz", "integrity": "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", @@ -10473,7 +10447,6 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -10609,8 +10582,7 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/react-is-19": { "name": "react-is", @@ -10618,8 +10590,7 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.6.tgz", "integrity": "sha512-XjBR15BhXuylgWGuslhDKqlSayuqvqBX91BP8pauG8kd1zY8kotkNWbXksTCNRarse4kuGbe2kIY05ARtwNIvw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/read-yaml-file": { "version": "1.1.0", diff --git a/package.json b/package.json index 5e8c2a9..393777a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "devDependencies": { "@changesets/changelog-github": "^0.4.7", "@changesets/cli": "^2.25.2", + "@types/jest": "^30.0.0", "turbo": "^1.6.3" }, "jest": { diff --git a/packages/plugin-button-click-counter/examples/index.html b/packages/plugin-button-click-counter/examples/index.html index 9977b26..6a336e4 100644 --- a/packages/plugin-button-click-counter/examples/index.html +++ b/packages/plugin-button-click-counter/examples/index.html @@ -17,7 +17,6 @@ type: jsPsychButtonClickCounter, button_label: "Click me!", key_to_advance: "Enter", - prompt: "

Click the button as many times as you like, then press Enter to continue.

", }; jsPsych.run([trial]); diff --git a/packages/plugin-button-click-counter/src/index.spec.ts b/packages/plugin-button-click-counter/src/index.spec.ts index b98ad7b..a622bfd 100644 --- a/packages/plugin-button-click-counter/src/index.spec.ts +++ b/packages/plugin-button-click-counter/src/index.spec.ts @@ -34,7 +34,7 @@ describe("button-click-counter", () => { }, ]); - expect(getHTML()).toContain("Button clicks:"); + expect(getHTML()).toContain("Click till you hit 100, then press Enter to find your time in milliseconds: "); expect( getHTML().includes(">0<") || getHTML().includes(">0 <") || getHTML().includes("value\">0") ).toBe(true); diff --git a/packages/plugin-button-click-counter/src/index.ts b/packages/plugin-button-click-counter/src/index.ts index 0359a23..77a68eb 100644 --- a/packages/plugin-button-click-counter/src/index.ts +++ b/packages/plugin-button-click-counter/src/index.ts @@ -67,7 +67,7 @@ class ButtonClickCounterPlugin implements JsPsychPlugin { const countPara = document.createElement("p"); countPara.id = "jspsych-button-click-counter-count"; - countPara.appendChild(document.createTextNode("Button clicks: ")); + countPara.appendChild(document.createTextNode("Click till you hit 100, then press Enter to find your time in milliseconds: ")); const countSpan = document.createElement("span"); countSpan.id = "jspsych-button-click-counter-value"; countSpan.textContent = "0"; diff --git a/packages/plugin-button-click-counter/tsconfig.json b/packages/plugin-button-click-counter/tsconfig.json index 8a84508..8cfb4af 100644 --- a/packages/plugin-button-click-counter/tsconfig.json +++ b/packages/plugin-button-click-counter/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@jspsych/config/tsconfig.contrib.json", "compilerOptions": { + "types": ["jest", "node"], "baseUrl": ".", "resolveJsonModule": true }, diff --git a/packages/plugin-emoji-screen/tsconfig.json b/packages/plugin-emoji-screen/tsconfig.json index 8a84508..beb725d 100644 --- a/packages/plugin-emoji-screen/tsconfig.json +++ b/packages/plugin-emoji-screen/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "@jspsych/config/tsconfig.contrib.json", "compilerOptions": { + "moduleResolution": "node", "baseUrl": ".", "resolveJsonModule": true }, "include": ["src"] -} +} \ No newline at end of file