mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-14 09:58:37 -05:00
* 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. https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304 * 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. https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304 * 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. https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304 * 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>
21 lines
625 B
TypeScript
21 lines
625 B
TypeScript
import { parseCatalogProtocol } from '@pnpm/catalogs.protocol-parser'
|
|
|
|
test('parses named catalog', () => {
|
|
expect(parseCatalogProtocol('catalog:foo')).toBe('foo')
|
|
expect(parseCatalogProtocol('catalog:bar')).toBe('bar')
|
|
})
|
|
|
|
test('returns null for specifier not using catalog protocol', () => {
|
|
expect(parseCatalogProtocol('^1.0.0')).toBe(null)
|
|
})
|
|
|
|
describe('default catalog', () => {
|
|
test('parses explicit default catalog', () => {
|
|
expect(parseCatalogProtocol('catalog:default')).toBe('default')
|
|
})
|
|
|
|
test('parses implicit catalog', () => {
|
|
expect(parseCatalogProtocol('catalog:')).toBe('default')
|
|
})
|
|
})
|