Skip to content

fix(plugins): update sample plugin imports to use package subpath exports#1484

Open
coopernetes wants to merge 4 commits intomainfrom
fix/plugin-sample-exports
Open

fix(plugins): update sample plugin imports to use package subpath exports#1484
coopernetes wants to merge 4 commits intomainfrom
fix/plugin-sample-exports

Conversation

@coopernetes
Copy link
Copy Markdown
Contributor

@coopernetes coopernetes commented Mar 26, 2026

Summary

  • Updates index.js and example.cjs in git-proxy-plugin-samples to import from the correct package subpath exports (@finos/git-proxy/plugin, @finos/git-proxy/proxy/actions) instead of internal source paths (@finos/git-proxy/src/plugin.js, @finos/git-proxy/src/proxy/actions) which are not defined in the exports map and throw ERR_PACKAGE_PATH_NOT_EXPORTED at runtime
  • Bumps @finos/git-proxy-plugin-samples to 0.1.2
  • Bumps peer dependency to ^2.0.0

Blocked on

Depends on #1480 — the dist/src/ content (where subpath exports resolve to) is excluded from the published package until that PR's .npmignorefiles allowlist change lands.

Test plan

  • Merge fix: broken plugin exports #1480 first
  • npm install in plugins/git-proxy-plugin-samples against the published 2.0.0 tarball
  • Verify require('@finos/git-proxy/plugin') and import ... from '@finos/git-proxy/plugin' resolve without ERR_PACKAGE_PATH_NOT_EXPORTED
  • Publish @finos/[email protected]

…orts

The sample plugins were importing directly from internal source paths
(`@finos/git-proxy/src/plugin.js`, `@finos/git-proxy/src/proxy/actions`)
which are not defined in the package exports map and throw
ERR_PACKAGE_PATH_NOT_EXPORTED at runtime.

Update to use the correct exported subpaths (`@finos/git-proxy/plugin`,
`@finos/git-proxy/proxy/actions`) as defined in package.json exports.

Bump package version to 0.1.2 and peer dependency to ^2.0.0-rc.6.

Depends on #1480 (fix(npm): replace .npmignore with files allowlist).
@coopernetes coopernetes requested a review from a team as a code owner March 26, 2026 03:50
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 848746e
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/69d5e0a170dd750008bb0111

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 848746e.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.66%. Comparing base (c0b4a8d) to head (848746e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1484   +/-   ##
=======================================
  Coverage   89.66%   89.66%           
=======================================
  Files          68       68           
  Lines        4869     4869           
  Branches      888      888           
=======================================
  Hits         4366     4366           
  Misses        485      485           
  Partials       18       18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@jescalada jescalada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coopernetes I just did some testing with the git-proxy-plugin-samples and things are apparently working:

Set-Location "c:\Users\jescalada\git-proxy\plugins\git-proxy-plugin-samples"; node -e "const p=require('@finos/git-proxy/plugin'); const a=require('@finos/git-proxy/proxy/actions'); console.log('plugin keys:', Object.keys(p).slice(0,5)); console.log('Step:', typeof a.Step); console.log('CJS subpaths: OK');"
plugin keys: [
  'PluginLoader',
  'PushActionPlugin',
  'PullActionPlugin',
  'isCompatiblePlugin'
]
Step: function
CJS subpaths: OK
Set-Location "c:\Users\jescalada\git-proxy\plugins\git-proxy-plugin-samples"; node --input-type=module -e "import { PullActionPlugin } from '@finos/git-proxy/plugin'; import { Step } from '@finos/git-proxy/proxy/actions'; console.log('PullActionPlugin:', typeof PullActionPlugin, 'Step:', typeof Step); console.log('ESM subpaths: OK');"
PullActionPlugin: function Step: function
ESM subpaths: OK
Set-Location "c:\Users\jescalada\git-proxy\plugins\git-proxy-plugin-samples"; node --input-type=module -e "import './index.js'; console.log('index.js loaded OK');"
index.js loaded OK
Set-Location "c:\Users\jescalada\git-proxy\plugins\git-proxy-plugin-samples"; node -e "require('./example.cjs'); console.log('example.cjs loaded OK');"
example.cjs loaded OK

I'm not sure how publishing the git-proxy-plugin-samples would work if we first need the v2.0.0 release to exist for the import to work. I'm guessing we should publish the rc.6 for now, then get git-proxy v2.0.0 out with the included git-proxy-plugin-samples: v0.1.2 subpackage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants