Skip to content

Commit

Permalink
Fix error: no such file or directory, open
Browse files Browse the repository at this point in the history
'addon-testing-project/jsconfig.json' in addon clone command

In @plone/generator-volto > 7.0.0-alpha.6, we no
longer have jsconfig.json, but tsconfig.json. So let's test if
jsconfig.json exists and use it if it does. If it doesn't exist, we use
tsconfig.json
  • Loading branch information
wesleybl committed Sep 29, 2023
1 parent 825af6c commit e7c0a74
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
24 changes: 22 additions & 2 deletions packages/scripts/addon/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});

Expand Down Expand Up @@ -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',
});

Expand Down
1 change: 1 addition & 0 deletions packages/scripts/news/5239.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix error ``no such file or directory, open 'addon-testing-project/jsconfig.json'`` in addon clone command. @wesleybl

0 comments on commit e7c0a74

Please sign in to comment.