create-psytask 1.1.0 → 1.1.1

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/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- import{confirm as c,isCancel as p,outro as l,text as u}from"@clack/prompts";import e from"node:fs/promises";import a from"node:path";const m=a.join(import.meta.dirname,"../template"),o=async(t)=>{const s=await t;if(p(s))process.exit(0);return s};(async()=>{if(process.argv0!=="bun")console.warn("We only provide templates for bun temporarily, please change package.json scripts yourself.");const t=(await o(u({message:"Project name:",placeholder:"psytask-project",defaultValue:"psytask-project"}))).trim(),s=await o(c({message:"Use TypeScript?",initialValue:!1})),r=a.join(process.cwd(),t);await e.access(r,e.constants.W_OK).then(async()=>{if(!await o(c({message:"Directory already exists. Do you want to overwrite it?",initialValue:!1})))return;await e.rm(r,{recursive:!0,force:!0})},()=>e.mkdir(r,{recursive:!0}));await e.cp(a.join(m,s?"bun-ts":"bun-js"),r,{recursive:!0});const i=a.join(r,"package.json"),n=Object.assign(JSON.parse(await e.readFile(i,"utf-8")),{name:t});await e.writeFile(i,JSON.stringify(n,null,2));l(`Project created successfully: ${r}`)})().catch((t)=>{console.error(t);process.exit(1)});
1
+ #!/usr/bin/env node
2
+ import{confirm as c,isCancel as p,outro as l,text as u}from"@clack/prompts";import e from"node:fs/promises";import a from"node:path";var m=a.join(import.meta.dirname,"../template"),o=async(t)=>{let s=await t;if(p(s))process.exit(0);return s};(async()=>{if(process.argv0!=="bun")console.warn("We only provide templates for bun temporarily, please change package.json scripts yourself.");let t=(await o(u({message:"Project name:",placeholder:"psytask-project",defaultValue:"psytask-project"}))).trim(),s=await o(c({message:"Use TypeScript?",initialValue:!1})),r=a.join(process.cwd(),t);await e.access(r,e.constants.W_OK).then(async()=>{if(!await o(c({message:"Directory already exists. Do you want to overwrite it?",initialValue:!1})))return;await e.rm(r,{recursive:!0,force:!0})},()=>e.mkdir(r,{recursive:!0})),await e.cp(a.join(m,s?"bun-ts":"bun-js"),r,{recursive:!0});let i=a.join(r,"package.json"),n=Object.assign(JSON.parse(await e.readFile(i,"utf-8")),{name:t});await e.writeFile(i,JSON.stringify(n,null,2)),l(`Project created successfully: ${r}`)})().catch((t)=>{console.error(t),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-psytask",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "CLI tool to create a new psytask project",
5
5
  "type": "module",
6
6
  "engines": {
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "dev": "bun run build --watch",
18
- "build": "bun build index.ts --outfile=dist/index.js --target=node --no-bundle --production"
18
+ "build": "bun build index.ts --outfile=dist/index.js --target=node --external=@clack/prompts --banner='#!/usr/bin/env node' --production"
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^0.11.0"
@@ -0,0 +1,3 @@
1
+ FROM oven/bun:latest-debian
2
+
3
+ WORKDIR /workspace
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Bun Environment",
3
+ "build": {
4
+ "dockerfile": "Dockerfile"
5
+ }
6
+ }
@@ -1,4 +1,5 @@
1
1
  import { createApp } from 'psytask';
2
+ import 'psytask/main.css';
2
3
 
3
4
  using app = await createApp();
4
5
  using dc = app.collector('demo.csv');