From e4092bd72d4ef0e6beeb9c73ec6a03876e8e6bf7 Mon Sep 17 00:00:00 2001 From: Ruben Romero Montes Date: Wed, 23 Apr 2025 16:31:50 +0200 Subject: [PATCH 1/4] feat: add support for pnpm Signed-off-by: Ruben Romero Montes --- .github/workflows/pr.yml | 3 + README.md | 7 + package-lock.json | 2244 ++++++++++----- src/provider.js | 20 +- src/providers/base_javascript.js | 214 ++ src/providers/golang_gomodules.js | 2 +- src/providers/java_gradle.js | 6 +- src/providers/java_maven.js | 2 +- src/providers/javascript_npm.js | 202 +- src/providers/javascript_pnpm.js | 32 + src/providers/python_pip.js | 2 +- test/it/end-to-end.js | 56 +- test/it/test_manifests/pnpm/package.json | 16 + test/it/test_manifests/pnpm/pnpm-lock.yaml | 100 + test/provider.test.js | 2 +- test/providers/javascript.test.js | 102 + test/providers/javascript_npm.test.js | 118 - .../pnpm/with_lock_file/package.json | 11 + .../pnpm/with_lock_file/pnpm-lock.yaml | 9 + .../pnpm/without_lock_file/package.json | 11 + ...ponent_stack.json => component_stack.json} | 0 ..._component.json => listing_component.json} | 0 ..._listing_stack.json => listing_stack.json} | 0 ..._json_deps_without_exhortignore_object.iml | 9 - ..._component.json => listing_component.json} | 0 ..._listing_stack.json => listing_stack.json} | 0 .../component_expected_sbom.json | 140 + .../component_stack.json | 56 + .../listing_component.json | 58 + .../listing_stack.json | 1435 ++++++++++ .../package.json | 32 + .../pnpm-lock.yaml | 1715 +++++++++++ .../stack_expected_sbom.json | 2533 +++++++++++++++++ .../component_expected_sbom.json | 140 + .../listing_component.json | 53 + .../listing_stack.json | 1059 +++++++ .../package.json | 28 + .../pnpm-lock.yaml | 1269 +++++++++ .../stack_expected_sbom.json | 1893 ++++++++++++ 39 files changed, 12449 insertions(+), 1130 deletions(-) create mode 100644 src/providers/base_javascript.js create mode 100644 src/providers/javascript_pnpm.js create mode 100644 test/it/test_manifests/pnpm/package.json create mode 100644 test/it/test_manifests/pnpm/pnpm-lock.yaml create mode 100644 test/providers/javascript.test.js delete mode 100644 test/providers/javascript_npm.test.js create mode 100644 test/providers/provider_manifests/pnpm/with_lock_file/package.json create mode 100644 test/providers/provider_manifests/pnpm/with_lock_file/pnpm-lock.yaml create mode 100644 test/providers/provider_manifests/pnpm/without_lock_file/package.json rename test/providers/tst_manifests/npm/package_json_deps_with_exhortignore_object/{npm_component_stack.json => component_stack.json} (100%) rename test/providers/tst_manifests/npm/package_json_deps_with_exhortignore_object/{npm_listing_component.json => listing_component.json} (100%) rename test/providers/tst_manifests/npm/package_json_deps_with_exhortignore_object/{npm_listing_stack.json => listing_stack.json} (100%) delete mode 100644 test/providers/tst_manifests/npm/package_json_deps_without_exhortignore_object/.idea/package_json_deps_without_exhortignore_object.iml rename test/providers/tst_manifests/npm/package_json_deps_without_exhortignore_object/{npm_listing_component.json => listing_component.json} (100%) rename test/providers/tst_manifests/npm/package_json_deps_without_exhortignore_object/{npm_listing_stack.json => listing_stack.json} (100%) create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/component_expected_sbom.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/component_stack.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/listing_component.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/listing_stack.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/package.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/pnpm-lock.yaml create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_with_exhortignore_object/stack_expected_sbom.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/component_expected_sbom.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/listing_component.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/listing_stack.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/package.json create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/pnpm-lock.yaml create mode 100644 test/providers/tst_manifests/pnpm/package_json_deps_without_exhortignore_object/stack_expected_sbom.json diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ebfd3de..7539e69 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -51,6 +51,9 @@ jobs: with: go-version: '1.20.1' + - name: Install pnpm + run: npm install -g pnpm + - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/README.md b/README.md index ad57718..ca357e4 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ $ exhort-javascript-api component /path/to/pom.xml