socket 1.1.112 → 1.1.114
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/CHANGELOG.md +11 -1
- package/dist/cli.js +2076 -1434
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +6 -8
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/manifest/bazel/bazel-cquery.d.mts +70 -0
- package/dist/types/commands/manifest/bazel/bazel-cquery.d.mts.map +1 -0
- package/dist/types/commands/manifest/bazel/bazel-pypi-discovery.d.mts +14 -1
- package/dist/types/commands/manifest/bazel/bazel-pypi-discovery.d.mts.map +1 -1
- package/dist/types/commands/manifest/bazel/bazel-query-runner.d.mts +58 -14
- package/dist/types/commands/manifest/bazel/bazel-query-runner.d.mts.map +1 -1
- package/dist/types/commands/manifest/bazel/bazel-repo-discovery.d.mts +43 -30
- package/dist/types/commands/manifest/bazel/bazel-repo-discovery.d.mts.map +1 -1
- package/dist/types/commands/manifest/bazel/bazel-workspace-walk.d.mts +18 -0
- package/dist/types/commands/manifest/bazel/bazel-workspace-walk.d.mts.map +1 -0
- package/dist/types/commands/manifest/bazel/cmd-manifest-bazel.d.mts +12 -10
- package/dist/types/commands/manifest/bazel/cmd-manifest-bazel.d.mts.map +1 -1
- package/dist/types/commands/manifest/bazel/extract_bazel_to_maven.d.mts +70 -8
- package/dist/types/commands/manifest/bazel/extract_bazel_to_maven.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -1
- package/dist/types/commands/manifest/coana-manifest-facts.d.mts +27 -0
- package/dist/types/commands/manifest/coana-manifest-facts.d.mts.map +1 -0
- package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts +8 -2
- package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts +10 -2
- package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts.map +1 -1
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -1
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts +6 -4
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-reach.d.mts +2 -1
- package/dist/types/commands/scan/output-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/constants.d.mts +2 -4
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts +1 -0
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/socket-json.d.mts +4 -2
- package/dist/types/utils/socket-json.d.mts.map +1 -1
- package/dist/utils.js +2 -1
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
- package/requirements.json +1 -1
- package/dist/socket-facts.init.gradle +0 -429
- package/dist/socket-facts.plugin.scala +0 -416
- package/dist/types/commands/manifest/bazel/bazel-build-parser.d.mts +0 -34
- package/dist/types/commands/manifest/bazel/bazel-build-parser.d.mts.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { BazelQueryOptions } from './bazel-query-runner.mts';
|
|
2
|
+
// One Maven artifact recovered from the cquery stream. `ruleKind` is whatever
|
|
3
|
+
// `ruleClass` jsonproto reports (`jvm_import`, `aar_import`, `java_library`,
|
|
4
|
+
// `kt_jvm_import`, any future rules_jvm_external rule), so the type is open.
|
|
5
|
+
// `deps` holds resolved versionless Maven coordinates (the parser resolves the
|
|
6
|
+
// rule's label edges against this repo's own targets), not raw Bazel labels.
|
|
7
|
+
export type ExtractedArtifact = {
|
|
8
|
+
deps: string[];
|
|
9
|
+
mavenCoordinates: string;
|
|
10
|
+
ruleKind: string;
|
|
11
|
+
ruleName: string;
|
|
12
|
+
sourceRepo?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type CqueryStatus = 'ok' | 'partial' | 'timeout' | 'empty' | 'error';
|
|
15
|
+
export type CqueryRepoResult = {
|
|
16
|
+
repoName: string;
|
|
17
|
+
workspaceRelPath: string;
|
|
18
|
+
status: CqueryStatus;
|
|
19
|
+
artifacts: ExtractedArtifact[];
|
|
20
|
+
// Hub-prefixed dep labels the parser could not resolve to a coordinate
|
|
21
|
+
// (missing target or ambiguous suffix). A non-empty list means the graph
|
|
22
|
+
// is known-incomplete; the orchestrator flips the hub partial.
|
|
23
|
+
unresolvedLabels: string[];
|
|
24
|
+
stderr: string;
|
|
25
|
+
durationMs: number;
|
|
26
|
+
};
|
|
27
|
+
export type RunMetadataCqueryArgs = {
|
|
28
|
+
repoName: string;
|
|
29
|
+
workspaceRoot: string;
|
|
30
|
+
// Provenance label (e.g. "examples/dagger"). Empty string for the root
|
|
31
|
+
// workspace. Embedded in each artifact's `sourceRepo` as
|
|
32
|
+
// `workspace:<path>+repo:<name>`.
|
|
33
|
+
workspaceRelPath: string;
|
|
34
|
+
// Per-repo timeout in milliseconds. 60s default for auto-manifest;
|
|
35
|
+
// 120s for explicit invocation. Orchestrator picks; runner just enforces.
|
|
36
|
+
timeoutMs: number;
|
|
37
|
+
opts: BazelQueryOptions;
|
|
38
|
+
};
|
|
39
|
+
// Result of parsing one repo's cquery stream: the recovered artifacts (with
|
|
40
|
+
// resolved coordinate edges in `deps`) plus any hub-prefixed dep labels that
|
|
41
|
+
// could not be resolved.
|
|
42
|
+
export type ParseCqueryResult = {
|
|
43
|
+
artifacts: ExtractedArtifact[];
|
|
44
|
+
unresolvedLabels: string[];
|
|
45
|
+
};
|
|
46
|
+
// Build the full cquery argv for a per-repo metadata cquery. Exposed for
|
|
47
|
+
// argv-shape unit tests without touching `spawn`.
|
|
48
|
+
export declare function buildMetadataCqueryArgv(repoName: string, opts: BazelQueryOptions): string[];
|
|
49
|
+
// Strip the trailing version segment from a Maven coordinate, preserving any
|
|
50
|
+
// packaging/classifier segments. `g:a:v` -> `g:a`,
|
|
51
|
+
// `g:a:packaging:v` -> `g:a:packaging`,
|
|
52
|
+
// `g:a:packaging:classifier:v` -> `g:a:packaging:classifier`. Coordinates with
|
|
53
|
+
// fewer than 3 segments have no version to strip and are returned unchanged.
|
|
54
|
+
// This matches depscan's `coordinateToParts` keying (position 3 = extension,
|
|
55
|
+
// position 4 = classifier on the versionless key), so AAR/classifier artifacts
|
|
56
|
+
// key correctly instead of being mis-keyed as bare `group:artifact` jars.
|
|
57
|
+
export declare function versionlessCoordinate(coord: string): string;
|
|
58
|
+
// Pure parser for the jsonproto cquery stream. Returns one
|
|
59
|
+
// `ExtractedArtifact` per rule with a recoverable maven coordinate (its `deps`
|
|
60
|
+
// holding resolved versionless coordinates) plus the set of hub-prefixed dep
|
|
61
|
+
// labels that could not be resolved. The `sourceRepo` field carries
|
|
62
|
+
// `<workspaceRelPath>:<repoName>` provenance when a workspace path was
|
|
63
|
+
// provided; otherwise just the repo name.
|
|
64
|
+
export declare function parseCqueryJsonproto(stdout: string, repoName: string, workspaceRelPath: string): ParseCqueryResult;
|
|
65
|
+
// Spawn the per-repo metadata cquery, parse the result, and return a
|
|
66
|
+
// structured outcome. On spawn timeout, return `status: 'timeout'` so the
|
|
67
|
+
// orchestrator can reap the server (`bazel --output_user_root=<dir>
|
|
68
|
+
// shutdown` + `rm -rf`) before moving on.
|
|
69
|
+
export declare function runMetadataCqueryForRepo(args: RunMetadataCqueryArgs): Promise<CqueryRepoResult>;
|
|
70
|
+
//# sourceMappingURL=bazel-cquery.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bazel-cquery.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-cquery.mts"],"names":[],"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yEAAyE;AACzE,kDAAkD;AAClD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,iBAAiB,GACtB,MAAM,EAAE,CAwBV;AAyED,6EAA6E;AAC7E,mDAAmD;AACnD,wCAAwC;AACxC,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM3D;AAiKD,2DAA2D;AAC3D,+EAA+E;AAC/E,6EAA6E;AAC7E,oEAAoE;AACpE,uEAAuE;AACvE,0CAA0C;AAC1C,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,iBAAiB,CAmFnB;AAyBD,qEAAqE;AACrE,0EAA0E;AAC1E,oEAAoE;AACpE,0CAA0C;AAC1C,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAuE3B"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type { RepoProbe
|
|
1
|
+
import type { RepoProbe } from './bazel-repo-discovery.mts';
|
|
2
|
+
// Result shape returned by `validatePypiHub`. Kept local to the PyPI module
|
|
3
|
+
// since validation here is hub-alias-marker based (different from the
|
|
4
|
+
// Maven-side tri-state classifier).
|
|
5
|
+
export type ValidationResult = {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
// Probe stdout — populated whenever the probe was reachable, even when
|
|
8
|
+
// validation rejects the hub. Empty string when the probe itself threw.
|
|
9
|
+
stdout: string;
|
|
10
|
+
};
|
|
11
|
+
// Parse `bazel mod dump_repo_mapping "" --output=json` output. Also accepts
|
|
12
|
+
// the older streamed jsonproto shape (apparentName / apparent_name records).
|
|
13
|
+
// PyPI-only; the Maven path consumes `bazel mod show_extension` instead.
|
|
14
|
+
export declare function parseVisibleRepoCandidates(output: string): string[];
|
|
2
15
|
export type PypiHubInfo = {
|
|
3
16
|
hubName: string;
|
|
4
17
|
source: 'MODULE.bazel' | 'WORKSPACE' | 'WORKSPACE.bazel' | '.bzl' | 'visible-repos' | 'default-seed' | 'bazel-mod-show-extension';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bazel-pypi-discovery.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-pypi-discovery.mts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bazel-pypi-discovery.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-pypi-discovery.mts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,4EAA4E;AAC5E,sEAAsE;AACtE,oCAAoC;AACpC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,yEAAuE;IACvE,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AA6CD,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BnE;AAwCD,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EACF,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,MAAM,GACN,eAAe,GACf,cAAc,GACd,0BAA0B,CAAA;IAC9B,aAAa,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC9C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1C,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,WAAW,EACX,aAAa,GAAG,kBAAkB,CACnC,CAAA;AAED,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,gBAAgB,EAAE,CAoCpB;AA8GD,4EAA4E;AAC5E,iCAAiC;AACjC,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,iEAAiE;AACjE,yEAAyE;AACzE,0EAA0E;AAC1E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,OAAO,GAChB,gBAAgB,EAAE,CAoGpB;AAED,mEAAmE;AACnE,kEAAkE;AAClE,mDAAmD;AACnD,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,gBAAgB,CAAC,CA8B3B;AAOD,4EAA4E;AAC5E,6DAA6D;AAC7D,uDAAuD;AACvD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,EAChB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE,OAAO,EACjB,sBAAsB,CAAC,EAAE,gBAAgB,EAAE,GAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAyDnC"}
|
|
@@ -6,6 +6,13 @@ export type BazelQueryOptions = {
|
|
|
6
6
|
bazelRc?: string;
|
|
7
7
|
bazelFlags?: string;
|
|
8
8
|
bazelOutputBase?: string;
|
|
9
|
+
// Per-invocation `--output_user_root` for server isolation. When set, all
|
|
10
|
+
// argv builders inject it as a startup flag so a timed-out Bazel server
|
|
11
|
+
// can be reaped via `bazel --output_user_root=<this> shutdown` + `rm -rf`
|
|
12
|
+
// without disturbing the user's shared output_user_root. The Maven
|
|
13
|
+
// orchestrator mkdtemp's a fresh path per invocation; the legacy PyPI
|
|
14
|
+
// path may leave it unset for now.
|
|
15
|
+
outputUserRoot?: string;
|
|
9
16
|
env?: NodeJS.ProcessEnv;
|
|
10
17
|
verbose?: boolean;
|
|
11
18
|
};
|
|
@@ -19,6 +26,21 @@ export type BazelQueryResult = {
|
|
|
19
26
|
// whitespace are not supported (documented limitation; same trust model as
|
|
20
27
|
// gradleOpts).
|
|
21
28
|
export declare function splitBazelFlags(flags: string | undefined): string[];
|
|
29
|
+
// Build the shared startup-flag prefix for any bazel invocation. Centralised
|
|
30
|
+
// so `--output_user_root` propagates to every spawn — principle 7 of the
|
|
31
|
+
// Maven design requires per-invocation server isolation across query,
|
|
32
|
+
// cquery, and `bazel mod` commands alike.
|
|
33
|
+
declare function buildStartupFlags(opts: BazelQueryOptions): string[];
|
|
34
|
+
declare function buildBazelModShowVisibleReposArgv(opts: BazelQueryOptions): string[];
|
|
35
|
+
declare function buildBazelModShowMavenExtensionArgv(opts: BazelQueryOptions): string[];
|
|
36
|
+
declare function buildBazelModShowPipExtensionArgv(opts: BazelQueryOptions): string[];
|
|
37
|
+
declare function buildBazelArgv(queryStr: string, opts: BazelQueryOptions, output?: string): string[];
|
|
38
|
+
// Lightweight presence-check cquery used by the tri-state probe classifier.
|
|
39
|
+
// `--keep_going --output=label` keeps it fast even on partial-analysis
|
|
40
|
+
// repos and avoids paying for `--output=jsonproto` plus
|
|
41
|
+
// `--proto:output_rule_attrs` (which the heavier metadata extraction in
|
|
42
|
+
// `bazel-cquery.mts` needs but the probe does not).
|
|
43
|
+
declare function buildBazelProbeCqueryArgv(repoName: string, opts: BazelQueryOptions): string[];
|
|
22
44
|
/**
|
|
23
45
|
* Run `bazel query` with the standardized argv shape and capture
|
|
24
46
|
* stdout/stderr/code. Wraps the call in a spinner that resolves on success
|
|
@@ -27,29 +49,51 @@ export declare function splitBazelFlags(flags: string | undefined): string[];
|
|
|
27
49
|
*/
|
|
28
50
|
export declare function runBazelQuery(queryStr: string, opts: BazelQueryOptions, output?: string): Promise<BazelQueryResult>;
|
|
29
51
|
/**
|
|
30
|
-
* Bzlmod-native visible repository enumeration.
|
|
31
|
-
*
|
|
32
|
-
*
|
|
52
|
+
* Bzlmod-native visible repository enumeration. NOTE: only consumed by the
|
|
53
|
+
* legacy PyPI path; the Maven path uses `runBazelModShowMavenExtension`
|
|
54
|
+
* instead because `dump_repo_mapping` over-enumerates apparent names that
|
|
55
|
+
* are not Maven hubs.
|
|
33
56
|
*/
|
|
34
57
|
export declare function runBazelModShowVisibleRepos(opts: BazelQueryOptions): Promise<BazelQueryResult>;
|
|
35
58
|
/**
|
|
36
|
-
* Bzlmod-native
|
|
37
|
-
*
|
|
38
|
-
*
|
|
59
|
+
* Bzlmod-native Maven hub enumeration via the rules_jvm_external maven
|
|
60
|
+
* extension. The text-format report lists every repo the extension
|
|
61
|
+
* generated; `parseShowExtensionOutput` (bazel-repo-discovery.mts)
|
|
62
|
+
* extracts the hubs from the `Fetched repositories:` section.
|
|
63
|
+
*/
|
|
64
|
+
export declare function runBazelModShowMavenExtension(opts: BazelQueryOptions): Promise<BazelQueryResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Bzlmod-native rules_python pip extension usage inspection. Used by the
|
|
67
|
+
* PyPI path; kept here since the argv shape is identical to the maven
|
|
68
|
+
* variant modulo the extension target.
|
|
39
69
|
*/
|
|
40
70
|
export declare function runBazelModShowPipExtension(opts: BazelQueryOptions): Promise<BazelQueryResult>;
|
|
41
71
|
/**
|
|
42
|
-
* Build a `RepoProbe` (compatible with bazel-repo-discovery
|
|
43
|
-
*
|
|
44
|
-
*
|
|
72
|
+
* Build a `RepoProbe` (compatible with bazel-repo-discovery's tri-state
|
|
73
|
+
* classifier) bound to opts. Runs the lightweight presence-check cquery
|
|
74
|
+
* `@<name>//... --output=label --keep_going` — cheap enough to attempt
|
|
75
|
+
* every conventional Maven hub name without triggering `repository_rule`
|
|
76
|
+
* fetches on undefined names (Exp 3).
|
|
45
77
|
*/
|
|
46
|
-
export declare function
|
|
78
|
+
export declare function buildMavenProbeFor(opts: BazelQueryOptions): RepoProbe;
|
|
47
79
|
/**
|
|
48
80
|
* Build a `RepoProbe` for validating pip hub candidates.
|
|
49
|
-
* Queries the hub for package targets (e.g. `@<hub>//...`) and returns
|
|
50
|
-
*
|
|
51
|
-
* Does NOT require `pypi_name=` tags in the hub output, because
|
|
52
|
-
* tags live on spoke repos, not the hub alias layer.
|
|
81
|
+
* Queries the hub for package targets (e.g. `@<hub>//...`) and returns the
|
|
82
|
+
* full result triple so the caller can check for `:pkg` labels or alias
|
|
83
|
+
* rules. Does NOT require `pypi_name=` tags in the hub output, because
|
|
84
|
+
* those tags live on spoke repos, not the hub alias layer.
|
|
53
85
|
*/
|
|
54
86
|
export declare function buildPypiProbeFor(opts: BazelQueryOptions): RepoProbe;
|
|
87
|
+
// Re-exported for direct test access — useful when asserting on argv shape
|
|
88
|
+
// without spawning. Returns the exact argv `runBazelModShowMavenExtension`
|
|
89
|
+
// would pass to spawn.
|
|
90
|
+
export declare const _internalArgvBuilders: {
|
|
91
|
+
buildBazelArgv: typeof buildBazelArgv;
|
|
92
|
+
buildBazelModShowMavenExtensionArgv: typeof buildBazelModShowMavenExtensionArgv;
|
|
93
|
+
buildBazelModShowPipExtensionArgv: typeof buildBazelModShowPipExtensionArgv;
|
|
94
|
+
buildBazelModShowVisibleReposArgv: typeof buildBazelModShowVisibleReposArgv;
|
|
95
|
+
buildBazelProbeCqueryArgv: typeof buildBazelProbeCqueryArgv;
|
|
96
|
+
buildStartupFlags: typeof buildStartupFlags;
|
|
97
|
+
};
|
|
98
|
+
export {};
|
|
55
99
|
//# sourceMappingURL=bazel-query-runner.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bazel-query-runner.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-query-runner.mts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAQD,+DAA+D;AAC/D,+EAA6E;AAC7E,2EAA2E;AAC3E,eAAe;AACf,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAKnE;
|
|
1
|
+
{"version":3,"file":"bazel-query-runner.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-query-runner.mts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0EAA0E;IAC1E,wEAAwE;IACxE,0EAA0E;IAC1E,mEAAmE;IACnE,sEAAsE;IACtE,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;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H,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAUrE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,CAMpE;AAED,6EAA2E;AAC3E,2EAA2E;AAC3E,uBAAuB;AACvB,eAAO,MAAM,qBAAqB;;;;;;;CAOjC,CAAA"}
|
|
@@ -1,34 +1,47 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
// The importer token Bazel prints for a hub generated for the root module
|
|
2
|
+
// itself (`(imported by <root>, …)`). Hubs imported only by rulesets
|
|
3
|
+
// (`rules_jvm_external@6.7`, `stardoc@0.7.2`, …) are build-tooling, not the
|
|
4
|
+
// user's SBOM, and are filtered out by the orchestrator.
|
|
5
|
+
export declare const ROOT_MODULE_IMPORTER = "<root>";
|
|
6
|
+
// One hub repo from a `bazel mod show_extension` report: its name plus the
|
|
7
|
+
// modules that imported it (the `(imported by …)` annotation), merged across
|
|
8
|
+
// every line the repo appears on.
|
|
9
|
+
export type ShowExtensionRepo = {
|
|
10
|
+
name: string;
|
|
11
|
+
importers: string[];
|
|
12
|
+
};
|
|
13
|
+
export type ProbeResult = {
|
|
9
14
|
code: number;
|
|
10
|
-
}>;
|
|
11
|
-
export type ValidationResult = {
|
|
12
|
-
valid: boolean;
|
|
13
|
-
// Probe stdout — populated whenever the probe was reachable, even when
|
|
14
|
-
// validation rejects the repo. Empty string when the probe itself threw.
|
|
15
15
|
stdout: string;
|
|
16
|
+
stderr: string;
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// the
|
|
33
|
-
|
|
18
|
+
export type RepoProbe = (repoName: string) => Promise<ProbeResult>;
|
|
19
|
+
export type ProbeStatus = 'populated' | 'empty' | 'not-defined';
|
|
20
|
+
// Conventional Maven hub names rules_jvm_external sets up under
|
|
21
|
+
// WORKSPACE-mode invocations. Probing each one is cheap (a failed visibility
|
|
22
|
+
// lookup never triggers a `repository_rule` fetch) so the orchestrator can
|
|
23
|
+
// try them all without paying the cost of a real cquery on undefined repos.
|
|
24
|
+
export declare const CONVENTIONAL_MAVEN_REPO_NAMES: readonly string[];
|
|
25
|
+
// Pure parser for `bazel mod show_extension @rules_jvm_external//:extensions.bzl%maven`
|
|
26
|
+
// stdout. Returns the hub repos listed under `Fetched repositories:` — i.e.
|
|
27
|
+
// items annotated with `(imported by ...)` — each carrying the set of modules
|
|
28
|
+
// that imported it. Generated per-artifact repos (no annotation) are skipped.
|
|
29
|
+
// A repo can legitimately appear on multiple lines with different importers,
|
|
30
|
+
// so importers are merged per repo (name-only dedupe would lose that, and the
|
|
31
|
+
// importers data is what lets the orchestrator keep only root-imported hubs).
|
|
32
|
+
// Output is sorted by name. Tolerant of `DEBUG:` / `WARNING:` lines from
|
|
33
|
+
// Bazel; the section header `## @@<canonical>//:extensions.bzl%maven:` is the
|
|
34
|
+
// anchor.
|
|
35
|
+
export declare function parseShowExtensionOutput(stdout: string): ShowExtensionRepo[];
|
|
36
|
+
// Classify a raw probe result into one of three states. The probe contract
|
|
37
|
+
// is whatever the runner emits — typically a lightweight
|
|
38
|
+
// `cquery '@<name>//...' --keep_going --output=label`. The orchestrator
|
|
39
|
+
// treats `empty` and `not-defined` uniformly as no-ops; the distinction
|
|
40
|
+
// is preserved for verbose-mode diagnostics.
|
|
41
|
+
export declare function classifyProbeResult(result: ProbeResult): ProbeStatus;
|
|
42
|
+
// Convenience: probe a single candidate and return its classified status,
|
|
43
|
+
// with optional verbose logging. Pure orchestration around `probe` +
|
|
44
|
+
// `classifyProbeResult`; isolated so the test suite can exercise the
|
|
45
|
+
// logging contract independently of the runner implementation.
|
|
46
|
+
export declare function probeCandidate(repoName: string, probe: RepoProbe, verbose?: boolean): Promise<ProbeStatus>;
|
|
34
47
|
//# sourceMappingURL=bazel-repo-discovery.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bazel-repo-discovery.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-repo-discovery.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bazel-repo-discovery.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-repo-discovery.mts"],"names":[],"mappings":"AAgBA,0EAA0E;AAC1E,uEAAqE;AACrE,8EAA4E;AAC5E,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAE5C,2EAA2E;AAC3E,+EAA6E;AAC7E,kCAAkC;AAClC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AAElE,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,CAAA;AAE/D,gEAAgE;AAChE,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAM1D,CAAA;AA4BD,wFAAwF;AACxF,8EAA4E;AAC5E,gFAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAC9E,UAAU;AACV,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CA0C5E;AAED,2EAA2E;AAC3E,2DAAyD;AACzD,wEAAwE;AACxE,wEAAwE;AACxE,6CAA6C;AAC7C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CA0BpE;AAED,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,+DAA+D;AAC/D,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,WAAW,CAAC,CAmBtB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type FindWorkspaceRootsOptions = {
|
|
2
|
+
cwd: string;
|
|
3
|
+
// Directory basenames to skip outright (exact match). Pass the union of
|
|
4
|
+
// the codebase-wide ignore set (`IGNORED_DIRS` in `src/utils/glob.mts`)
|
|
5
|
+
// and any caller-specific additions (e.g. `.socket-auto-manifest`).
|
|
6
|
+
ignoreDirNames?: ReadonlySet<string>;
|
|
7
|
+
// Directory basename prefixes to skip. Bazel callers pass `['bazel-']` so
|
|
8
|
+
// the walk never descends into Bazel's output_base symlinks.
|
|
9
|
+
ignoreDirPrefixes?: readonly string[];
|
|
10
|
+
// Visited-directory budget override (testing); defaults to MAX_WALK_DIRS.
|
|
11
|
+
maxWalkDirs?: number;
|
|
12
|
+
verbose?: boolean;
|
|
13
|
+
};
|
|
14
|
+
// Walks the tree rooted at `opts.cwd` and returns absolute paths to every
|
|
15
|
+
// directory that contains at least one workspace marker file. Output is
|
|
16
|
+
// sorted for determinism and capped at MAX_WORKSPACE_ROOTS.
|
|
17
|
+
export declare function findWorkspaceRoots(opts: FindWorkspaceRootsOptions): string[];
|
|
18
|
+
//# sourceMappingURL=bazel-workspace-walk.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bazel-workspace-walk.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/bazel-workspace-walk.mts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,wEAAwE;IACxE,wEAAwE;IACxE,oEAAoE;IACpE,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACpC,0EAA0E;IAC1E,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAKD,0EAA0E;AAC1E,wEAAwE;AACxE,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,MAAM,EAAE,CAyF5E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExtractBazelStatus } from './extract_bazel_to_maven.mts';
|
|
1
2
|
import type { CliCommandContext } from '../../../utils/meow-with-subcommands.mts';
|
|
2
3
|
export declare const cmdManifestBazel: {
|
|
3
4
|
description: string;
|
|
@@ -6,22 +7,23 @@ export declare const cmdManifestBazel: {
|
|
|
6
7
|
};
|
|
7
8
|
export type EcosystemOutcome = {
|
|
8
9
|
ecosystem: 'maven' | 'pypi';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hardFailure?: boolean;
|
|
12
|
-
manifestPath?: string | undefined;
|
|
10
|
+
status: ExtractBazelStatus;
|
|
11
|
+
manifestPaths: string[];
|
|
13
12
|
};
|
|
14
13
|
// Pure outcome-matrix evaluator. Exported so dispatcher behavior can be
|
|
15
14
|
// unit-tested without spawning the CLI binary. Throws InputError on
|
|
16
15
|
// failures that must propagate to a non-zero CLI exit; returns void on
|
|
17
16
|
// success.
|
|
18
17
|
//
|
|
19
|
-
// -
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// -
|
|
23
|
-
//
|
|
24
|
-
// succeeded
|
|
18
|
+
// - `complete`/`partial` both count as produced output (>=1 manifest).
|
|
19
|
+
// `partial` additionally warns — a known-incomplete SBOM is still emitted,
|
|
20
|
+
// not a hard error.
|
|
21
|
+
// - `hardFailure`: the ecosystem was detected (or the runner crashed) but
|
|
22
|
+
// wrote zero manifests. Always a non-zero exit, even when another
|
|
23
|
+
// ecosystem succeeded.
|
|
24
|
+
// - `noEcosystem`: genuinely absent ecosystem. Auto-detect mode tolerates it
|
|
25
|
+
// when at least one other ecosystem produced output; explicit mode treats
|
|
26
|
+
// it as an error (the user requested an ecosystem that isn't there).
|
|
25
27
|
export declare function evaluateEcosystemOutcomes(outcomes: readonly EcosystemOutcome[], isExplicit: boolean): void;
|
|
26
28
|
declare function run(argv: string[] | readonly string[], importMeta: ImportMeta, { parentName }: CliCommandContext): Promise<void>;
|
|
27
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd-manifest-bazel.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/cmd-manifest-bazel.mts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,0CAA0C,CAAA;
|
|
1
|
+
{"version":3,"file":"cmd-manifest-bazel.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/cmd-manifest-bazel.mts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,0CAA0C,CAAA;AAkFjD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,GAAG,MAAM,CAAA;IAC3B,MAAM,EAAE,kBAAkB,CAAA;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAED,wEAAwE;AACxE,oEAAoE;AACpE,uEAAuE;AACvE,WAAW;AACX,EAAE;AACF,uEAAuE;AACvE,+EAA6E;AAC7E,sBAAsB;AACtB,0EAA0E;AAC1E,oEAAoE;AACpE,yBAAyB;AACzB,6EAA6E;AAC7E,4EAA4E;AAC5E,uEAAuE;AACvE,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,UAAU,EAAE,OAAO,GAClB,IAAI,CA8CN;AAuBD,iBAAe,GAAG,CAChB,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAClC,UAAU,EAAE,UAAU,EACtB,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAChC,OAAO,CAAC,IAAI,CAAC,CA4Kf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtractedArtifact } from './bazel-
|
|
1
|
+
import type { ExtractedArtifact } from './bazel-cquery.mts';
|
|
2
2
|
export type ExtractBazelOptions = {
|
|
3
3
|
bazelFlags: string | undefined;
|
|
4
4
|
bazelOutputBase: string | undefined;
|
|
@@ -7,28 +7,90 @@ export type ExtractBazelOptions = {
|
|
|
7
7
|
cwd: string;
|
|
8
8
|
// Optional env override used for python-shim PATH augmentation.
|
|
9
9
|
env?: NodeJS.ProcessEnv;
|
|
10
|
+
// Directory basenames the workspace walker must not descend into.
|
|
11
|
+
// Caller-supplied so the orchestrator stays generic; the CLI command
|
|
12
|
+
// composes the codebase-wide `IGNORED_DIRS` with Bazel-specific dirs
|
|
13
|
+
// like `.socket-auto-manifest`.
|
|
14
|
+
ignoreDirNames?: ReadonlySet<string> | undefined;
|
|
15
|
+
// Directory basename prefixes the workspace walker must not descend
|
|
16
|
+
// into. Caller-supplied so the orchestrator stays generic; the CLI
|
|
17
|
+
// command supplies `bazel-` for Bazel's output_base symlinks.
|
|
18
|
+
ignoreDirPrefixes?: readonly string[] | undefined;
|
|
10
19
|
out: string;
|
|
11
20
|
// Use the auto-manifest sibling directory instead of writing directly to `out`.
|
|
12
21
|
outLayout?: 'flat';
|
|
22
|
+
// Per-repo cquery timeout in milliseconds. Auto-manifest default is 60s
|
|
23
|
+
// (the orchestrator's job is to not stall the wider scan); explicit
|
|
24
|
+
// invocations may bump it.
|
|
25
|
+
perRepoTimeoutMs?: number | undefined;
|
|
13
26
|
verbose: boolean;
|
|
14
27
|
};
|
|
28
|
+
// Best-effort-per-hub produces four distinct run outcomes a single `ok`
|
|
29
|
+
// boolean would conflate:
|
|
30
|
+
// - `complete` — every discovered hub extracted cleanly; >=1 manifest.
|
|
31
|
+
// - `partial` — >=1 manifest written, but at least one hub failed,
|
|
32
|
+
// timed out, or dropped edges. Worth uploading, but the
|
|
33
|
+
// graph is known-incomplete.
|
|
34
|
+
// - `noEcosystem` — no Bazel/Maven found. Whether that's an error is
|
|
35
|
+
// caller-dependent (tolerated in auto mode, error in
|
|
36
|
+
// explicit mode), so it must NOT be flattened into the
|
|
37
|
+
// failure states.
|
|
38
|
+
// - `hardFailure` — zero manifests written and it wasn't `noEcosystem`
|
|
39
|
+
// (discovery threw, or every discovered hub failed).
|
|
40
|
+
// Always an error for every caller.
|
|
41
|
+
export type ExtractBazelStatus = 'complete' | 'hardFailure' | 'noEcosystem' | 'partial';
|
|
15
42
|
export type ExtractBazelResult = {
|
|
16
43
|
artifactCount: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ok: boolean;
|
|
44
|
+
manifestPaths: string[];
|
|
45
|
+
status: ExtractBazelStatus;
|
|
20
46
|
};
|
|
47
|
+
// Default directory-prune policy for the Bazel workspace walk. The
|
|
48
|
+
// orchestrator applies this unconditionally so neither caller (the explicit
|
|
49
|
+
// `socket manifest bazel` command nor `--auto-manifest`) can omit it and let
|
|
50
|
+
// the walk descend `node_modules`/VCS/vendored trees. Callers may
|
|
51
|
+
// pass extra names/prefixes to EXTEND, not replace, this set.
|
|
52
|
+
export declare const DEFAULT_BAZEL_WALKER_IGNORE_DIR_NAMES: ReadonlySet<string>;
|
|
53
|
+
// Bazel's `bazel-*` output_base symlinks.
|
|
54
|
+
export declare const DEFAULT_BAZEL_WALKER_IGNORE_DIR_PREFIXES: readonly string[];
|
|
21
55
|
type MavenInstallJsonCurrent = {
|
|
22
56
|
artifacts: Record<string, {
|
|
23
|
-
shasums: {
|
|
24
|
-
jar?: string;
|
|
25
|
-
};
|
|
26
57
|
version: string;
|
|
27
58
|
}>;
|
|
28
59
|
dependencies: Record<string, string[]>;
|
|
29
60
|
repositories?: Record<string, string[]>;
|
|
30
61
|
};
|
|
31
|
-
export
|
|
62
|
+
export type NormalizeResult = {
|
|
63
|
+
json: MavenInstallJsonCurrent;
|
|
64
|
+
// Versionless keys skipped because the coordinate was malformed (key shape
|
|
65
|
+
// outside 2-4 non-empty segments, or an empty version). Known data loss.
|
|
66
|
+
droppedArtifacts: string[];
|
|
67
|
+
// `source -> target` edges pruned because one endpoint wasn't an emitted
|
|
68
|
+
// artifact. Known data loss.
|
|
69
|
+
prunedEdges: string[];
|
|
70
|
+
};
|
|
71
|
+
// Builds a modern `maven_install.json` from artifacts whose `deps` already
|
|
72
|
+
// hold resolved versionless coordinates (the cquery parser resolves edge
|
|
73
|
+
// labels against each repo's own targets while `repoName` is in scope, so no
|
|
74
|
+
// label-to-coordinate resolution happens here). Keys are versionless `g:a`
|
|
75
|
+
// (preserving any packaging/classifier segments); dependency values are the
|
|
76
|
+
// resolved coordinate sets.
|
|
77
|
+
//
|
|
78
|
+
// Two-phase so the emitted graph is internally closed and survives the server
|
|
79
|
+
// parser, which rejects malformed coordinates and edges referencing unlisted
|
|
80
|
+
// artifacts (and can abort after enough errors). Phase 1 builds (and
|
|
81
|
+
// validates) the artifact keys; phase 2 emits only edges whose source AND
|
|
82
|
+
// target are valid emitted keys. Anything dropped is reported so the caller
|
|
83
|
+
// can flip the hub partial — never silently lost post-upload.
|
|
84
|
+
export declare function normalizeToMavenInstallJson(artifacts: ExtractedArtifact[]): NormalizeResult;
|
|
85
|
+
// Cross-workspace dedup keyed on the full Maven coordinate string
|
|
86
|
+
// (`g:a:v[:classifier]`). The metadata cquery emits one entry per rule,
|
|
87
|
+
// so the same `androidx.annotation:annotation:1.8.2` can show up in
|
|
88
|
+
// `examples/dagger/@maven` and `examples/ksp/@maven` in rules_kotlin —
|
|
89
|
+
// downstream only needs it once. Each occurrence resolves its edges against
|
|
90
|
+
// its own repo's targets, so the resolved `deps` can legitimately differ
|
|
91
|
+
// between occurrences; union them rather than keeping only the first, or
|
|
92
|
+
// real graph edges would be silently dropped.
|
|
93
|
+
export declare function dedupArtifactsByCoord(artifacts: ExtractedArtifact[]): ExtractedArtifact[];
|
|
32
94
|
export declare function extractBazelToMaven(opts: ExtractBazelOptions): Promise<ExtractBazelResult>;
|
|
33
95
|
export {};
|
|
34
96
|
//# sourceMappingURL=extract_bazel_to_maven.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract_bazel_to_maven.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/extract_bazel_to_maven.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract_bazel_to_maven.d.mts","sourceRoot":"","sources":["../../../../../src/commands/manifest/bazel/extract_bazel_to_maven.mts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI7E,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,GAAG,EAAE,MAAM,CA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,CAAA;KAAE,CAAC,CAAA;IAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,uBAAuB,CAAA;IAC7B,2EAA2E;IAC3E,yEAAyE;IACzE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,yEAAyE;IACzE,6BAA6B;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAcD,2EAA2E;AAC3E,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,4BAA4B;AAC5B,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,qEAAqE;AACrE,0EAA0E;AAC1E,4EAA4E;AAC5E,gEAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,iBAAiB,EAAE,GAC7B,eAAe,CAmEjB;AAED,kEAAkE;AAClE,wEAAwE;AACxE,oEAAoE;AACpE,yEAAuE;AACvE,4EAA4E;AAC5E,yEAAyE;AACzE,yEAAyE;AACzE,8CAA8C;AAC9C,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,iBAAiB,EAAE,GAC7B,iBAAiB,EAAE,CAerB;AA0MD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,kBAAkB,CAAC,CAsS7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd-manifest-gradle.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-gradle.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"cmd-manifest-gradle.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-gradle.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;AAqF9C,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAA;AAED,iBAAe,GAAG,CAChB,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAClC,UAAU,EAAE,UAAU,EACtB,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAChC,OAAO,CAAC,IAAI,CAAC,CAiMf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd-manifest-kotlin.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-kotlin.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"cmd-manifest-kotlin.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-kotlin.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;AA0F9C,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAA;AAED,iBAAe,GAAG,CAChB,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAClC,UAAU,EAAE,UAAU,EACtB,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAChC,OAAO,CAAC,IAAI,CAAC,CA+Lf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd-manifest-scala.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-scala.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"cmd-manifest-scala.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/cmd-manifest-scala.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,uCAAuC,CAAA;AA0G9C,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA;AAED,iBAAe,GAAG,CAChB,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAClC,UAAU,EAAE,UAAU,EACtB,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAChC,OAAO,CAAC,IAAI,CAAC,CAsOf"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Delegates Socket facts generation for a JVM build tool to the Coana CLI's
|
|
2
|
+
// `manifest <ecosystem>` command. The build-tool resolution scripts (the Gradle
|
|
3
|
+
// init script and the sbt plugin) live in Coana now, so socket-cli no longer
|
|
4
|
+
// runs them itself; it only asks Coana for the uploadable `.socket.facts.json`.
|
|
5
|
+
//
|
|
6
|
+
// The resolved artifact-paths sidecar is intentionally NOT requested here: it
|
|
7
|
+
// only matters for reachability analysis, which is internal to Coana, so Coana
|
|
8
|
+
// emits it itself when it runs reachability. `socket manifest` only needs the
|
|
9
|
+
// facts file.
|
|
10
|
+
//
|
|
11
|
+
// `spawnCoanaDlx` resolves the Coana CLI via dlx (or a local build when
|
|
12
|
+
// `SOCKET_CLI_COANA_LOCAL_PATH` is set). `bin` (the gradle/sbt executable) is
|
|
13
|
+
// always resolved by the caller to a concrete default (`<cwd>/gradlew`, or
|
|
14
|
+
// `sbt` on PATH) before we get here, so it is forwarded verbatim; the empty
|
|
15
|
+
// guard below is just a cheap safeguard against passing `--bin ''`.
|
|
16
|
+
export declare function runCoanaManifestFacts({ bin, buildOpts, buildOptsFlag, cwd, ecosystem, excludeConfigs, ignoreUnresolved, includeConfigs, verbose }: {
|
|
17
|
+
bin: string;
|
|
18
|
+
buildOpts: string[];
|
|
19
|
+
buildOptsFlag: '--gradle-opts' | '--sbt-opts';
|
|
20
|
+
cwd: string;
|
|
21
|
+
ecosystem: 'gradle' | 'sbt';
|
|
22
|
+
excludeConfigs: string;
|
|
23
|
+
ignoreUnresolved: boolean;
|
|
24
|
+
includeConfigs: string;
|
|
25
|
+
verbose: boolean;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=coana-manifest-facts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coana-manifest-facts.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/coana-manifest-facts.mts"],"names":[],"mappings":"AAQA,4EAA4E;AAC5E,gFAAgF;AAChF,6EAA6E;AAC7E,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,cAAc;AACd,EAAE;AACF,wEAAwE;AACxE,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,oEAAoE;AACpE,wBAAsB,qBAAqB,CAAC,EAC1C,GAAG,EACH,SAAS,EACT,aAAa,EACb,GAAG,EACH,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,OAAO,EACR,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,EAAE,eAAe,GAAG,YAAY,CAAA;IAC7C,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFhB"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
// Generates a `.socket.facts.json` for a Gradle project by delegating to the
|
|
2
|
+
// Coana CLI's `manifest gradle` command (which owns the Gradle init script that
|
|
3
|
+
// resolves the dependency graph). socket-cli no longer runs gradle itself; an
|
|
4
|
+
// explicit `bin` is forwarded as `--bin`, otherwise Coana defaults to
|
|
5
|
+
// `./gradlew`.
|
|
6
|
+
export declare function convertGradleToFacts({ bin, cwd, excludeConfigs, gradleOpts, ignoreUnresolved, includeConfigs, verbose }: {
|
|
2
7
|
bin: string;
|
|
3
|
-
configs: string;
|
|
4
8
|
cwd: string;
|
|
9
|
+
excludeConfigs: string;
|
|
5
10
|
gradleOpts: string[];
|
|
6
11
|
ignoreUnresolved: boolean;
|
|
12
|
+
includeConfigs: string;
|
|
7
13
|
verbose: boolean;
|
|
8
14
|
}): Promise<void>;
|
|
9
15
|
//# sourceMappingURL=convert-gradle-to-facts.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-gradle-to-facts.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/convert-gradle-to-facts.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-gradle-to-facts.d.mts","sourceRoot":"","sources":["../../../../src/commands/manifest/convert-gradle-to-facts.mts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,gFAAgF;AAChF,8EAA8E;AAC9E,sEAAsE;AACtE,eAAe;AACf,wBAAsB,oBAAoB,CAAC,EACzC,GAAG,EACH,GAAG,EACH,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,OAAO,EACR,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhB"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
// Generates a `.socket.facts.json` for an sbt project by delegating to the
|
|
2
|
+
// Coana CLI's `manifest sbt` command (which owns the sbt plugin that resolves
|
|
3
|
+
// the dependency graph). socket-cli no longer runs sbt itself; an explicit
|
|
4
|
+
// `bin` is forwarded as `--bin`, otherwise Coana defaults to `sbt` on PATH.
|
|
5
|
+
// JDK-compatibility guidance (sbt 0.13/early 1.x cannot run on modern JDKs) is
|
|
6
|
+
// handled by Coana; pass a compatible JDK via `--sbt-opts "--java-home <path>"`
|
|
7
|
+
// or `JAVA_HOME`.
|
|
8
|
+
export declare function convertSbtToFacts({ bin, cwd, excludeConfigs, ignoreUnresolved, includeConfigs, sbtOpts, verbose }: {
|
|
2
9
|
bin: string;
|
|
3
|
-
configs: string;
|
|
4
10
|
cwd: string;
|
|
11
|
+
excludeConfigs: string;
|
|
5
12
|
ignoreUnresolved: boolean;
|
|
13
|
+
includeConfigs: string;
|
|
6
14
|
sbtOpts: string[];
|
|
7
15
|
verbose: boolean;
|
|
8
16
|
}): Promise<void>;
|