create-psytask 1.1.1 → 1.1.3
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 +6 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/{bun-js/index.html → index.html} +1 -1
- package/template/package.json +9 -0
- package/template/{bun-ts/tsconfig.json → tsconfig.json} +1 -1
- package/template/bun-js/package.json +0 -13
- package/template/bun-ts/.devcontainer/Dockerfile +0 -3
- package/template/bun-ts/.devcontainer/devcontainer.json +0 -6
- package/template/bun-ts/index.html +0 -11
- package/template/bun-ts/package.json +0 -16
- /package/template/{bun-ts/index.ts → main.ts} +0 -0
package/README.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
+
# create-psytask
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
1
7
|
Create a new [psytask](https://github.com/bluebones-team/psytask) project.
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{confirm as
|
|
2
|
+
import{confirm as u,isCancel as p,outro as d,select as v,text as w}from"@clack/prompts";import i from"node:fs/promises";import c from"node:path";var f=c.join(import.meta.dirname,"../template"),o=async(e)=>{let t=await e;if(p(t))process.exit(0);return t},m=async(e,t)=>{let r=await i.readFile(e,"utf-8"),s=t(r);await i.writeFile(e,s)};(async()=>{let e=(await o(w({message:"Project name:",placeholder:"psytask-project",defaultValue:"psytask-project"}))).trim(),t=await o(u({message:"Use TypeScript?",initialValue:!1})),r=await o(v({message:"Select a bundler:",options:[{value:"vite"},{value:"bun"}],initialValue:"vite"})),s=c.join(process.cwd(),e);await i.access(s,i.constants.W_OK).then(async()=>{if(!await o(u({message:"Directory already exists. Do you want to overwrite it?",initialValue:!1})))return;await i.rm(s,{recursive:!0,force:!0})},()=>i.mkdir(s,{recursive:!0})),await i.cp(f,s,{recursive:!0});let a=c.join.bind(null,s),l=[m(a("package.json"),(n)=>JSON.stringify(Object.assign(JSON.parse(n),{name:e,scripts:r==="bun"?{dev:"bun index.html",build:"bun build index.html --outdir=dist --production","type-check":t?"tsc --noEmit":void 0}:{dev:"vite",build:"vite build",preview:"vite preview","type-check":t?"tsc --noEmit":void 0},devDependencies:{typescript:t?"^5":void 0,vite:r==="vite"?"^7":void 0}}),null,2))];if(!t)l.push(m(a("index.html"),(n)=>n.replace("main.ts","main.js")),i.rename(a("main.ts"),a("main.js")),i.rename(a("tsconfig.json"),a("jsconfig.json")));await Promise.all(l),d(`Project created successfully: ${s}`)})().catch((e)=>{console.error(e),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Welcome to Psytask</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<script type="module" src="./index.ts"></script>
|
|
10
|
-
</body>
|
|
11
|
-
</html>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bun-ts",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "bun index.html",
|
|
8
|
-
"build": "bun build index.html --outdir=dist --production"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"psytask": "^1"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"typescript": "^5"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
File without changes
|