@bridge-ds/core 0.13.0 → 0.15.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 +25 -1
- package/bridge.config.schema.json +17 -0
- package/dist/audit/index.js +3 -3
- package/dist/component-scan.d.ts +158 -0
- package/dist/config.d.ts +17 -0
- package/dist/contrast-model.d.ts +43 -0
- package/dist/github-client.d.ts +166 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1377 -339
- package/dist/index.js.map +1 -1
- package/dist/node/fs-source.d.ts +5 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +53 -4
- package/dist/node/index.js.map +1 -1
- package/dist/{prod-branch-6ftQWwdu.js → prod-branch-BjXFIz74.js} +129 -117
- package/dist/prod-branch-BjXFIz74.js.map +1 -0
- package/dist/repo-access.d.ts +66 -0
- package/dist/repo-model.d.ts +142 -0
- package/dist/{suggestion-apply-bH6-gZrE.js → repo-source-CNZLq_xK.js} +478 -204
- package/dist/repo-source-CNZLq_xK.js.map +1 -0
- package/dist/repo-source-github.d.ts +43 -0
- package/dist/repo-source.d.ts +38 -0
- package/dist/{report-BeWNSjPk.js → report-DCPfvvoq.js} +2 -2
- package/dist/{report-BeWNSjPk.js.map → report-DCPfvvoq.js.map} +1 -1
- package/dist/snapshot.d.ts +132 -0
- package/dist/token-rows.d.ts +122 -0
- package/dist/try-in-product.d.ts +4 -1
- package/package.json +1 -1
- package/dist/prod-branch-6ftQWwdu.js.map +0 -1
- package/dist/suggestion-apply-bH6-gZrE.js.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RepoSource, type RepoSourceRef } from '../repo-source';
|
|
2
|
+
/** owner, repo and sha of a checkout: the github.com origin remote and HEAD, when git knows them. */
|
|
3
|
+
export declare function localRepoRef(root: string): RepoSourceRef;
|
|
4
|
+
/** A RepoSource over the files of `root` as they are on disk (uncommitted changes included). */
|
|
5
|
+
export declare function fsSource(root: string, ref?: Partial<RepoSourceRef>): RepoSource;
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
1
|
+
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 { K as selectTokenFiles, bl as globToRegExp, N as loadConfig, L as LayeredTokenSet, V as CONFIG_FILE, $ as layoutOptions, a0 as buildTokenSet,
|
|
5
|
+
import { aZ as assertSafeBranch, c as collectHistory, p as packageDirCandidates, a as parseChangelog, m as mergeReleases, r as releasesFromTags, b as buildReport, cA as prNumberFromSubject, cX as specHash, dk as validateComponentSpec, bT as hashSpec, bU as iconComponentName, C as variantKeyOf, df as tokenCssVar, ao as COMPONENT_SPECS_VERSION, an as COLOR_FIELDS, c_ as suggestionAppliedComment, X as gitBlobSha, cy as planSuggestionApply, ak as normalizeRepoPath } from "../repo-source-CNZLq_xK.js";
|
|
6
|
+
import { K as selectTokenFiles, bl as globToRegExp, N as loadConfig, L as LayeredTokenSet, V as CONFIG_FILE, $ as layoutOptions, a0 as buildTokenSet, b4 as defaultContext, B as resolve$1, ae as slugify, bY as protectedBranchesOf, aN as baseBranchOf } from "../prod-branch-BjXFIz74.js";
|
|
7
7
|
import { statSync, readFileSync, existsSync, writeFileSync, readdirSync } from "node:fs";
|
|
8
|
-
import { i as isAuditable, Q as planCssFixes, O as parseAllowlist, d as DesignSystemIndex, l as buildAuditReport, o as compareWithBaseline, b as AUDIT_IGNORE_DIRS } from "../report-
|
|
8
|
+
import { i as isAuditable, Q as planCssFixes, O as parseAllowlist, d as DesignSystemIndex, l as buildAuditReport, o as compareWithBaseline, b as AUDIT_IGNORE_DIRS } from "../report-DCPfvvoq.js";
|
|
9
9
|
import ts from "typescript";
|
|
10
10
|
function git(root, args, opts = {}) {
|
|
11
11
|
return new Promise((resolve2, reject) => {
|
|
@@ -3797,6 +3797,53 @@ async function applySuggestionLocally(input) {
|
|
|
3797
3797
|
appliedComment: suggestionAppliedComment(plan, { by: input.by, branch, commit: res.sha, at })
|
|
3798
3798
|
});
|
|
3799
3799
|
}
|
|
3800
|
+
const SKIP = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
3801
|
+
function gitOut(root, args) {
|
|
3802
|
+
try {
|
|
3803
|
+
return execFileSync("git", args, { cwd: root, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
3804
|
+
} catch {
|
|
3805
|
+
return "";
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
function localRepoRef(root) {
|
|
3809
|
+
const origin = /github\.com[:/]([\w.-]+)\/([\w.-]+?)(\.git)?$/.exec(gitOut(root, ["remote", "get-url", "origin"]));
|
|
3810
|
+
return { owner: origin?.[1] ?? "", repo: origin?.[2] ?? "", sha: gitOut(root, ["rev-parse", "HEAD"]) || "working-tree" };
|
|
3811
|
+
}
|
|
3812
|
+
function fsSource(root, ref = {}) {
|
|
3813
|
+
let resolved;
|
|
3814
|
+
const walk2 = (rel, out) => {
|
|
3815
|
+
for (const entry of readdirSync(join(root, rel), { withFileTypes: true })) {
|
|
3816
|
+
if (SKIP.has(entry.name)) continue;
|
|
3817
|
+
const path = rel ? `${rel}/${entry.name}` : entry.name;
|
|
3818
|
+
if (entry.isDirectory()) walk2(path, out);
|
|
3819
|
+
else if (entry.isFile()) out.push(path);
|
|
3820
|
+
else if (entry.isSymbolicLink() && statSync(join(root, path), { throwIfNoEntry: false })?.isFile()) out.push(path);
|
|
3821
|
+
}
|
|
3822
|
+
};
|
|
3823
|
+
return {
|
|
3824
|
+
get ref() {
|
|
3825
|
+
resolved ??= { ...localRepoRef(root), ...Object.fromEntries(Object.entries(ref).filter(([, v]) => v !== void 0)) };
|
|
3826
|
+
return resolved;
|
|
3827
|
+
},
|
|
3828
|
+
async list(prefix = "") {
|
|
3829
|
+
const rel = normalizeRepoPath(prefix);
|
|
3830
|
+
const abs = join(root, rel);
|
|
3831
|
+
if (!existsSync(abs)) return [];
|
|
3832
|
+
if (!statSync(abs).isDirectory()) return [rel];
|
|
3833
|
+
const out = [];
|
|
3834
|
+
walk2(rel, out);
|
|
3835
|
+
return out.sort();
|
|
3836
|
+
},
|
|
3837
|
+
async text(path) {
|
|
3838
|
+
const abs = join(root, normalizeRepoPath(path));
|
|
3839
|
+
try {
|
|
3840
|
+
return statSync(abs).isFile() ? readFileSync(abs, "utf8") : null;
|
|
3841
|
+
} catch {
|
|
3842
|
+
return null;
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
};
|
|
3846
|
+
}
|
|
3800
3847
|
export {
|
|
3801
3848
|
COMMON_ICONS,
|
|
3802
3849
|
DEFAULT_STATE,
|
|
@@ -3820,6 +3867,7 @@ export {
|
|
|
3820
3867
|
fileDiff,
|
|
3821
3868
|
findDesignSystemRoot,
|
|
3822
3869
|
fixCss,
|
|
3870
|
+
fsSource,
|
|
3823
3871
|
generateAllComponentSpecs,
|
|
3824
3872
|
generateComponentSpec,
|
|
3825
3873
|
generateComponentSpecs,
|
|
@@ -3835,6 +3883,7 @@ export {
|
|
|
3835
3883
|
loadDesignSystem,
|
|
3836
3884
|
loadLocalHistory,
|
|
3837
3885
|
localGitHistoryBackend,
|
|
3886
|
+
localRepoRef,
|
|
3838
3887
|
localTags,
|
|
3839
3888
|
matchComplex,
|
|
3840
3889
|
mediaApplies,
|