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

Enable cookieplone add-ons via mrs.developer in pnpm-workspace.yaml #109

Open
Fosten opened this issue Nov 20, 2024 · 2 comments
Open

Enable cookieplone add-ons via mrs.developer in pnpm-workspace.yaml #109

Fosten opened this issue Nov 20, 2024 · 2 comments

Comments

@Fosten
Copy link
Contributor

Fosten commented Nov 20, 2024

This line works within cookieplone add-ons

But for a project's pnpm-workspace file, this only supports generator-volto add-ons

As seen in kitconcept.volto-lite-theme
https://github.com/kitconcept/volto-light-theme/blob/18c9fba394c41fafbf303dce877ae946735823ca/pnpm-workspace.yaml#L4-L6
This supports cookieplone addons within a cookieplone project

'packages/**/packages/*'

This also worked for me.

'packages/*/packages/*'

Additionally, if the project's pnpm-workspace.yaml is customized for any reason, the user will need to add this to the frontend Dockerfile

COPY --chown=node pnpm-workspace.yaml /app/
@davisagli
Copy link
Member

@Fosten I'm not sure I understand the situation you're reporting. Could you provide steps to reproduce the problem starting from a fresh cookieplone project?

@Fosten
Copy link
Contributor Author

Fosten commented Nov 21, 2024

Ah yes, sorry, I see that I left out a key detail. This is for cookieplone add-ons fetched via mrs.developer.

Steps to reproduce:

  1. Add any cookieplone addon to mrs.developer.json
  2. Enable add-on in volto.config.js
  3. make install = ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In packages/volto-addon: "volto-addon@workspace:*" is in the dependencies but no package named "volto-addon" is present in the workspace

This is because it clones the entire repo including the "-dev" outer package where there is already declaration for "dependencies": { "volto-addon": "workspace:*"}.

In your cookieplone root project pnpm-workspace.yaml, you can add
packages/volto-addon/packages/*

Or add a catch-all like
packages/*/packages/*

Or simply change
packages/*
to recursive
packages/**

And then for the Dockerfile additionally copy in your pnpm-workspace.yaml (Which should be done anyway to allow future user-customization of this file).

Perhaps there is a better way? Only clone the inner packages/src? Or change mrs.developer add-on path "output": "packages"? Or use hoist settings in .npmrc https://pnpm.io/npmrc ? However, the above solutions worked fine.

This ticket is related to issue #108.

@Fosten Fosten changed the title Enable cookieplone add-ons in project pnpm-workspace.yaml Enable cookieplone add-ons via mrs.developer in pnpm-workspace.yaml Nov 21, 2024
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

No branches or pull requests

2 participants