diff --git a/packages/scripts/addon/generators.js b/packages/scripts/addon/generators.js index a21ea9c909..806ab0f4a6 100644 --- a/packages/scripts/addon/generators.js +++ b/packages/scripts/addon/generators.js @@ -74,9 +74,19 @@ export async function runGitGenerator({ branch, }); + // BBB: Maintains compatibility with + // @plone/generator-volto < 7.0.0-alpha.7 + // In new versions of @plone/generator-volto we do not have jsconfig.json but tsconfig.json + let configFile; + if (fs.existsSync(`${destination}/jsconfig.json`)) { + configFile = 'jsconfig.json'; + } else { + configFile = 'tsconfig.json'; + } + await develop({ root: destination, - configFile: 'jsconfig.json', + configFile: configFile, output: 'addons', }); @@ -163,9 +173,19 @@ export async function runLocalGenerator({ destination, }); + // BBB: Maintains compatibility with + // @plone/generator-volto < 7.0.0-alpha.7 + // In new versions of @plone/generator-volto we do not have jsconfig.json but tsconfig.json + let configFile; + if (fs.existsSync(`${destination}/jsconfig.json`)) { + configFile = 'jsconfig.json'; + } else { + configFile = 'tsconfig.json'; + } + await develop({ root: destination, - configFile: 'jsconfig.json', + configFile: configFile, output: 'addons', }); diff --git a/packages/scripts/news/5239.bugfix b/packages/scripts/news/5239.bugfix new file mode 100644 index 0000000000..f8971746c5 --- /dev/null +++ b/packages/scripts/news/5239.bugfix @@ -0,0 +1 @@ +Fix error ``no such file or directory, open 'addon-testing-project/jsconfig.json'`` in addon clone command. @wesleybl