@socketsecurity/cli 1.1.102 → 1.1.151
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 +273 -3
- package/README.md +9 -0
- package/bin/cli.js +33 -1
- package/dist/cli.js +6598 -1912
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +8 -10
- package/dist/constants.js.map +1 -1
- package/dist/init.gradle +73 -0
- package/dist/manifest-scripts/maven-extension/coana-maven-extension.jar +0 -0
- package/dist/manifest-scripts/socket-facts.init.gradle +581 -0
- package/dist/manifest-scripts/socket-facts.plugin.scala +544 -0
- package/dist/shadow-npm-bin2.js +6 -6
- package/dist/shadow-npm-bin2.js.map +1 -1
- package/dist/shadow-npm-inject.js +10 -10
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/shadow-pnpm-bin2.js +13 -13
- package/dist/shadow-pnpm-bin2.js.map +1 -1
- package/dist/shadow-yarn-bin.js +3 -3
- package/dist/shadow-yarn-bin.js.map +1 -1
- package/dist/socket-completion.bash +0 -0
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -1
- package/dist/types/commands/ci/handle-ci.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-set.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/types.d.mts +1 -0
- package/dist/types/commands/fix/types.d.mts.map +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 +44 -0
- package/dist/types/commands/manifest/bazel/bazel-pypi-discovery.d.mts.map +1 -0
- package/dist/types/commands/manifest/bazel/bazel-pypi-parser.d.mts +46 -0
- package/dist/types/commands/manifest/bazel/bazel-pypi-parser.d.mts.map +1 -0
- package/dist/types/commands/manifest/bazel/bazel-query-runner.d.mts +66 -8
- 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 +69 -29
- 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 +26 -0
- 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 +110 -7
- package/dist/types/commands/manifest/bazel/extract_bazel_to_maven.d.mts.map +1 -1
- package/dist/types/commands/manifest/bazel/extract_bazel_to_pypi.d.mts +20 -0
- package/dist/types/commands/manifest/bazel/extract_bazel_to_pypi.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-auto.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-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/convert-gradle-to-facts.d.mts +9 -1
- package/dist/types/commands/manifest/convert-gradle-to-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/convert-sbt-to-facts.d.mts +19 -0
- package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts.map +1 -0
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -1
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +1 -1
- 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 +12 -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/run-manifest-facts.d.mts +24 -0
- package/dist/types/commands/manifest/run-manifest-facts.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/assemble.d.mts +16 -0
- package/dist/types/commands/manifest/scripts/assemble.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/build-tool.d.mts +3 -0
- package/dist/types/commands/manifest/scripts/build-tool.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/facts.d.mts +46 -0
- package/dist/types/commands/manifest/scripts/facts.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/records.d.mts +66 -0
- package/dist/types/commands/manifest/scripts/records.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/resolution-report-gradle.d.mts +10 -0
- package/dist/types/commands/manifest/scripts/resolution-report-gradle.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/resolution-report-ivy.d.mts +7 -0
- package/dist/types/commands/manifest/scripts/resolution-report-ivy.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/resolution-report-maven.d.mts +8 -0
- package/dist/types/commands/manifest/scripts/resolution-report-maven.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/resolution-report-render.d.mts +43 -0
- package/dist/types/commands/manifest/scripts/resolution-report-render.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/resolution-report.d.mts +18 -0
- package/dist/types/commands/manifest/scripts/resolution-report.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/run.d.mts +43 -0
- package/dist/types/commands/manifest/scripts/run.d.mts.map +1 -0
- package/dist/types/commands/manifest/scripts/sidecar.d.mts +27 -0
- package/dist/types/commands/manifest/scripts/sidecar.d.mts.map +1 -0
- package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -1
- package/dist/types/commands/organization/fetch-organization-list.d.mts +2 -2
- package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -1
- package/dist/types/commands/package/output-purls-shallow-score.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-create-repo.d.mts +2 -2
- package/dist/types/commands/repository/fetch-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-delete-repo.d.mts +2 -2
- package/dist/types/commands/repository/fetch-delete-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-list-all-repos.d.mts +2 -2
- package/dist/types/commands/repository/fetch-list-all-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-list-repos.d.mts +2 -2
- package/dist/types/commands/repository/fetch-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-update-repo.d.mts +2 -2
- package/dist/types/commands/repository/fetch-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/fetch-view-repo.d.mts +2 -2
- package/dist/types/commands/repository/fetch-view-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/output-create-repo.d.mts +2 -2
- package/dist/types/commands/repository/output-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/output-delete-repo.d.mts +2 -2
- package/dist/types/commands/repository/output-delete-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/output-list-repos.d.mts +2 -2
- package/dist/types/commands/repository/output-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repository/output-update-repo.d.mts +2 -2
- package/dist/types/commands/repository/output-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repository/output-view-repo.d.mts +2 -2
- package/dist/types/commands/repository/output-view-repo.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/create-scan-from-github.d.mts.map +1 -1
- package/dist/types/commands/scan/exclude-paths.d.mts +2 -2
- package/dist/types/commands/scan/exclude-paths.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +2 -2
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +2 -2
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +2 -2
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +2 -2
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -0
- package/dist/types/commands/scan/fetch-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +2 -1
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts +9 -5
- 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-create-new-scan.d.mts +2 -2
- package/dist/types/commands/scan/output-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-delete-scan.d.mts +2 -2
- package/dist/types/commands/scan/output-delete-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +2 -2
- package/dist/types/commands/scan/output-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-metadata.d.mts +2 -2
- package/dist/types/commands/scan/output-scan-metadata.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 +10 -3
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/commands/scan/reachability-flags.d.mts.map +1 -1
- package/dist/types/commands/scan/reachability-units.d.mts +18 -0
- package/dist/types/commands/scan/reachability-units.d.mts.map +1 -0
- package/dist/types/commands/scan/stream-scan.d.mts +3 -1
- package/dist/types/commands/scan/stream-scan.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/api.d.mts +53 -7
- package/dist/types/utils/api.d.mts.map +1 -1
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/dlx.d.mts +4 -3
- package/dist/types/utils/dlx.d.mts.map +1 -1
- package/dist/types/utils/ecosystem.d.mts +8 -1
- package/dist/types/utils/ecosystem.d.mts.map +1 -1
- package/dist/types/utils/fs.d.mts +1 -0
- package/dist/types/utils/fs.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts +5 -4
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +1 -1
- package/dist/types/utils/path-resolve.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts +6 -0
- package/dist/types/utils/sdk.d.mts.map +1 -1
- package/dist/types/utils/self-update.d.mts +3 -0
- package/dist/types/utils/self-update.d.mts.map +1 -0
- package/dist/types/utils/socket-json.d.mts +17 -0
- package/dist/types/utils/socket-json.d.mts.map +1 -1
- package/dist/types/utils/socket-package-alert.d.mts.map +1 -1
- package/dist/utils.js +614 -283
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +50578 -27781
- package/external/blessed/lib/tput.js +5 -5
- package/package.json +60 -131
- package/requirements.json +1 -1
- package/shadow-bin/npm +0 -0
- package/shadow-bin/npx +0 -0
- package/shadow-bin/pnpm +0 -0
- package/shadow-bin/yarn +0 -0
- package/dist/socket-facts.init.gradle +0 -353
- 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
- package/external/blessed/usr/fonts/AUTHORS +0 -1
- package/external/blessed/usr/fonts/LICENSE +0 -94
- package/external/blessed/usr/fonts/README +0 -340
- package/external/blessed/usr/fonts/ter-u14b.json +0 -17826
- package/external/blessed/usr/fonts/ter-u14n.json +0 -17826
|
@@ -886,7 +886,7 @@ Tput.prototype._compile = function(info, key, str) {
|
|
|
886
886
|
ch = ':';
|
|
887
887
|
break;
|
|
888
888
|
case '0':
|
|
889
|
-
ch = '\
|
|
889
|
+
ch = '\x80';
|
|
890
890
|
break;
|
|
891
891
|
case 'a':
|
|
892
892
|
ch = '\x07';
|
|
@@ -2096,10 +2096,10 @@ Tput.prototype.detectBrokenACS = function(info) {
|
|
|
2096
2096
|
&& process.env.TERMCAP
|
|
2097
2097
|
&& ~process.env.TERMCAP.indexOf('screen')
|
|
2098
2098
|
&& ~process.env.TERMCAP.indexOf('hhII00')) {
|
|
2099
|
-
if (~info.strings.enter_alt_charset_mode.indexOf('\
|
|
2100
|
-
|| ~info.strings.enter_alt_charset_mode.indexOf('\
|
|
2101
|
-
|| ~info.strings.set_attributes.indexOf('\
|
|
2102
|
-
|| ~info.strings.set_attributes.indexOf('\
|
|
2099
|
+
if (~info.strings.enter_alt_charset_mode.indexOf('\x0e')
|
|
2100
|
+
|| ~info.strings.enter_alt_charset_mode.indexOf('\x0f')
|
|
2101
|
+
|| ~info.strings.set_attributes.indexOf('\x0e')
|
|
2102
|
+
|| ~info.strings.set_attributes.indexOf('\x0f')) {
|
|
2103
2103
|
return true;
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.151",
|
|
4
4
|
"description": "CLI for Socket.dev",
|
|
5
5
|
"homepage": "https://github.com/SocketDev/socket-cli",
|
|
6
|
-
"license": "MIT
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/SocketDev/socket-cli.git"
|
|
@@ -32,72 +32,18 @@
|
|
|
32
32
|
"./requirements.json": "./requirements.json",
|
|
33
33
|
"./translations.json": "./translations.json"
|
|
34
34
|
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "pnpm build:dist",
|
|
37
|
-
"build:dist": "pnpm build:dist:src && pnpm build:dist:types",
|
|
38
|
-
"build:dist:src": "run-p -c clean:dist clean:external && dotenvx -q run -f .env.local -- rollup -c .config/rollup.dist.config.mjs",
|
|
39
|
-
"build:dist:types": "pnpm clean:dist:types && tsgo --project tsconfig.dts.json",
|
|
40
|
-
"build:sea": "node src/sea/build-sea.mts",
|
|
41
|
-
"build:sea:internal:bootstrap": "rollup -c .config/rollup.sea.config.mjs",
|
|
42
|
-
"check": "pnpm check:lint && pnpm check:tsc",
|
|
43
|
-
"check:lint": "dotenvx -q run -f .env.local -- eslint --report-unused-disable-directives .",
|
|
44
|
-
"check:tsc": "tsgo",
|
|
45
|
-
"check-ci": "pnpm check:lint",
|
|
46
|
-
"coverage": "run-s coverage:*",
|
|
47
|
-
"coverage:test": "run-s test:prepare test:unit:coverage",
|
|
48
|
-
"coverage:type": "dotenvx -q run -f .env.local -- type-coverage --detail",
|
|
49
|
-
"clean": "run-p -c --aggregate-output clean:*",
|
|
50
|
-
"clean:cache": "del-cli '**/.cache'",
|
|
51
|
-
"clean:dist": "del-cli 'dist'",
|
|
52
|
-
"clean:dist:types": "del-cli 'dist/types'",
|
|
53
|
-
"clean:external": "del-cli 'external'",
|
|
54
|
-
"clean:node_modules": "del-cli '**/node_modules'",
|
|
55
|
-
"fix": "pnpm lint:fix",
|
|
56
|
-
"knip:dependencies": "knip --dependencies",
|
|
57
|
-
"knip:exports": "knip --include exports,duplicates",
|
|
58
|
-
"lint": "dotenvx -q run -f .env.local -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json .",
|
|
59
|
-
"lint:dist:fix": "run-s -c lint:dist:fix:*",
|
|
60
|
-
"lint:dist:fix:oxlint": "dotenvx -q run -f .env.dist -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --silent --fix ./dist | dev-null",
|
|
61
|
-
"lint:dist:fix:biome": "dotenvx -q run -f .env.dist -- biome format --log-level=none --fix ./dist | dev-null",
|
|
62
|
-
"//lint:dist:fix:eslint": "dotenvx -q run -f .env.dist -- eslint --report-unused-disable-directives --quiet --fix ./dist | dev-null",
|
|
63
|
-
"lint:external:fix": "run-s -c lint:external:fix:*",
|
|
64
|
-
"lint:external:fix:oxlint": "dotenvx -q run -f .env.external -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --silent --fix ./external | dev-null",
|
|
65
|
-
"lint:external:fix:biome": "dotenvx -q run -f .env.external -- biome format --log-level=none --fix ./external | dev-null",
|
|
66
|
-
"//lint:external:fix:eslint": "dotenvx -q run -f .env.external -- eslint --report-unused-disable-directives --quiet --fix ./external | dev-null",
|
|
67
|
-
"lint:fix": "run-s -c lint:fix:*",
|
|
68
|
-
"lint:fix:oxlint": "dotenvx -q run -f .env.local -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --quiet --fix . | dev-null",
|
|
69
|
-
"lint:fix:biome": "dotenvx -q run -f .env.local -- biome format --log-level=none --fix . | dev-null",
|
|
70
|
-
"lint:fix:eslint": "dotenvx -q run -f .env.local -- eslint --report-unused-disable-directives --fix . | dev-null",
|
|
71
|
-
"lint-staged": "dotenvx -q run -f .env.local -- lint-staged",
|
|
72
|
-
"precommit": "dotenvx -q run -f .env.local -- lint-staged",
|
|
73
|
-
"prepare": "dotenvx -q run -f .env.local -- husky",
|
|
74
|
-
"bs": "dotenvx -q run -f .env.local -- pnpm build:dist:src; pnpm exec socket --",
|
|
75
|
-
"s": "dotenvx -q run -f .env.local -- pnpm exec socket --",
|
|
76
|
-
"e2e-tests": "dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
|
|
77
|
-
"test": "run-s check test:*",
|
|
78
|
-
"test:prepare": "dotenvx -q run -f .env.test -- pnpm build && del-cli 'test/**/node_modules'",
|
|
79
|
-
"test:unit": "dotenvx -q run -f .env.test -- vitest run",
|
|
80
|
-
"test:unit:update": "dotenvx -q run -f .env.test -- vitest run --update",
|
|
81
|
-
"test:unit:coverage": "dotenvx -q run -f .env.test -- vitest run --coverage",
|
|
82
|
-
"test-ci": "run-s test:*",
|
|
83
|
-
"testu": "dotenvx -q run -f .env.testu -- run-s test:prepare; pnpm test:unit:update --",
|
|
84
|
-
"testuf": "dotenvx -q run -f .env.testu -- pnpm test:unit:update --",
|
|
85
|
-
"update": "run-p --aggregate-output update:**",
|
|
86
|
-
"update:deps": "taze",
|
|
87
|
-
"update:socket": "pnpm update '@socketsecurity/*' '@socketregistry/*' --latest"
|
|
88
|
-
},
|
|
89
35
|
"dependencies": {
|
|
90
36
|
"@socketsecurity/socket-patch": "2.0.0"
|
|
91
37
|
},
|
|
92
38
|
"devDependencies": {
|
|
93
|
-
"@babel/core": "7.
|
|
39
|
+
"@babel/core": "7.29.6",
|
|
94
40
|
"@babel/plugin-proposal-export-default-from": "7.27.1",
|
|
95
41
|
"@babel/plugin-transform-export-namespace-from": "7.27.1",
|
|
96
42
|
"@babel/plugin-transform-runtime": "7.28.3",
|
|
97
43
|
"@babel/preset-typescript": "7.27.1",
|
|
98
44
|
"@babel/runtime": "7.28.4",
|
|
99
45
|
"@biomejs/biome": "2.2.4",
|
|
100
|
-
"@coana-tech/cli": "15.
|
|
46
|
+
"@coana-tech/cli": "15.9.9",
|
|
101
47
|
"@cyclonedx/cdxgen": "12.1.2",
|
|
102
48
|
"@dotenvx/dotenvx": "1.49.0",
|
|
103
49
|
"@eslint/compat": "1.3.2",
|
|
@@ -125,7 +71,7 @@
|
|
|
125
71
|
"@socketregistry/packageurl-js": "1.0.9",
|
|
126
72
|
"@socketsecurity/config": "3.0.1",
|
|
127
73
|
"@socketsecurity/registry": "1.1.17",
|
|
128
|
-
"@socketsecurity/sdk": "
|
|
74
|
+
"@socketsecurity/sdk": "4.0.3",
|
|
129
75
|
"@types/blessed": "0.1.25",
|
|
130
76
|
"@types/cmd-shim": "5.0.2",
|
|
131
77
|
"@types/js-yaml": "4.0.9",
|
|
@@ -174,8 +120,6 @@
|
|
|
174
120
|
"oxlint": "1.15.0",
|
|
175
121
|
"pony-cause": "2.1.11",
|
|
176
122
|
"postject": "1.0.0-alpha.6",
|
|
177
|
-
"registry-auth-token": "5.1.0",
|
|
178
|
-
"registry-url": "7.2.0",
|
|
179
123
|
"rollup": "4.50.1",
|
|
180
124
|
"semver": "7.7.2",
|
|
181
125
|
"synp": "1.9.14",
|
|
@@ -196,7 +140,6 @@
|
|
|
196
140
|
"node": ">=18.20.8",
|
|
197
141
|
"pnpm": ">=10.33.0"
|
|
198
142
|
},
|
|
199
|
-
"packageManager": "pnpm@10.33.0",
|
|
200
143
|
"files": [
|
|
201
144
|
"bin/**",
|
|
202
145
|
"dist/**",
|
|
@@ -214,74 +157,6 @@
|
|
|
214
157
|
"pnpm lint:fix:biome -- --no-errors-on-unmatched --files-ignore-unknown=true --colors=off"
|
|
215
158
|
]
|
|
216
159
|
},
|
|
217
|
-
"pnpm": {
|
|
218
|
-
"overrides": {
|
|
219
|
-
"@octokit/graphql": "$@octokit/graphql",
|
|
220
|
-
"@octokit/request-error": "$@octokit/request-error",
|
|
221
|
-
"@rollup/plugin-commonjs": "28.0.6",
|
|
222
|
-
"@socketsecurity/registry": "$@socketsecurity/registry",
|
|
223
|
-
"aggregate-error": "npm:@socketregistry/aggregate-error@^1.0.14",
|
|
224
|
-
"ansi-regex": "6.1.0",
|
|
225
|
-
"ansi-term": "0.0.2",
|
|
226
|
-
"blessed": "0.1.81",
|
|
227
|
-
"blessed-contrib": "4.11.0",
|
|
228
|
-
"brace-expansion": "2.0.2",
|
|
229
|
-
"bresenham": "0.0.3",
|
|
230
|
-
"drawille-blessed-contrib": "1.0.0",
|
|
231
|
-
"drawille-canvas-blessed-contrib": "0.1.3",
|
|
232
|
-
"es-define-property": "npm:@socketregistry/es-define-property@^1.0.7",
|
|
233
|
-
"es-set-tostringtag": "npm:@socketregistry/es-set-tostringtag@^1.0.9",
|
|
234
|
-
"function-bind": "npm:@socketregistry/function-bind@^1.0.7",
|
|
235
|
-
"globalthis": "npm:@socketregistry/globalthis@^1.0.7",
|
|
236
|
-
"gopd": "npm:@socketregistry/gopd@^1.0.7",
|
|
237
|
-
"graceful-fs": "4.2.11",
|
|
238
|
-
"has-property-descriptors": "npm:@socketregistry/has-property-descriptors@^1.0.7",
|
|
239
|
-
"has-proto": "npm:@socketregistry/has-proto@^1.0.7",
|
|
240
|
-
"has-symbols": "npm:@socketregistry/has-symbols@^1.0.7",
|
|
241
|
-
"has-tostringtag": "npm:@socketregistry/has-tostringtag@^1.0.7",
|
|
242
|
-
"hasown": "npm:@socketregistry/hasown@^1.0.7",
|
|
243
|
-
"indent-string": "npm:@socketregistry/indent-string@^1.0.13",
|
|
244
|
-
"is-core-module": "npm:@socketregistry/is-core-module@^1.0.10",
|
|
245
|
-
"isarray": "npm:@socketregistry/isarray@^1.0.7",
|
|
246
|
-
"lodash": "4.17.21",
|
|
247
|
-
"meow": "13.2.0",
|
|
248
|
-
"npm-package-arg": "$npm-package-arg",
|
|
249
|
-
"packageurl-js": "npm:@socketregistry/packageurl-js@^1.0.9",
|
|
250
|
-
"path-parse": "npm:@socketregistry/path-parse@^1.0.7",
|
|
251
|
-
"rollup": "4.50.1",
|
|
252
|
-
"safe-buffer": "npm:@socketregistry/safe-buffer@^1.0.8",
|
|
253
|
-
"safer-buffer": "npm:@socketregistry/safer-buffer@^1.0.9",
|
|
254
|
-
"semver": "$semver",
|
|
255
|
-
"set-function-length": "npm:@socketregistry/set-function-length@^1.0.9",
|
|
256
|
-
"shell-quote": "npm:shell-quote@^1.8.3",
|
|
257
|
-
"side-channel": "npm:@socketregistry/side-channel@^1.0.9",
|
|
258
|
-
"string_decoder": "0.10.31",
|
|
259
|
-
"tiny-colors": "$yoctocolors-cjs",
|
|
260
|
-
"tiny-updater": "3.5.3",
|
|
261
|
-
"typedarray": "npm:@socketregistry/typedarray@^1.0.7",
|
|
262
|
-
"undici": "6.21.3",
|
|
263
|
-
"vite": "7.1.5",
|
|
264
|
-
"xml2js": "0.6.2",
|
|
265
|
-
"yaml": "2.8.1",
|
|
266
|
-
"yargs-parser": "$yargs-parser"
|
|
267
|
-
},
|
|
268
|
-
"patchedDependencies": {
|
|
269
|
-
"graceful-fs@4.2.11": "patches/graceful-fs@4.2.11.patch",
|
|
270
|
-
"string_decoder@0.10.31": "patches/string_decoder@0.10.31.patch",
|
|
271
|
-
"meow@13.2.0": "patches/meow@13.2.0.patch",
|
|
272
|
-
"@rollup/plugin-commonjs@28.0.6": "patches/@rollup__plugin-commonjs@28.0.6.patch",
|
|
273
|
-
"ansi-term@0.0.2": "patches/ansi-term@0.0.2.patch",
|
|
274
|
-
"drawille-blessed-contrib@1.0.0": "patches/drawille-blessed-contrib@1.0.0.patch",
|
|
275
|
-
"drawille-canvas-blessed-contrib@0.1.3": "patches/drawille-canvas-blessed-contrib@0.1.3.patch",
|
|
276
|
-
"blessed@0.1.81": "patches/blessed@0.1.81.patch",
|
|
277
|
-
"blessed-contrib@4.11.0": "patches/blessed-contrib@4.11.0.patch",
|
|
278
|
-
"brace-expansion@2.0.2": "patches/brace-expansion@2.0.2.patch",
|
|
279
|
-
"bresenham@0.0.3": "patches/bresenham@0.0.3.patch",
|
|
280
|
-
"lodash@4.17.21": "patches/lodash@4.17.21.patch",
|
|
281
|
-
"rollup@4.50.1": "patches/rollup@4.50.1.patch",
|
|
282
|
-
"tiny-updater@3.5.3": "patches/tiny-updater@3.5.3.patch"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
160
|
"typeCoverage": {
|
|
286
161
|
"cache": true,
|
|
287
162
|
"atLeast": 95,
|
|
@@ -292,5 +167,59 @@
|
|
|
292
167
|
"ignore-type-assertion": true,
|
|
293
168
|
"ignore-files": "test/*",
|
|
294
169
|
"strict": true
|
|
170
|
+
},
|
|
171
|
+
"scripts": {
|
|
172
|
+
"build": "pnpm build:dist",
|
|
173
|
+
"build:dist": "pnpm build:dist:src && pnpm build:dist:types",
|
|
174
|
+
"build:dist:src": "run-p -c clean:dist clean:external && dotenvx -q run -f .env.local -- rollup -c .config/rollup.dist.config.mjs",
|
|
175
|
+
"build:dist:types": "pnpm clean:dist:types && tsgo --project tsconfig.dts.json",
|
|
176
|
+
"build:maven-extension": "bash src/commands/manifest/scripts/maven-extension/build-jar.sh",
|
|
177
|
+
"build:sea": "node src/sea/build-sea.mts",
|
|
178
|
+
"build:sea:internal:bootstrap": "rollup -c .config/rollup.sea.config.mjs",
|
|
179
|
+
"check": "pnpm check:lint && pnpm check:tsc",
|
|
180
|
+
"check:lint": "dotenvx -q run -f .env.local -- eslint --report-unused-disable-directives .",
|
|
181
|
+
"check:tsc": "tsgo",
|
|
182
|
+
"check-ci": "pnpm check:lint",
|
|
183
|
+
"coverage": "run-s coverage:*",
|
|
184
|
+
"coverage:test": "run-s test:prepare test:unit:coverage",
|
|
185
|
+
"coverage:type": "dotenvx -q run -f .env.local -- type-coverage --detail",
|
|
186
|
+
"clean": "run-p -c --aggregate-output clean:*",
|
|
187
|
+
"clean:cache": "del-cli '**/.cache'",
|
|
188
|
+
"clean:dist": "del-cli 'dist'",
|
|
189
|
+
"clean:dist:types": "del-cli 'dist/types'",
|
|
190
|
+
"clean:external": "del-cli 'external'",
|
|
191
|
+
"clean:node_modules": "del-cli '**/node_modules'",
|
|
192
|
+
"fix": "pnpm lint:fix",
|
|
193
|
+
"knip:dependencies": "knip --dependencies",
|
|
194
|
+
"knip:exports": "knip --include exports,duplicates",
|
|
195
|
+
"lint": "dotenvx -q run -f .env.local -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json .",
|
|
196
|
+
"lint:dist:fix": "run-s -c lint:dist:fix:*",
|
|
197
|
+
"lint:dist:fix:oxlint": "dotenvx -q run -f .env.dist -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --silent --fix ./dist | dev-null",
|
|
198
|
+
"lint:dist:fix:biome": "dotenvx -q run -f .env.dist -- biome format --log-level=none --fix ./dist | dev-null",
|
|
199
|
+
"//lint:dist:fix:eslint": "dotenvx -q run -f .env.dist -- eslint --report-unused-disable-directives --quiet --fix ./dist | dev-null",
|
|
200
|
+
"lint:external:fix": "run-s -c lint:external:fix:*",
|
|
201
|
+
"lint:external:fix:oxlint": "dotenvx -q run -f .env.external -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --silent --fix ./external | dev-null",
|
|
202
|
+
"lint:external:fix:biome": "dotenvx -q run -f .env.external -- biome format --log-level=none --fix ./external | dev-null",
|
|
203
|
+
"//lint:external:fix:eslint": "dotenvx -q run -f .env.external -- eslint --report-unused-disable-directives --quiet --fix ./external | dev-null",
|
|
204
|
+
"lint:fix": "run-s -c lint:fix:*",
|
|
205
|
+
"lint:fix:oxlint": "dotenvx -q run -f .env.local -- oxlint -c=.oxlintrc.json --ignore-path=.oxlintignore --tsconfig=tsconfig.json --quiet --fix . | dev-null",
|
|
206
|
+
"lint:fix:biome": "dotenvx -q run -f .env.local -- biome format --log-level=none --fix . | dev-null",
|
|
207
|
+
"lint:fix:eslint": "dotenvx -q run -f .env.local -- eslint --report-unused-disable-directives --fix . | dev-null",
|
|
208
|
+
"lint-staged": "dotenvx -q run -f .env.local -- lint-staged",
|
|
209
|
+
"precommit": "dotenvx -q run -f .env.local -- lint-staged",
|
|
210
|
+
"bs": "dotenvx -q run -f .env.local -- pnpm build:dist:src; pnpm exec socket --",
|
|
211
|
+
"s": "dotenvx -q run -f .env.local -- pnpm exec socket --",
|
|
212
|
+
"e2e-tests": "dotenvx -q run -f .env.test -- vitest run --config vitest.e2e.config.mts",
|
|
213
|
+
"test": "run-s check test:*",
|
|
214
|
+
"test:prepare": "dotenvx -q run -f .env.test -- pnpm build && del-cli 'test/**/node_modules'",
|
|
215
|
+
"test:unit": "dotenvx -q run -f .env.test -- vitest run",
|
|
216
|
+
"test:unit:update": "dotenvx -q run -f .env.test -- vitest run --update",
|
|
217
|
+
"test:unit:coverage": "dotenvx -q run -f .env.test -- vitest run --coverage",
|
|
218
|
+
"test-ci": "run-s test:*",
|
|
219
|
+
"testu": "dotenvx -q run -f .env.testu -- run-s test:prepare; pnpm test:unit:update --",
|
|
220
|
+
"testuf": "dotenvx -q run -f .env.testu -- pnpm test:unit:update --",
|
|
221
|
+
"update": "run-p --aggregate-output update:**",
|
|
222
|
+
"update:deps": "taze",
|
|
223
|
+
"update:socket": "pnpm update '@socketsecurity/*' '@socketregistry/*' --latest"
|
|
295
224
|
}
|
|
296
|
-
}
|
|
225
|
+
}
|
package/requirements.json
CHANGED
package/shadow-bin/npm
CHANGED
|
File without changes
|
package/shadow-bin/npx
CHANGED
|
File without changes
|
package/shadow-bin/pnpm
CHANGED
|
File without changes
|
package/shadow-bin/yarn
CHANGED
|
File without changes
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
// Gradle init script that emits a single `.socket.facts.json` file at the
|
|
2
|
-
// build root describing the resolved compile/runtime dependency graph of
|
|
3
|
-
// every subproject combined.
|
|
4
|
-
//
|
|
5
|
-
// Schema matches the canonical SocketFacts shape consumed by depscan
|
|
6
|
-
// (`workspaces/lib/src/socket-facts/socket-facts-schema.ts`):
|
|
7
|
-
//
|
|
8
|
-
// { components: SF_Artifact[] }
|
|
9
|
-
//
|
|
10
|
-
// Each Maven SF_Artifact is `{ type: 'maven', namespace, name, version?,
|
|
11
|
-
// qualifiers? } & { id, direct?, dev?, tooling?, dependencies? }`.
|
|
12
|
-
// `qualifiers` is strict on `{ classifier?, ext? }` — anything else is
|
|
13
|
-
// dropped.
|
|
14
|
-
//
|
|
15
|
-
// Invoke via:
|
|
16
|
-
// ./gradlew --init-script socket-facts.init.gradle socketFacts
|
|
17
|
-
//
|
|
18
|
-
// Structure:
|
|
19
|
-
// - per-subproject `socketFactsCollect` tasks resolve that subproject's
|
|
20
|
-
// configurations and contribute to shared accumulators on gradle.ext
|
|
21
|
-
// - the root `socketFacts` task depends on every collector, then
|
|
22
|
-
// serializes the accumulated graph to a single JSON file at the build
|
|
23
|
-
// root
|
|
24
|
-
//
|
|
25
|
-
// Intra-project dependencies (i.e. `project(':lib')` style edges between
|
|
26
|
-
// subprojects in the same build) are dropped from the output entirely.
|
|
27
|
-
// Their reasoning: each subproject contributes its own external deps to
|
|
28
|
-
// the shared facts; the inter-project edges would just be noise that
|
|
29
|
-
// downstream consumers (coana mvn dependency:get) would try to resolve
|
|
30
|
-
// against Maven Central and fail. The externals each intra-project dep
|
|
31
|
-
// brings in are picked up via that subproject's own collector.
|
|
32
|
-
|
|
33
|
-
import java.util.Collections
|
|
34
|
-
import groovy.json.JsonOutput
|
|
35
|
-
|
|
36
|
-
// Must stay in sync with `DOT_SOCKET_DOT_FACTS_JSON` in
|
|
37
|
-
// src/constants.mts (TS side). Groovy can't import the TS constant, so
|
|
38
|
-
// the two strings are intentionally duplicated; if you change one,
|
|
39
|
-
// change the other.
|
|
40
|
-
ext.SOCKET_FACTS_FILENAME = '.socket.facts.json'
|
|
41
|
-
|
|
42
|
-
// Shared accumulators across all subprojects' contributions. Synchronized
|
|
43
|
-
// collections so --parallel-enabled builds don't race. The accumulator
|
|
44
|
-
// lives on `gradle.ext` so every subproject's collector and the root
|
|
45
|
-
// aggregator share the same instance.
|
|
46
|
-
gradle.ext.socketFactsState = [
|
|
47
|
-
// id -> [coord, children, prod, nonTooling]
|
|
48
|
-
nodes : Collections.synchronizedMap([:]),
|
|
49
|
-
// first-level dep ids
|
|
50
|
-
directIds : Collections.synchronizedSet([] as Set),
|
|
51
|
-
// selectors we've already logged as unresolved (deduped across configs)
|
|
52
|
-
reportedUnresolved : Collections.synchronizedSet([] as Set),
|
|
53
|
-
// "group:name" of every project in this build — used to filter
|
|
54
|
-
// intra-project deps. Populated once all projects are evaluated.
|
|
55
|
-
projectKeys : Collections.synchronizedSet([] as Set),
|
|
56
|
-
]
|
|
57
|
-
|
|
58
|
-
// Capture every project's (group:name) once all projects are configured so
|
|
59
|
-
// per-subproject collectors can filter intra-project deps without an
|
|
60
|
-
// ordering dependency on other subprojects.
|
|
61
|
-
gradle.projectsEvaluated { g ->
|
|
62
|
-
g.rootProject.allprojects.each { p ->
|
|
63
|
-
g.socketFactsState.projectKeys.add("${p.group ?: ''}:${p.name}")
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
allprojects { project ->
|
|
68
|
-
def collectTask = project.tasks.create('socketFactsCollect') {
|
|
69
|
-
description = "Resolves ${project.path}'s configurations into the build-wide Socket facts accumulator"
|
|
70
|
-
// Dependency resolution depends on state Gradle's up-to-date tracking
|
|
71
|
-
// can't represent reliably.
|
|
72
|
-
outputs.upToDateWhen { false }
|
|
73
|
-
|
|
74
|
-
doLast {
|
|
75
|
-
def state = gradle.socketFactsState
|
|
76
|
-
def nodes = state.nodes
|
|
77
|
-
def directIds = state.directIds
|
|
78
|
-
def reportedUnresolved = state.reportedUnresolved
|
|
79
|
-
def projectKeys = state.projectKeys
|
|
80
|
-
|
|
81
|
-
// `id` omits ext so Gradle's variant artifacts (e.g.
|
|
82
|
-
// `java-classes-directory` and `jar` for the same project dep)
|
|
83
|
-
// dedupe into a single component. Classifier stays in the id since
|
|
84
|
-
// it identifies a distinct artifact (sources, javadoc, etc.).
|
|
85
|
-
def coordId = { coord ->
|
|
86
|
-
def parts = [coord.groupId, coord.artifactId]
|
|
87
|
-
if (coord.classifier) parts << coord.classifier
|
|
88
|
-
parts << coord.version
|
|
89
|
-
parts.join(':')
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
def isIntraProject = { String group, String name ->
|
|
93
|
-
projectKeys.contains("${group ?: ''}:${name}")
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Atomic upsert: bracket the read-modify-write under the nodes map's
|
|
97
|
-
// monitor so concurrent contributions don't lose flag updates.
|
|
98
|
-
def upsertNode = { Map coord, boolean isProd, boolean isNonTooling ->
|
|
99
|
-
def id = coordId(coord)
|
|
100
|
-
synchronized (nodes) {
|
|
101
|
-
def node = nodes[id]
|
|
102
|
-
if (node == null) {
|
|
103
|
-
node = [coord: coord, children: [] as Set, prod: false, nonTooling: false]
|
|
104
|
-
nodes[id] = node
|
|
105
|
-
} else if (!node.coord.ext && coord.ext) {
|
|
106
|
-
// Upgrade to the variant whose Gradle artifact has a real
|
|
107
|
-
// packaging extension. Compile classpath visits often arrive
|
|
108
|
-
// with no ext (a project dep exposes only its classes-directory
|
|
109
|
-
// variant there); the runtime classpath visit then fills in
|
|
110
|
-
// the canonical jar/aar.
|
|
111
|
-
node.coord = coord
|
|
112
|
-
}
|
|
113
|
-
if (isProd) {
|
|
114
|
-
node.prod = true
|
|
115
|
-
}
|
|
116
|
-
if (isNonTooling) {
|
|
117
|
-
node.nonTooling = true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
id
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Walk a resolved dependency, emitting nodes for itself and its
|
|
124
|
-
// transitive closure. `cache` is keyed by ResolvedDependency identity
|
|
125
|
-
// and short-circuits revisits in diamond/cyclic graphs.
|
|
126
|
-
//
|
|
127
|
-
// We never touch `artifact.file` — that forces Gradle to *download*
|
|
128
|
-
// the underlying file (catastrophic on large builds that declare
|
|
129
|
-
// distribution archives as dependencies). `artifact.extension` and
|
|
130
|
-
// `artifact.classifier` read from metadata that resolution already
|
|
131
|
-
// needed.
|
|
132
|
-
//
|
|
133
|
-
// Intra-project deps (project(':lib') and friends) are dropped at
|
|
134
|
-
// visit time: we return an empty produced-id set, don't emit a node,
|
|
135
|
-
// and don't recurse into the dep's children. The transitives those
|
|
136
|
-
// intra-project deps expose are picked up via the consumer
|
|
137
|
-
// subproject's classpath directly (Gradle merges them) and via the
|
|
138
|
-
// intra-project's own collector.
|
|
139
|
-
def visit
|
|
140
|
-
visit = { dep, boolean isProd, boolean isNonTooling, Map cache ->
|
|
141
|
-
if (cache.containsKey(dep)) {
|
|
142
|
-
return cache[dep]
|
|
143
|
-
}
|
|
144
|
-
if (isIntraProject(dep.moduleGroup, dep.moduleName)) {
|
|
145
|
-
def empty = [] as Set
|
|
146
|
-
cache[dep] = empty
|
|
147
|
-
return empty
|
|
148
|
-
}
|
|
149
|
-
// Pre-populate the cache to break cycles before we recurse.
|
|
150
|
-
def producedIds = [] as Set
|
|
151
|
-
cache[dep] = producedIds
|
|
152
|
-
|
|
153
|
-
def artifacts = dep.moduleArtifacts
|
|
154
|
-
if (artifacts.isEmpty()) {
|
|
155
|
-
producedIds << upsertNode([
|
|
156
|
-
groupId : dep.moduleGroup ?: '',
|
|
157
|
-
artifactId: dep.moduleName,
|
|
158
|
-
version : dep.moduleVersion ?: '',
|
|
159
|
-
classifier: '',
|
|
160
|
-
ext : '',
|
|
161
|
-
], isProd, isNonTooling)
|
|
162
|
-
} else {
|
|
163
|
-
artifacts.each { a ->
|
|
164
|
-
producedIds << upsertNode([
|
|
165
|
-
groupId : dep.moduleGroup ?: '',
|
|
166
|
-
artifactId: dep.moduleName,
|
|
167
|
-
version : dep.moduleVersion ?: '',
|
|
168
|
-
classifier: a.classifier ?: '',
|
|
169
|
-
// Use the file extension Gradle reports. For Gradle-internal
|
|
170
|
-
// directory variants (java-classes-directory etc.) the
|
|
171
|
-
// extension is empty — we let that through and emit no ext
|
|
172
|
-
// qualifier. Never fall back to artifact.type, which is
|
|
173
|
-
// Gradle's variant attribute, not Maven packaging.
|
|
174
|
-
ext : a.extension ?: '',
|
|
175
|
-
], isProd, isNonTooling)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
def childIds = [] as Set
|
|
180
|
-
dep.children.each { child ->
|
|
181
|
-
childIds.addAll(visit(child, isProd, isNonTooling, cache))
|
|
182
|
-
}
|
|
183
|
-
synchronized (nodes) {
|
|
184
|
-
producedIds.each { pid ->
|
|
185
|
-
nodes[pid].children.addAll(childIds)
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
producedIds
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// Configuration selection by name pattern. We match the conventional
|
|
192
|
-
// suffixes used across Gradle plugins for resolvable classpath configs:
|
|
193
|
-
// Java (`compileClasspath`, `runtimeClasspath`,
|
|
194
|
-
// `testCompileClasspath`, `testRuntimeClasspath`), Kotlin Gradle Plugin
|
|
195
|
-
// (`jvmMainCompileClasspath`, `linuxX64MainRuntimeClasspath`, ...) and
|
|
196
|
-
// AGP per-variant (`debugCompileClasspath`, `releaseRuntimeClasspath`,
|
|
197
|
-
// `debugUnitTestRuntimeClasspath`, ...).
|
|
198
|
-
//
|
|
199
|
-
// Beyond classpaths we also walk other resolvable configurations
|
|
200
|
-
// (annotation processors, linter classpaths, etc.) so build-tooling
|
|
201
|
-
// deps land in the output too — tagged `tooling: true` so downstream
|
|
202
|
-
// reachability scanners can skip them.
|
|
203
|
-
//
|
|
204
|
-
// We exclude AGP's instrumented-test classpaths (`*AndroidTest*`)
|
|
205
|
-
// because their variant resolution requires consumer attributes
|
|
206
|
-
// (target SDK, device/host runtime) that an init-script-driven
|
|
207
|
-
// resolution doesn't set, and they produce ambiguity errors at
|
|
208
|
-
// resolution time. Unit-test classpaths (`*UnitTest*`) resolve fine.
|
|
209
|
-
def isClasspath = { String name ->
|
|
210
|
-
def lower = name.toLowerCase()
|
|
211
|
-
lower.endsWith('compileclasspath') || lower.endsWith('runtimeclasspath')
|
|
212
|
-
}
|
|
213
|
-
def isAndroidInstrumentedTest = { String name ->
|
|
214
|
-
name.toLowerCase().contains('androidtest')
|
|
215
|
-
}
|
|
216
|
-
def isTestConfig = { String name -> name.toLowerCase().contains('test') }
|
|
217
|
-
|
|
218
|
-
def targetConfigs = project.configurations.findAll {
|
|
219
|
-
it.canBeResolved && !isAndroidInstrumentedTest(it.name)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
targetConfigs.each { cfg ->
|
|
223
|
-
def isProd = !isTestConfig(cfg.name)
|
|
224
|
-
def isNonTooling = isClasspath(cfg.name)
|
|
225
|
-
// Per-configuration try/catch: AGP-style configurations can fail
|
|
226
|
-
// with "variant ambiguity" when resolved from an init-script
|
|
227
|
-
// context that doesn't carry the consumer attributes AGP sets
|
|
228
|
-
// internally. We log and continue so a single ambiguous config
|
|
229
|
-
// doesn't sink the whole facts file.
|
|
230
|
-
try {
|
|
231
|
-
def lenient = cfg.resolvedConfiguration.lenientConfiguration
|
|
232
|
-
def cache = [:]
|
|
233
|
-
lenient.firstLevelModuleDependencies.each { dep ->
|
|
234
|
-
directIds.addAll(visit(dep, isProd, isNonTooling, cache))
|
|
235
|
-
}
|
|
236
|
-
lenient.unresolvedModuleDependencies.each { dep ->
|
|
237
|
-
if (isIntraProject(dep.selector.group, dep.selector.name)) {
|
|
238
|
-
return
|
|
239
|
-
}
|
|
240
|
-
def selectorKey = dep.selector.toString()
|
|
241
|
-
if (reportedUnresolved.add(selectorKey)) {
|
|
242
|
-
def reason = dep.problem?.message?.readLines()?.first() ?: 'unknown reason'
|
|
243
|
-
println "[socket-facts] unresolved: ${selectorKey} in ${project.path}: ${reason}"
|
|
244
|
-
}
|
|
245
|
-
def coord = [
|
|
246
|
-
groupId : dep.selector.group ?: '',
|
|
247
|
-
artifactId: dep.selector.name,
|
|
248
|
-
version : dep.selector.version ?: '',
|
|
249
|
-
classifier: '',
|
|
250
|
-
ext : '',
|
|
251
|
-
]
|
|
252
|
-
directIds.add(upsertNode(coord, isProd, isNonTooling))
|
|
253
|
-
}
|
|
254
|
-
} catch (Exception e) {
|
|
255
|
-
println "[socket-facts] skipping ${project.path}:${cfg.name}: ${e.message?.readLines()?.first()}"
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
rootProject {
|
|
263
|
-
tasks.create('socketFacts') {
|
|
264
|
-
group = 'socket'
|
|
265
|
-
description = 'Aggregates a single Socket facts JSON for the entire build'
|
|
266
|
-
outputs.upToDateWhen { false }
|
|
267
|
-
|
|
268
|
-
doLast {
|
|
269
|
-
def state = gradle.socketFactsState
|
|
270
|
-
def nodes = state.nodes
|
|
271
|
-
def directIds = state.directIds
|
|
272
|
-
|
|
273
|
-
// Snapshot the accumulators under the same monitor used by writers in
|
|
274
|
-
// each subproject's socketFactsCollect doLast. Task dependencies
|
|
275
|
-
// (`aggregator.dependsOn(collector)`) already guarantee a
|
|
276
|
-
// happens-before edge between writes and this read, but we
|
|
277
|
-
// synchronize on `nodes` here so the read path is symmetric with the
|
|
278
|
-
// write path — no implicit reliance on Gradle's task-graph ordering
|
|
279
|
-
// semantics for memory visibility of plain HashMap/HashSet fields.
|
|
280
|
-
def components
|
|
281
|
-
synchronized (nodes) {
|
|
282
|
-
components = nodes.collect { id, node ->
|
|
283
|
-
[id: id, coord: node.coord, prod: node.prod, nonTooling: node.nonTooling, children: (node.children as List).sort()]
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
components = components.collect { snapshot ->
|
|
288
|
-
def id = snapshot.id
|
|
289
|
-
def coord = snapshot.coord
|
|
290
|
-
def component = [
|
|
291
|
-
type : 'maven',
|
|
292
|
-
namespace: coord.groupId,
|
|
293
|
-
name : coord.artifactId,
|
|
294
|
-
]
|
|
295
|
-
if (coord.version) {
|
|
296
|
-
component.version = coord.version
|
|
297
|
-
}
|
|
298
|
-
def qualifiers = [:]
|
|
299
|
-
if (coord.classifier) {
|
|
300
|
-
qualifiers.classifier = coord.classifier
|
|
301
|
-
}
|
|
302
|
-
if (coord.ext) {
|
|
303
|
-
qualifiers.ext = coord.ext
|
|
304
|
-
}
|
|
305
|
-
if (!qualifiers.isEmpty()) {
|
|
306
|
-
component.qualifiers = qualifiers
|
|
307
|
-
}
|
|
308
|
-
component.id = id
|
|
309
|
-
if (directIds.contains(id)) {
|
|
310
|
-
component.direct = true
|
|
311
|
-
}
|
|
312
|
-
if (!snapshot.prod) {
|
|
313
|
-
component.dev = true
|
|
314
|
-
}
|
|
315
|
-
if (!snapshot.nonTooling) {
|
|
316
|
-
component.tooling = true
|
|
317
|
-
}
|
|
318
|
-
if (!snapshot.children.isEmpty()) {
|
|
319
|
-
component.dependencies = snapshot.children
|
|
320
|
-
}
|
|
321
|
-
component
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (components.isEmpty()) {
|
|
325
|
-
println "[socket-facts] no resolvable dependencies in build, skipping"
|
|
326
|
-
return
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
def outputDir = project.findProperty('socket.outputDirectory')
|
|
330
|
-
? new File(project.findProperty('socket.outputDirectory').toString())
|
|
331
|
-
: project.projectDir
|
|
332
|
-
outputDir.mkdirs()
|
|
333
|
-
def fileName = project.findProperty('socket.outputFile') ?: SOCKET_FACTS_FILENAME
|
|
334
|
-
def outFile = new File(outputDir, fileName.toString())
|
|
335
|
-
outFile.text = JsonOutput.prettyPrint(JsonOutput.toJson([components: components]))
|
|
336
|
-
println "Socket facts file written to: ${outFile.absolutePath}"
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Wire every subproject's collector as a dependency of the root aggregator
|
|
342
|
-
// so the aggregator runs after all contributions have been made.
|
|
343
|
-
gradle.projectsEvaluated { g ->
|
|
344
|
-
def aggregator = g.rootProject.tasks.findByName('socketFacts')
|
|
345
|
-
if (aggregator) {
|
|
346
|
-
g.rootProject.allprojects.each { p ->
|
|
347
|
-
def collector = p.tasks.findByName('socketFactsCollect')
|
|
348
|
-
if (collector) {
|
|
349
|
-
aggregator.dependsOn(collector)
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|