From 8ddf8c0be19a0c5c799f594b791b37e0cb76dbf2 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Wed, 27 Jun 2018 16:15:19 +0300 Subject: [PATCH 1/2] fix(livesync): check node_modules for changes only with `--sync-all-files` fixes #3710 --- lib/services/project-changes-service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/services/project-changes-service.ts b/lib/services/project-changes-service.ts index ff5c93bff1..bb09655ceb 100644 --- a/lib/services/project-changes-service.ts +++ b/lib/services/project-changes-service.ts @@ -70,11 +70,13 @@ export class ProjectChangesService implements IProjectChangesService { const platformResourcesDir = path.join(projectData.appResourcesDirectoryPath, platformData.normalizedPlatformName); this._changesInfo.appResourcesChanged = this.containsNewerFiles(platformResourcesDir, null, projectData); /*done because currently all node_modules are traversed, a possible improvement could be traversing only the production dependencies*/ - this._changesInfo.nativeChanged = this.containsNewerFiles( - path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME), - path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME, "tns-ios-inspector"), - projectData, - this.fileChangeRequiresBuild); + this._changesInfo.nativeChanged = projectChangesOptions.skipModulesNativeCheck ? + false : + this.containsNewerFiles( + path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME), + path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME, "tns-ios-inspector"), + projectData, + this.fileChangeRequiresBuild); if (this._newFiles > 0 || this._changesInfo.nativeChanged) { this._changesInfo.modulesChanged = true; From a684d200d5bdb39e801b911de6b24ae4e0807541 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Wed, 27 Jun 2018 16:56:49 +0300 Subject: [PATCH 2/2] style: fix linting errors --- lib/services/project-changes-service.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/services/project-changes-service.ts b/lib/services/project-changes-service.ts index bb09655ceb..1f6c54fbd0 100644 --- a/lib/services/project-changes-service.ts +++ b/lib/services/project-changes-service.ts @@ -70,13 +70,11 @@ export class ProjectChangesService implements IProjectChangesService { const platformResourcesDir = path.join(projectData.appResourcesDirectoryPath, platformData.normalizedPlatformName); this._changesInfo.appResourcesChanged = this.containsNewerFiles(platformResourcesDir, null, projectData); /*done because currently all node_modules are traversed, a possible improvement could be traversing only the production dependencies*/ - this._changesInfo.nativeChanged = projectChangesOptions.skipModulesNativeCheck ? - false : - this.containsNewerFiles( - path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME), - path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME, "tns-ios-inspector"), - projectData, - this.fileChangeRequiresBuild); + this._changesInfo.nativeChanged = projectChangesOptions.skipModulesNativeCheck ? false : this.containsNewerFiles( + path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME), + path.join(projectData.projectDir, NODE_MODULES_FOLDER_NAME, "tns-ios-inspector"), + projectData, + this.fileChangeRequiresBuild); if (this._newFiles > 0 || this._changesInfo.nativeChanged) { this._changesInfo.modulesChanged = true;