create-psytask 1.1.0 → 1.1.2
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 +2 -1
- package/package.json +2 -2
- package/template/{bun-js/index.html → index.html} +1 -1
- package/template/{bun-ts/index.ts → main.ts} +1 -0
- 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/index.html +0 -11
- package/template/bun-ts/package.json +0 -16
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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{confirm as p,isCancel as m,outro as d,select as v,text as f}from"@clack/prompts";import i from"node:fs/promises";import c from"node:path";var y=c.join(import.meta.dirname,"../template"),o=async(e)=>{let t=await e;if(m(t))process.exit(0);return t},u=async(e,t)=>{let a=await i.readFile(e,"utf-8"),s=t(a);await i.writeFile(e,s)};(async()=>{if(process.argv0!=="bun")console.warn("We only provide templates for bun temporarily, please change package.json scripts yourself.");let e=(await o(f({message:"Project name:",placeholder:"psytask-project",defaultValue:"psytask-project"}))).trim(),t=await o(p({message:"Use TypeScript?",initialValue:!1})),a=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(p({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(y,s,{recursive:!0});let r=c.join.bind(null,s),l=[u(r("package.json"),(n)=>JSON.stringify(Object.assign(JSON.parse(n),{name:e,scripts:a==="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:a==="vite"?"^7":void 0}}),null,2))];if(!t)l.push(u(r("index.html"),(n)=>n.replace("main.ts","main.js")),i.rename(r("main.ts"),r("main.js")),i.rename(r("tsconfig.json"),r("jsconfig.json")));await Promise.all(l),d(`Project created successfully: ${s}`)})().catch((e)=>{console.error(e),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-psytask",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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 --
|
|
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"
|
|
@@ -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
|
-
}
|