@bridge-ds/core 0.20.0 → 0.22.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/bridge.config.schema.json +5 -0
- package/dist/audit/index.js +275 -52
- package/dist/audit/index.js.map +1 -1
- package/dist/audit/missing-pieces.d.ts +4 -0
- package/dist/component-spec.d.ts +13 -0
- package/dist/exploration-done-github.d.ts +50 -0
- package/dist/exploration-resume.d.ts +136 -0
- package/dist/explorations-github.d.ts +75 -3
- package/dist/explorations.d.ts +137 -8
- package/dist/figma-fix-loop.d.ts +1 -1
- package/dist/figma-fixes.d.ts +14 -2
- package/dist/github-client.d.ts +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1708 -1283
- package/dist/index.js.map +1 -1
- package/dist/measured-only.d.ts +13 -1
- package/dist/node/index.js +11 -11
- package/dist/previews-github.d.ts +13 -0
- package/dist/previews.d.ts +8 -1
- package/dist/{prod-branch-CJZwMfVD.js → prod-branch-JL5tmL6u.js} +257 -193
- package/dist/prod-branch-JL5tmL6u.js.map +1 -0
- package/dist/prod-branch-github.d.ts +54 -4
- package/dist/prod-branch.d.ts +42 -1
- package/dist/products.d.ts +22 -0
- package/dist/{repo-source-CshjjC7x.js → repo-source-CcWmqNBZ.js} +2165 -1998
- package/dist/repo-source-CcWmqNBZ.js.map +1 -0
- package/dist/{report-CE-jHAuw.js → report-CxOwwG_w.js} +38 -38
- package/dist/{report-CE-jHAuw.js.map → report-CxOwwG_w.js.map} +1 -1
- package/dist/review-gate.d.ts +1 -1
- package/dist/try-in-product.d.ts +4 -1
- package/package.json +1 -1
- package/dist/prod-branch-CJZwMfVD.js.map +0 -1
- package/dist/repo-source-CshjjC7x.js.map +0 -1
package/dist/measured-only.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentSpecsFile } from './component-spec';
|
|
2
2
|
import type { FigmaHints, FixedMeasuredSpecsFile } from './figma-fixes';
|
|
3
|
-
import { type MeasuredSpecsFile } from './measured-spec';
|
|
3
|
+
import { type MeasuredSpec, type MeasuredSpecsFile } from './measured-spec';
|
|
4
4
|
/** What building from the measure gave: sets, variants, and the stories it used. */
|
|
5
5
|
export interface MeasuredOnlyReport {
|
|
6
6
|
sets: number;
|
|
@@ -17,6 +17,18 @@ export interface VariantShot {
|
|
|
17
17
|
}
|
|
18
18
|
/** Set name -> variant key (variantKeyOf) -> its story's screenshot: the reference Check fidelity compares with. */
|
|
19
19
|
export type MeasuredShots = Record<string, Record<string, VariantShot>>;
|
|
20
|
+
/**
|
|
21
|
+
* A size of its own, read from the boxes: a frame bigger than its children plus its padding on an axis (a 48 px button
|
|
22
|
+
* around a 16 px icon, a 24 px label row around a 16 px label) keeps that size, as its CSS gives it, when the measure
|
|
23
|
+
* did not say so. `own`: the axes its parent does not size (not stretched across, not grown along).
|
|
24
|
+
*/
|
|
25
|
+
export declare function boxSized(spec: MeasuredSpec, partId: string, own: {
|
|
26
|
+
width: boolean;
|
|
27
|
+
height: boolean;
|
|
28
|
+
}): {
|
|
29
|
+
width?: number;
|
|
30
|
+
height?: number;
|
|
31
|
+
};
|
|
20
32
|
/** Every set the measure can give, by component (the last segment of a story's title: "Figma variants/Radio" is Radio). */
|
|
21
33
|
export declare function specsFromMeasure(file: MeasuredSpecsFile | FixedMeasuredSpecsFile, opts?: {
|
|
22
34
|
known?: ((path: string) => boolean) | undefined;
|
package/dist/node/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { execFile, execFileSync } from "node:child_process";
|
|
|
2
2
|
import { mkdtemp, rm, mkdir, writeFile, lstat, readFile } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join, resolve, relative, dirname, sep, posix } from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { K as selectTokenFiles,
|
|
5
|
+
import { bz as assertSafeBranch, c as collectHistory, p as packageDirCandidates, a as parseChangelog, m as mergeReleases, r as releasesFromTags, b as buildReport, dx as prNumberFromSubject, dW as specHash, et as validateComponentSpec, X as hashSpec, cA as iconComponentName, T as variantKeyOf, en as tokenCssVar, aN as COMPONENT_SPECS_VERSION, Z as COLOR_FIELDS, e2 as suggestionAppliedComment, a9 as gitBlobSha, dv as planSuggestionApply, ax as normalizeRepoPath, dT as sharedTokenPrefix, eq as tokenVariablePath, eD as withSrgbColors, dZ as storybookIframeUrl, db as parseBoxShadow } from "../repo-source-CcWmqNBZ.js";
|
|
6
|
+
import { b3, S, cg, cY, W, df, V } from "../repo-source-CcWmqNBZ.js";
|
|
7
|
+
import { K as selectTokenFiles, al as globToRegExp, N as loadConfig, L as LayeredTokenSet, V as CONFIG_FILE, ag as layoutOptions, ah as buildTokenSet, bd as defaultContext, B as resolve$1, aj as slugify, c7 as protectedBranchesOf, ae as baseBranchOf } from "../prod-branch-JL5tmL6u.js";
|
|
8
8
|
import { statSync, readFileSync, existsSync, writeFileSync, readdirSync } from "node:fs";
|
|
9
|
-
import { i as isAuditable,
|
|
9
|
+
import { i as isAuditable, R as planCssFixes, P as parseAllowlist, e as DesignSystemIndex, m as buildAuditReport, p as compareWithBaseline, c as AUDIT_IGNORE_DIRS } from "../report-CxOwwG_w.js";
|
|
10
10
|
import ts from "typescript";
|
|
11
11
|
function git(root, args, opts = {}) {
|
|
12
12
|
return new Promise((resolve2, reject) => {
|
|
@@ -5441,7 +5441,7 @@ export {
|
|
|
5441
5441
|
INHERITED,
|
|
5442
5442
|
MEASURE_SCRIPT,
|
|
5443
5443
|
MEDIA_SLOT,
|
|
5444
|
-
|
|
5444
|
+
b3 as MeasuredSpecsError,
|
|
5445
5445
|
OPEN_SCRIPT,
|
|
5446
5446
|
PROPS_SCRIPT,
|
|
5447
5447
|
SPEC_VIEWPORT_WIDTH,
|
|
@@ -5454,14 +5454,14 @@ export {
|
|
|
5454
5454
|
collectAuditFiles,
|
|
5455
5455
|
commitToNewLocalBranch,
|
|
5456
5456
|
commitTree,
|
|
5457
|
-
|
|
5457
|
+
S as compareSpecToMeasured,
|
|
5458
5458
|
computeValues,
|
|
5459
5459
|
currentBranch,
|
|
5460
5460
|
declaredFor,
|
|
5461
5461
|
draftedCodeHash,
|
|
5462
5462
|
draftedSpec,
|
|
5463
5463
|
entryFor,
|
|
5464
|
-
|
|
5464
|
+
cg as evalCalc,
|
|
5465
5465
|
expandDecl,
|
|
5466
5466
|
fileDiff,
|
|
5467
5467
|
findDesignSystemRoot,
|
|
@@ -5488,7 +5488,7 @@ export {
|
|
|
5488
5488
|
localRepoRef,
|
|
5489
5489
|
localTags,
|
|
5490
5490
|
markMeasuredRoot,
|
|
5491
|
-
|
|
5491
|
+
cY as markUsedTokens,
|
|
5492
5492
|
matchComplex,
|
|
5493
5493
|
measureRendered,
|
|
5494
5494
|
measureStory,
|
|
@@ -5500,9 +5500,9 @@ export {
|
|
|
5500
5500
|
openingTransitions,
|
|
5501
5501
|
originRepo,
|
|
5502
5502
|
overridesDirOf,
|
|
5503
|
-
|
|
5503
|
+
W as pairParts,
|
|
5504
5504
|
parseCssModule,
|
|
5505
|
-
|
|
5505
|
+
df as parseMeasuredSpecsFile,
|
|
5506
5506
|
parseSelector,
|
|
5507
5507
|
parseTransitions,
|
|
5508
5508
|
pickStoriesToMeasure,
|
|
@@ -5523,6 +5523,6 @@ export {
|
|
|
5523
5523
|
tokenCssIndex,
|
|
5524
5524
|
tokenVariablePath,
|
|
5525
5525
|
transitionBetween,
|
|
5526
|
-
|
|
5526
|
+
V as withoutAddedWrappers
|
|
5527
5527
|
};
|
|
5528
5528
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BridgeConfig } from './config';
|
|
2
2
|
import type { GitHubClient } from './github-client';
|
|
3
|
+
import type { ProductConfig } from './products';
|
|
3
4
|
import { type BranchPreview, type PreviewApps } from './previews';
|
|
4
5
|
export interface BranchPreviewOptions {
|
|
5
6
|
/** Branch and head commit when the caller knows them (skips reading the pull request). */
|
|
@@ -20,3 +21,15 @@ export declare function branchPreviewUrls(gh: GitHubClient, ref: number | string
|
|
|
20
21
|
apps?: PreviewApps | undefined;
|
|
21
22
|
} | undefined;
|
|
22
23
|
} | undefined, opts?: BranchPreviewOptions): Promise<BranchPreview[]>;
|
|
24
|
+
/**
|
|
25
|
+
* The preview of a branch of a product that has its own repository (products[].repo): the URL Vercel reports in that
|
|
26
|
+
* repository (deployments, commit statuses, its pull request comment), the product's `preview` template only when
|
|
27
|
+
* Vercel cannot have shortened it. Vercel shortens a branch alias over 63 characters with a hash nobody can predict
|
|
28
|
+
* (`bridge-demo-shop-git-explore-wishlis-f9937d-...`), so most exploration branches need the reported URL. Null when
|
|
29
|
+
* the product has no preview. `gh` reads the product repository; a failed read leaves that source out.
|
|
30
|
+
*/
|
|
31
|
+
export declare function productPreviewOnGitHub(gh: GitHubClient, product: Pick<ProductConfig, 'key' | 'name' | 'preview'>, e: {
|
|
32
|
+
number: number;
|
|
33
|
+
branch: string;
|
|
34
|
+
sha?: string | undefined;
|
|
35
|
+
}): Promise<BranchPreview | null>;
|
package/dist/previews.d.ts
CHANGED
|
@@ -114,6 +114,11 @@ export interface BranchPreview {
|
|
|
114
114
|
url: string | null;
|
|
115
115
|
state: PreviewState;
|
|
116
116
|
source: PreviewUrlSource | null;
|
|
117
|
+
/**
|
|
118
|
+
* Vercel skipped the latest build (its Ignored Build Step: nothing the app is built from changed on the branch), so
|
|
119
|
+
* the branch has no build of its own and its link opens a canceled deployment. Set only when true.
|
|
120
|
+
*/
|
|
121
|
+
skipped?: true;
|
|
117
122
|
}
|
|
118
123
|
/** A GitHub deployment with its latest status, as `GitHubClient.listDeployments` returns it. */
|
|
119
124
|
export interface DeploymentLike {
|
|
@@ -126,6 +131,8 @@ export interface CommitStatusLike {
|
|
|
126
131
|
context: string;
|
|
127
132
|
state: string;
|
|
128
133
|
target_url?: string | null | undefined;
|
|
134
|
+
/** "Canceled by Ignored Build Step" when Vercel skipped the build. */
|
|
135
|
+
description?: string | null | undefined;
|
|
129
136
|
}
|
|
130
137
|
/** One project of the Vercel bot comment. */
|
|
131
138
|
export interface VercelCommentProject {
|
|
@@ -171,7 +178,7 @@ export interface BranchPreviewSources {
|
|
|
171
178
|
* The state comes from the freshest signal: commit status, then deployment, then the comment.
|
|
172
179
|
*/
|
|
173
180
|
export declare function resolveBranchPreviews(apps: PreviewApps, ctx: PreviewContext, sources?: BranchPreviewSources): BranchPreview[];
|
|
174
|
-
/** The previews that have a URL, as links (`{ app, label, url }`), in the stable app order. */
|
|
181
|
+
/** The previews that have a URL, as links (`{ app, label, url }`), in the stable app order. A skipped build has none. */
|
|
175
182
|
export declare const previewLinksOf: (previews: BranchPreview[]) => {
|
|
176
183
|
app: keyof PreviewApps;
|
|
177
184
|
label: string;
|