Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Aug 8, 2025

Q A
Bug fix? no
New feature? no
Docs? yes
Issues Fix #2951, #2737
License MIT

Added some documentation explaining the issue with unsupported protocol workspace:* with UX Map bridges, and how to deal with it.

This is not ideal, but better that nothing for the moment

@Kocal
Copy link
Member Author

Kocal commented Aug 8, 2025

Superseded by #2983

@Kocal Kocal added the Documentation Improvements or additions to documentation label Aug 8, 2025
kbond added a commit that referenced this pull request Aug 8, 2025
… `npm` when using `file:vendor/symfony/ux-*-map/assets` (Kocal)

This PR was merged into the 2.x branch.

Discussion
----------

[Map] Allows Bridges JavaScript assets to be installed with `npm` when using `file:vendor/symfony/ux-*-map/assets`

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #2951, #2737 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Update/add documentation as required (we can help!)
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Alternative to #2982.

Moving the `"`@symfony`/ux-map": "workspace:*"` requirements **outside the package.json** allows the Bridges JavaScript assets to be installed with `npm` when ``@symfony`/ux-leaflet-map` (or ``@symfony`/ux-google-map`) is using constraint version `file:vendor/symfony/ux-leaflet-map/assets` (or `file:vendor/symfony/ux-google-map/assets`) in the user application.

This is possible to this super feature from pnpm: [packageExtensions](https://pnpm.io/settings#packageextensions), which allows to override some part of package definitions in file `pnpm-workspace.yaml`:
- this file is read by pnpm and understand that ``@symfony`/ux-map` is a dependency of ``@symfony`/ux-leaflet-map` and ``@symfony`/ux-google-map` 🎉
- this file is totally unknown to npm, no `workspace:*` anymore in any `package.json` 🎉

It is not possible to defines `packageExtensions.devDependencies`, so I used `packageExtensions.dependencies` instead but that's fine. ``@symfony`/ux-map` is not referenced in any `package.json` when running `pnpm pack` in `src/Bridge/*/assets`.

Commits
-------

1667af7 [Map] Allows Bridges JavaScript assets to be installed with `npm` when using `file:vendor/symfony/ux-*-map/assets`
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 Map Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm error Unsupported URL Type "catalog:"
2 participants