From 36db21ed56214172495bb7053d0af32b553bf5c5 Mon Sep 17 00:00:00 2001 From: Tyna William <65050204+tynawilliam@users.noreply.github.com> Date: Thu, 6 Jul 2023 08:41:09 -0400 Subject: [PATCH] Merge pull request #13475 from overleaf/revert-13473-revert-13439-tw-support-rnw-files Revert "Revert "support for Rnw files"" GitOrigin-RevId: 2bdaf154592f0b3c4bd3762d266b89a159a0b091 --- services/clsi/app/js/LatexRunner.js | 2 +- services/clsi/test/acceptance/js/helpers/Client.js | 1 + services/web/app/src/Features/Project/ProjectRootDocManager.js | 2 +- services/web/config/settings.defaults.js | 2 +- services/web/cypress/support/ct/window.ts | 2 +- services/web/frontend/stories/decorators/scope.tsx | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/clsi/app/js/LatexRunner.js b/services/clsi/app/js/LatexRunner.js index 55769ec2f3..51286dce91 100644 --- a/services/clsi/app/js/LatexRunner.js +++ b/services/clsi/app/js/LatexRunner.js @@ -184,7 +184,7 @@ function _buildLatexCommand(mainFile, opts = {}) { // We want to run latexmk on the tex file which we will automatically // generate from the Rtex/Rmd/md file. - mainFile = mainFile.replace(/\.(Rtex|md|Rmd)$/, '.tex') + mainFile = mainFile.replace(/\.(Rtex|md|Rmd|Rnw)$/, '.tex') command.push(Path.join('$COMPILE_DIR', mainFile)) return command diff --git a/services/clsi/test/acceptance/js/helpers/Client.js b/services/clsi/test/acceptance/js/helpers/Client.js index 88ed4d3be5..041518966d 100644 --- a/services/clsi/test/acceptance/js/helpers/Client.js +++ b/services/clsi/test/acceptance/js/helpers/Client.js @@ -178,6 +178,7 @@ module.exports = Client = { 'ist', 'md', 'Rmd', + 'Rnw', ].indexOf(extension) > -1 ) { resources.push({ diff --git a/services/web/app/src/Features/Project/ProjectRootDocManager.js b/services/web/app/src/Features/Project/ProjectRootDocManager.js index c7aceb6f4d..c1779fee58 100644 --- a/services/web/app/src/Features/Project/ProjectRootDocManager.js +++ b/services/web/app/src/Features/Project/ProjectRootDocManager.js @@ -72,7 +72,7 @@ module.exports = ProjectRootDocManager = { if (callback == null) { callback = function () {} } - const filePathsPromise = globby(['**/*.{tex,Rtex}'], { + const filePathsPromise = globby(['**/*.{tex,Rtex,Rnw}'], { cwd: directoryPath, followSymlinkedDirectories: false, onlyFiles: true, diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index 37dfa0bedf..d9a6916f9a 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -679,7 +679,7 @@ module.exports = { process.env.FILE_IGNORE_PATTERN || '**/{{__MACOSX,.git,.texpadtmp,.R}{,/**},.!(latexmkrc),*.{dvi,aux,log,toc,out,pdfsync,synctex,synctex(busy),fdb_latexmk,fls,nlo,ind,glo,gls,glg,bbl,blg,doc,docx,gz,swp}}', - validRootDocExtensions: ['tex', 'Rtex', 'ltx'], + validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'], emailConfirmationDisabled: process.env.EMAIL_CONFIRMATION_DISABLED === 'true' || false, diff --git a/services/web/cypress/support/ct/window.ts b/services/web/cypress/support/ct/window.ts index dec1aa788f..6a2529d2c9 100644 --- a/services/web/cypress/support/ct/window.ts +++ b/services/web/cypress/support/ct/window.ts @@ -1,5 +1,5 @@ window.i18n = { currentLangCode: 'en' } window.ExposedSettings = { appName: 'Overleaf', - validRootDocExtensions: ['tex', 'Rtex', 'ltx'], + validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'], } as typeof window.ExposedSettings diff --git a/services/web/frontend/stories/decorators/scope.tsx b/services/web/frontend/stories/decorators/scope.tsx index 72cee254a0..72fffddf62 100644 --- a/services/web/frontend/stories/decorators/scope.tsx +++ b/services/web/frontend/stories/decorators/scope.tsx @@ -185,7 +185,7 @@ const initialize = () => { 'gv', 'mf', ], - validRootDocExtensions: ['tex', 'Rtex', 'ltx'], + validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'], } window.project_id = project._id