diff --git a/.yarn/versions/fb37557b.yml b/.yarn/versions/fb37557b.yml new file mode 100644 index 000000000000..20a0069f4eaf --- /dev/null +++ b/.yarn/versions/fb37557b.yml @@ -0,0 +1,34 @@ +releases: + "@yarnpkg/cli": major + "@yarnpkg/core": major + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-exec" + - "@yarnpkg/plugin-file" + - "@yarnpkg/plugin-git" + - "@yarnpkg/plugin-github" + - "@yarnpkg/plugin-http" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-link" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-pnpm" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/doctor" + - "@yarnpkg/extensions" + - "@yarnpkg/nm" + - "@yarnpkg/pnpify" + - "@yarnpkg/sdks" diff --git a/CHANGELOG.md b/CHANGELOG.md index 153d30a264a0..9d33f66706f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ The following changes only affect people writing Yarn plugins: - `npmConfigUtils.getAuditRegistry` no longer takes a `Manifest` as its first argument. +- `Manifest.isManifestFieldCompatible` and `Manifest.prototype.isCompatibleWith{OS,CPU}` have been removed. Use `Manifest.prototype.getConditions` and `structUtils.isPackageCompatible` instead. + - `versionUtils.{fetchBase,fetchRoot,fetchChangedFiles}` have been moved from `@yarnpkg/plugin-version` to `@yarnpkg/plugin-git`. Use `gitUtils.{fetchBase,fetchRoot,fetchChangedFiles}` instead. ### Installs diff --git a/packages/yarnpkg-core/sources/Manifest.ts b/packages/yarnpkg-core/sources/Manifest.ts index 2e7055e80519..cd67cb05e5f9 100644 --- a/packages/yarnpkg-core/sources/Manifest.ts +++ b/packages/yarnpkg-core/sources/Manifest.ts @@ -131,33 +131,6 @@ export class Manifest { return manifest; } - static isManifestFieldCompatible(rules: Array | null, actual: string) { - if (rules === null) - return true; - - let isNotOnAllowlist = true; - let isOnDenylist = false; - - for (const rule of rules) { - if (rule[0] === `!`) { - isOnDenylist = true; - - if (actual === rule.slice(1)) { - return false; - } - } else { - isNotOnAllowlist = false; - - if (rule === actual) { - return true; - } - } - } - - // Denylists with allowlisted items should be treated as allowlists for `os` and `cpu` in `package.json` - return isOnDenylist && isNotOnAllowlist; - } - loadFromText(text: string) { let data; try { @@ -714,20 +687,6 @@ export class Manifest { return fields.length > 0 ? fields.join(` & `) : null; } - /** - * @deprecated Prefer getConditions() instead - */ - isCompatibleWithOS(os: string): boolean { - return Manifest.isManifestFieldCompatible(this.os, os); - } - - /** - * @deprecated Prefer getConditions() instead - */ - isCompatibleWithCPU(cpu: string): boolean { - return Manifest.isManifestFieldCompatible(this.cpu, cpu); - } - ensureDependencyMeta(descriptor: Descriptor) { if (descriptor.range !== `unknown` && !semver.valid(descriptor.range)) throw new Error(`Invalid meta field range for '${structUtils.stringifyDescriptor(descriptor)}'`);