socket 1.1.124 → 1.1.126
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 +15 -2
- package/README.md +8 -0
- package/dist/cli.js +463 -125
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +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-maven.d.mts +9 -0
- package/dist/types/commands/manifest/cmd-manifest-maven.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/coana-manifest-facts.d.mts +6 -6
- package/dist/types/commands/manifest/coana-manifest-facts.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-maven-to-facts.d.mts +15 -0
- package/dist/types/commands/manifest/convert-maven-to-facts.d.mts.map +1 -0
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts +1 -0
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +1 -1
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/parse-build-tool-opts.d.mts +9 -0
- package/dist/types/commands/manifest/parse-build-tool-opts.d.mts.map +1 -0
- package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -1
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts +5 -3
- 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/utils/socket-json.d.mts +9 -0
- package/dist/types/utils/socket-json.d.mts.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -333,9 +333,9 @@ const hidden$x = false;
|
|
|
333
333
|
const cmdAnalytics = {
|
|
334
334
|
description: description$F,
|
|
335
335
|
hidden: hidden$x,
|
|
336
|
-
run: run$
|
|
336
|
+
run: run$U
|
|
337
337
|
};
|
|
338
|
-
async function run$
|
|
338
|
+
async function run$U(argv, importMeta, {
|
|
339
339
|
parentName
|
|
340
340
|
}) {
|
|
341
341
|
const config = {
|
|
@@ -756,9 +756,9 @@ const hidden$w = false;
|
|
|
756
756
|
const cmdAuditLog = {
|
|
757
757
|
description: description$E,
|
|
758
758
|
hidden: hidden$w,
|
|
759
|
-
run: run$
|
|
759
|
+
run: run$T
|
|
760
760
|
};
|
|
761
|
-
async function run$
|
|
761
|
+
async function run$T(argv, importMeta, {
|
|
762
762
|
parentName
|
|
763
763
|
}) {
|
|
764
764
|
const config = {
|
|
@@ -1110,11 +1110,13 @@ async function fetchSupportedScanFileNames(options) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
1112
|
/**
|
|
1113
|
-
* Finalize a
|
|
1114
|
-
*
|
|
1113
|
+
* Finalize a full application reachability scan (formerly known as "tier 1";
|
|
1114
|
+
* the wire endpoint and request fields below retain the legacy tier1 name as
|
|
1115
|
+
* a backend contract).
|
|
1116
|
+
* - Associates the reachability scan metadata with the full scan
|
|
1115
1117
|
* (or with `null` when called from a standalone reachability flow that
|
|
1116
1118
|
* has no full scan to bind to).
|
|
1117
|
-
* - Transitions the
|
|
1119
|
+
* - Transitions the reachability scan to its DONE terminal state.
|
|
1118
1120
|
*/
|
|
1119
1121
|
async function finalizeTier1Scan(tier1ReachabilityScanId, scanId) {
|
|
1120
1122
|
// we do not use the SDK here because the tier1-reachability-scan/finalize is a hidden
|
|
@@ -1787,7 +1789,7 @@ async function performReachabilityAnalysis(options) {
|
|
|
1787
1789
|
if (!utils.hasEnterpriseOrgPlan(organizations)) {
|
|
1788
1790
|
return {
|
|
1789
1791
|
ok: false,
|
|
1790
|
-
message: '
|
|
1792
|
+
message: 'Full application reachability analysis requires an enterprise plan',
|
|
1791
1793
|
cause: `Please ${utils.socketDevLink('upgrade your plan', '/pricing')}. This feature is only available for organizations with an enterprise plan.`
|
|
1792
1794
|
};
|
|
1793
1795
|
}
|
|
@@ -1900,7 +1902,7 @@ async function performReachabilityAnalysis(options) {
|
|
|
1900
1902
|
// with `cwd` above), so resolve the read path against `cwd` too. Reading
|
|
1901
1903
|
// the bare relative path would resolve against `process.cwd()` and miss
|
|
1902
1904
|
// the file whenever `cwd !== process.cwd()` (e.g. `--cwd <dir>`), silently
|
|
1903
|
-
// dropping the
|
|
1905
|
+
// dropping the full application reachability scan id and skipping finalize downstream.
|
|
1904
1906
|
const resolvedReportPath = path.resolve(cwd, outputFilePath);
|
|
1905
1907
|
return {
|
|
1906
1908
|
ok: true,
|
|
@@ -1938,6 +1940,7 @@ sockJson, cwd = process.cwd()) {
|
|
|
1938
1940
|
count: 0,
|
|
1939
1941
|
conda: false,
|
|
1940
1942
|
gradle: false,
|
|
1943
|
+
maven: false,
|
|
1941
1944
|
sbt: false
|
|
1942
1945
|
};
|
|
1943
1946
|
if (sockJson?.defaults?.manifest?.bazel?.disabled) {
|
|
@@ -1961,6 +1964,13 @@ sockJson, cwd = process.cwd()) {
|
|
|
1961
1964
|
output.gradle = true;
|
|
1962
1965
|
output.count += 1;
|
|
1963
1966
|
}
|
|
1967
|
+
if (sockJson?.defaults?.manifest?.maven?.disabled) {
|
|
1968
|
+
require$$9.debugLog('notice', `[DEBUG] - maven auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
1969
|
+
} else if (fs$1.existsSync(path.join(cwd, 'pom.xml'))) {
|
|
1970
|
+
require$$9.debugLog('notice', '[DEBUG] - Detected a Maven pom.xml build file');
|
|
1971
|
+
output.maven = true;
|
|
1972
|
+
output.count += 1;
|
|
1973
|
+
}
|
|
1964
1974
|
if (sockJson?.defaults?.manifest?.conda?.disabled) {
|
|
1965
1975
|
require$$9.debugLog('notice', `[DEBUG] - conda auto-detection is disabled in ${constants.SOCKET_JSON}`);
|
|
1966
1976
|
} else {
|
|
@@ -4283,10 +4293,10 @@ async function extractBazelToMaven(opts) {
|
|
|
4283
4293
|
// facts file.
|
|
4284
4294
|
//
|
|
4285
4295
|
// `spawnCoanaDlx` resolves the Coana CLI via dlx (or a local build when
|
|
4286
|
-
// `SOCKET_CLI_COANA_LOCAL_PATH` is set). `bin` (the gradle/sbt executable)
|
|
4287
|
-
// always resolved by the caller to a concrete default (`<cwd>/gradlew`, or
|
|
4288
|
-
// `sbt` on PATH) before we get here, so it is forwarded verbatim; the
|
|
4289
|
-
// guard below is just a cheap safeguard against passing `--bin ''`.
|
|
4296
|
+
// `SOCKET_CLI_COANA_LOCAL_PATH` is set). `bin` (the gradle/maven/sbt executable)
|
|
4297
|
+
// is always resolved by the caller to a concrete default (`<cwd>/gradlew`, or
|
|
4298
|
+
// `mvn`/`sbt` on PATH) before we get here, so it is forwarded verbatim; the
|
|
4299
|
+
// empty guard below is just a cheap safeguard against passing `--bin ''`.
|
|
4290
4300
|
async function runCoanaManifestFacts({
|
|
4291
4301
|
bin,
|
|
4292
4302
|
buildOpts,
|
|
@@ -4390,6 +4400,33 @@ async function convertGradleToFacts({
|
|
|
4390
4400
|
});
|
|
4391
4401
|
}
|
|
4392
4402
|
|
|
4403
|
+
// Generates a `.socket.facts.json` for a Maven project by delegating to the
|
|
4404
|
+
// Coana CLI's `manifest maven` command (which owns the Maven plugin that
|
|
4405
|
+
// resolves the dependency graph). socket-cli no longer runs maven itself; an
|
|
4406
|
+
// explicit `bin` is forwarded as `--bin`, otherwise Coana defaults to `mvn` on
|
|
4407
|
+
// PATH.
|
|
4408
|
+
async function convertMavenToFacts({
|
|
4409
|
+
bin,
|
|
4410
|
+
cwd,
|
|
4411
|
+
excludeConfigs,
|
|
4412
|
+
ignoreUnresolved,
|
|
4413
|
+
includeConfigs,
|
|
4414
|
+
mavenOpts,
|
|
4415
|
+
verbose
|
|
4416
|
+
}) {
|
|
4417
|
+
await runCoanaManifestFacts({
|
|
4418
|
+
bin,
|
|
4419
|
+
buildOpts: mavenOpts,
|
|
4420
|
+
buildOptsFlag: '--maven-opts',
|
|
4421
|
+
cwd,
|
|
4422
|
+
ecosystem: 'maven',
|
|
4423
|
+
excludeConfigs,
|
|
4424
|
+
ignoreUnresolved,
|
|
4425
|
+
includeConfigs,
|
|
4426
|
+
verbose
|
|
4427
|
+
});
|
|
4428
|
+
}
|
|
4429
|
+
|
|
4393
4430
|
// Generates a `.socket.facts.json` for an sbt project by delegating to the
|
|
4394
4431
|
// Coana CLI's `manifest sbt` command (which owns the sbt plugin that resolves
|
|
4395
4432
|
// the dependency graph). socket-cli no longer runs sbt itself; an explicit
|
|
@@ -4864,6 +4901,59 @@ async function handleManifestConda({
|
|
|
4864
4901
|
await outputRequirements(data, outputKind, out);
|
|
4865
4902
|
}
|
|
4866
4903
|
|
|
4904
|
+
// Tokenizes a build-tool options string (e.g. the value of `--gradle-opts`,
|
|
4905
|
+
// `--sbt-opts`, `--maven-opts`) into individual argv tokens. Splits on
|
|
4906
|
+
// whitespace but honors single and double quotes so a value containing spaces,
|
|
4907
|
+
// such as a settings path (`-s "my settings.xml"`), survives as one token
|
|
4908
|
+
// instead of being shredded into three. Quotes are consumed (not emitted), and
|
|
4909
|
+
// quoting is intra-token aware (`-Dkey="a b"` -> `-Dkey=a b`). For unquoted
|
|
4910
|
+
// input this is equivalent to the previous whitespace split.
|
|
4911
|
+
function parseBuildToolOpts(opts) {
|
|
4912
|
+
if (!opts) {
|
|
4913
|
+
return [];
|
|
4914
|
+
}
|
|
4915
|
+
const tokens = [];
|
|
4916
|
+
let current = '';
|
|
4917
|
+
let hasToken = false;
|
|
4918
|
+
let inSingle = false;
|
|
4919
|
+
let inDouble = false;
|
|
4920
|
+
for (let i = 0; i < opts.length; i += 1) {
|
|
4921
|
+
const ch = opts[i];
|
|
4922
|
+
if (inSingle) {
|
|
4923
|
+
if (ch === "'") {
|
|
4924
|
+
inSingle = false;
|
|
4925
|
+
} else {
|
|
4926
|
+
current += ch;
|
|
4927
|
+
}
|
|
4928
|
+
} else if (inDouble) {
|
|
4929
|
+
if (ch === '"') {
|
|
4930
|
+
inDouble = false;
|
|
4931
|
+
} else {
|
|
4932
|
+
current += ch;
|
|
4933
|
+
}
|
|
4934
|
+
} else if (ch === "'") {
|
|
4935
|
+
inSingle = true;
|
|
4936
|
+
hasToken = true;
|
|
4937
|
+
} else if (ch === '"') {
|
|
4938
|
+
inDouble = true;
|
|
4939
|
+
hasToken = true;
|
|
4940
|
+
} else if (ch === ' ' || ch === '\t') {
|
|
4941
|
+
if (hasToken) {
|
|
4942
|
+
tokens.push(current);
|
|
4943
|
+
current = '';
|
|
4944
|
+
hasToken = false;
|
|
4945
|
+
}
|
|
4946
|
+
} else {
|
|
4947
|
+
current += ch;
|
|
4948
|
+
hasToken = true;
|
|
4949
|
+
}
|
|
4950
|
+
}
|
|
4951
|
+
if (hasToken) {
|
|
4952
|
+
tokens.push(current);
|
|
4953
|
+
}
|
|
4954
|
+
return tokens;
|
|
4955
|
+
}
|
|
4956
|
+
|
|
4867
4957
|
async function generateAutoManifest({
|
|
4868
4958
|
cwd,
|
|
4869
4959
|
detected,
|
|
@@ -4883,7 +4973,7 @@ async function generateAutoManifest({
|
|
|
4883
4973
|
// Note: `sbt` is more likely to be resolved against PATH env.
|
|
4884
4974
|
bin: sockJson.defaults?.manifest?.sbt?.bin ?? 'sbt',
|
|
4885
4975
|
cwd,
|
|
4886
|
-
sbtOpts: sockJson.defaults?.manifest?.sbt?.sbtOpts
|
|
4976
|
+
sbtOpts: parseBuildToolOpts(sockJson.defaults?.manifest?.sbt?.sbtOpts),
|
|
4887
4977
|
verbose: Boolean(sockJson.defaults?.manifest?.sbt?.verbose)
|
|
4888
4978
|
};
|
|
4889
4979
|
// Socket facts is the default; opt into pom generation with
|
|
@@ -4912,7 +5002,7 @@ async function generateAutoManifest({
|
|
|
4912
5002
|
bin: sockJson.defaults?.manifest?.gradle?.bin ? path.resolve(cwd, sockJson.defaults.manifest.gradle.bin) : path.join(cwd, 'gradlew'),
|
|
4913
5003
|
cwd,
|
|
4914
5004
|
verbose: Boolean(sockJson.defaults?.manifest?.gradle?.verbose),
|
|
4915
|
-
gradleOpts: sockJson.defaults?.manifest?.gradle?.gradleOpts
|
|
5005
|
+
gradleOpts: parseBuildToolOpts(sockJson.defaults?.manifest?.gradle?.gradleOpts)
|
|
4916
5006
|
};
|
|
4917
5007
|
// Socket facts is the default; opt into pom generation with
|
|
4918
5008
|
// `defaults.manifest.gradle.facts: false` in socket.json.
|
|
@@ -4929,6 +5019,19 @@ async function generateAutoManifest({
|
|
|
4929
5019
|
await convertGradleToMaven(gradleArgs);
|
|
4930
5020
|
}
|
|
4931
5021
|
}
|
|
5022
|
+
if (!sockJson?.defaults?.manifest?.maven?.disabled && detected.maven) {
|
|
5023
|
+
logger.logger.log('Detected a Maven pom.xml build, generating Socket facts...');
|
|
5024
|
+
await convertMavenToFacts({
|
|
5025
|
+
// Note: `mvn` is more likely to be resolved against PATH env.
|
|
5026
|
+
bin: sockJson.defaults?.manifest?.maven?.bin ?? 'mvn',
|
|
5027
|
+
cwd,
|
|
5028
|
+
excludeConfigs: sockJson.defaults?.manifest?.maven?.excludeConfigs ?? '',
|
|
5029
|
+
ignoreUnresolved: Boolean(sockJson.defaults?.manifest?.maven?.ignoreUnresolved),
|
|
5030
|
+
includeConfigs: sockJson.defaults?.manifest?.maven?.includeConfigs ?? '',
|
|
5031
|
+
mavenOpts: parseBuildToolOpts(sockJson.defaults?.manifest?.maven?.mavenOpts),
|
|
5032
|
+
verbose: Boolean(sockJson.defaults?.manifest?.maven?.verbose)
|
|
5033
|
+
});
|
|
5034
|
+
}
|
|
4932
5035
|
if (!sockJson?.defaults?.manifest?.conda?.disabled && detected.conda) {
|
|
4933
5036
|
logger.logger.log('Detected an environment.yml file, running default Conda generator...');
|
|
4934
5037
|
await handleManifestConda({
|
|
@@ -5191,12 +5294,12 @@ async function handleCreateNewScan({
|
|
|
5191
5294
|
if (reach && scanId && tier1ReachabilityScanId) {
|
|
5192
5295
|
await finalizeTier1Scan(tier1ReachabilityScanId, scanId);
|
|
5193
5296
|
} else if (reach.runReachabilityAnalysis && scanId && !tier1ReachabilityScanId) {
|
|
5194
|
-
// Reachability analysis ran and a scan was created, but no
|
|
5195
|
-
// reachability scan id was extracted from the facts file.
|
|
5196
|
-
// instead of silently skipping finalize — otherwise the
|
|
5197
|
-
// stuck (e.g. at COANA_DONE) and the full scan is
|
|
5198
|
-
// reachability report.
|
|
5199
|
-
logger.logger.warn('Reachability analysis ran but no
|
|
5297
|
+
// Reachability analysis ran and a scan was created, but no full
|
|
5298
|
+
// application reachability scan id was extracted from the facts file.
|
|
5299
|
+
// Surface this instead of silently skipping finalize — otherwise the
|
|
5300
|
+
// reachability row stays stuck (e.g. at COANA_DONE) and the full scan is
|
|
5301
|
+
// never linked to its reachability report.
|
|
5302
|
+
logger.logger.warn('Reachability analysis ran but no full application reachability scan ID was found; skipping reachability finalize. The scan was created but its reachability report was not linked.');
|
|
5200
5303
|
}
|
|
5201
5304
|
|
|
5202
5305
|
// On a successful scan, clean up the `.socket.facts.json` coana wrote at
|
|
@@ -5207,8 +5310,9 @@ async function handleCreateNewScan({
|
|
|
5207
5310
|
// the --reach path coana overwrites that file with its enriched output
|
|
5208
5311
|
// anyway, so it's the same path that gets removed. `--reach-retain-facts-file`
|
|
5209
5312
|
// opts out of this cleanup so the report can be inspected; the user is then
|
|
5210
|
-
// responsible for deleting it before the next
|
|
5211
|
-
// picked up as pre-generated input and would make those
|
|
5313
|
+
// responsible for deleting it before the next full application reachability
|
|
5314
|
+
// scan (a stale file is picked up as pre-generated input and would make those
|
|
5315
|
+
// results unreliable).
|
|
5212
5316
|
if (fullScanCResult.ok && scanId && reachabilityReport && !reach.reachRetainFactsFile) {
|
|
5213
5317
|
try {
|
|
5214
5318
|
await fs.unlink(path.resolve(cwd, reachabilityReport));
|
|
@@ -5323,7 +5427,7 @@ async function handleCi(autoManifest) {
|
|
|
5323
5427
|
});
|
|
5324
5428
|
}
|
|
5325
5429
|
|
|
5326
|
-
const config$
|
|
5430
|
+
const config$m = {
|
|
5327
5431
|
commandName: 'ci',
|
|
5328
5432
|
description: 'Alias for `socket scan create --report` (creates report and exits with error if unhealthy)',
|
|
5329
5433
|
hidden: false,
|
|
@@ -5341,7 +5445,7 @@ const config$l = {
|
|
|
5341
5445
|
$ ${command} [options]
|
|
5342
5446
|
|
|
5343
5447
|
Options
|
|
5344
|
-
${utils.getFlagListOutput(config$
|
|
5448
|
+
${utils.getFlagListOutput(config$m.flags)}
|
|
5345
5449
|
|
|
5346
5450
|
This command is intended to use in CI runs to allow automated systems to
|
|
5347
5451
|
accept or reject a current build. It will use the default org of the
|
|
@@ -5359,16 +5463,16 @@ const config$l = {
|
|
|
5359
5463
|
`
|
|
5360
5464
|
};
|
|
5361
5465
|
const cmdCI = {
|
|
5362
|
-
description: config$
|
|
5363
|
-
hidden: config$
|
|
5364
|
-
run: run$
|
|
5466
|
+
description: config$m.description,
|
|
5467
|
+
hidden: config$m.hidden,
|
|
5468
|
+
run: run$S
|
|
5365
5469
|
};
|
|
5366
|
-
async function run$
|
|
5470
|
+
async function run$S(argv, importMeta, {
|
|
5367
5471
|
parentName
|
|
5368
5472
|
}) {
|
|
5369
5473
|
const cli = utils.meowOrExit({
|
|
5370
5474
|
argv,
|
|
5371
|
-
config: config$
|
|
5475
|
+
config: config$m,
|
|
5372
5476
|
parentName,
|
|
5373
5477
|
importMeta
|
|
5374
5478
|
});
|
|
@@ -5611,9 +5715,9 @@ const hidden$v = false;
|
|
|
5611
5715
|
const cmdConfigAuto = {
|
|
5612
5716
|
description: description$D,
|
|
5613
5717
|
hidden: hidden$v,
|
|
5614
|
-
run: run$
|
|
5718
|
+
run: run$R
|
|
5615
5719
|
};
|
|
5616
|
-
async function run$
|
|
5720
|
+
async function run$R(argv, importMeta, {
|
|
5617
5721
|
parentName
|
|
5618
5722
|
}) {
|
|
5619
5723
|
const config = {
|
|
@@ -5729,7 +5833,7 @@ async function handleConfigGet({
|
|
|
5729
5833
|
await outputConfigGet(key, result, outputKind);
|
|
5730
5834
|
}
|
|
5731
5835
|
|
|
5732
|
-
const config$
|
|
5836
|
+
const config$l = {
|
|
5733
5837
|
commandName: 'get',
|
|
5734
5838
|
description: 'Get the value of a local CLI config item',
|
|
5735
5839
|
hidden: false,
|
|
@@ -5759,16 +5863,16 @@ ${utils.getSupportedConfigEntries().map(({
|
|
|
5759
5863
|
`
|
|
5760
5864
|
};
|
|
5761
5865
|
const cmdConfigGet = {
|
|
5762
|
-
description: config$
|
|
5763
|
-
hidden: config$
|
|
5764
|
-
run: run$
|
|
5866
|
+
description: config$l.description,
|
|
5867
|
+
hidden: config$l.hidden,
|
|
5868
|
+
run: run$Q
|
|
5765
5869
|
};
|
|
5766
|
-
async function run$
|
|
5870
|
+
async function run$Q(argv, importMeta, {
|
|
5767
5871
|
parentName
|
|
5768
5872
|
}) {
|
|
5769
5873
|
const cli = utils.meowOrExit({
|
|
5770
5874
|
argv,
|
|
5771
|
-
config: config$
|
|
5875
|
+
config: config$l,
|
|
5772
5876
|
importMeta,
|
|
5773
5877
|
parentName
|
|
5774
5878
|
});
|
|
@@ -5870,7 +5974,7 @@ async function outputConfigList({
|
|
|
5870
5974
|
}
|
|
5871
5975
|
}
|
|
5872
5976
|
|
|
5873
|
-
const config$
|
|
5977
|
+
const config$k = {
|
|
5874
5978
|
commandName: 'list',
|
|
5875
5979
|
description: 'Show all local CLI config items and their values',
|
|
5876
5980
|
hidden: false,
|
|
@@ -5895,16 +5999,16 @@ const config$j = {
|
|
|
5895
5999
|
`
|
|
5896
6000
|
};
|
|
5897
6001
|
const cmdConfigList = {
|
|
5898
|
-
description: config$
|
|
5899
|
-
hidden: config$
|
|
5900
|
-
run: run$
|
|
6002
|
+
description: config$k.description,
|
|
6003
|
+
hidden: config$k.hidden,
|
|
6004
|
+
run: run$P
|
|
5901
6005
|
};
|
|
5902
|
-
async function run$
|
|
6006
|
+
async function run$P(argv, importMeta, {
|
|
5903
6007
|
parentName
|
|
5904
6008
|
}) {
|
|
5905
6009
|
const cli = utils.meowOrExit({
|
|
5906
6010
|
argv,
|
|
5907
|
-
config: config$
|
|
6011
|
+
config: config$k,
|
|
5908
6012
|
importMeta,
|
|
5909
6013
|
parentName
|
|
5910
6014
|
});
|
|
@@ -5994,9 +6098,9 @@ const hidden$u = false;
|
|
|
5994
6098
|
const cmdConfigSet = {
|
|
5995
6099
|
description: description$C,
|
|
5996
6100
|
hidden: hidden$u,
|
|
5997
|
-
run: run$
|
|
6101
|
+
run: run$O
|
|
5998
6102
|
};
|
|
5999
|
-
async function run$
|
|
6103
|
+
async function run$O(argv, importMeta, {
|
|
6000
6104
|
parentName
|
|
6001
6105
|
}) {
|
|
6002
6106
|
const config = {
|
|
@@ -6121,9 +6225,9 @@ const hidden$t = false;
|
|
|
6121
6225
|
const cmdConfigUnset = {
|
|
6122
6226
|
description: description$B,
|
|
6123
6227
|
hidden: hidden$t,
|
|
6124
|
-
run: run$
|
|
6228
|
+
run: run$N
|
|
6125
6229
|
};
|
|
6126
|
-
async function run$
|
|
6230
|
+
async function run$N(argv, importMeta, {
|
|
6127
6231
|
parentName
|
|
6128
6232
|
}) {
|
|
6129
6233
|
const config = {
|
|
@@ -7338,7 +7442,7 @@ const hidden$s = false;
|
|
|
7338
7442
|
const cmdFix = {
|
|
7339
7443
|
description: description$z,
|
|
7340
7444
|
hidden: hidden$s,
|
|
7341
|
-
run: run$
|
|
7445
|
+
run: run$M
|
|
7342
7446
|
};
|
|
7343
7447
|
const generalFlags$2 = {
|
|
7344
7448
|
autopilot: {
|
|
@@ -7513,7 +7617,7 @@ const hiddenFlags = {
|
|
|
7513
7617
|
hidden: true
|
|
7514
7618
|
}
|
|
7515
7619
|
};
|
|
7516
|
-
async function run$
|
|
7620
|
+
async function run$M(argv, importMeta, {
|
|
7517
7621
|
parentName
|
|
7518
7622
|
}) {
|
|
7519
7623
|
const config = {
|
|
@@ -7842,7 +7946,7 @@ async function handleInstallCompletion(targetName) {
|
|
|
7842
7946
|
await outputInstallCompletion(result);
|
|
7843
7947
|
}
|
|
7844
7948
|
|
|
7845
|
-
const config$
|
|
7949
|
+
const config$j = {
|
|
7846
7950
|
commandName: 'completion',
|
|
7847
7951
|
description: 'Install bash completion for Socket CLI',
|
|
7848
7952
|
hidden: false,
|
|
@@ -7879,16 +7983,16 @@ const config$i = {
|
|
|
7879
7983
|
`
|
|
7880
7984
|
};
|
|
7881
7985
|
const cmdInstallCompletion = {
|
|
7882
|
-
description: config$
|
|
7883
|
-
hidden: config$
|
|
7884
|
-
run: run$
|
|
7986
|
+
description: config$j.description,
|
|
7987
|
+
hidden: config$j.hidden,
|
|
7988
|
+
run: run$L
|
|
7885
7989
|
};
|
|
7886
|
-
async function run$
|
|
7990
|
+
async function run$L(argv, importMeta, {
|
|
7887
7991
|
parentName
|
|
7888
7992
|
}) {
|
|
7889
7993
|
const cli = utils.meowOrExit({
|
|
7890
7994
|
argv,
|
|
7891
|
-
config: config$
|
|
7995
|
+
config: config$j,
|
|
7892
7996
|
parentName,
|
|
7893
7997
|
importMeta
|
|
7894
7998
|
});
|
|
@@ -7945,7 +8049,7 @@ async function handleCmdJson(cwd) {
|
|
|
7945
8049
|
await outputCmdJson(cwd);
|
|
7946
8050
|
}
|
|
7947
8051
|
|
|
7948
|
-
const config$
|
|
8052
|
+
const config$i = {
|
|
7949
8053
|
commandName: 'json',
|
|
7950
8054
|
description: `Display the \`${constants.SOCKET_JSON}\` that would be applied for target folder`,
|
|
7951
8055
|
hidden: true,
|
|
@@ -7964,16 +8068,16 @@ const config$h = {
|
|
|
7964
8068
|
`
|
|
7965
8069
|
};
|
|
7966
8070
|
const cmdJson = {
|
|
7967
|
-
description: config$
|
|
7968
|
-
hidden: config$
|
|
7969
|
-
run: run$
|
|
8071
|
+
description: config$i.description,
|
|
8072
|
+
hidden: config$i.hidden,
|
|
8073
|
+
run: run$K
|
|
7970
8074
|
};
|
|
7971
|
-
async function run$
|
|
8075
|
+
async function run$K(argv, importMeta, {
|
|
7972
8076
|
parentName
|
|
7973
8077
|
}) {
|
|
7974
8078
|
const cli = utils.meowOrExit({
|
|
7975
8079
|
argv,
|
|
7976
|
-
config: config$
|
|
8080
|
+
config: config$i,
|
|
7977
8081
|
parentName,
|
|
7978
8082
|
importMeta
|
|
7979
8083
|
});
|
|
@@ -8128,9 +8232,9 @@ const hidden$r = false;
|
|
|
8128
8232
|
const cmdLogin = {
|
|
8129
8233
|
description: description$x,
|
|
8130
8234
|
hidden: hidden$r,
|
|
8131
|
-
run: run$
|
|
8235
|
+
run: run$J
|
|
8132
8236
|
};
|
|
8133
|
-
async function run$
|
|
8237
|
+
async function run$J(argv, importMeta, {
|
|
8134
8238
|
parentName
|
|
8135
8239
|
}) {
|
|
8136
8240
|
const config = {
|
|
@@ -8208,7 +8312,7 @@ function attemptLogout() {
|
|
|
8208
8312
|
}
|
|
8209
8313
|
}
|
|
8210
8314
|
|
|
8211
|
-
const config$
|
|
8315
|
+
const config$h = {
|
|
8212
8316
|
commandName: 'logout',
|
|
8213
8317
|
description: 'Socket API logout',
|
|
8214
8318
|
hidden: false,
|
|
@@ -8226,16 +8330,16 @@ const config$g = {
|
|
|
8226
8330
|
`
|
|
8227
8331
|
};
|
|
8228
8332
|
const cmdLogout = {
|
|
8229
|
-
description: config$
|
|
8230
|
-
hidden: config$
|
|
8231
|
-
run: run$
|
|
8333
|
+
description: config$h.description,
|
|
8334
|
+
hidden: config$h.hidden,
|
|
8335
|
+
run: run$I
|
|
8232
8336
|
};
|
|
8233
|
-
async function run$
|
|
8337
|
+
async function run$I(argv, importMeta, {
|
|
8234
8338
|
parentName
|
|
8235
8339
|
}) {
|
|
8236
8340
|
const cli = utils.meowOrExit({
|
|
8237
8341
|
argv,
|
|
8238
|
-
config: config$
|
|
8342
|
+
config: config$h,
|
|
8239
8343
|
importMeta,
|
|
8240
8344
|
parentName
|
|
8241
8345
|
});
|
|
@@ -8548,7 +8652,7 @@ const yargsConfig = {
|
|
|
8548
8652
|
'usages-slices-file' // hidden
|
|
8549
8653
|
]
|
|
8550
8654
|
};
|
|
8551
|
-
const config$
|
|
8655
|
+
const config$g = {
|
|
8552
8656
|
commandName: 'cdxgen',
|
|
8553
8657
|
description: 'Run cdxgen for SBOM generation',
|
|
8554
8658
|
hidden: false,
|
|
@@ -8558,11 +8662,11 @@ const config$f = {
|
|
|
8558
8662
|
help: () => ''
|
|
8559
8663
|
};
|
|
8560
8664
|
const cmdManifestCdxgen = {
|
|
8561
|
-
description: config$
|
|
8562
|
-
hidden: config$
|
|
8563
|
-
run: run$
|
|
8665
|
+
description: config$g.description,
|
|
8666
|
+
hidden: config$g.hidden,
|
|
8667
|
+
run: run$H
|
|
8564
8668
|
};
|
|
8565
|
-
async function run$
|
|
8669
|
+
async function run$H(argv, importMeta, context) {
|
|
8566
8670
|
const {
|
|
8567
8671
|
parentName
|
|
8568
8672
|
} = {
|
|
@@ -8572,7 +8676,7 @@ async function run$G(argv, importMeta, context) {
|
|
|
8572
8676
|
const cli = utils.meowOrExit({
|
|
8573
8677
|
// Don't let meow take over --help.
|
|
8574
8678
|
argv: argv.filter(a => !utils.isHelpFlag(a)),
|
|
8575
|
-
config: config$
|
|
8679
|
+
config: config$g,
|
|
8576
8680
|
importMeta,
|
|
8577
8681
|
parentName
|
|
8578
8682
|
});
|
|
@@ -9611,7 +9715,7 @@ async function buildSpokeTagLookup(reached, queryOpts, verbose) {
|
|
|
9611
9715
|
return lookup;
|
|
9612
9716
|
}
|
|
9613
9717
|
|
|
9614
|
-
const config$
|
|
9718
|
+
const config$f = {
|
|
9615
9719
|
commandName: 'bazel',
|
|
9616
9720
|
description: '[beta] Bazel SBOM support — generate manifest files for a Bazel project (Maven, PyPI)',
|
|
9617
9721
|
hidden: false,
|
|
@@ -9695,9 +9799,9 @@ const config$e = {
|
|
|
9695
9799
|
// shorter default lives in extract_bazel_to_maven.mts.
|
|
9696
9800
|
const EXPLICIT_PER_REPO_TIMEOUT_MS = 120_000;
|
|
9697
9801
|
const cmdManifestBazel = {
|
|
9698
|
-
description: config$
|
|
9699
|
-
hidden: config$
|
|
9700
|
-
run: run$
|
|
9802
|
+
description: config$f.description,
|
|
9803
|
+
hidden: config$f.hidden,
|
|
9804
|
+
run: run$G
|
|
9701
9805
|
};
|
|
9702
9806
|
// Pure outcome-matrix evaluator. Exported so dispatcher behavior can be
|
|
9703
9807
|
// unit-tested without spawning the CLI binary. Throws InputError on
|
|
@@ -9781,12 +9885,12 @@ function pypiOutcome(result) {
|
|
|
9781
9885
|
status: 'hardFailure'
|
|
9782
9886
|
};
|
|
9783
9887
|
}
|
|
9784
|
-
async function run$
|
|
9888
|
+
async function run$G(argv, importMeta, {
|
|
9785
9889
|
parentName
|
|
9786
9890
|
}) {
|
|
9787
9891
|
const cli = utils.meowOrExit({
|
|
9788
9892
|
argv,
|
|
9789
|
-
config: config$
|
|
9893
|
+
config: config$f,
|
|
9790
9894
|
importMeta,
|
|
9791
9895
|
parentName
|
|
9792
9896
|
});
|
|
@@ -9874,7 +9978,7 @@ async function run$F(argv, importMeta, {
|
|
|
9874
9978
|
}
|
|
9875
9979
|
}
|
|
9876
9980
|
if (verbose) {
|
|
9877
|
-
logger.logger.group('- ', parentName, config$
|
|
9981
|
+
logger.logger.group('- ', parentName, config$f.commandName, ':');
|
|
9878
9982
|
logger.logger.group('- flags:', cli.flags);
|
|
9879
9983
|
logger.logger.groupEnd();
|
|
9880
9984
|
logger.logger.log('- input:', cli.input);
|
|
@@ -9951,7 +10055,7 @@ async function run$F(argv, importMeta, {
|
|
|
9951
10055
|
evaluateEcosystemOutcomes(outcomes, wasExplicitEcosystemSelection);
|
|
9952
10056
|
}
|
|
9953
10057
|
|
|
9954
|
-
const config$
|
|
10058
|
+
const config$e = {
|
|
9955
10059
|
commandName: 'auto',
|
|
9956
10060
|
description: 'Auto-detect build and attempt to generate manifest file',
|
|
9957
10061
|
hidden: false,
|
|
@@ -9984,16 +10088,16 @@ const config$d = {
|
|
|
9984
10088
|
`
|
|
9985
10089
|
};
|
|
9986
10090
|
const cmdManifestAuto = {
|
|
9987
|
-
description: config$
|
|
9988
|
-
hidden: config$
|
|
9989
|
-
run: run$
|
|
10091
|
+
description: config$e.description,
|
|
10092
|
+
hidden: config$e.hidden,
|
|
10093
|
+
run: run$F
|
|
9990
10094
|
};
|
|
9991
|
-
async function run$
|
|
10095
|
+
async function run$F(argv, importMeta, {
|
|
9992
10096
|
parentName
|
|
9993
10097
|
}) {
|
|
9994
10098
|
const cli = utils.meowOrExit({
|
|
9995
10099
|
argv,
|
|
9996
|
-
config: config$
|
|
10100
|
+
config: config$e,
|
|
9997
10101
|
importMeta,
|
|
9998
10102
|
parentName
|
|
9999
10103
|
});
|
|
@@ -10011,7 +10115,7 @@ async function run$E(argv, importMeta, {
|
|
|
10011
10115
|
cwd = path.resolve(process.cwd(), cwd);
|
|
10012
10116
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
10013
10117
|
if (verbose) {
|
|
10014
|
-
logger.logger.group('- ', parentName, config$
|
|
10118
|
+
logger.logger.group('- ', parentName, config$e.commandName, ':');
|
|
10015
10119
|
logger.logger.group('- flags:', cli.flags);
|
|
10016
10120
|
logger.logger.groupEnd();
|
|
10017
10121
|
logger.logger.log('- input:', cli.input);
|
|
@@ -10045,7 +10149,7 @@ async function run$E(argv, importMeta, {
|
|
|
10045
10149
|
logger.logger.success(`Finished. Should have attempted to generate manifest files for ${detected.count} targets.`);
|
|
10046
10150
|
}
|
|
10047
10151
|
|
|
10048
|
-
const config$
|
|
10152
|
+
const config$d = {
|
|
10049
10153
|
commandName: 'conda',
|
|
10050
10154
|
description: `[beta] Convert a Conda ${constants.ENVIRONMENT_YML} file to a python ${constants.REQUIREMENTS_TXT}`,
|
|
10051
10155
|
hidden: false,
|
|
@@ -10098,16 +10202,16 @@ const config$c = {
|
|
|
10098
10202
|
`
|
|
10099
10203
|
};
|
|
10100
10204
|
const cmdManifestConda = {
|
|
10101
|
-
description: config$
|
|
10102
|
-
hidden: config$
|
|
10103
|
-
run: run$
|
|
10205
|
+
description: config$d.description,
|
|
10206
|
+
hidden: config$d.hidden,
|
|
10207
|
+
run: run$E
|
|
10104
10208
|
};
|
|
10105
|
-
async function run$
|
|
10209
|
+
async function run$E(argv, importMeta, {
|
|
10106
10210
|
parentName
|
|
10107
10211
|
}) {
|
|
10108
10212
|
const cli = utils.meowOrExit({
|
|
10109
10213
|
argv,
|
|
10110
|
-
config: config$
|
|
10214
|
+
config: config$d,
|
|
10111
10215
|
importMeta,
|
|
10112
10216
|
parentName
|
|
10113
10217
|
});
|
|
@@ -10165,7 +10269,7 @@ async function run$D(argv, importMeta, {
|
|
|
10165
10269
|
verbose = false;
|
|
10166
10270
|
}
|
|
10167
10271
|
if (verbose) {
|
|
10168
|
-
logger.logger.group('- ', parentName, config$
|
|
10272
|
+
logger.logger.group('- ', parentName, config$d.commandName, ':');
|
|
10169
10273
|
logger.logger.group('- flags:', cli.flags);
|
|
10170
10274
|
logger.logger.groupEnd();
|
|
10171
10275
|
logger.logger.log('- target:', cwd);
|
|
@@ -10201,7 +10305,7 @@ async function run$D(argv, importMeta, {
|
|
|
10201
10305
|
});
|
|
10202
10306
|
}
|
|
10203
10307
|
|
|
10204
|
-
const config$
|
|
10308
|
+
const config$c = {
|
|
10205
10309
|
commandName: 'gradle',
|
|
10206
10310
|
description: '[beta] Generate a Socket facts file (or `pom.xml` with --pom) for a Gradle/Java/Kotlin/etc project',
|
|
10207
10311
|
hidden: false,
|
|
@@ -10277,16 +10381,16 @@ const config$b = {
|
|
|
10277
10381
|
`
|
|
10278
10382
|
};
|
|
10279
10383
|
const cmdManifestGradle = {
|
|
10280
|
-
description: config$
|
|
10281
|
-
hidden: config$
|
|
10282
|
-
run: run$
|
|
10384
|
+
description: config$c.description,
|
|
10385
|
+
hidden: config$c.hidden,
|
|
10386
|
+
run: run$D
|
|
10283
10387
|
};
|
|
10284
|
-
async function run$
|
|
10388
|
+
async function run$D(argv, importMeta, {
|
|
10285
10389
|
parentName
|
|
10286
10390
|
}) {
|
|
10287
10391
|
const cli = utils.meowOrExit({
|
|
10288
10392
|
argv,
|
|
10289
|
-
config: config$
|
|
10393
|
+
config: config$c,
|
|
10290
10394
|
importMeta,
|
|
10291
10395
|
parentName
|
|
10292
10396
|
});
|
|
@@ -10390,7 +10494,7 @@ async function run$C(argv, importMeta, {
|
|
|
10390
10494
|
logger.logger.warn('The `--include-configs`, `--exclude-configs`, and `--ignore-unresolved` options only apply when generating Socket facts (not with `--pom`); ignoring them.');
|
|
10391
10495
|
}
|
|
10392
10496
|
if (verbose) {
|
|
10393
|
-
logger.logger.group('- ', parentName, config$
|
|
10497
|
+
logger.logger.group('- ', parentName, config$c.commandName, ':');
|
|
10394
10498
|
logger.logger.group('- flags:', cli.flags);
|
|
10395
10499
|
logger.logger.groupEnd();
|
|
10396
10500
|
logger.logger.log('- input:', cli.input);
|
|
@@ -10420,7 +10524,7 @@ async function run$C(argv, importMeta, {
|
|
|
10420
10524
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
10421
10525
|
return;
|
|
10422
10526
|
}
|
|
10423
|
-
const parsedGradleOpts = String(gradleOpts || '')
|
|
10527
|
+
const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''));
|
|
10424
10528
|
if (facts) {
|
|
10425
10529
|
await convertGradleToFacts({
|
|
10426
10530
|
bin: String(bin),
|
|
@@ -10446,7 +10550,7 @@ async function run$C(argv, importMeta, {
|
|
|
10446
10550
|
// sense for the help panels to note the requested language, rather than
|
|
10447
10551
|
// `socket manifest kotlin` to print help screens with `gradle` as the
|
|
10448
10552
|
// command. Room for improvement.
|
|
10449
|
-
const config$
|
|
10553
|
+
const config$b = {
|
|
10450
10554
|
commandName: 'kotlin',
|
|
10451
10555
|
description: '[beta] Generate a Socket facts file (or `pom.xml` with --pom) for a Kotlin project',
|
|
10452
10556
|
hidden: false,
|
|
@@ -10522,16 +10626,16 @@ const config$a = {
|
|
|
10522
10626
|
`
|
|
10523
10627
|
};
|
|
10524
10628
|
const cmdManifestKotlin = {
|
|
10525
|
-
description: config$
|
|
10526
|
-
hidden: config$
|
|
10527
|
-
run: run$
|
|
10629
|
+
description: config$b.description,
|
|
10630
|
+
hidden: config$b.hidden,
|
|
10631
|
+
run: run$C
|
|
10528
10632
|
};
|
|
10529
|
-
async function run$
|
|
10633
|
+
async function run$C(argv, importMeta, {
|
|
10530
10634
|
parentName
|
|
10531
10635
|
}) {
|
|
10532
10636
|
const cli = utils.meowOrExit({
|
|
10533
10637
|
argv,
|
|
10534
|
-
config: config$
|
|
10638
|
+
config: config$b,
|
|
10535
10639
|
importMeta,
|
|
10536
10640
|
parentName
|
|
10537
10641
|
});
|
|
@@ -10633,7 +10737,7 @@ async function run$B(argv, importMeta, {
|
|
|
10633
10737
|
logger.logger.warn('The `--include-configs`, `--exclude-configs`, and `--ignore-unresolved` options only apply when generating Socket facts (not with `--pom`); ignoring them.');
|
|
10634
10738
|
}
|
|
10635
10739
|
if (verbose) {
|
|
10636
|
-
logger.logger.group('- ', parentName, config$
|
|
10740
|
+
logger.logger.group('- ', parentName, config$b.commandName, ':');
|
|
10637
10741
|
logger.logger.group('- flags:', cli.flags);
|
|
10638
10742
|
logger.logger.groupEnd();
|
|
10639
10743
|
logger.logger.log('- input:', cli.input);
|
|
@@ -10663,7 +10767,7 @@ async function run$B(argv, importMeta, {
|
|
|
10663
10767
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
10664
10768
|
return;
|
|
10665
10769
|
}
|
|
10666
|
-
const parsedGradleOpts = String(gradleOpts || '')
|
|
10770
|
+
const parsedGradleOpts = parseBuildToolOpts(String(gradleOpts || ''));
|
|
10667
10771
|
if (facts) {
|
|
10668
10772
|
await convertGradleToFacts({
|
|
10669
10773
|
bin: String(bin),
|
|
@@ -10684,6 +10788,189 @@ async function run$B(argv, importMeta, {
|
|
|
10684
10788
|
});
|
|
10685
10789
|
}
|
|
10686
10790
|
|
|
10791
|
+
const config$a = {
|
|
10792
|
+
commandName: 'maven',
|
|
10793
|
+
description: '[beta] Generate a Socket facts file from a Maven `pom.xml` project',
|
|
10794
|
+
hidden: false,
|
|
10795
|
+
flags: {
|
|
10796
|
+
...flags.commonFlags,
|
|
10797
|
+
bin: {
|
|
10798
|
+
type: 'string',
|
|
10799
|
+
description: 'Location of the maven binary to use, default: mvn on PATH'
|
|
10800
|
+
},
|
|
10801
|
+
includeConfigs: {
|
|
10802
|
+
type: 'string',
|
|
10803
|
+
description: 'Comma-separated glob patterns matched against Maven dependency scopes (case-sensitive, `*` and `?` wildcards). Only scopes matching at least one pattern are resolved. e.g. `compile,runtime`. Default: every scope'
|
|
10804
|
+
},
|
|
10805
|
+
excludeConfigs: {
|
|
10806
|
+
type: 'string',
|
|
10807
|
+
description: 'Comma-separated glob patterns; Maven scopes matching any pattern are skipped (applied after --include-configs)'
|
|
10808
|
+
},
|
|
10809
|
+
ignoreUnresolved: {
|
|
10810
|
+
type: 'boolean',
|
|
10811
|
+
description: 'Warn on unresolved dependencies instead of failing the run (unresolved deps are not emitted to the facts file)'
|
|
10812
|
+
},
|
|
10813
|
+
mavenOpts: {
|
|
10814
|
+
type: 'string',
|
|
10815
|
+
description: 'Additional options to pass on to maven, e.g. `-P <profile> -s <settings.xml>`'
|
|
10816
|
+
},
|
|
10817
|
+
verbose: {
|
|
10818
|
+
type: 'boolean',
|
|
10819
|
+
description: 'Print debug messages'
|
|
10820
|
+
}
|
|
10821
|
+
},
|
|
10822
|
+
help: (command, config) => `
|
|
10823
|
+
Usage
|
|
10824
|
+
$ ${command} [options] [CWD=.]
|
|
10825
|
+
|
|
10826
|
+
Options
|
|
10827
|
+
${utils.getFlagListOutput(config.flags)}
|
|
10828
|
+
|
|
10829
|
+
Emits a single \`.socket.facts.json\` describing the resolved dependency
|
|
10830
|
+
graph of your Maven project, using maven (\`mvn\` on PATH by default). It
|
|
10831
|
+
reads dependency metadata only and never downloads artifacts; an unresolved
|
|
10832
|
+
dependency is a fatal error. You can pass --include-configs /
|
|
10833
|
+
--exclude-configs (comma-separated glob patterns) to control which Maven
|
|
10834
|
+
scopes are resolved (e.g. --include-configs=\`compile,runtime\`), and
|
|
10835
|
+
--ignore-unresolved to warn on unresolved dependencies instead of failing.
|
|
10836
|
+
|
|
10837
|
+
You can specify --bin to override the path to the \`mvn\` binary to invoke
|
|
10838
|
+
(e.g. a project \`./mvnw\` wrapper), and --maven-opts to pass extra options
|
|
10839
|
+
through to maven (e.g. \`-P <profile> -s <settings.xml>\`).
|
|
10840
|
+
|
|
10841
|
+
Support is beta. Please report issues or give us feedback on what's missing.
|
|
10842
|
+
|
|
10843
|
+
Examples
|
|
10844
|
+
|
|
10845
|
+
$ ${command} .
|
|
10846
|
+
$ ${command} --bin=./mvnw .
|
|
10847
|
+
$ ${command} --maven-opts="-P release" .
|
|
10848
|
+
`
|
|
10849
|
+
};
|
|
10850
|
+
const cmdManifestMaven = {
|
|
10851
|
+
description: config$a.description,
|
|
10852
|
+
hidden: config$a.hidden,
|
|
10853
|
+
run: run$B
|
|
10854
|
+
};
|
|
10855
|
+
async function run$B(argv, importMeta, {
|
|
10856
|
+
parentName
|
|
10857
|
+
}) {
|
|
10858
|
+
const cli = utils.meowOrExit({
|
|
10859
|
+
argv,
|
|
10860
|
+
config: config$a,
|
|
10861
|
+
importMeta,
|
|
10862
|
+
parentName
|
|
10863
|
+
});
|
|
10864
|
+
const {
|
|
10865
|
+
json = false,
|
|
10866
|
+
markdown = false
|
|
10867
|
+
} = cli.flags;
|
|
10868
|
+
const dryRun = !!cli.flags['dryRun'];
|
|
10869
|
+
|
|
10870
|
+
// TODO: Implement json/md further.
|
|
10871
|
+
const outputKind = utils.getOutputKind(json, markdown);
|
|
10872
|
+
let [cwd = '.'] = cli.input;
|
|
10873
|
+
// Note: path.resolve vs .join:
|
|
10874
|
+
// If given path is absolute then cwd should not affect it.
|
|
10875
|
+
cwd = path.resolve(process.cwd(), cwd);
|
|
10876
|
+
const sockJson = utils.readOrDefaultSocketJson(cwd);
|
|
10877
|
+
require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} maven`, sockJson?.defaults?.manifest?.maven);
|
|
10878
|
+
let {
|
|
10879
|
+
bin,
|
|
10880
|
+
excludeConfigs,
|
|
10881
|
+
ignoreUnresolved,
|
|
10882
|
+
includeConfigs,
|
|
10883
|
+
mavenOpts,
|
|
10884
|
+
verbose
|
|
10885
|
+
} = cli.flags;
|
|
10886
|
+
|
|
10887
|
+
// Set defaults for any flag/arg that is not given. Check socket.json first.
|
|
10888
|
+
if (!bin) {
|
|
10889
|
+
if (sockJson.defaults?.manifest?.maven?.bin) {
|
|
10890
|
+
bin = sockJson.defaults?.manifest?.maven?.bin;
|
|
10891
|
+
logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
|
|
10892
|
+
} else {
|
|
10893
|
+
bin = 'mvn';
|
|
10894
|
+
}
|
|
10895
|
+
}
|
|
10896
|
+
if (!mavenOpts) {
|
|
10897
|
+
if (sockJson.defaults?.manifest?.maven?.mavenOpts) {
|
|
10898
|
+
mavenOpts = sockJson.defaults?.manifest?.maven?.mavenOpts;
|
|
10899
|
+
logger.logger.info(`Using default --maven-opts from ${constants.SOCKET_JSON}:`, mavenOpts);
|
|
10900
|
+
} else {
|
|
10901
|
+
mavenOpts = '';
|
|
10902
|
+
}
|
|
10903
|
+
}
|
|
10904
|
+
if (includeConfigs === undefined) {
|
|
10905
|
+
if (sockJson.defaults?.manifest?.maven?.includeConfigs !== undefined) {
|
|
10906
|
+
includeConfigs = sockJson.defaults?.manifest?.maven?.includeConfigs;
|
|
10907
|
+
logger.logger.info(`Using default --include-configs from ${constants.SOCKET_JSON}:`, includeConfigs);
|
|
10908
|
+
} else {
|
|
10909
|
+
includeConfigs = '';
|
|
10910
|
+
}
|
|
10911
|
+
}
|
|
10912
|
+
if (excludeConfigs === undefined) {
|
|
10913
|
+
if (sockJson.defaults?.manifest?.maven?.excludeConfigs !== undefined) {
|
|
10914
|
+
excludeConfigs = sockJson.defaults?.manifest?.maven?.excludeConfigs;
|
|
10915
|
+
logger.logger.info(`Using default --exclude-configs from ${constants.SOCKET_JSON}:`, excludeConfigs);
|
|
10916
|
+
} else {
|
|
10917
|
+
excludeConfigs = '';
|
|
10918
|
+
}
|
|
10919
|
+
}
|
|
10920
|
+
if (ignoreUnresolved === undefined) {
|
|
10921
|
+
if (sockJson.defaults?.manifest?.maven?.ignoreUnresolved !== undefined) {
|
|
10922
|
+
ignoreUnresolved = sockJson.defaults?.manifest?.maven?.ignoreUnresolved;
|
|
10923
|
+
logger.logger.info(`Using default --ignore-unresolved from ${constants.SOCKET_JSON}:`, ignoreUnresolved);
|
|
10924
|
+
} else {
|
|
10925
|
+
ignoreUnresolved = false;
|
|
10926
|
+
}
|
|
10927
|
+
}
|
|
10928
|
+
if (verbose === undefined) {
|
|
10929
|
+
if (sockJson.defaults?.manifest?.maven?.verbose !== undefined) {
|
|
10930
|
+
verbose = sockJson.defaults?.manifest?.maven?.verbose;
|
|
10931
|
+
logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
|
|
10932
|
+
} else {
|
|
10933
|
+
verbose = false;
|
|
10934
|
+
}
|
|
10935
|
+
}
|
|
10936
|
+
if (verbose) {
|
|
10937
|
+
logger.logger.group('- ', parentName, config$a.commandName, ':');
|
|
10938
|
+
logger.logger.group('- flags:', cli.flags);
|
|
10939
|
+
logger.logger.groupEnd();
|
|
10940
|
+
logger.logger.log('- input:', cli.input);
|
|
10941
|
+
logger.logger.groupEnd();
|
|
10942
|
+
}
|
|
10943
|
+
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
10944
|
+
nook: true,
|
|
10945
|
+
test: cli.input.length <= 1,
|
|
10946
|
+
message: 'Can only accept one DIR (make sure to escape spaces!)',
|
|
10947
|
+
fail: 'received ' + cli.input.length
|
|
10948
|
+
});
|
|
10949
|
+
if (!wasValidInput) {
|
|
10950
|
+
return;
|
|
10951
|
+
}
|
|
10952
|
+
if (verbose) {
|
|
10953
|
+
logger.logger.group();
|
|
10954
|
+
logger.logger.info('- cwd:', cwd);
|
|
10955
|
+
logger.logger.info('- maven bin:', bin);
|
|
10956
|
+
logger.logger.groupEnd();
|
|
10957
|
+
}
|
|
10958
|
+
if (dryRun) {
|
|
10959
|
+
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
10960
|
+
return;
|
|
10961
|
+
}
|
|
10962
|
+
const parsedMavenOpts = parseBuildToolOpts(String(mavenOpts || ''));
|
|
10963
|
+
await convertMavenToFacts({
|
|
10964
|
+
bin: String(bin),
|
|
10965
|
+
cwd,
|
|
10966
|
+
excludeConfigs: String(excludeConfigs || ''),
|
|
10967
|
+
ignoreUnresolved: Boolean(ignoreUnresolved),
|
|
10968
|
+
includeConfigs: String(includeConfigs || ''),
|
|
10969
|
+
mavenOpts: parsedMavenOpts,
|
|
10970
|
+
verbose: Boolean(verbose)
|
|
10971
|
+
});
|
|
10972
|
+
}
|
|
10973
|
+
|
|
10687
10974
|
const config$9 = {
|
|
10688
10975
|
commandName: 'scala',
|
|
10689
10976
|
description: '[beta] Generate a Socket facts file (or `pom.xml` with --pom) from a Scala `build.sbt` project',
|
|
@@ -10948,7 +11235,7 @@ async function run$A(argv, importMeta, {
|
|
|
10948
11235
|
logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
|
|
10949
11236
|
return;
|
|
10950
11237
|
}
|
|
10951
|
-
const parsedSbtOpts = String(sbtOpts || '')
|
|
11238
|
+
const parsedSbtOpts = parseBuildToolOpts(String(sbtOpts || ''));
|
|
10952
11239
|
if (facts) {
|
|
10953
11240
|
await convertSbtToFacts({
|
|
10954
11241
|
bin: String(bin),
|
|
@@ -11021,6 +11308,10 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
11021
11308
|
name: 'Kotlin (gradle)'.padEnd(30, ' '),
|
|
11022
11309
|
value: 'gradle',
|
|
11023
11310
|
description: 'Generate a Socket facts file or pom.xml (for Kotlin) through gradle'
|
|
11311
|
+
}, {
|
|
11312
|
+
name: 'Maven'.padEnd(30, ' '),
|
|
11313
|
+
value: 'maven',
|
|
11314
|
+
description: 'Generate a Socket facts file through maven'
|
|
11024
11315
|
}, {
|
|
11025
11316
|
name: 'Scala (gradle)'.padEnd(30, ' '),
|
|
11026
11317
|
value: 'gradle',
|
|
@@ -11088,6 +11379,14 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
|
|
|
11088
11379
|
result = await setupGradle(sockJson.defaults.manifest.gradle);
|
|
11089
11380
|
break;
|
|
11090
11381
|
}
|
|
11382
|
+
case 'maven':
|
|
11383
|
+
{
|
|
11384
|
+
if (!sockJson.defaults.manifest.maven) {
|
|
11385
|
+
sockJson.defaults.manifest.maven = {};
|
|
11386
|
+
}
|
|
11387
|
+
result = await setupMaven(sockJson.defaults.manifest.maven);
|
|
11388
|
+
break;
|
|
11389
|
+
}
|
|
11091
11390
|
case 'sbt':
|
|
11092
11391
|
{
|
|
11093
11392
|
if (!sockJson.defaults.manifest.sbt) {
|
|
@@ -11229,6 +11528,44 @@ async function setupGradle(config) {
|
|
|
11229
11528
|
}
|
|
11230
11529
|
return notCanceled$1();
|
|
11231
11530
|
}
|
|
11531
|
+
async function setupMaven(config) {
|
|
11532
|
+
const bin = await askForBin(config.bin || 'mvn');
|
|
11533
|
+
if (bin === undefined) {
|
|
11534
|
+
return canceledByUser$1();
|
|
11535
|
+
} else if (bin) {
|
|
11536
|
+
config.bin = bin;
|
|
11537
|
+
} else {
|
|
11538
|
+
delete config.bin;
|
|
11539
|
+
}
|
|
11540
|
+
const opts = await prompts.input({
|
|
11541
|
+
message: '(--maven-opts) Enter maven options to pass through',
|
|
11542
|
+
default: config.mavenOpts || '',
|
|
11543
|
+
required: false
|
|
11544
|
+
});
|
|
11545
|
+
if (opts === undefined) {
|
|
11546
|
+
return canceledByUser$1();
|
|
11547
|
+
} else if (opts) {
|
|
11548
|
+
config.mavenOpts = opts;
|
|
11549
|
+
} else {
|
|
11550
|
+
delete config.mavenOpts;
|
|
11551
|
+
}
|
|
11552
|
+
|
|
11553
|
+
// Maven only generates Socket facts (no pom path), so always ask the
|
|
11554
|
+
// facts-only options.
|
|
11555
|
+
const factsOptions = await setupFactsOptions(config);
|
|
11556
|
+
if (!factsOptions.ok || factsOptions.data.canceled) {
|
|
11557
|
+
return factsOptions;
|
|
11558
|
+
}
|
|
11559
|
+
const verbose = await askForVerboseFlag(config.verbose);
|
|
11560
|
+
if (verbose === undefined) {
|
|
11561
|
+
return canceledByUser$1();
|
|
11562
|
+
} else if (verbose === 'yes' || verbose === 'no') {
|
|
11563
|
+
config.verbose = verbose === 'yes';
|
|
11564
|
+
} else {
|
|
11565
|
+
delete config.verbose;
|
|
11566
|
+
}
|
|
11567
|
+
return notCanceled$1();
|
|
11568
|
+
}
|
|
11232
11569
|
async function setupSbt(config) {
|
|
11233
11570
|
const bin = await askForBin(config.bin || 'sbt');
|
|
11234
11571
|
if (bin === undefined) {
|
|
@@ -11584,6 +11921,7 @@ async function run$y(argv, importMeta, {
|
|
|
11584
11921
|
conda: cmdManifestConda,
|
|
11585
11922
|
gradle: cmdManifestGradle,
|
|
11586
11923
|
kotlin: cmdManifestKotlin,
|
|
11924
|
+
maven: cmdManifestMaven,
|
|
11587
11925
|
scala: cmdManifestScala,
|
|
11588
11926
|
setup: cmdManifestSetup
|
|
11589
11927
|
}
|
|
@@ -15668,12 +16006,12 @@ const reachabilityFlags = {
|
|
|
15668
16006
|
reachContinueOnAnalysisErrors: {
|
|
15669
16007
|
type: 'boolean',
|
|
15670
16008
|
default: false,
|
|
15671
|
-
description: 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed
|
|
16009
|
+
description: 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed reachability results. By default, the CLI halts on analysis errors.'
|
|
15672
16010
|
},
|
|
15673
16011
|
reachContinueOnInstallErrors: {
|
|
15674
16012
|
type: 'boolean',
|
|
15675
16013
|
default: false,
|
|
15676
|
-
description: 'Continue reachability analysis when package installation fails, falling back to precomputed
|
|
16014
|
+
description: 'Continue reachability analysis when package installation fails, falling back to precomputed reachability results. By default, the CLI halts on installation errors.'
|
|
15677
16015
|
},
|
|
15678
16016
|
reachContinueOnMissingLockFiles: {
|
|
15679
16017
|
type: 'boolean',
|
|
@@ -15736,7 +16074,7 @@ const reachabilityFlags = {
|
|
|
15736
16074
|
reachRetainFactsFile: {
|
|
15737
16075
|
type: 'boolean',
|
|
15738
16076
|
default: false,
|
|
15739
|
-
description: 'Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. IMPORTANT: you must delete this file before running a fresh
|
|
16077
|
+
description: 'Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. IMPORTANT: you must delete this file before running a fresh full application reachability scan. A stale `.socket.facts.json` left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.'
|
|
15740
16078
|
},
|
|
15741
16079
|
reachSkipCache: {
|
|
15742
16080
|
type: 'boolean',
|
|
@@ -15753,7 +16091,7 @@ const excludePathsFlag = {
|
|
|
15753
16091
|
excludePaths: {
|
|
15754
16092
|
type: 'string',
|
|
15755
16093
|
isMultiple: true,
|
|
15756
|
-
description: 'List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled)
|
|
16094
|
+
description: 'List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) full application reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (`--cwd` if set), not the reachability target: `tests` matches only `<cwd>/tests`; use `**/tests` to match at any depth. Negation patterns (`!path`) are not supported. Accepts a comma-separated value or multiple flags.'
|
|
15757
16095
|
}
|
|
15758
16096
|
};
|
|
15759
16097
|
|
|
@@ -15873,7 +16211,7 @@ const generalFlags$1 = {
|
|
|
15873
16211
|
reach: {
|
|
15874
16212
|
type: 'boolean',
|
|
15875
16213
|
default: false,
|
|
15876
|
-
description: 'Run
|
|
16214
|
+
description: 'Run full application reachability analysis'
|
|
15877
16215
|
},
|
|
15878
16216
|
readOnly: {
|
|
15879
16217
|
type: 'boolean',
|
|
@@ -18170,9 +18508,9 @@ async function handleScanReach({
|
|
|
18170
18508
|
});
|
|
18171
18509
|
spinner.stop();
|
|
18172
18510
|
|
|
18173
|
-
// Standalone reachability has no full scan to bind to, but the
|
|
18174
|
-
// reachability scan row still needs to transition to its DONE
|
|
18175
|
-
// state — otherwise it sits at the post-Coana intermediate state forever
|
|
18511
|
+
// Standalone reachability has no full scan to bind to, but the full
|
|
18512
|
+
// application reachability scan row still needs to transition to its DONE
|
|
18513
|
+
// terminal state — otherwise it sits at the post-Coana intermediate state forever
|
|
18176
18514
|
// and looks indistinguishable from a stuck run. Pass `null` as the full
|
|
18177
18515
|
// scan id; the endpoint accepts it for this flow. Best-effort: never
|
|
18178
18516
|
// block the user-visible output on this.
|
|
@@ -18180,7 +18518,7 @@ async function handleScanReach({
|
|
|
18180
18518
|
if (tier1Id) {
|
|
18181
18519
|
const finalizeResult = await finalizeTier1Scan(tier1Id, null);
|
|
18182
18520
|
if (!finalizeResult.ok) {
|
|
18183
|
-
logger.logger.warn(`Failed to finalize
|
|
18521
|
+
logger.logger.warn(`Failed to finalize full application reachability scan: ${finalizeResult.message}${finalizeResult.cause ? ` — ${finalizeResult.cause}` : ''}`);
|
|
18184
18522
|
}
|
|
18185
18523
|
}
|
|
18186
18524
|
await outputScanReach(result, {
|
|
@@ -18191,7 +18529,7 @@ async function handleScanReach({
|
|
|
18191
18529
|
}
|
|
18192
18530
|
|
|
18193
18531
|
const CMD_NAME$4 = 'reach';
|
|
18194
|
-
const description$6 = 'Compute
|
|
18532
|
+
const description$6 = 'Compute full application reachability';
|
|
18195
18533
|
const hidden$4 = true;
|
|
18196
18534
|
const generalFlags = {
|
|
18197
18535
|
...flags.commonFlags,
|
|
@@ -20329,5 +20667,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
20329
20667
|
// eslint-disable-next-line n/no-process-exit
|
|
20330
20668
|
process.exit(1);
|
|
20331
20669
|
});
|
|
20332
|
-
//# debugId=
|
|
20670
|
+
//# debugId=6c799c7a-7beb-4a6d-a648-0638ba473165
|
|
20333
20671
|
//# sourceMappingURL=cli.js.map
|