# Impact of the publication of npm package to registries in xwiki-platform

**URL:** <https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923>\
**Category:** Development\
**Tags:** proposal, cristal\
**Created:** [November 17, 2025, 3:48pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923 "2025-11-17T15:48:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 17, 2025, 3:48pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/1 "2025-11-17T15:48:13Z")

</div>

While my work to be able to publish npm packages from `xwiki-platform` modules is still ongoing, I’d like to highlight the impacts I already identified to make them known to all of you as soon as possible.

## Impact on the CI

A technical user will need to be registered on the agents to allow the automated publication of snapshot versions (see Impact on Maven below).

## Impact on the release

### `xwiki-dev-tools/maven-release.sh`

We’ll need to change package.json version on the pre/post steps.

`pre_update_parent_versions`/`post_update_parent_versions` will be replaced by more generic functions (e.g., `pre_update __versions`/`post_update__ versions`) that will call `*_update_parent_versions` + a new `*_update_npm_packages_versions` that will patch the `package.json` versions.

### During the release

- Committers will be requested for an npm token to be able to push the artifact to [https://www.npmjs.com/](https://www.npmjs.com/)
- Committers will need to be part of the [xwiki](https://www.npmjs.com/org/xwiki) npmjs organization (with sufficient rights). From previous discussions, I understand that we do not want to share a generic account to publish artifacts (at least @tmortagne mentioned this to me, but I can’t find the forum discussion).

## Impact on Maven

I propose to add a small JavaScript script that would be called during the `deploy` phrase through the `frontend-maven-plugin`. Its logic would be the following:

- check for the presence of `SNAPSHOT` in the version
  - if `true`
    - replace `SNAPSHOT` by the current timestamp (e.g., `date +%s`).
    - call `pnpm publish --registry ${xwiki.npm.snapshot.registry} --tag snapshot --no-git-checks`

  - if `false`: call `pnpm publish --registry ${xwiki.npm.release.registry} --access public`

With:

- `xwiki.npm.snapshot.registry` = [Sonatype Nexus Repository](https://nexus-snapshots.xwiki.org/#browse/browse:npmhosted)
- `xwiki.npm.release.registry` = [https://registry.npmjs.org/](https://registry.npmjs.org/)

## Impact on Cristal

For Cristal this means that some packages will not be part of the workspace anymore.

Cristal developers will need to use [Sonatype Nexus Repository](https://nexus-snapshots.xwiki.org/#browse/browse:npm) as the main registry during development.

This also means that code change will not be as instantaneous as it used to be.  
In development, all the `@xwiki-platform-*` packages will have a `^${next-stable-XS-version)-0` version.  
Calling `pnpm upgrade` will update the version with the most recent timestamp.  
During the release, `^${next-stable-XS-version)-0` will be replaced by `${next-stable-XS-version)` using the [https://registry.npmjs.org/](https://registry.npmjs.org/) registry to make sure to have reproducible builds.

## Impact on Nexus

This part is not fully sorted out, but we’ll need to add a script to clear deprecated snapshot versions, as it does not make sense to keep old snapshot artifacts forever.

I’ll update this discussion if I identify new impacts when working on the topic.  
Meanwhile, please let me know what you think.  
Thanks.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [November 17, 2025, 3:58pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/2 "2025-11-17T15:58:24Z")

</div>

> [@mleduc](#):
>
> Committers will need to be part of the [xwiki](https://www.npmjs.com/org/xwiki) npmjs organization (with sufficient rights). From previous discussions, I understand that we do not want to share a generic account to publish artifacts (at least @tmortagne mentioned this to me, but I can’t find the forum discussion).

Actually we do use common credentials to deploy artifacts on Maven central. The difference is on the signing of those artifacts.

What I mentionned to you is [Use the same GitHub account and GPG key for all XWiki Standard releases](https://forum.xwiki.org/t/use-the-same-github-account-and-gpg-key-for-all-xwiki-standard-releases/17508), so more the github and signing side of things.

> [@mleduc](#):
>
> we’ll need to add a script to clear deprecated snapshot versions

We are using standard Nexus schedulers for that kind of cleanup, but if the concept of SNAPSHOT does not exist in npm Nexus support, I guess there is nothing like this out of the box.

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [November 18, 2025, 3:27pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/3 "2025-11-18T15:27:20Z")

</div>

> [@mleduc](#):
>
> - `xwiki.npm.snapshot.registry` = [Sonatype Nexus Repository](https://nexus-snapshots.xwiki.org/#browse/browse:npmhosted)
> - `xwiki.npm.release.registry` = [http://localhost:4873/](http://localhost:4873/)

Not sure to understand this? We deploy snapshots to our own nexus repo ok. But in case of release we deploy the release artifacts to a server hosted on the release machine?

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 18, 2025, 3:28pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/4 "2025-11-18T15:28:53Z")

</div>

> [@surli](#):
>
> Not sure to understand this? We deploy snapshots to our own nexus repo ok. But in case of release we deploy the release artifacts to a server hosted on the release machine?

Bad copy-paste… The right value is [https://registry.npmjs.org/](https://registry.npmjs.org/)

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [November 18, 2025, 3:30pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/5 "2025-11-18T15:30:00Z")

</div>

> [@mleduc](#):
>
> During the release, `^${next-stable-XS-version)-0` will be replaced by `${next-stable-XS-version)` using the [http://localhost:4873/](http://localhost:4873/) registry to make sure to have reproducible builds.

So here too?

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 18, 2025, 3:31pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/6 "2025-11-18T15:31:36Z")

</div>

> [@surli](#):
>
> So here too?

Yes, fixed as well.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 19, 2025, 2:45pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/7 "2025-11-19T14:45:04Z")

</div>

See the currently opened PRs:

- Changes the release scripts: [XINFRA-446: Support patching npm package during releases by manuelleduc · Pull Request #16 · xwiki/xwiki-dev-tools · GitHub](https://github.com/xwiki/xwiki-dev-tools/pull/16)
- Changes to xwiki-platform: [XWIKI-23610: Allow xwiki build to publish npm artifacts by manuelleduc · Pull Request #4812 · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/pull/4812)

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 21, 2025, 2:45pm UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/8 "2025-11-21T14:45:35Z")

</div>

And [https://dev.xwiki.org/xwiki/bin/view/ChangeRequest/Data/npm-publication-2d0ffd16-b683-4d40-96dc-6ce69f9d3694/](https://dev.xwiki.org/xwiki/bin/view/ChangeRequest/Data/npm-publication-2d0ffd16-b683-4d40-96dc-6ce69f9d3694/) for the release process changes.  
This CR will be applied only once agreed upon and the other PRs merged.  
Additionally, I’ll need to update the new committer onboarding to add step to add committers to the npmjs `@xwiki` organization.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [January 14, 2026, 8:46am UTC](https://forum.xwiki.org/t/impact-of-the-publication-of-npm-package-to-registries-in-xwiki-platform/17923/9 "2026-01-14T08:46:50Z")

</div>

done
