fastapi-poe
Advanced tools
Comparing version 0.1.1 to 0.1.2
import { Command as i } from "commander"; | ||
import { confirm as m, password as p } from "@inquirer/prompts"; | ||
import a from "node:path"; | ||
import { access as d, cp as u, writeFile as n, readFile as f } from "node:fs/promises"; | ||
import { access as d, cp as f, writeFile as n, readFile as u } from "node:fs/promises"; | ||
import { fileURLToPath as w } from "node:url"; | ||
import c from "chalk"; | ||
const v = "0.1.0", g = a.resolve( | ||
const v = "0.1.2", g = a.resolve( | ||
a.dirname(w(import.meta.url)), | ||
@@ -12,10 +12,8 @@ ".." | ||
async function y(e) { | ||
const r = a.resolve(g, "./packages/poe-bot-template"); | ||
await u(r, e.distPath, { | ||
const s = a.resolve(g, "./packages/poe-bot-template"); | ||
await f(s, e.distPath, { | ||
recursive: !0, | ||
force: !0, | ||
dereference: !0, | ||
filter(t) { | ||
return !t.includes("node_modules"); | ||
} | ||
filter: (t) => a.basename(t) !== "node_modules" | ||
}), await n( | ||
@@ -25,11 +23,11 @@ a.resolve(e.distPath, ".dev.vars"), | ||
); | ||
const s = async (t, o) => { | ||
const l = await f(t, "utf-8"); | ||
await n(t, o(l)); | ||
const o = async (t, r) => { | ||
const l = await u(t, "utf-8"); | ||
await n(t, r(l)); | ||
}; | ||
await Promise.all( | ||
["package.json", "wrangler.toml", "src/index.ts"].map( | ||
(t) => s( | ||
(t) => o( | ||
a.resolve(e.distPath, t), | ||
(o) => o.replace("poe-bot-template", e.name) | ||
(r) => r.replace("poe-bot-template", e.name) | ||
) | ||
@@ -41,4 +39,4 @@ ) | ||
new i("init").arguments("<project-name>").action(async (e) => { | ||
const r = a.resolve(e); | ||
if (await h(r) && !await m({ | ||
const s = a.resolve(e); | ||
if (await h(s) && !await m({ | ||
message: "Directory already exists, do you want to overwrite it?", | ||
@@ -48,3 +46,3 @@ default: !1 | ||
return; | ||
const s = await p({ | ||
const o = await p({ | ||
message: "Input Poe Server Bot Access key", | ||
@@ -55,4 +53,4 @@ mask: "*" | ||
name: e, | ||
accessKey: s, | ||
distPath: r | ||
accessKey: o, | ||
distPath: s | ||
}), console.log(` | ||
@@ -59,0 +57,0 @@ ✨ PoeAI server bot project create success! |
{ | ||
"name": "fastapi-poe", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "bin": { |
Sorry, the diff of this file is not supported yet
18239
372