Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor!: remove FetchOptions.skipIntegrityCheck
  • Loading branch information
paul-soporan committed Jul 19, 2022
commit f8eb48e1a5a05fff29601af862d45a8dbfcd19dd
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The following changes only affect people writing Yarn plugins:

- `renderForm`'s `options` argument is now required to enforce that custom streams are always specified.

- The `FetchOptions.skipIntegrityCheck` option has been removed. Use `FetchOptions.cacheOptions.skipIntegrityCheck` instead.

### Installs

- The `pnpm` linker avoids creating symlinks that lead to loops on the file system, by moving them higher up in the directory structure.
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-essentials/sources/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default class InfoCommand extends BaseCommand {
const infoTree: treeUtils.TreeNode = {children: infoTreeChildren};

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

const builtinInfoBuilders: Array<Exclude<Hooks['fetchPackageInfo'], undefined>> = [
// Manifest fields
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-essentials/sources/dedupeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export async function dedupe(project: Project, {strategy, patterns, cache, repor
fetcher,
project,
report: throwReport,
skipIntegrityCheck: true,
cacheOptions: {
skipIntegrityCheck: true,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-essentials/sources/suggestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export async function fetchDescriptorFrom(ident: Ident, range: string, {project,
const fetcher = project.configuration.makeFetcher();
const resolver = project.configuration.makeResolver();

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

// The descriptor has to be bound for the resolvers that need a parent locator. (e.g. FileResolver)
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-exec/sources/ExecFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class ExecFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
onMiss: () => opts.report.reportCacheMiss(locator),
loader: () => this.fetchFromDisk(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-file/sources/FileFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class FileFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.fetchFromDisk(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-file/sources/TarballFileFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class TarballFileFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.fetchFromDisk(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-git/sources/GitFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class GitFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.cloneFromRemote(normalizedLocator, nextOpts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-github/sources/GithubFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class GithubFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
onMiss: () => opts.report.reportCacheMiss(locator, `${structUtils.prettyLocator(opts.project.configuration, locator)} can't be found in the cache and will be fetched from GitHub`),
loader: () => this.fetchFromNetwork(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-http/sources/TarballHttpFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class TarballHttpFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.fetchFromNetwork(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-npm/sources/NpmHttpFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class NpmHttpFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.fetchFromNetwork(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-npm/sources/NpmSemverFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class NpmSemverFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.fetchFromNetwork(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
1 change: 0 additions & 1 deletion packages/plugin-patch/sources/PatchFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class PatchFetcher implements Fetcher {
onHit: () => opts.report.reportCacheHit(locator),
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`),
loader: () => this.patchPackage(locator, opts),
skipIntegrityCheck: opts.skipIntegrityCheck,
...opts.cacheOptions,
});

Expand Down
4 changes: 0 additions & 4 deletions packages/yarnpkg-core/sources/Fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ export type FetchOptions = MinimalFetchOptions & {
cacheOptions?: CacheOptions;
checksums: Map<LocatorHash, string | null>;
report: Report;
/**
* @deprecated Use cacheOptions.skipIntegrityCheck instead
*/
skipIntegrityCheck?: boolean;
};

export type FetchResult = {
Expand Down
2 changes: 1 addition & 1 deletion packages/yarnpkg-core/sources/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ export class Project {
};

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

const linkers = this.configuration.getLinkers();
const linkerOptions: LinkOptions = {project: this, report};
Expand Down
2 changes: 1 addition & 1 deletion packages/yarnpkg-doctor/sources/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function makeResolveFn(project: Project) {
const checksums = project.storedChecksums;
const yarnReport = new ThrowReport();

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

return async (descriptor: Descriptor) => {
Expand Down