@design-ai/cli 4.56.0 → 4.57.0
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/.claude-plugin/plugin.json +109 -25
- package/CHANGELOG.md +36 -0
- package/README.ko.md +9 -26
- package/README.md +10 -23
- package/cli/bin/design-ai.mjs +1 -0
- package/cli/commands/help.mjs +7 -4
- package/cli/commands/index.mjs +292 -0
- package/cli/commands/learn-help.mjs +149 -0
- package/cli/commands/learn-print-profile.mjs +373 -0
- package/cli/commands/learn-print-restore.mjs +349 -0
- package/cli/commands/learn-print-signals.mjs +453 -0
- package/cli/commands/learn.mjs +60 -1281
- package/cli/commands/pack.mjs +7 -3
- package/cli/commands/prompt.mjs +7 -3
- package/cli/commands/search.mjs +94 -1
- package/cli/lib/dispatch.mjs +3 -0
- package/cli/lib/embedding-index.mjs +199 -0
- package/cli/lib/embedding-provider.mjs +121 -0
- package/cli/lib/embedding-rerank.mjs +52 -0
- package/cli/lib/learn-args.mjs +490 -0
- package/cli/lib/learn-backup.mjs +748 -0
- package/cli/lib/learn-curation.mjs +612 -0
- package/cli/lib/learn-eval.mjs +459 -0
- package/cli/lib/learn-profile.mjs +763 -0
- package/cli/lib/learn-select.mjs +223 -0
- package/cli/lib/learn-shared.mjs +158 -0
- package/cli/lib/learn-test-support.mjs +218 -0
- package/cli/lib/learn-usage.mjs +360 -0
- package/cli/lib/learn.mjs +83 -3694
- package/cli/lib/lexical.mjs +137 -0
- package/cli/lib/local-config.mjs +110 -0
- package/cli/lib/mcp-server.mjs +13 -3
- package/cli/lib/pack.mjs +31 -4
- package/cli/lib/prompt.mjs +42 -4
- package/cli/lib/recall.mjs +193 -0
- package/cli/lib/retrieval-index.mjs +0 -0
- package/cli/lib/search-ranked.mjs +170 -0
- package/cli/lib/search.mjs +11 -1
- package/cli/lib/signals-backlog-commands.mjs +673 -0
- package/cli/lib/signals-backlog.mjs +361 -0
- package/cli/lib/signals-eval.mjs +176 -0
- package/cli/lib/signals-readiness.mjs +247 -0
- package/cli/lib/signals-registry.mjs +377 -0
- package/cli/lib/signals-render.mjs +478 -0
- package/cli/lib/signals-shared.mjs +75 -0
- package/cli/lib/signals.mjs +16 -2337
- package/cli/lib/site-bundle-handoff-expected.mjs +173 -0
- package/cli/lib/site-bundle-handoff-runbook-action-summary.mjs +332 -0
- package/cli/lib/site-bundle-handoff-runbook-human-lines.mjs +167 -0
- package/cli/lib/site-bundle-handoff-runbook-maps.mjs +238 -0
- package/cli/lib/site-bundle-handoff-runbook-next-step.mjs +278 -0
- package/cli/lib/site-bundle-handoff-runbook.mjs +44 -931
- package/cli/lib/site-test-support.mjs +68 -0
- package/cli/lib/skill-proposals-apply-commands.mjs +135 -0
- package/cli/lib/skill-proposals-apply-contract.mjs +750 -0
- package/cli/lib/skill-proposals-apply-plan.mjs +118 -0
- package/cli/lib/skill-proposals-generate.mjs +298 -0
- package/cli/lib/skill-proposals-render.mjs +532 -0
- package/cli/lib/skill-proposals-review.mjs +262 -0
- package/cli/lib/skill-proposals.mjs +15 -2046
- package/cli/lib/workspace-args.mjs +83 -0
- package/cli/lib/workspace-git.mjs +169 -0
- package/cli/lib/workspace-learning.mjs +483 -0
- package/cli/lib/workspace-repo.mjs +139 -0
- package/cli/lib/workspace-report.mjs +283 -0
- package/cli/lib/workspace-test-support.mjs +99 -0
- package/cli/lib/workspace.mjs +30 -1056
- package/docs/AI-LEARNING-PHASE2.md +215 -0
- package/docs/DISTRIBUTION.ko.md +2 -2
- package/docs/DISTRIBUTION.md +2 -2
- package/docs/NEXT-SURFACE-DECISION.md +125 -0
- package/docs/PRODUCT-READINESS.md +3 -3
- package/docs/RELEASE-GATES.ko.md +35 -0
- package/docs/RELEASE-GATES.md +234 -0
- package/docs/ROADMAP.md +53 -8
- package/docs/external-status.md +6 -8
- package/docs/inspection-20260630.md +169 -0
- package/docs/integrations/design-ai-mcp-server.md +4 -4
- package/docs/reference/ant-design.md +413 -0
- package/docs/reference/awesome-design-md.md +439 -0
- package/docs/reference/mui.md +783 -0
- package/docs/reference/shadcn-ui.md +298 -0
- package/examples/component-accordion-actions.md +5 -5
- package/examples/component-accordion-details.md +5 -5
- package/examples/component-accordion-summary.md +5 -5
- package/examples/component-accordion.md +3 -3
- package/examples/component-affix.md +1 -1
- package/examples/component-alert-dialog.md +1 -1
- package/examples/component-alert-title.md +1 -1
- package/examples/component-alert.md +3 -3
- package/examples/component-anchor.md +1 -1
- package/examples/component-app-bar.md +1 -1
- package/examples/component-aspect-ratio.md +1 -1
- package/examples/component-auto-complete.md +2 -2
- package/examples/component-avatar-group.md +5 -5
- package/examples/component-avatar.md +3 -3
- package/examples/component-back-top.md +1 -1
- package/examples/component-backdrop.md +1 -1
- package/examples/component-badge.md +3 -3
- package/examples/component-border-beam.md +3 -3
- package/examples/component-bottom-navigation.md +1 -1
- package/examples/component-box.md +1 -1
- package/examples/component-breadcrumb.md +3 -3
- package/examples/component-button-base.md +3 -3
- package/examples/component-button-group.md +2 -2
- package/examples/component-button.md +3 -3
- package/examples/component-calendar.md +2 -2
- package/examples/component-card-actions.md +1 -1
- package/examples/component-card-content.md +1 -1
- package/examples/component-card-header.md +1 -1
- package/examples/component-card-media.md +1 -1
- package/examples/component-card.md +3 -3
- package/examples/component-carousel.md +2 -2
- package/examples/component-cascader.md +1 -1
- package/examples/component-chart.md +1 -1
- package/examples/component-checkbox.md +3 -3
- package/examples/component-click-away-listener.md +1 -1
- package/examples/component-code.md +1 -1
- package/examples/component-collapsible.md +1 -1
- package/examples/component-color-picker.md +1 -1
- package/examples/component-combobox.md +1 -1
- package/examples/component-command.md +1 -1
- package/examples/component-config-provider.md +3 -3
- package/examples/component-context-menu.md +1 -1
- package/examples/component-css-baseline.md +3 -3
- package/examples/component-date-picker.md +2 -2
- package/examples/component-descriptions.md +1 -1
- package/examples/component-dialog-actions.md +1 -1
- package/examples/component-dialog-content-text.md +1 -1
- package/examples/component-dialog-content.md +1 -1
- package/examples/component-dialog-title.md +1 -1
- package/examples/component-dialog.md +2 -2
- package/examples/component-divider.md +3 -3
- package/examples/component-drawer.md +3 -3
- package/examples/component-dropdown.md +3 -3
- package/examples/component-empty.md +2 -2
- package/examples/component-fade.md +1 -1
- package/examples/component-field.md +1 -1
- package/examples/component-filled-input.md +1 -1
- package/examples/component-flex.md +1 -1
- package/examples/component-float-button.md +2 -2
- package/examples/component-form-control-label.md +1 -1
- package/examples/component-form-control.md +1 -1
- package/examples/component-form-controls.md +1 -1
- package/examples/component-form-group.md +1 -1
- package/examples/component-form-helper-text.md +1 -1
- package/examples/component-form-label.md +1 -1
- package/examples/component-form.md +2 -2
- package/examples/component-grid.md +2 -2
- package/examples/component-grow.md +1 -1
- package/examples/component-hover-card.md +1 -1
- package/examples/component-icon-button.md +1 -1
- package/examples/component-icon.md +1 -1
- package/examples/component-image-list.md +1 -1
- package/examples/component-image.md +1 -1
- package/examples/component-input-adornment.md +1 -1
- package/examples/component-input-base.md +1 -1
- package/examples/component-input-number.md +1 -1
- package/examples/component-input-otp.md +2 -2
- package/examples/component-input.md +3 -3
- package/examples/component-item.md +1 -1
- package/examples/component-label.md +1 -1
- package/examples/component-layout.md +1 -1
- package/examples/component-link.md +1 -1
- package/examples/component-list-item-avatar.md +1 -1
- package/examples/component-list-item-button.md +1 -1
- package/examples/component-list-item-icon.md +1 -1
- package/examples/component-list-item-text.md +1 -1
- package/examples/component-list-item.md +1 -1
- package/examples/component-list-subheader.md +1 -1
- package/examples/component-list.md +2 -2
- package/examples/component-masonry.md +1 -1
- package/examples/component-mentions.md +1 -1
- package/examples/component-menu-item.md +1 -1
- package/examples/component-menu-list.md +1 -1
- package/examples/component-menu.md +1 -1
- package/examples/component-menubar.md +1 -1
- package/examples/component-message.md +1 -1
- package/examples/component-mobile-stepper.md +1 -1
- package/examples/component-modal.md +5 -5
- package/examples/component-navigation-menu.md +1 -1
- package/examples/component-notification.md +1 -1
- package/examples/component-outlined-input.md +1 -1
- package/examples/component-pagination.md +3 -3
- package/examples/component-paper.md +1 -1
- package/examples/component-popconfirm.md +1 -1
- package/examples/component-popover.md +3 -3
- package/examples/component-popper.md +1 -1
- package/examples/component-progress.md +2 -2
- package/examples/component-qr-code.md +1 -1
- package/examples/component-radio.md +3 -3
- package/examples/component-rate.md +2 -2
- package/examples/component-resizable.md +1 -1
- package/examples/component-result.md +1 -1
- package/examples/component-scroll-area.md +1 -1
- package/examples/component-segmented.md +3 -3
- package/examples/component-select.md +3 -3
- package/examples/component-separator.md +1 -1
- package/examples/component-sheet.md +1 -1
- package/examples/component-sidebar.md +1 -1
- package/examples/component-skeleton.md +3 -3
- package/examples/component-slide.md +1 -1
- package/examples/component-slider.md +3 -3
- package/examples/component-snackbar-content.md +1 -1
- package/examples/component-snackbar.md +1 -1
- package/examples/component-sonner.md +1 -1
- package/examples/component-space.md +1 -1
- package/examples/component-speed-dial-action.md +1 -1
- package/examples/component-speed-dial.md +1 -1
- package/examples/component-spin.md +2 -2
- package/examples/component-spinner.md +1 -1
- package/examples/component-splitter.md +2 -2
- package/examples/component-stack.md +1 -1
- package/examples/component-statistic.md +1 -1
- package/examples/component-step-button.md +4 -4
- package/examples/component-step-connector.md +4 -4
- package/examples/component-step-content.md +1 -1
- package/examples/component-step-icon.md +1 -1
- package/examples/component-step-label.md +1 -1
- package/examples/component-step.md +2 -2
- package/examples/component-steps.md +2 -2
- package/examples/component-swipeable-drawer.md +1 -1
- package/examples/component-switch.md +3 -3
- package/examples/component-tab-scroll-button.md +5 -5
- package/examples/component-tab.md +1 -1
- package/examples/component-table-body.md +1 -1
- package/examples/component-table-cell.md +1 -1
- package/examples/component-table-container.md +1 -1
- package/examples/component-table-footer.md +1 -1
- package/examples/component-table-head.md +1 -1
- package/examples/component-table-pagination.md +1 -1
- package/examples/component-table-row.md +1 -1
- package/examples/component-table-sort-label.md +1 -1
- package/examples/component-table.md +2 -2
- package/examples/component-tabs.md +3 -3
- package/examples/component-tag-badge.md +2 -2
- package/examples/component-tag.md +1 -1
- package/examples/component-textarea-autosize.md +1 -1
- package/examples/component-textarea.md +1 -1
- package/examples/component-time-picker.md +1 -1
- package/examples/component-timeline.md +1 -1
- package/examples/component-toast.md +4 -4
- package/examples/component-toggle-button.md +1 -1
- package/examples/component-toggle.md +1 -1
- package/examples/component-toolbar.md +1 -1
- package/examples/component-tooltip.md +3 -3
- package/examples/component-tour.md +1 -1
- package/examples/component-transfer.md +1 -1
- package/examples/component-tree-select.md +1 -1
- package/examples/component-tree.md +1 -1
- package/examples/component-typography.md +2 -2
- package/examples/component-upload.md +1 -1
- package/examples/component-watermark.md +1 -1
- package/examples/component-zoom.md +1 -1
- package/knowledge/COVERAGE.md +4 -3
- package/knowledge/components/INDEX.md +202 -202
- package/knowledge/patterns/brand-references.md +72 -72
- package/package.json +1 -1
- package/tools/audit/local-ci.py +16 -1
- package/tools/audit/package-smoke.py +611 -9
- package/tools/audit/registry-smoke.py +534 -0
- package/tools/audit/release-metadata.py +47 -1
- package/tools/audit/smoke_assertions.py +915 -13
- package/tools/migrations/refs-links-to-reference-pages.py +179 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// CLI argument parsing for `design-ai workspace`.
|
|
2
|
+
|
|
3
|
+
import { unknownOptionMessage } from "./suggest.mjs";
|
|
4
|
+
|
|
5
|
+
export const WORKSPACE_OPTIONS = [
|
|
6
|
+
"-h",
|
|
7
|
+
"--help",
|
|
8
|
+
"--json",
|
|
9
|
+
"--strict",
|
|
10
|
+
"--root",
|
|
11
|
+
"--learning-file",
|
|
12
|
+
"--learning-usage",
|
|
13
|
+
"--learning-eval",
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export function parseWorkspaceArgs(args) {
|
|
17
|
+
const flags = {
|
|
18
|
+
help: false,
|
|
19
|
+
json: false,
|
|
20
|
+
strict: false,
|
|
21
|
+
root: "",
|
|
22
|
+
learningFilePath: "",
|
|
23
|
+
learningUsagePath: "",
|
|
24
|
+
learningEvalPath: "",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
28
|
+
const arg = args[i];
|
|
29
|
+
if (arg === "-h" || arg === "--help") {
|
|
30
|
+
flags.help = true;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (arg === "--json") {
|
|
34
|
+
flags.json = true;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (arg === "--strict") {
|
|
38
|
+
flags.strict = true;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (arg === "--root") {
|
|
42
|
+
const root = args[i + 1];
|
|
43
|
+
if (!root || root.startsWith("--")) throw new Error("--root expects a path");
|
|
44
|
+
flags.root = root;
|
|
45
|
+
i += 1;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (arg === "--learning-file") {
|
|
49
|
+
const filePath = args[i + 1];
|
|
50
|
+
if (!filePath || filePath.startsWith("--")) {
|
|
51
|
+
throw new Error("--learning-file expects a path");
|
|
52
|
+
}
|
|
53
|
+
flags.learningFilePath = filePath;
|
|
54
|
+
i += 1;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (arg === "--learning-usage") {
|
|
58
|
+
const usagePath = args[i + 1];
|
|
59
|
+
if (!usagePath || usagePath.startsWith("--")) {
|
|
60
|
+
throw new Error("--learning-usage expects a path");
|
|
61
|
+
}
|
|
62
|
+
flags.learningUsagePath = usagePath;
|
|
63
|
+
i += 1;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (arg === "--learning-eval") {
|
|
67
|
+
const evalPath = args[i + 1];
|
|
68
|
+
if (!evalPath || evalPath.startsWith("--")) {
|
|
69
|
+
throw new Error("--learning-eval expects a path");
|
|
70
|
+
}
|
|
71
|
+
flags.learningEvalPath = evalPath;
|
|
72
|
+
i += 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
throw new Error(
|
|
77
|
+
`${unknownOptionMessage("workspace", arg, WORKSPACE_OPTIONS)}\n` +
|
|
78
|
+
"Usage: design-ai workspace [--root path] [--learning-file path] [--learning-usage path] [--learning-eval path] [--strict] [--json]",
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return flags;
|
|
83
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Git working-tree readiness report for `design-ai workspace`.
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
const IGNORED_LOCAL_ARTIFACT_EXACT_PATHS = new Set([
|
|
7
|
+
"DEV_LOG.md",
|
|
8
|
+
"docs/case-study.md",
|
|
9
|
+
"docs/evidence-checklist.md",
|
|
10
|
+
"docs/evidence-gallery.md",
|
|
11
|
+
"docs/implementation-evidence.md",
|
|
12
|
+
"docs/interview-story.md",
|
|
13
|
+
"docs/project-card.md",
|
|
14
|
+
"docs/project-roadmap.md",
|
|
15
|
+
"docs/readme-improvement.md",
|
|
16
|
+
"docs/resume-bullets.md",
|
|
17
|
+
"links.md",
|
|
18
|
+
"portfolio_manifest.md",
|
|
19
|
+
]);
|
|
20
|
+
const IGNORED_LOCAL_ARTIFACT_PREFIXES = [
|
|
21
|
+
"_portfolio_export/",
|
|
22
|
+
"evidence/",
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export function runGitCommand(args, { cwd }) {
|
|
26
|
+
const result = spawnSync("git", args, {
|
|
27
|
+
cwd,
|
|
28
|
+
encoding: "utf8",
|
|
29
|
+
timeout: 5000,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
ok: result.status === 0,
|
|
33
|
+
status: result.status,
|
|
34
|
+
stdout: result.stdout || "",
|
|
35
|
+
stderr: result.stderr || "",
|
|
36
|
+
error: result.error?.message || "",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function splitLines(text) {
|
|
41
|
+
return String(text || "")
|
|
42
|
+
.split(/\r?\n/)
|
|
43
|
+
.map((line) => line.trimEnd())
|
|
44
|
+
.filter(Boolean);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function trimOutput(result) {
|
|
48
|
+
return String(result?.stdout || "").trim();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function parseAheadBehind(text) {
|
|
52
|
+
const [behindRaw, aheadRaw] = String(text || "").trim().split(/\s+/);
|
|
53
|
+
const behind = Number(behindRaw);
|
|
54
|
+
const ahead = Number(aheadRaw);
|
|
55
|
+
return {
|
|
56
|
+
ahead: Number.isInteger(ahead) ? ahead : 0,
|
|
57
|
+
behind: Number.isInteger(behind) ? behind : 0,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function parseLastCommit(text) {
|
|
62
|
+
const trimmed = String(text || "").trim();
|
|
63
|
+
if (!trimmed) return null;
|
|
64
|
+
const [hash, ...subjectParts] = trimmed.split("\t");
|
|
65
|
+
return {
|
|
66
|
+
hash: hash || "",
|
|
67
|
+
subject: subjectParts.join("\t").trim(),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function parseUntrackedStatusPath(line) {
|
|
72
|
+
const text = String(line || "");
|
|
73
|
+
if (!text.startsWith("?? ")) return "";
|
|
74
|
+
return text.slice(3).trim();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isIgnoredLocalArtifactStatus(line) {
|
|
78
|
+
const filePath = parseUntrackedStatusPath(line);
|
|
79
|
+
if (!filePath) return false;
|
|
80
|
+
if (IGNORED_LOCAL_ARTIFACT_EXACT_PATHS.has(filePath)) return true;
|
|
81
|
+
return IGNORED_LOCAL_ARTIFACT_PREFIXES.some((prefix) => filePath === prefix.slice(0, -1) || filePath.startsWith(prefix));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function splitGitStatusShort(statusShort) {
|
|
85
|
+
const activeStatusShort = [];
|
|
86
|
+
const ignoredStatusShort = [];
|
|
87
|
+
for (const line of statusShort) {
|
|
88
|
+
if (isIgnoredLocalArtifactStatus(line)) {
|
|
89
|
+
ignoredStatusShort.push(line);
|
|
90
|
+
} else {
|
|
91
|
+
activeStatusShort.push(line);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { activeStatusShort, ignoredStatusShort };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function collectGitReport({ root = process.cwd(), gitRunner = runGitCommand } = {}) {
|
|
98
|
+
const resolvedRoot = path.resolve(root);
|
|
99
|
+
const base = {
|
|
100
|
+
isRepo: false,
|
|
101
|
+
root: resolvedRoot,
|
|
102
|
+
branch: "",
|
|
103
|
+
clean: true,
|
|
104
|
+
upstream: "",
|
|
105
|
+
ahead: 0,
|
|
106
|
+
behind: 0,
|
|
107
|
+
remote: "",
|
|
108
|
+
lastCommit: null,
|
|
109
|
+
statusShort: [],
|
|
110
|
+
allStatusShort: [],
|
|
111
|
+
ignoredStatusShort: [],
|
|
112
|
+
ignoredLocalArtifactCount: 0,
|
|
113
|
+
hasIgnoredLocalArtifacts: false,
|
|
114
|
+
reason: "",
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const inside = gitRunner(["rev-parse", "--is-inside-work-tree"], { cwd: resolvedRoot });
|
|
118
|
+
if (!inside.ok || trimOutput(inside) !== "true") {
|
|
119
|
+
return {
|
|
120
|
+
...base,
|
|
121
|
+
reason: inside.error || trimOutput(inside) || String(inside.stderr || "").trim() || "not a git repository",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const repoRootResult = gitRunner(["rev-parse", "--show-toplevel"], { cwd: resolvedRoot });
|
|
126
|
+
const repoRoot = repoRootResult.ok && trimOutput(repoRootResult)
|
|
127
|
+
? trimOutput(repoRootResult)
|
|
128
|
+
: resolvedRoot;
|
|
129
|
+
const branchResult = gitRunner(["branch", "--show-current"], { cwd: repoRoot });
|
|
130
|
+
const statusResult = gitRunner(["status", "--short"], { cwd: repoRoot });
|
|
131
|
+
const upstreamResult = gitRunner(["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], {
|
|
132
|
+
cwd: repoRoot,
|
|
133
|
+
});
|
|
134
|
+
const remoteResult = gitRunner(["config", "--get", "remote.origin.url"], { cwd: repoRoot });
|
|
135
|
+
const lastCommitResult = gitRunner(["log", "-1", "--pretty=%h%x09%s"], { cwd: repoRoot });
|
|
136
|
+
|
|
137
|
+
let ahead = 0;
|
|
138
|
+
let behind = 0;
|
|
139
|
+
if (upstreamResult.ok && trimOutput(upstreamResult)) {
|
|
140
|
+
const countsResult = gitRunner(["rev-list", "--left-right", "--count", "@{u}...HEAD"], {
|
|
141
|
+
cwd: repoRoot,
|
|
142
|
+
});
|
|
143
|
+
if (countsResult.ok) {
|
|
144
|
+
({ ahead, behind } = parseAheadBehind(trimOutput(countsResult)));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const statusShort = statusResult.ok ? splitLines(statusResult.stdout) : [];
|
|
149
|
+
const { activeStatusShort, ignoredStatusShort } = splitGitStatusShort(statusShort);
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
...base,
|
|
153
|
+
isRepo: true,
|
|
154
|
+
root: repoRoot,
|
|
155
|
+
branch: trimOutput(branchResult),
|
|
156
|
+
clean: activeStatusShort.length === 0,
|
|
157
|
+
upstream: upstreamResult.ok ? trimOutput(upstreamResult) : "",
|
|
158
|
+
ahead,
|
|
159
|
+
behind,
|
|
160
|
+
remote: remoteResult.ok ? trimOutput(remoteResult) : "",
|
|
161
|
+
lastCommit: lastCommitResult.ok ? parseLastCommit(lastCommitResult.stdout) : null,
|
|
162
|
+
statusShort: activeStatusShort,
|
|
163
|
+
allStatusShort: statusShort,
|
|
164
|
+
ignoredStatusShort,
|
|
165
|
+
ignoredLocalArtifactCount: ignoredStatusShort.length,
|
|
166
|
+
hasIgnoredLocalArtifacts: ignoredStatusShort.length > 0,
|
|
167
|
+
reason: "",
|
|
168
|
+
};
|
|
169
|
+
}
|