@bridge-ds/core 0.8.0 → 0.10.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/README.md +27 -1
- package/bridge.config.schema.json +23 -0
- package/dist/audit/index.d.ts +1 -0
- package/dist/audit/index.js +269 -23
- package/dist/audit/index.js.map +1 -1
- package/dist/audit/missing-pieces.d.ts +43 -0
- package/dist/config.d.ts +28 -0
- package/dist/docs-proposal.d.ts +58 -10
- package/dist/figma-push-github.d.ts +143 -0
- package/dist/figma-push.d.ts +204 -0
- package/dist/github-client.d.ts +15 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1569 -3179
- package/dist/index.js.map +1 -1
- package/dist/node/git-local.d.ts +15 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +201 -10
- package/dist/node/index.js.map +1 -1
- package/dist/node/suggestion-apply-node.d.ts +69 -0
- package/dist/{component-spec-SKuywZqr.js → prod-branch-BdMPKffE.js} +1134 -1438
- package/dist/prod-branch-BdMPKffE.js.map +1 -0
- package/dist/prod-branch-github.d.ts +160 -0
- package/dist/prod-branch.d.ts +267 -0
- package/dist/{report-iPSnsjYi.js → report-DOnKUw8G.js} +24 -24
- package/dist/{report-iPSnsjYi.js.map → report-DOnKUw8G.js.map} +1 -1
- package/dist/suggestion-apply-ByBEYtct.js +4802 -0
- package/dist/suggestion-apply-ByBEYtct.js.map +1 -0
- package/dist/suggestion-apply.d.ts +150 -0
- package/dist/suggestion-review.d.ts +70 -0
- package/dist/suggestions-github.d.ts +131 -0
- package/dist/suggestions.d.ts +236 -0
- package/dist/token-proposal.d.ts +123 -0
- package/package.json +1 -1
- package/dist/component-spec-SKuywZqr.js.map +0 -1
- package/dist/layered-BnbmToGs.js +0 -500
- package/dist/layered-BnbmToGs.js.map +0 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { ChangesMode } from './config';
|
|
2
|
+
import { type ExplorationSettings } from './explorations-github';
|
|
3
|
+
import { type GitHubClient, type PullRequestSummary } from './github-client';
|
|
4
|
+
import { type ProductConfig } from './products';
|
|
5
|
+
import { productBranchSentence, type LibraryBranchPlan, type LibraryLink, type LinkStatus, type MissingPiece, type PiecesRecord, type LibraryPreviewState, type ProductBranchRef } from './prod-branch';
|
|
6
|
+
import { type RequestSource } from './requests';
|
|
7
|
+
/** At most this many product files are read per check (two reads each). */
|
|
8
|
+
export declare const PIECES_FILE_LIMIT = 40;
|
|
9
|
+
type Pull = PullRequestSummary & {
|
|
10
|
+
body: string;
|
|
11
|
+
mergeable: boolean | null;
|
|
12
|
+
requestedReviewers: string[];
|
|
13
|
+
};
|
|
14
|
+
export interface ProductBranchRead {
|
|
15
|
+
pull: Pull;
|
|
16
|
+
product: ProductConfig;
|
|
17
|
+
/** The product's changed files, their texts at the branch start (merge base with main) and at its head. */
|
|
18
|
+
files: {
|
|
19
|
+
path: string;
|
|
20
|
+
before: string | null;
|
|
21
|
+
after: string | null;
|
|
22
|
+
}[];
|
|
23
|
+
/** Product files left unread past the limit. */
|
|
24
|
+
skipped: number;
|
|
25
|
+
record: PiecesRecord | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reads a product branch for the check: the pull request, its product, and the product files it changes with their
|
|
29
|
+
* text before and after (two reads per file, up to PIECES_FILE_LIMIT files).
|
|
30
|
+
*/
|
|
31
|
+
export declare function readProductBranchOnGitHub(gh: GitHubClient, pr: number, opts: {
|
|
32
|
+
products: readonly ProductConfig[];
|
|
33
|
+
}): Promise<ProductBranchRead>;
|
|
34
|
+
/** Saves a check in the product branch body, keeping the library branches already opened for its pieces. */
|
|
35
|
+
export declare function recordPiecesOnGitHub(gh: GitHubClient, pr: number, check: {
|
|
36
|
+
pieces: MissingPiece[];
|
|
37
|
+
fixes: number;
|
|
38
|
+
headSha?: string | undefined;
|
|
39
|
+
checkedAt?: string | undefined;
|
|
40
|
+
}): Promise<PiecesRecord>;
|
|
41
|
+
export interface PreviewMerge {
|
|
42
|
+
status: 'merged' | 'up-to-date' | 'conflict';
|
|
43
|
+
sha: string | null;
|
|
44
|
+
said: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The product branch uses the library branch's preview: Bridge merges the library branch into it, so the product
|
|
48
|
+
* preview deploy and anyone working on the branch get the real library change. A conflict is left to a developer.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useLibraryPreviewOnGitHub(gh: GitHubClient, input: {
|
|
51
|
+
productBranch: string;
|
|
52
|
+
libraryBranch: string;
|
|
53
|
+
libraryNumber: number;
|
|
54
|
+
}): Promise<PreviewMerge>;
|
|
55
|
+
export interface OpenLibraryBranchInput {
|
|
56
|
+
/** The product branch (pull request number). */
|
|
57
|
+
pr: number;
|
|
58
|
+
/** The piece id, from the recorded check. */
|
|
59
|
+
piece: string;
|
|
60
|
+
/** Branch library work starts from (the default branch). */
|
|
61
|
+
base: string;
|
|
62
|
+
products: readonly ProductConfig[];
|
|
63
|
+
/** Previews and snapshot packages for a library exploration. */
|
|
64
|
+
exploration: Pick<ExplorationSettings, 'packages' | 'apps'>;
|
|
65
|
+
/**
|
|
66
|
+
* Opens the token change of a token piece (planTokenProposal + writeTokenProposalOnGitHub where the caller has the
|
|
67
|
+
* token files and contrast pairs). Without it a token piece is refused. In suggest mode (`ctx.mode`), it files a
|
|
68
|
+
* suggestion instead (suggestTokenProposalOnGitHub with `neededBy: plan.neededBy`) and returns its result: a result
|
|
69
|
+
* with `status: 'suggested'` is linked as a suggestion, anything else as a token change pull request.
|
|
70
|
+
*/
|
|
71
|
+
writeTokens?: ((plan: Extract<LibraryBranchPlan, {
|
|
72
|
+
kind: 'token-change';
|
|
73
|
+
}>, ctx: {
|
|
74
|
+
mode: ChangesMode;
|
|
75
|
+
}) => Promise<LibraryTokenWrite>) | undefined;
|
|
76
|
+
/** Who opens it, and the AI agent behind it ("claude"). */
|
|
77
|
+
openedBy?: string | undefined;
|
|
78
|
+
agent?: string | undefined;
|
|
79
|
+
source?: RequestSource | undefined;
|
|
80
|
+
/** Merge the new library branch into the product branch when it already changes something (default true). */
|
|
81
|
+
usePreview?: boolean | undefined;
|
|
82
|
+
dryRun?: boolean | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* "direct" (default here, so existing callers keep their behaviour): a token piece opens a pull request, a variant
|
|
85
|
+
* an exploration branch. "suggest": a token piece is filed as a suggestion and a variant as a component request, so
|
|
86
|
+
* the token only needs Issues write. Callers pass changesMode(config), or an explicit choice.
|
|
87
|
+
*/
|
|
88
|
+
mode?: ChangesMode | undefined;
|
|
89
|
+
}
|
|
90
|
+
/** What writeTokens returns: the pull request it opened, or the suggestion it filed. */
|
|
91
|
+
export type LibraryTokenWrite = {
|
|
92
|
+
number: number;
|
|
93
|
+
url: string;
|
|
94
|
+
branch: string;
|
|
95
|
+
status?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
status: 'suggested';
|
|
98
|
+
number: number;
|
|
99
|
+
url: string;
|
|
100
|
+
};
|
|
101
|
+
export interface OpenedLibraryBranch {
|
|
102
|
+
/** "suggested": the library side is a suggestion (`link.kind` 'suggestion', `link.number` its issue). */
|
|
103
|
+
status: 'opened' | 'suggested' | 'already-linked' | 'dry-run';
|
|
104
|
+
plan: LibraryBranchPlan;
|
|
105
|
+
link: LibraryLink | null;
|
|
106
|
+
preview: PreviewMerge | null;
|
|
107
|
+
warnings: string[];
|
|
108
|
+
}
|
|
109
|
+
/** The product branch as the library side names it. */
|
|
110
|
+
export declare function productBranchRef(pull: Pick<Pull, 'number' | 'title' | 'headRef' | 'url' | 'author' | 'body'>, product: ProductConfig): ProductBranchRef;
|
|
111
|
+
/**
|
|
112
|
+
* Opens the library side of a missing piece and links both ways: the library branch (or request) says "Needed by" the
|
|
113
|
+
* product branch and carries the `needed-by-product` label; the product branch records the link. A token piece opens a
|
|
114
|
+
* token change (through `writeTokens`), a variant a library exploration, a new component a request. When the new
|
|
115
|
+
* library branch already changes something (a token change), the product branch takes its preview.
|
|
116
|
+
* In suggest mode nothing is a branch: a token piece is a suggestion (through `writeTokens`), a variant and a new
|
|
117
|
+
* component are requests; recording the link on the product branch is best effort (a warning when refused).
|
|
118
|
+
*/
|
|
119
|
+
export declare function openLibraryBranchOnGitHub(gh: GitHubClient, input: OpenLibraryBranchInput): Promise<OpenedLibraryBranch>;
|
|
120
|
+
export interface LinkedLibraryBranch {
|
|
121
|
+
link: LibraryLink;
|
|
122
|
+
piece: MissingPiece | undefined;
|
|
123
|
+
status: LinkStatus;
|
|
124
|
+
preview: LibraryPreviewState;
|
|
125
|
+
/** Requested reviewers of a library pull request, or assignees of a request. */
|
|
126
|
+
people: string[];
|
|
127
|
+
}
|
|
128
|
+
export interface ProductBranchView {
|
|
129
|
+
pull: Pull;
|
|
130
|
+
product: ProductConfig;
|
|
131
|
+
record: PiecesRecord | undefined;
|
|
132
|
+
sentence: ReturnType<typeof productBranchSentence>;
|
|
133
|
+
linked: LinkedLibraryBranch[];
|
|
134
|
+
/** Pieces with no library branch yet. */
|
|
135
|
+
open: MissingPiece[];
|
|
136
|
+
}
|
|
137
|
+
/** Where one linked library branch stands, and what its preview means for the product branch. */
|
|
138
|
+
export declare function linkedLibraryBranchOnGitHub(gh: GitHubClient, link: LibraryLink, product: {
|
|
139
|
+
headSha: string;
|
|
140
|
+
baseRef: string;
|
|
141
|
+
}, piece?: MissingPiece): Promise<LinkedLibraryBranch>;
|
|
142
|
+
/**
|
|
143
|
+
* Everything a product branch page shows: the record, the sentence, and each linked library branch with its status,
|
|
144
|
+
* its reviewers and what its preview means for the product branch. A few reads per linked branch.
|
|
145
|
+
*/
|
|
146
|
+
export declare function productBranchViewOnGitHub(gh: GitHubClient, pr: number, opts: {
|
|
147
|
+
products: readonly ProductConfig[];
|
|
148
|
+
viewer?: string | null | undefined;
|
|
149
|
+
agentName?: string | undefined;
|
|
150
|
+
}): Promise<ProductBranchView>;
|
|
151
|
+
/**
|
|
152
|
+
* "Switch to the published version": once the library branch shipped, main comes into the product branch (GitHub's
|
|
153
|
+
* update branch), so the product branch stops carrying the library change and uses the shipped one. Conflicts are
|
|
154
|
+
* left to bridge_update_from_main or a developer.
|
|
155
|
+
*/
|
|
156
|
+
export declare function switchToPublishedOnGitHub(gh: GitHubClient, pr: number): Promise<{
|
|
157
|
+
status: 'switched' | 'up-to-date';
|
|
158
|
+
said: string;
|
|
159
|
+
}>;
|
|
160
|
+
export {};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import type { Exploration } from './explorations';
|
|
2
|
+
import type { ChangesMode } from './config';
|
|
3
|
+
import type { ComponentChangeRequest } from './requests';
|
|
4
|
+
import type { SuggestionStatus } from './suggestions';
|
|
5
|
+
import type { TokenEdit } from './token-edits';
|
|
6
|
+
/** What the library lacks: a token value, a variant of an existing component, or a component. */
|
|
7
|
+
export type PieceKind = 'token' | 'variant' | 'component';
|
|
8
|
+
/** What a variant changes on its component, in designer words. */
|
|
9
|
+
export type PieceAspect = 'tone' | 'shape' | 'size' | 'style';
|
|
10
|
+
export interface PieceValue {
|
|
11
|
+
/** Audit category: color, radius, spacing... */
|
|
12
|
+
category: string;
|
|
13
|
+
/** CSS property, when known: background-color, border-radius. */
|
|
14
|
+
property?: string | undefined;
|
|
15
|
+
/** As written: "#c2410c", "10px". */
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PieceNearest {
|
|
19
|
+
/** Token path of the closest library value: color.feedback.danger.bg. */
|
|
20
|
+
token: string;
|
|
21
|
+
cssVar: string;
|
|
22
|
+
/** Its value, as the audit resolved it. */
|
|
23
|
+
value: string;
|
|
24
|
+
/** How close: high means it looks a lot like it. */
|
|
25
|
+
level: 'exact' | 'high' | 'medium' | 'low';
|
|
26
|
+
/** The word people use for it: "danger" for color.feedback.danger.bg, "control" for radius.control. */
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
export interface MissingPiece {
|
|
30
|
+
/** Stable id inside one product branch: "badge-overdue-tone", "color-c2410c". */
|
|
31
|
+
id: string;
|
|
32
|
+
kind: PieceKind;
|
|
33
|
+
/** Designer title: "Badge: overdue tone", "New color #C2410C", "New component: Timeline". */
|
|
34
|
+
title: string;
|
|
35
|
+
/** One plain sentence: what the branch did and what the library has today. */
|
|
36
|
+
summary: string;
|
|
37
|
+
/** The name the branch gives it ("overdue"), from a class name, the element's text or the component name. */
|
|
38
|
+
name: string;
|
|
39
|
+
/** The library component it extends (variant) or the proposed component name (component). */
|
|
40
|
+
component?: string | undefined;
|
|
41
|
+
aspect?: PieceAspect | undefined;
|
|
42
|
+
values: PieceValue[];
|
|
43
|
+
nearest?: PieceNearest | undefined;
|
|
44
|
+
/** Where the branch writes it, first places only. */
|
|
45
|
+
where: {
|
|
46
|
+
file: string;
|
|
47
|
+
line: number;
|
|
48
|
+
}[];
|
|
49
|
+
/** Token pieces: the token the library branch would add (one value, every file the closest token lives in). */
|
|
50
|
+
token?: {
|
|
51
|
+
path: string;
|
|
52
|
+
type: string;
|
|
53
|
+
value: string;
|
|
54
|
+
files: string[];
|
|
55
|
+
} | undefined;
|
|
56
|
+
}
|
|
57
|
+
/** Where the library side of a piece lives. A suggestion is an issue holding the exact token change (suggestions.ts). */
|
|
58
|
+
export type LibraryLinkKind = 'token-change' | 'exploration' | 'request' | 'suggestion';
|
|
59
|
+
export interface LibraryLink {
|
|
60
|
+
/** The piece id. */
|
|
61
|
+
piece: string;
|
|
62
|
+
kind: LibraryLinkKind;
|
|
63
|
+
/** Pull request number (token change, exploration) or issue number (request, suggestion). */
|
|
64
|
+
number: number;
|
|
65
|
+
url: string;
|
|
66
|
+
title: string;
|
|
67
|
+
/** Head branch of a pull request. */
|
|
68
|
+
branch?: string | undefined;
|
|
69
|
+
/** GitHub login of who opened it, and the AI agent behind it ("claude") when one did. */
|
|
70
|
+
openedBy?: string | undefined;
|
|
71
|
+
agent?: string | undefined;
|
|
72
|
+
/** ISO date. */
|
|
73
|
+
at: string;
|
|
74
|
+
}
|
|
75
|
+
/** What the product branch body keeps: the last check and the library branches opened for its pieces. */
|
|
76
|
+
export interface PiecesRecord {
|
|
77
|
+
/** ISO date of the last check. */
|
|
78
|
+
checkedAt: string;
|
|
79
|
+
/** Head commit the check read. */
|
|
80
|
+
headSha?: string | undefined;
|
|
81
|
+
pieces: MissingPiece[];
|
|
82
|
+
links: LibraryLink[];
|
|
83
|
+
/** Values and elements the library already has (a token or a component to use instead): fixes, not pieces. */
|
|
84
|
+
fixes?: number | undefined;
|
|
85
|
+
}
|
|
86
|
+
/** Every library branch opened for a product branch carries this label, so lists can find them without the body. */
|
|
87
|
+
export declare const NEEDED_BY_LABEL = "needed-by-product";
|
|
88
|
+
/** The record in a product branch body, or undefined when the branch was never checked. */
|
|
89
|
+
export declare function parsePiecesRecord(body: string | null | undefined): PiecesRecord | undefined;
|
|
90
|
+
/** The section people read on GitHub, then the hidden record tools read. */
|
|
91
|
+
export declare function piecesSection(r: PiecesRecord): string;
|
|
92
|
+
/** The body with the pieces section replaced, or added at the end. */
|
|
93
|
+
export declare function withPiecesRecord(body: string | null | undefined, r: PiecesRecord): string;
|
|
94
|
+
/**
|
|
95
|
+
* A new check merged with the previous record: links stay with their piece (same id), and links of pieces the branch
|
|
96
|
+
* no longer has stay too, so a library branch is never forgotten.
|
|
97
|
+
*/
|
|
98
|
+
export declare function mergePiecesRecord(prev: PiecesRecord | undefined, next: Omit<PiecesRecord, 'links'> & {
|
|
99
|
+
links?: LibraryLink[] | undefined;
|
|
100
|
+
}): PiecesRecord;
|
|
101
|
+
/** The record with one more link (replacing the piece's earlier one). */
|
|
102
|
+
export declare function withLink(r: PiecesRecord, l: LibraryLink): PiecesRecord;
|
|
103
|
+
export interface NeededBy {
|
|
104
|
+
/** The product branch (pull request number), its title and branch. */
|
|
105
|
+
pr: number;
|
|
106
|
+
title: string;
|
|
107
|
+
branch: string;
|
|
108
|
+
url: string;
|
|
109
|
+
/** Product key and name: "admin", "Admin demo". */
|
|
110
|
+
product: string;
|
|
111
|
+
productName: string;
|
|
112
|
+
/** Who started the product branch (GitHub login). */
|
|
113
|
+
author?: string | undefined;
|
|
114
|
+
/** The piece it answers. */
|
|
115
|
+
piece: string;
|
|
116
|
+
pieceTitle: string;
|
|
117
|
+
/** The closest thing the library has today, so a reviewer can suggest it instead: "danger". */
|
|
118
|
+
nearest?: string | undefined;
|
|
119
|
+
nearestToken?: string | undefined;
|
|
120
|
+
}
|
|
121
|
+
/** "Needed by" for a library branch body: one line people read, one hidden block tools read. */
|
|
122
|
+
export declare function neededBySection(n: NeededBy): string;
|
|
123
|
+
export declare function parseNeededBy(body: string | null | undefined): NeededBy | undefined;
|
|
124
|
+
/** The body with the "Needed by" section first (replacing an earlier one). */
|
|
125
|
+
export declare function withNeededBy(body: string | null | undefined, n: NeededBy): string;
|
|
126
|
+
export interface ProductBranchRef {
|
|
127
|
+
pr: number;
|
|
128
|
+
title: string;
|
|
129
|
+
branch: string;
|
|
130
|
+
url: string;
|
|
131
|
+
productKey: string;
|
|
132
|
+
productName: string;
|
|
133
|
+
author?: string | undefined;
|
|
134
|
+
}
|
|
135
|
+
export type LibraryBranchPlan = {
|
|
136
|
+
kind: 'token-change';
|
|
137
|
+
title: string;
|
|
138
|
+
summary: string;
|
|
139
|
+
edits: TokenEdit[];
|
|
140
|
+
neededBy: NeededBy;
|
|
141
|
+
} | {
|
|
142
|
+
kind: 'exploration';
|
|
143
|
+
title: string;
|
|
144
|
+
exploration: Exploration;
|
|
145
|
+
neededBy: NeededBy;
|
|
146
|
+
brief: string;
|
|
147
|
+
} | {
|
|
148
|
+
kind: 'request';
|
|
149
|
+
title: string;
|
|
150
|
+
request: ComponentChangeRequest;
|
|
151
|
+
neededBy: NeededBy;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* What a piece opens in the library, honestly labelled by what Bridge can write:
|
|
155
|
+
* - a token piece: a token change (the new token, a draft for review, the usual gate); in suggest mode the same
|
|
156
|
+
* change is filed as a suggestion;
|
|
157
|
+
* - a variant: a library exploration (a branch and a draft for the component work, with a brief for Claude); in
|
|
158
|
+
* suggest mode a component request, since an exploration is a branch;
|
|
159
|
+
* - a new component: a component request (an issue): it needs design work before code.
|
|
160
|
+
*/
|
|
161
|
+
export declare function libraryBranchPlan(piece: MissingPiece, branch: ProductBranchRef, opts?: {
|
|
162
|
+
source?: ComponentChangeRequest['source'];
|
|
163
|
+
requestedBy?: string | undefined;
|
|
164
|
+
mode?: ChangesMode | undefined;
|
|
165
|
+
}): LibraryBranchPlan;
|
|
166
|
+
export type LinkStatusKey = 'draft' | 'in-review' | 'changes' | 'approved' | 'shipped' | 'closed' | 'exploring' | 'requested' | 'in-progress' | 'done' | 'declined' | 'outdated';
|
|
167
|
+
export interface LinkStatus {
|
|
168
|
+
key: LinkStatusKey;
|
|
169
|
+
/** "In review", "Shipped". */
|
|
170
|
+
label: string;
|
|
171
|
+
/** Logins asked to review (pull requests), or assignees (requests). */
|
|
172
|
+
people: string[];
|
|
173
|
+
/** "In review · @dana reviews". */
|
|
174
|
+
line: string;
|
|
175
|
+
}
|
|
176
|
+
/** Badge tone of a status: status colours only for status. */
|
|
177
|
+
export declare const LINK_STATUS_TONE: Record<LinkStatusKey, 'neutral' | 'info' | 'warning' | 'success' | 'danger'>;
|
|
178
|
+
/**
|
|
179
|
+
* Where a library branch stands, from what GitHub says: a pull request (state, draft, labels, requested reviewers,
|
|
180
|
+
* latest review per person), a request issue (state, reason, assignees, whether a pull request implements it) or a
|
|
181
|
+
* suggestion (its status, suggestionStatus in suggestions.ts, and who it is assigned to).
|
|
182
|
+
*/
|
|
183
|
+
export declare function linkStatus(x: {
|
|
184
|
+
kind: 'token-change' | 'exploration';
|
|
185
|
+
state: string;
|
|
186
|
+
draft: boolean;
|
|
187
|
+
labels?: readonly string[] | undefined;
|
|
188
|
+
requestedReviewers?: readonly string[] | undefined;
|
|
189
|
+
reviews?: readonly {
|
|
190
|
+
user?: string | undefined;
|
|
191
|
+
state: string;
|
|
192
|
+
}[] | undefined;
|
|
193
|
+
} | {
|
|
194
|
+
kind: 'request';
|
|
195
|
+
state: 'open' | 'closed';
|
|
196
|
+
stateReason?: string | null | undefined;
|
|
197
|
+
assignees?: readonly string[] | undefined;
|
|
198
|
+
implemented?: boolean | undefined;
|
|
199
|
+
} | {
|
|
200
|
+
kind: 'suggestion';
|
|
201
|
+
status: SuggestionStatus;
|
|
202
|
+
assignees?: readonly string[] | undefined;
|
|
203
|
+
}): LinkStatus;
|
|
204
|
+
export type LibraryPreviewKey = 'nothing-yet' | 'not-used' | 'preview' | 'outdated' | 'published' | 'switched' | 'declined';
|
|
205
|
+
export interface LibraryPreviewState {
|
|
206
|
+
key: LibraryPreviewKey;
|
|
207
|
+
/** One sentence in designer words. */
|
|
208
|
+
sentence: string;
|
|
209
|
+
/** The one action that moves it on, when there is one. */
|
|
210
|
+
action: {
|
|
211
|
+
kind: 'use-preview' | 'refresh-preview' | 'switch';
|
|
212
|
+
label: string;
|
|
213
|
+
} | null;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* What the product branch shows of a library branch, and what to do next:
|
|
217
|
+
* - while the library branch is open, the product branch carries its commits (Bridge merges the library branch in),
|
|
218
|
+
* so the product preview shows the real library change; new library commits make it outdated;
|
|
219
|
+
* - once the library branch ships, "Switch to the published version" brings main into the product branch: its own
|
|
220
|
+
* diff no longer carries the library change, the shipped one is used;
|
|
221
|
+
* - a request has nothing to preview until someone builds it; a closed library branch says so.
|
|
222
|
+
*
|
|
223
|
+
* `missing` is how many library commits the product branch lacks, `total` how many the library branch has on top of
|
|
224
|
+
* main (null when unknown). `behindMain` is how far the product branch is behind main.
|
|
225
|
+
*/
|
|
226
|
+
export declare function libraryPreviewState(x: {
|
|
227
|
+
kind: LibraryLinkKind;
|
|
228
|
+
lifecycle: 'open' | 'merged' | 'closed';
|
|
229
|
+
/** The library branch changes something beyond its exploration note. */
|
|
230
|
+
hasChanges: boolean;
|
|
231
|
+
missing: number | null;
|
|
232
|
+
total: number | null;
|
|
233
|
+
behindMain: number | null;
|
|
234
|
+
nearest?: string | undefined;
|
|
235
|
+
}): LibraryPreviewState;
|
|
236
|
+
/**
|
|
237
|
+
* The one sentence first on a product branch: "Built with the library. 1 piece was missing, and Claude AI opened a
|
|
238
|
+
* library branch for it." `who` names who opened the library branches when they are all from the same one.
|
|
239
|
+
*/
|
|
240
|
+
export declare function productBranchSentence(r: PiecesRecord | undefined, opts?: {
|
|
241
|
+
agentName?: string | undefined;
|
|
242
|
+
viewer?: string | null | undefined;
|
|
243
|
+
}): {
|
|
244
|
+
lead: string;
|
|
245
|
+
strong: string;
|
|
246
|
+
rest: string;
|
|
247
|
+
};
|
|
248
|
+
/** "Why it exists" on the library review: "Ann needs it for <title> in Admin demo." */
|
|
249
|
+
export declare function whyItExists(n: NeededBy, opts?: {
|
|
250
|
+
names?: Record<string, string>;
|
|
251
|
+
}): {
|
|
252
|
+
who: string;
|
|
253
|
+
title: string;
|
|
254
|
+
product: string;
|
|
255
|
+
};
|
|
256
|
+
/** The reviewer's question when the closest library value looks a lot like the piece. */
|
|
257
|
+
export declare function nearestQuestion(n: NeededBy, opts?: {
|
|
258
|
+
names?: Record<string, string>;
|
|
259
|
+
}): string | null;
|
|
260
|
+
/** The review comment of "Suggest <nearest>": request changes with the library value to use instead. */
|
|
261
|
+
export declare function suggestNearestComment(n: NeededBy): string | null;
|
|
262
|
+
/** A piece id from its kind and names: "badge-overdue-tone". */
|
|
263
|
+
export declare function pieceId(parts: (string | undefined)[]): string;
|
|
264
|
+
/** The word people use for a token: the tone in its path, else its last meaningful segment. */
|
|
265
|
+
export declare function tokenLabel(path: string): string;
|
|
266
|
+
/** A new token beside the closest one, named after the piece: color.feedback.danger.bg + "overdue" -> color.feedback.overdue.bg when the closest has a tone, else a sibling. */
|
|
267
|
+
export declare function proposedTokenPath(nearest: string | undefined, name: string, category: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bn as hexToRgba, aW as comboKey } from "./prod-branch-BdMPKffE.js";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
const AUDIT_SCHEMA_VERSION = 1;
|
|
4
4
|
const FINDING_CATEGORIES = ["color", "spacing", "size", "radius", "border-width", "shadow", "duration", "easing", "z-index", "font-family", "font-size", "font-weight", "line-height"];
|
|
@@ -1880,31 +1880,31 @@ export {
|
|
|
1880
1880
|
tailwindColor as X,
|
|
1881
1881
|
tailwindFindings as Y,
|
|
1882
1882
|
toOklab as Z,
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1883
|
+
auditFile as a,
|
|
1884
|
+
AUDIT_IGNORE_DIRS as b,
|
|
1885
|
+
AUDIT_SCHEMA_VERSION as c,
|
|
1886
|
+
DesignSystemIndex as d,
|
|
1887
|
+
LOOKALIKE_CLASSES as e,
|
|
1888
|
+
applyAllowlist as f,
|
|
1889
|
+
applyIgnoreComments as g,
|
|
1890
|
+
auditCssText as h,
|
|
1891
|
+
isAuditable as i,
|
|
1892
|
+
auditMarkdown as j,
|
|
1893
|
+
blankComments as k,
|
|
1894
|
+
buildAuditReport as l,
|
|
1895
|
+
classifyModule as m,
|
|
1896
|
+
classifyTag as n,
|
|
1897
|
+
compareWithBaseline as o,
|
|
1898
|
+
cssPropertyOf as p,
|
|
1899
|
+
deltaE as q,
|
|
1900
|
+
domRendererComponent as r,
|
|
1901
|
+
dsEquivalent as s,
|
|
1902
|
+
historyPoint as t,
|
|
1903
|
+
ignoreDirectives as u,
|
|
1904
|
+
importsOf as v,
|
|
1905
1905
|
isColorLiteral as w,
|
|
1906
1906
|
isNonVisual as x,
|
|
1907
1907
|
isRouterLink as y,
|
|
1908
1908
|
isSafeFix as z
|
|
1909
1909
|
};
|
|
1910
|
-
//# sourceMappingURL=report-
|
|
1910
|
+
//# sourceMappingURL=report-DOnKUw8G.js.map
|