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 +1 -7
- package/package.json +8 -3
- package/template/index.html +1 -1
- package/template/main.ts +24 -6
- package/template/package.json +5 -2
- package/template/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
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.
|
|
4
|
-
"description": "CLI tool to create
|
|
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"
|
package/template/index.html
CHANGED
package/template/main.ts
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import { createApp } from 'psytask';
|
|
2
|
-
import 'psytask/
|
|
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
|
|
10
|
+
using simpleText = app.scene(Container, {
|
|
11
|
+
defaultProps: { content: '' },
|
|
12
|
+
close_on: 'pointerup',
|
|
13
|
+
});
|
|
8
14
|
|
|
9
|
-
await
|
|
10
|
-
|
|
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
|
|
14
|
-
|
|
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();
|
package/template/package.json
CHANGED
package/template/tsconfig.json
CHANGED