create-psytask 1.1.3 → 1.2.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1 @@
1
- # create-psytask
2
-
3
- ![NPM Version](https://img.shields.io/npm/v/create-psytask)
4
- ![NPM Downloads](https://img.shields.io/npm/dm/create-psytask)
5
- ![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/create-psytask)
6
-
7
- Create a new [psytask](https://github.com/bluebones-team/psytask) project.
1
+ A CLI to create [PsyTask](https://github.com/bluebonesx/psytask) project.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-psytask",
3
- "version": "1.1.3",
4
- "description": "CLI tool to create a new psytask project",
3
+ "version": "1.2.0-0",
4
+ "description": "CLI tool to create PsyTask project",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=22"
@@ -11,8 +11,13 @@
11
11
  },
12
12
  "files": [
13
13
  "dist",
14
- "template"
14
+ "template",
15
+ "README.md"
15
16
  ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/bluebonesx/psytask.git"
20
+ },
16
21
  "scripts": {
17
22
  "dev": "bun run build --watch",
18
23
  "build": "bun build index.ts --outfile=dist/index.js --target=node --external=@clack/prompts --banner='#!/usr/bin/env node' --production"
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Welcome to Psytask</title>
6
+ <title>Welcome to PsyTask</title>
7
7
  </head>
8
8
  <body>
9
9
  <script type="module" src="./main.ts"></script>
package/template/main.ts CHANGED
@@ -1,18 +1,36 @@
1
1
  import { createApp } from 'psytask';
2
- import 'psytask/main.css';
2
+ import { Container } from '@psytask/components';
3
+ import van from 'vanjs-core';
4
+
5
+ const { a, div } = van.tags;
3
6
 
4
7
  using app = await createApp();
5
8
  using dc = app.collector('demo.csv');
6
9
 
7
- using text = app.text('', { close_on: 'pointerup' });
10
+ using simpleText = app.scene(Container, {
11
+ defaultProps: { content: '' },
12
+ close_on: 'pointerup',
13
+ });
8
14
 
9
- await text.show({
10
- children: 'Welcome to the experiment! Click to continue.',
15
+ await simpleText.show({
16
+ content: div(
17
+ 'Welcome to PsyTask template!\nsee more ',
18
+ a(
19
+ { href: 'https://bluebonesx.github.io/psytask', target: '_blank' },
20
+ 'Information & Examples',
21
+ ),
22
+ '\n\nClick to continue.',
23
+ ),
11
24
  });
12
25
  for (let i = 0; i < 3; i++) {
13
- const { start_time } = await text.show({
14
- children: `This is trial ${i + 1}. Click to continue.`,
26
+ const { start_time } = await simpleText.show({
27
+ content: `This is trial ${i + 1}. Click to continue.`,
15
28
  });
16
29
 
17
30
  dc.add({ index: i + 1, start_time });
18
31
  }
32
+
33
+ // show data on page and download
34
+ document.body.style.whiteSpace = 'pre-wrap';
35
+ document.body.textContent = dc.final();
36
+ dc.download();
@@ -1,9 +1,12 @@
1
1
  {
2
- "name": "base",
2
+ "name": "template",
3
3
  "version": "1.0.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "psytask": "^1"
7
+ "psytask": "^1",
8
+ "@psytask/components": "^1",
9
+ "@psytask/jspsych": "^1",
10
+ "vanjs-core": "^1"
8
11
  }
9
12
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  // environment
4
- "lib": ["DOM", "ES2022", "ESNext.Disposable"],
5
- "target": "es2022",
4
+ "lib": ["DOM", "ES2017", "ESNext.Disposable"],
5
+ "target": "es2017",
6
6
  "module": "esnext",
7
7
  "moduleDetection": "force",
8
8
  "jsx": "preserve",