Skip to content

feat: create new @pnpm/catalogs.config package#8220

Merged
zkochan merged 3 commits intocatalogsfrom
gluxon/catalog-config-package
Jun 17, 2024
Merged

feat: create new @pnpm/catalogs.config package#8220
zkochan merged 3 commits intocatalogsfrom
gluxon/catalog-config-package

Conversation

@gluxon
Copy link
Member

@gluxon gluxon commented Jun 17, 2024

Changes

Adding a new @pnpm/catalogs.config package that merges the catalog and catalogs fields from pnpm-workspace.yaml.

Usage

This will be used in @pnpm/config in a future PR. fbd0197

if (pnpmConfig.workspaceDir != null) {
const workspaceManifest = await readWorkspaceManifest(pnpmConfig.workspaceDir)
pnpmConfig.workspacePackagePatterns = cliOptions['workspace-packages'] as string[] ?? workspaceManifest?.packages
pnpmConfig.catalogs = getCatalogsFromWorkspaceManifest(workspaceManifest)
}

gluxon added 3 commits June 17, 2024 13:47
This check will happen in  `@pnpm/catalogs.config` instead.
This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)
}
}

export function checkDefaultCatalogIsDefinedOnce (manifest: { catalog?: WorkspaceCatalog, catalogs?: WorkspaceNamedCatalogs }): void {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this check out of readWorkspaceManifest() and into getCatalogsFromWorkspaceManifest(). I think it's generally a good idea to perform parsing and validation in the same step.

@gluxon gluxon marked this pull request as ready for review June 17, 2024 18:34
@gluxon gluxon requested a review from zkochan as a code owner June 17, 2024 18:34
@zkochan zkochan merged commit 9c92c0b into catalogs Jun 17, 2024
@zkochan zkochan deleted the gluxon/catalog-config-package branch June 17, 2024 20:05
gluxon added a commit that referenced this pull request Jun 17, 2024
* refactor: remove single default catalog check

This check will happen in  `@pnpm/catalogs.config` instead.

* feat: create new @pnpm/catalogs.config package

* fix: work around CI setup not compiling orphan packages before testing

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)
gluxon added a commit that referenced this pull request Jun 17, 2024
* refactor: remove single default catalog check

This check will happen in  `@pnpm/catalogs.config` instead.

* feat: create new @pnpm/catalogs.config package

* fix: work around CI setup not compiling orphan packages before testing

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)
gluxon added a commit that referenced this pull request Jun 27, 2024
* refactor: remove single default catalog check

This check will happen in  `@pnpm/catalogs.config` instead.

* feat: create new @pnpm/catalogs.config package

* fix: work around CI setup not compiling orphan packages before testing

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)
zkochan added a commit that referenced this pull request Jun 27, 2024
* feat: create new @pnpm/catalogs.types package (#8026)

* feat: read catalog configs from workspace manifest (#8123)

* refactor: move InvalidWorkspaceManifestError to its own file

* feat: read catalogs config from workspace manifest

* chore: add changeset for new catalog config parsing

* feat: create new `@pnpm/catalogs.protocol-parser` package (#8124)

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)

* refactor: factor out isWantedDepPrefSame to extend in a future commit (#8125)

* feat: create new `@pnpm/catalogs.config` package (#8220)

* refactor: remove single default catalog check

This check will happen in  `@pnpm/catalogs.config` instead.

* feat: create new @pnpm/catalogs.config package

* fix: work around CI setup not compiling orphan packages before testing

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)

* feat: create new `@pnpm/catalogs.resolver` package (#8219)

* feat: create new @pnpm/catalogs.resolver package

* fix: work around CI setup not compiling orphan packages before testing

This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.

#8027 (comment)

* feat: implement catalog protocol for publish (#8225)

* feat: implement catalog protocol for install (#8221)

* feat: add catalogs to @pnpm/config

* refactor: factor out resolveDependenciesOfImporterDependency function

* feat: implement catalog resolver and replace prefs

* revert: work around CI setup not compiling orphan packages before testing

* feat: record catalog lookup snapshots through propagated metadata

* feat: update projects when catalogs config changes

* test: add catalog protocol install tests

* refactor: remove filter-packages-from-dir dependency from core tests (#8244)

* refactor: remove filter-packages-from-dir dependency from core tests

* test: refactor

* test: refactor

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
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.

2 participants