Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jtoar/redwood-issues

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jtoar/redwood-issues - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

esm/create_gist_command.js

2

esm/lib.js
import * as dntShim from "./_dnt.shims.js";
import $ from "./deps/deno.land/x/dax@0.35.0/mod.js";
import { $ } from "./deps.js";
import { findUp } from "./deps/deno.land/x/find_up_deno@0.1.2/mod.js";

@@ -4,0 +4,0 @@ // ─── Fs ──────────────────────────────────────────────────────────────────────

#!/usr/bin/env node
import "./_dnt.polyfills.js";
import * as dntShim from "./_dnt.shims.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;
try {
redwoodProjectPathRef = await getRedwoodProjectPathRef();
import { parse } from "./deps/deno.land/std@0.203.0/flags/mod.js";
import { createGistCommand } from "./create_gist_command.js";
import { findInNodeModulesCommand } from "./find_in_node_modules_command.js";
const commands = {
"create-gist": createGistCommand,
"find-in-node-modules": findInNodeModulesCommand,
};
function printHelp() {
console.log(`Available commands: ${Object.keys(commands).join(", ")}`);
}
function main() {
const args = parse(dntShim.Deno.args, {
boolean: ["dev"],
});
if (args.dev) {
console.log("Running in dev mode");
dntShim.Deno.chdir("./fixtures/main");
}
catch (e) {
console.error(e.message);
dntShim.Deno.exit(1);
let positionals = args._;
let command;
for (const positional of positionals) {
if (typeof positional !== "string") {
continue;
}
if (Object.keys(commands).includes(positional)) {
command = positional;
positionals = positionals.filter((p) => p !== positional);
break;
}
}
progressBar.increment();
const data = await getDataFromRedwoodProjectPathRef(redwoodProjectPathRef);
progressBar.increment();
const body = JSON.stringify(Object.entries(data).filter(exists).reduce((body, [file, { contents }]) => {
body[file] = contents;
return body;
}, {}));
const serverRes = await fetch(SERVER_URL, {
method: "POST",
headers: {
"content-type": "application/json",
},
body,
});
const { url } = await serverRes.json();
progressBar.finish();
console.log(`Created a gist with ${Object.keys(data).length} file(s) at ${url}`);
if (!command) {
printHelp();
dntShim.Deno.exit(0);
}
commands[command](positionals);
}
if ((import.meta.url === ("file:///" + process.argv[1].replace(/\\/g, "/")).replace(/\/{3,}/, "///"))) {
await main();
}
main();

@@ -6,3 +6,3 @@ {

"name": "@jtoar/redwood-issues",
"version": "0.0.5",
"version": "0.0.6",
"description": "Tooling for Redwood issues",

@@ -9,0 +9,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc