@jtoar/redwood-issues
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -41,1 +41,5 @@ import * as dntShim from "./_dnt.shims.js"; | ||
export const SERVER_URL = "https://redwood-issues.deno.dev"; | ||
// ─── Progress ──────────────────────────────────────────────────────────────── | ||
export function getProgressBar(message, length) { | ||
return $.progress(message, { length }); | ||
} |
@@ -0,4 +1,7 @@ | ||
#!/usr/bin/env node | ||
import "./_dnt.polyfills.js"; | ||
import * as dntShim from "./_dnt.shims.js"; | ||
import { confirmFiles, exists, getDataFromRedwoodProjectPathRef, getRedwoodProjectPathRef, SERVER_URL, } from "./lib.js"; | ||
import { exists, getDataFromRedwoodProjectPathRef, getProgressBar, getRedwoodProjectPathRef, SERVER_URL, } from "./lib.js"; | ||
export async function main() { | ||
const progressBar = getProgressBar("Creating a gist with your Redwood project files...", 3); | ||
let redwoodProjectPathRef; | ||
@@ -12,7 +15,5 @@ try { | ||
} | ||
progressBar.increment(); | ||
const data = await getDataFromRedwoodProjectPathRef(redwoodProjectPathRef); | ||
const confirmRes = confirmFiles(data); | ||
if (!confirmRes) { | ||
dntShim.Deno.exit(1); | ||
} | ||
progressBar.increment(); | ||
const body = JSON.stringify(Object.entries(data).filter(exists).reduce((body, [file, { contents }]) => { | ||
@@ -30,3 +31,7 @@ body[file] = contents; | ||
const { url } = await serverRes.json(); | ||
progressBar.finish(); | ||
console.log(`Created a gist with ${Object.keys(data).length} file(s) at ${url}`); | ||
} | ||
if ((import.meta.url === ("file:///" + process.argv[1].replace(/\\/g, "/")).replace(/\/{3,}/, "///"))) { | ||
await main(); | ||
} |
{ | ||
"bin": { | ||
"rw-issues": "./esm/entrypoint.js" | ||
"rw-issues": "./esm/main.js" | ||
}, | ||
"name": "@jtoar/redwood-issues", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Tooling for Redwood issues", | ||
@@ -8,0 +8,0 @@ "dependencies": { |
846536
17889
115