Skip to content

fix(workspace): allow packages filed to be optional#8969

Merged
zkochan merged 3 commits intopnpm:pnpm-workspace-configfrom
btea:fix/workspace-allow-miss-packages-field
Feb 20, 2025
Merged

fix(workspace): allow packages filed to be optional#8969
zkochan merged 3 commits intopnpm:pnpm-workspace-configfrom
btea:fix/workspace-allow-miss-packages-field

Conversation

@btea
Copy link
Member

@btea btea commented Jan 14, 2025

close #8968

@btea btea requested a review from zkochan as a code owner January 14, 2025 06:14
Copy link
Contributor

@KSXGitHub KSXGitHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is little reason to use catalogs without a monorepo. The issue's OP wanted to use yaml anchor and alias but pnpm already supports package.yaml.

@btea
Copy link
Member Author

btea commented Jan 16, 2025

I can't find any instructions in the documentation, could you provide a link to detailed instructions?

@KSXGitHub
Copy link
Contributor

I can't find any instructions in the documentation, could you provide a link to detailed instructions?

What do you mean? Just write package.yaml as you would package.json, but with YAML syntax. For example:

# package.yaml
name: package-name
version: 1.2.3
private: true
dependencies:
  foo: 3.2.1

And since OP wanted to use yaml anchors:

# package.yaml
dependencies:
  '@dcloudio/uni-app': &uni-app 3.0.0-alpha-4040520250107001
  '@dcloudio/uni-app-harmony': *uni-app
  '@dcloudio/uni-app-plus': *uni-app
  '@dcloudio/uni-automator': *uni-app
  '@dcloudio/uni-cli-shared': *uni-app
  '@dcloudio/uni-components': *uni-app
  '@dcloudio/uni-h5': *uni-app

(the above was copy-pasted from OP's comment)

@btea
Copy link
Member Author

btea commented Jan 17, 2025

Thanks for the example, I never knew I could use package.yaml.

@zkochan
Copy link
Member

zkochan commented Jan 26, 2025

I'd like to add the possibility of loading catalogs from configurational dependencies. In that case, it will make sense to have catalogs support in single-package projects.

@btea
Copy link
Member Author

btea commented Jan 30, 2025

I'd like to add the possibility of loading catalogs from configurational dependencies. In that case, it will make sense to have catalogs support in single-package projects.

Our checking logic can remain as it is, there is no need to modify it?

@zkochan zkochan changed the base branch from main to pnpm-workspace-config February 20, 2025 01:36
@zkochan zkochan merged commit 1098157 into pnpm:pnpm-workspace-config Feb 20, 2025
8 checks passed
@btea btea deleted the fix/workspace-allow-miss-packages-field branch February 20, 2025 01:39
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.

packages in pnpm-workspace.yaml should be optional

3 participants