Page MenuHomePhabricator

docs: Clarify required packages when installing
Closed, ResolvedPublic

Description

The installation section of the usage docs mention that @wikimedia/codex-icons is optional, but does not say if @wikimedia/codex can be used without @wikimedia/codex-design-tokens.

It would be useful to know if Codex can be used without installing the design tokens package when deciding what packages to install.

Event Timeline

Hi! I'm a new contributor, so hopefully this isn't a duplicate. I would be happy to pick up this and T301730 (related) if triage finds this task worth doing.

Dug more and found https://phabricator.wikimedia.org/T349859, which captures the CSS portion of docs related to this task. I'll adjust the title and description to only include whether packages are required or not

tyhopp renamed this task from docs: Clarify usage page information to docs: Clarify required packages when installing.Nov 7 2023, 7:51 AM
tyhopp updated the task description. (Show Details)

Hi! I'm a new contributor, so hopefully this isn't a duplicate.

Thank you for filing this task! I don't believe it's a duplicate, I have thought about this issue from time to time but I don't think anyone had ever filed it as a task.

I would be happy to pick up this and T301730 (related) if triage finds this task worth doing.

Please do!

In addition, we should verify that the existing documentation is accurate. For example, I think the type definitions for @wikimedia/codex import the Icon type from @wikimedia/codex-icons, so trying to use @wikimedia/codex without installing @wikimedia/codex-icons might cause errors if you're using TypeScript. If this is the case, we should probably address that by making @wikimedia/codex-icons a dependency of @wikimedia/codex.

As for the tokens package, I believe that the codex package can be used without the tokens package, but if you want to use Less mixins you will need the tokens package, and a lot of the code examples for how to use Codex components also require the tokens package (those should be relatively obvious because they contain statements like @import '@wikimedia/codex-design-tokens/something.less';, but it's still worth documenting that you'd probably want to install the tokens package).

Change 972923 had a related patch set uploaded (by Tyhopp; author: Tyhopp):

[design/codex@main] chore: Make icons explicit runtime dep of codex

https://gerrit.wikimedia.org/r/972923

Thanks for the direction!

In addition, we should verify that the existing documentation is accurate. For example, I think the type definitions for @wikimedia/codex import the Icon type from @wikimedia/codex-icons, so trying to use @wikimedia/codex without installing @wikimedia/codex-icons might cause errors if you're using TypeScript. If this is the case, we should probably address that by making @wikimedia/codex-icons a dependency of @wikimedia/codex.

This makes sense, I think I did run into something like this at some point when trying out the packages outside the monorepo context.

Do Codex packages follow semver? Saw they recently reached the first major release.

In https://gerrit.wikimedia.org/r/972923 I opted for the caret symbol, will update if there's something more preferable.

Will also update the docs in a separate patch. Is it okay to relate multiple separate patches to one Phabricator task? I'm new to these tools (:

Change 972926 had a related patch set uploaded (by Tyhopp; author: Tyhopp):

[design/codex@main] docs: Clarify required packages to install

https://gerrit.wikimedia.org/r/972926

Do Codex packages follow semver? Saw they recently reached the first major release.

Yes, we follow semver. That didn't mean as much when we were still on 0.x.y versions, but now that we've released 1.0.0 it does mean something.

In https://gerrit.wikimedia.org/r/972923 I opted for the caret symbol, will update if there's something more preferable.

That looks good to me. I do think we'd want to update this for every release (I think version 1.0.2 of @wikimedia/codex should depend on version 1.0.2 of @wikimedia/codex-icons for example), so maybe we can add something to the prepare-release.sh script that updates this.

Will also update the docs in a separate patch. Is it okay to relate multiple separate patches to one Phabricator task? I'm new to these tools (:

Yes, that's totally fine! Gerrit also allows you to submit multiple patches that depend on each other (probably not strictly necessary in this case, but can be useful in other cases).

Change 973277 had a related patch set uploaded (by Catrope; author: Catrope):

[design/codex@main] build: Automatically update codex-icons dependency for new releases

https://gerrit.wikimedia.org/r/973277

Change 972926 merged by jenkins-bot:

[design/codex@main] docs: Clarify required packages to install

https://gerrit.wikimedia.org/r/972926

Change 980902 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[mediawiki/core@master] Update Codex from v1.0.1 to v1.1.1

https://gerrit.wikimedia.org/r/980902

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/d419984345/w

Change 980902 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.0.1 to v1.1.1

https://gerrit.wikimedia.org/r/980902

CCiufo-WMF moved this task from Inbox to Contributor Experience on the Codex board.
CCiufo-WMF moved this task from Contributor Experience to Codex Adoption on the Codex board.

Change 972923 merged by jenkins-bot:

[design/codex@main] build: Make icons explicit runtime dep of codex package

https://gerrit.wikimedia.org/r/972923

Change 973277 merged by jenkins-bot:

[design/codex@main] build: Automatically update codex-icons dependency for new releases

https://gerrit.wikimedia.org/r/973277

Change 984519 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update Codex from v1.1.1 to v1.2.0

https://gerrit.wikimedia.org/r/984519

Change 984519 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.1.1 to v1.2.0

https://gerrit.wikimedia.org/r/984519

Was put onto sprint for reviewing capacity needed.

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/d419984345/w/