Publication of typescript configurations

Hello all,

Currently the node packages a sharing a common TypeScript configuration, but:

  1. The resolution is using a relative path (e.g., "extends": "@xwiki/platform-tool-tsconfig/tsconfig.json",). This is working but is annoying in case a package needs to be moved.
  2. The configuration cannot be shared more broadly (e.g., with Cristal, or with contrib extensions).
  3. The coonfiguration is only used inside npm packages of xwiki-platform-node, but not for other npm packages of xwiki-platform (i.e., xwiki-platform-livedata-webjar, xwiki-platform-blocknote-webjar, and xwiki-platform-notifications-webjar).

Therefore, I propose to:

  1. Start publishing a TypeScript configuration in a package
  2. This package would be published for each release
  3. Start using that configuration for xwiki-platform-livedata-webjar, xwiki-platform-blocknote-webjar, and xwiki-platform-notifications-webjar
  4. Once released, start using it for Cristal as well (since it’s where this config comes from initially).

I propose to name this package @xwiki/platform-tool-tsconfig and it would be located in xwiki-platform-core/xwiki-platform-node/src/main/node/tools/tool-tsconfig.

See for the PoC in this PR: XWIKI-23912: Introduce a shared typescript configuration by manuelleduc · Pull Request #5072 · xwiki/xwiki-platform · GitHub

WDYT?
Thanks

I can’t comment on this proposal as I don’t know enough. My only comment is that platform tools are in xwiki-platform-tools, but I guess you chose to put in under xwiki-platform-node because it’s only used in code located under xwiki-platform-node(your point 3). That makes sense to me.

Do we have a generic proposal on how to name npm packages? If not, would be great to have one so that we get consistency from the beginning.

Thx

It could (and should) be used by all packages of xwiki-platform, even when outside xwiki-platform-node.
I propose to locate it in xwiki-platform-node because I want to publish the configuration on https://www.npmjs.com/ to make it reusable by other projects (e.g., Cristal, contrib extensions, etc).

Good point; I don’t think I did. I’ll fix that.