Skip to content

Commit

Permalink
Fix: Reimplement part of the integrity check for workspaces (#4122)
Browse files Browse the repository at this point in the history
**Summary**

Fixes #3863. The integrity file doesn't currently support workspaces,
which leads to #3863 (removing a workspace node_modules folder and
running yarn doesn't do anything, because Yarn incorrectly assumes
that everything is already done).

This PR rewrites a good chunk of the integrity logic to support and
fix this behavior.

**Test plan**

New and already existing automated tests.
  • Loading branch information
arcanis authored and BYK committed Aug 14, 2017
1 parent f513948 commit 50508b2
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 93 deletions.
4 changes: 2 additions & 2 deletions src/cli/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export class Install {
if (!patterns.length && !match.integrityFileMissing) {
this.reporter.success(this.reporter.lang('nothingToInstall'));
await this.createEmptyManifestFolders();
await this.saveLockfileAndIntegrity(patterns);
await this.saveLockfileAndIntegrity(patterns, workspaceLayout);
return true;
}

Expand Down Expand Up @@ -675,7 +675,7 @@ export class Install {
patterns,
lockfileBasedOnResolver,
this.flags,
this.resolver.usedRegistries,
workspaceLayout,
this.scripts.getArtifacts(),
);

Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const CONFIG_DIRECTORY = getDirectory('config');
export const LINK_REGISTRY_DIRECTORY = path.join(CONFIG_DIRECTORY, 'link');
export const GLOBAL_MODULE_DIRECTORY = path.join(CONFIG_DIRECTORY, 'global');

export const NODE_MODULES_FOLDER = 'node_modules';

export const POSIX_GLOBAL_PREFIX = '/usr/local';
export const FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn');

Expand Down
Loading

0 comments on commit 50508b2

Please sign in to comment.