Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ERR_MODULE_NOT_FOUND when sample plugins ran #811

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

coopernetes
Copy link
Contributor

@coopernetes coopernetes commented Dec 1, 2024

  • move plugin sample README into the package so its viewable on npm
  • fix bad imports from ESM plugin (index.js)
  • bump @finos/git-proxy-plugin-samples to 0.1.1
  • update docs with simpler setup instructions
  • removed unused package

closes #812

Testing:

With fixes applied
$ npm install $REPOS/git-proxy/finos-git-proxy-1.7.0.tgz $REPOS/git-proxy/plugins/git-proxy-plugin-samples/finos-git-proxy-plugin-samples-0.1.1.tgz 
npm warn deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm warn deprecated [email protected]: This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md
npm warn deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
npm warn deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.

added 361 packages in 11s

58 packages are looking for funding
  run `npm fund` for details

$ cat proxy.config.json | grep -A 3 -B 3 plugins
  "urlShortener": "",
  "contactEmail": "",
  "csrfProtection": true,
  "plugins": ["@finos/git-proxy-plugin-samples/example", "@finos/git-proxy-plugin-samples"]
}

$ ./node_modules/.bin/git-proxy 
Found 2 plugin modules
found push plugin PushActionPlugin
found push plugin LogRequestPlugin
found pull plugin RunOnPullPlugin
Loaded plugin: PushActionPlugin
Loaded plugin: LogRequestPlugin
Loaded plugin: RunOnPullPlugin
HTTP Proxy Listening on 8000
HTTPS Proxy Listening on 8443
Service Listening on 8080
Current state
$ npm install @finos/git-proxy @finos/git-proxy-plugin-samples
npm warn deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm warn deprecated [email protected]: This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md
npm warn deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
npm warn deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.

added 361 packages, and audited 362 packages in 13s

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ cp node_modules/@finos/git-proxy/proxy.config.json .
$ vim proxy.config.json
$ ./node_modules/.bin/git-proxy 
Failed to load plugin: Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@finos/git-proxy-plugin' imported from /home/tom/scratch/
Found 0 plugin modules
creating user
        user=admin,
        gitAccount=none
        [email protected],
        admin=true
HTTP Proxy Listening on 8000
HTTPS Proxy Listening on 8443
Service Listening on 8080

Signed-off-by: Thomas Cooper [email protected]

@coopernetes coopernetes added documentation Improvements or additions to documentation plugins Extensibility of the framework fix labels Dec 1, 2024
Copy link

github-actions bot commented Dec 1, 2024

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

  • packages/git-proxy-notify-hello/package.json

Copy link

netlify bot commented Dec 1, 2024

Deploy Preview for endearing-brigadeiros-63f9d0 ready!

Name Link
🔨 Latest commit 0e90765
🔍 Latest deploy log https://app.netlify.com/sites/endearing-brigadeiros-63f9d0/deploys/674f1d34a0816e0008e8f4f8
😎 Deploy Preview https://deploy-preview-811--endearing-brigadeiros-63f9d0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.11%. Comparing base (727aa84) to head (0e90765).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #811   +/-   ##
=======================================
  Coverage   63.11%   63.11%           
=======================================
  Files          47       47           
  Lines        1681     1681           
=======================================
  Hits         1061     1061           
  Misses        620      620           

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

- move plugin sample README into the package so its viewable on npm
- fix bad imports from ESM plugin (index.js)
- bump @finos/git-proxy-plugin-samples to 0.1.1
- update docs with simpler setup instructions

Signed-off-by: Thomas Cooper <[email protected]>
Signed-off-by: Thomas Cooper <[email protected]>

Signed-off-by: Thomas Cooper <[email protected]>
Copy link
Member

@JamieSlome JamieSlome left a comment

Choose a reason for hiding this comment

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

LGTM! 🍰

@JamieSlome JamieSlome merged commit fe523cf into main Dec 3, 2024
14 checks passed
@JamieSlome JamieSlome deleted the hotfix/sample-module branch December 3, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation fix plugins Extensibility of the framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using the samples as documented not functional
2 participants