git-stack-cli
Advanced tools
| import * as React from "react"; | ||
| import { Debug } from "./Debug.js"; | ||
| import { DependencyCheck } from "./DependencyCheck.js"; | ||
| import { GatherMetadata } from "./GatherMetadata.js"; | ||
| import { GithubApiError } from "./GithubApiError.js"; | ||
| import { Main } from "./Main.js"; | ||
| import { Output } from "./Output.js"; | ||
| import { Store } from "./Store.js"; | ||
| export function App() { | ||
| const ink = Store.useState((state) => state.ink); | ||
| const argv = Store.useState((state) => state.argv); | ||
| if (!ink || !argv) { | ||
| return null; | ||
| } | ||
| // // debug component | ||
| // return ( | ||
| // <React.Fragment> | ||
| // <Debug /> | ||
| // <Output /> | ||
| // <GithubApiError /> | ||
| // </React.Fragment> | ||
| // ); | ||
| return (React.createElement(Providers, null, | ||
| React.createElement(Debug, null), | ||
| React.createElement(Output, null), | ||
| !argv.debug ? null : React.createElement(GithubApiError, null), | ||
| React.createElement(DependencyCheck, null, | ||
| React.createElement(GatherMetadata, null, | ||
| React.createElement(Main, null))))); | ||
| } |
| import * as React from "react"; | ||
| import { FormattedMessage } from "react-intl"; | ||
| export function FormatText(props) { | ||
| return (React.createElement(FormattedMessage, { id: "FormatText", defaultMessage: props.message, values: props.values }, (chunks) => { | ||
| return React.cloneElement(props.wrapper, {}, chunks); | ||
| })); | ||
| } |
| import * as React from "react"; | ||
| import { IntlProvider } from "react-intl"; | ||
| export function Providers(props) { | ||
| return React.createElement(IntlProvider, { locale: "en" }, props.children); | ||
| } |
+2
-1
@@ -8,2 +8,3 @@ import * as React from "react"; | ||
| import { Output } from "./Output.js"; | ||
| import { Providers } from "./Providers.js"; | ||
| import { Store } from "./Store.js"; | ||
@@ -24,3 +25,3 @@ export function App() { | ||
| // ); | ||
| return (React.createElement(React.Fragment, null, | ||
| return (React.createElement(Providers, null, | ||
| React.createElement(Debug, null), | ||
@@ -27,0 +28,0 @@ React.createElement(Output, null), |
@@ -6,2 +6,3 @@ import * as React from "react"; | ||
| import { wrap_index } from "../core/wrap_index.js"; | ||
| import { FormatText } from "./FormatText.js"; | ||
| import { MultiSelect } from "./MultiSelect.js"; | ||
@@ -51,6 +52,6 @@ import { Parens } from "./Parens.js"; | ||
| for (const group of props.commit_range.group_list) { | ||
| if (group.pr) { | ||
| if (group.id !== props.commit_range.UNASSIGNED) { | ||
| group_list.push({ | ||
| id: group.id, | ||
| title: group.pr.title, | ||
| title: group.pr?.title || group.id, | ||
| }); | ||
@@ -64,3 +65,4 @@ } | ||
| const inputLower = input.toLowerCase(); | ||
| if (unassigned_count === 0 && (inputLower === "r" || inputLower === "s")) { | ||
| const hasUnassignedCommits = unassigned_count > 0; | ||
| if (!hasUnassignedCommits && (inputLower === "r" || inputLower === "s")) { | ||
| actions.set((state) => { | ||
@@ -84,3 +86,3 @@ state.commit_map = {}; | ||
| // only allow create when on unassigned group | ||
| if (isUnassigned && inputLower === "c") { | ||
| if (hasUnassignedCommits && inputLower === "c") { | ||
| const id = uuid_v4(); | ||
@@ -134,6 +136,6 @@ actions.output(React.createElement(Ink.Box, null, | ||
| items.reverse(); | ||
| // console.debug({ group, isUnassigned }); | ||
| // console.debug({ current_index, group, isUnassigned }); | ||
| return (React.createElement(Ink.Box, { flexDirection: "column" }, | ||
| React.createElement(Ink.Box, { height: 1 }), | ||
| React.createElement(MultiSelect, { key: current_index, items: items, onSelect: (args) => { | ||
| React.createElement(MultiSelect, { key: group.id, items: items, onSelect: (args) => { | ||
| // console.debug("onSelect", args); | ||
@@ -158,13 +160,9 @@ const key = args.item.sha; | ||
| React.createElement(Ink.Box, { height: 1 }), | ||
| unassigned_count > 0 ? (React.createElement(Ink.Text, { color: "gray" }, | ||
| React.createElement(Ink.Text, { color: "#3b82f6", bold: true }, unassigned_count), | ||
| React.createElement(Ink.Text, null, " unassigned commits"), | ||
| !isUnassigned ? null : (React.createElement(Ink.Text, { color: "gray" }, | ||
| React.createElement(Ink.Text, null, ", press "), | ||
| React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, "c"), | ||
| " to ", | ||
| React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, | ||
| unassigned_count > 0 ? (React.createElement(FormatText, { wrapper: React.createElement(Ink.Text, { color: "gray" }), message: "{count} unassigned commits, press {c} to {create} a new group", values: { | ||
| count: (React.createElement(Ink.Text, { color: "#3b82f6", bold: true }, unassigned_count)), | ||
| c: (React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, "c")), | ||
| create: (React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, | ||
| React.createElement(Parens, null, "c"), | ||
| "reate"), | ||
| " a new group")))) : (React.createElement(React.Fragment, null, | ||
| "reate")), | ||
| } })) : (React.createElement(React.Fragment, null, | ||
| React.createElement(Ink.Text, null, | ||
@@ -171,0 +169,0 @@ "🎉 Done! Press ", |
@@ -17,2 +17,3 @@ import * as React from "react"; | ||
| url: "", | ||
| id: group.id, | ||
| }; | ||
@@ -36,2 +37,6 @@ if (group.id === commit_range.UNASSIGNED) { | ||
| if (group.pr) { | ||
| if (group.pr.state === "MERGED") { | ||
| row.icon = "↗"; | ||
| row.status = "MERGED"; | ||
| } | ||
| row.title = group.pr.title; | ||
@@ -86,3 +91,3 @@ row.count = `${group.pr.commits.length}/${group.commits.length}`; | ||
| row_list.map((row) => { | ||
| return (React.createElement(Ink.Box, { key: row.url, | ||
| return (React.createElement(Ink.Box, { key: row.id, | ||
| // borderStyle="round" | ||
@@ -89,0 +94,0 @@ flexDirection: "row", columnGap: columnGap, width: available_width }, |
@@ -16,2 +16,19 @@ import * as React from "react"; | ||
| }); | ||
| // prettier-ignore | ||
| const y = React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, "Y"); | ||
| const n = React.createElement(Ink.Text, { color: "#ef4444" }, "n"); | ||
| let choices; | ||
| switch (answer) { | ||
| case "y": | ||
| choices = y; | ||
| break; | ||
| case "n": | ||
| choices = n; | ||
| break; | ||
| default: | ||
| choices = (React.createElement(React.Fragment, null, | ||
| y, | ||
| React.createElement(Ink.Text, null, "/"), | ||
| n)); | ||
| } | ||
| return (React.createElement(Ink.Box, { flexDirection: "column" }, | ||
@@ -22,6 +39,3 @@ React.createElement(Ink.Box, null, | ||
| React.createElement(Parens, null, | ||
| React.createElement(Ink.Text, { color: "gray" }, | ||
| answer && answer !== "y" ? null : (React.createElement(Ink.Text, { bold: true, color: "#22c55e" }, "Y")), | ||
| answer ? null : React.createElement(Ink.Text, null, "/"), | ||
| answer && answer !== "n" ? null : (React.createElement(Ink.Text, { color: "#ef4444" }, "n"))))))); | ||
| React.createElement(Ink.Text, { color: "gray" }, choices))))); | ||
| } |
@@ -54,3 +54,3 @@ import * as Metadata from "./Metadata.js"; | ||
| const pr_result = await github.pr_status(group.id); | ||
| if (pr_result && pr_result.state === "OPEN") { | ||
| if (pr_result && pr_result.state !== "CLOSED") { | ||
| group.pr = pr_result; | ||
@@ -57,0 +57,0 @@ } |
+2
-1
| { | ||
| "name": "git-stack-cli", | ||
| "version": "0.3.0", | ||
| "version": "0.3.1", | ||
| "description": "", | ||
@@ -32,2 +32,3 @@ "author": "magus", | ||
| "react": "^18.2.0", | ||
| "react-intl": "^6.5.5", | ||
| "uuid": "^9.0.1", | ||
@@ -34,0 +35,0 @@ "yargs": "^17.7.2", |
+2
-0
| # git-stack-cli | ||
| > create stacked diffs (PRs) on Github from a single branch by grouping commits | ||
| ## install | ||
@@ -4,0 +6,0 @@ |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
177578
1.25%76
4.11%4311
1.41%75
2.74%8
14.29%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added