Skip to content

Add pnpm-workspace.yaml schema#4235

Merged
hyperupcall merged 5 commits intoSchemaStore:masterfrom
danielbayley:pnpm-workspace
Dec 7, 2024
Merged

Add pnpm-workspace.yaml schema#4235
hyperupcall merged 5 commits intoSchemaStore:masterfrom
danielbayley:pnpm-workspace

Conversation

@danielbayley
Copy link
Copy Markdown
Contributor

@danielbayley danielbayley commented Nov 23, 2024

For example:

# https://pnpm.io/pnpm-workspace_yaml
$schema: https://json.schemastore.org/pnpm-workspace.json
packages:
  - packages/*

catalog:
  chalk: ^4.1.2

# https://pnpm.io/catalogs
catalogs:
  react16:
    react: ^16.7.0
    react-dom: ^16.7.0
  react17:
    react: ^17.10.0
    react-dom: ^17.10.0

Depends on #4233, and #4234.

Note

For reference, better linting, and composability, I have built my own collection of schemas here: https://github.com/danielbayley/schemas

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@hyperupcall
Copy link
Copy Markdown
Member

Thanks! I'll be able to merge this once all the tests pass. I would recommend replacing the "$ref": "https://json.schemastore.org/npm-semver.json"-type statements with { "type": "string" } (possibly with minlength set to 1) since they didn't quite get merged

@danielbayley
Copy link
Copy Markdown
Contributor Author

danielbayley commented Nov 27, 2024

@hyperupcall Updated…

@hyperupcall
Copy link
Copy Markdown
Member

Thanks

@hyperupcall hyperupcall merged commit 483ad90 into SchemaStore:master Dec 7, 2024
@danielbayley danielbayley deleted the pnpm-workspace branch December 9, 2024 16:47
migalons pushed a commit to migalons/schemastore that referenced this pull request Dec 15, 2024
* Add pnpm-workspace.yaml schema

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pnpm-workspace.yaml schema

* Update catalog.json

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Kofler <[email protected]>
@kachkaev
Copy link
Copy Markdown

kachkaev commented Mar 3, 2025

Great stuff, thank you @danielbayley! You probably know that pnpm 10.5 has added more properties to pnpm-workspace.yaml:

Essentially, the whole pnpm section in package.json can be removed in favor of the same field in pnpm-workspace.yaml.

It’d be great to see the schema updated. WDYT?

@btea
Copy link
Copy Markdown
Contributor

btea commented Mar 4, 2025

Essentially, the whole pnpm section in package.json can be removed in favor of the same field in pnpm-workspace.yaml.

I think we should not rush to delete it now, because pnpm versions below 10.5 only support adding related configurations in package.json.

@kachkaev
Copy link
Copy Markdown

kachkaev commented Mar 4, 2025

I agree about keeping package.jsonpnpm. My comment was about adding newly supported fields to pnpm-workspace.yaml schema. They are currently flagged as not allowed:

Screenshot 2025-03-04 at 13 24 35

(the list is not necessarily exhaustive)

@btea
Copy link
Copy Markdown
Contributor

btea commented Mar 5, 2025

The PR I submitted only supplemented the onlyBuiltdependencies field. I will submit a new PR to supplement other relevant fields.

@kachkaev
Copy link
Copy Markdown

kachkaev commented Mar 6, 2025

@btea pnpm 10.6.0 also supports settings from .npmrc: https://github.com/pnpm/pnpm/releases/tag/v10.6.0 (just an FYI since you are planning to add more keys to the schema).

@btea
Copy link
Copy Markdown
Contributor

btea commented Mar 7, 2025

yeah, I'll try to add that setting.

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

Successfully merging this pull request may close these issues.

4 participants