Skip to content

Commit 2a51392

Browse files
refactor!: remove FetchOptions.skipIntegrityCheck (#4641)
* refactor!: remove `FetchOptions.skipIntegrityCheck` * chore: versions Co-authored-by: Maël Nison <[email protected]>
1 parent e12751b commit 2a51392

File tree

17 files changed

+40
-18
lines changed

17 files changed

+40
-18
lines changed

.yarn/versions/af0a51e3.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
releases:
2+
"@yarnpkg/cli": major
3+
"@yarnpkg/core": major
4+
"@yarnpkg/doctor": major
5+
"@yarnpkg/plugin-essentials": major
6+
"@yarnpkg/plugin-exec": major
7+
"@yarnpkg/plugin-file": major
8+
"@yarnpkg/plugin-git": major
9+
"@yarnpkg/plugin-github": major
10+
"@yarnpkg/plugin-http": major
11+
"@yarnpkg/plugin-npm": major
12+
"@yarnpkg/plugin-patch": major
13+
14+
declined:
15+
- "@yarnpkg/plugin-compat"
16+
- "@yarnpkg/plugin-constraints"
17+
- "@yarnpkg/plugin-dlx"
18+
- "@yarnpkg/plugin-init"
19+
- "@yarnpkg/plugin-interactive-tools"
20+
- "@yarnpkg/plugin-link"
21+
- "@yarnpkg/plugin-nm"
22+
- "@yarnpkg/plugin-npm-cli"
23+
- "@yarnpkg/plugin-pack"
24+
- "@yarnpkg/plugin-pnp"
25+
- "@yarnpkg/plugin-pnpm"
26+
- "@yarnpkg/plugin-stage"
27+
- "@yarnpkg/plugin-typescript"
28+
- "@yarnpkg/plugin-version"
29+
- "@yarnpkg/plugin-workspace-tools"
30+
- "@yarnpkg/builder"
31+
- "@yarnpkg/extensions"
32+
- "@yarnpkg/nm"
33+
- "@yarnpkg/pnpify"
34+
- "@yarnpkg/sdks"

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ The following changes only affect people writing Yarn plugins:
4242

4343
- `npmConfigUtils.getAuditRegistry` no longer takes a `Manifest` as its first argument.
4444

45+
- The `FetchOptions.skipIntegrityCheck` option has been removed. Use `FetchOptions.cacheOptions.skipIntegrityCheck` instead.
46+
4547
- `MapConfigurationValue` has been removed. Use `miscUtils.ToMapValue` instead.
4648

4749
- `Manifest.isManifestFieldCompatible` and `Manifest.prototype.isCompatibleWith{OS,CPU}` have been removed. Use `Manifest.prototype.getConditions` and `structUtils.isPackageCompatible` instead.

packages/plugin-essentials/sources/commands/info.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export default class InfoCommand extends BaseCommand {
227227
const infoTree: treeUtils.TreeNode = {children: infoTreeChildren};
228228

229229
const fetcher = configuration.makeFetcher();
230-
const fetcherOptions: FetchOptions = {project, fetcher, cache, checksums: project.storedChecksums, report: new ThrowReport(), cacheOptions: {skipIntegrityCheck: true}, skipIntegrityCheck: true};
230+
const fetcherOptions: FetchOptions = {project, fetcher, cache, checksums: project.storedChecksums, report: new ThrowReport(), cacheOptions: {skipIntegrityCheck: true}};
231231

232232
const builtinInfoBuilders: Array<Exclude<Hooks['fetchPackageInfo'], undefined>> = [
233233
// Manifest fields

packages/plugin-essentials/sources/dedupeUtils.ts

-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ export async function dedupe(project: Project, {strategy, patterns, cache, repor
158158
fetcher,
159159
project,
160160
report: throwReport,
161-
skipIntegrityCheck: true,
162161
cacheOptions: {
163162
skipIntegrityCheck: true,
164163
},

packages/plugin-essentials/sources/suggestUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export async function fetchDescriptorFrom(ident: Ident, range: string, {project,
369369
const fetcher = project.configuration.makeFetcher();
370370
const resolver = project.configuration.makeResolver();
371371

372-
const fetchOptions: FetchOptions = {project, fetcher, cache, checksums: project.storedChecksums, report, cacheOptions: {skipIntegrityCheck: true}, skipIntegrityCheck: true};
372+
const fetchOptions: FetchOptions = {project, fetcher, cache, checksums: project.storedChecksums, report, cacheOptions: {skipIntegrityCheck: true}};
373373
const resolveOptions: ResolveOptions = {...fetchOptions, resolver, fetchOptions};
374374

375375
// The descriptor has to be bound for the resolvers that need a parent locator. (e.g. FileResolver)

packages/plugin-exec/sources/ExecFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export class ExecFetcher implements Fetcher {
5151
onHit: () => opts.report.reportCacheHit(locator),
5252
onMiss: () => opts.report.reportCacheMiss(locator),
5353
loader: () => this.fetchFromDisk(locator, opts),
54-
skipIntegrityCheck: opts.skipIntegrityCheck,
5554
...opts.cacheOptions,
5655
});
5756

packages/plugin-file/sources/FileFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class FileFetcher implements Fetcher {
3333
onHit: () => opts.report.reportCacheHit(locator),
3434
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the disk`),
3535
loader: () => this.fetchFromDisk(locator, opts),
36-
skipIntegrityCheck: opts.skipIntegrityCheck,
3736
...opts.cacheOptions,
3837
});
3938

packages/plugin-file/sources/TarballFileFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export class TarballFileFetcher implements Fetcher {
2727
onHit: () => opts.report.reportCacheHit(locator),
2828
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the disk`),
2929
loader: () => this.fetchFromDisk(locator, opts),
30-
skipIntegrityCheck: opts.skipIntegrityCheck,
3130
...opts.cacheOptions,
3231
});
3332

packages/plugin-git/sources/GitFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export class GitFetcher implements Fetcher {
3131
onHit: () => opts.report.reportCacheHit(locator),
3232
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the remote repository`),
3333
loader: () => this.cloneFromRemote(normalizedLocator, nextOpts),
34-
skipIntegrityCheck: opts.skipIntegrityCheck,
3534
...opts.cacheOptions,
3635
});
3736

packages/plugin-github/sources/GithubFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export class GithubFetcher implements Fetcher {
2525
onHit: () => opts.report.reportCacheHit(locator),
2626
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from GitHub`),
2727
loader: () => this.fetchFromNetwork(locator, opts),
28-
skipIntegrityCheck: opts.skipIntegrityCheck,
2928
...opts.cacheOptions,
3029
});
3130

packages/plugin-http/sources/TarballHttpFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export class TarballHttpFetcher implements Fetcher {
2626
onHit: () => opts.report.reportCacheHit(locator),
2727
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the remote server`),
2828
loader: () => this.fetchFromNetwork(locator, opts),
29-
skipIntegrityCheck: opts.skipIntegrityCheck,
3029
...opts.cacheOptions,
3130
});
3231

packages/plugin-npm/sources/NpmHttpFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export class NpmHttpFetcher implements Fetcher {
3232
onHit: () => opts.report.reportCacheHit(locator),
3333
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the remote server`),
3434
loader: () => this.fetchFromNetwork(locator, opts),
35-
skipIntegrityCheck: opts.skipIntegrityCheck,
3635
...opts.cacheOptions,
3736
});
3837

packages/plugin-npm/sources/NpmSemverFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export class NpmSemverFetcher implements Fetcher {
3434
onHit: () => opts.report.reportCacheHit(locator),
3535
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the remote registry`),
3636
loader: () => this.fetchFromNetwork(locator, opts),
37-
skipIntegrityCheck: opts.skipIntegrityCheck,
3837
...opts.cacheOptions,
3938
});
4039

packages/plugin-patch/sources/PatchFetcher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export class PatchFetcher implements Fetcher {
2727
onHit: () => opts.report.reportCacheHit(locator),
2828
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from the disk`),
2929
loader: () => this.patchPackage(locator, opts),
30-
skipIntegrityCheck: opts.skipIntegrityCheck,
3130
...opts.cacheOptions,
3231
});
3332

packages/yarnpkg-core/sources/Fetcher.ts

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ export type FetchOptions = MinimalFetchOptions & {
1515
cacheOptions?: CacheOptions;
1616
checksums: Map<LocatorHash, string | null>;
1717
report: Report;
18-
/**
19-
* @deprecated Use cacheOptions.skipIntegrityCheck instead
20-
*/
21-
skipIntegrityCheck?: boolean;
2218
};
2319

2420
export type FetchResult = {

packages/yarnpkg-core/sources/Project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ export class Project {
10351035
};
10361036

10371037
const fetcher = optFetcher || this.configuration.makeFetcher();
1038-
const fetcherOptions: FetchOptions = {checksums: this.storedChecksums, project: this, cache, fetcher, report, skipIntegrityCheck: true, cacheOptions};
1038+
const fetcherOptions: FetchOptions = {checksums: this.storedChecksums, project: this, cache, fetcher, report, cacheOptions};
10391039

10401040
const linkers = this.configuration.getLinkers();
10411041
const linkerOptions: LinkOptions = {project: this, report};

packages/yarnpkg-doctor/sources/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async function makeResolveFn(project: Project) {
249249
const checksums = project.storedChecksums;
250250
const yarnReport = new ThrowReport();
251251

252-
const fetchOptions: FetchOptions = {project, fetcher, cache, checksums, report: yarnReport, cacheOptions: {skipIntegrityCheck: true}, skipIntegrityCheck: true};
252+
const fetchOptions: FetchOptions = {project, fetcher, cache, checksums, report: yarnReport, cacheOptions: {skipIntegrityCheck: true}};
253253
const resolveOptions: ResolveOptions = {...fetchOptions, resolver, fetchOptions};
254254

255255
return async (descriptor: Descriptor) => {

0 commit comments

Comments
 (0)