diff --git a/generate-local.js b/generate-local.js index 508df1f..e3cf8fd 100755 --- a/generate-local.js +++ b/generate-local.js @@ -27,7 +27,7 @@ function semverVersion(value) { program .addOption( new Option('-p, --project ', 'the project that you want to run this for') - .choices(['ember', 'ember-data']) + .choices(['ember', 'ember-data', 'ember-cli']) .makeOptionMandatory(), ) .requiredOption('-v, --version ', 'project version', semverVersion); @@ -59,6 +59,7 @@ try { let emberProjectPath = path.join('../', 'ember.js'); let emberDataProjectPath = path.join('../', 'data'); +let emberCliProjectPath = path.join('../', 'ember-cli'); let checkIfProjectDirExists = dirPath => { if (!existsSync(dirPath)) { @@ -69,14 +70,14 @@ let checkIfProjectDirExists = dirPath => { let buildDocs = async projDirPath => { checkIfProjectDirExists(projDirPath); - if (project === 'ember') { - await runCmd('volta', projDirPath, ['run', 'yarn']); - } else { + if (project === 'ember-data') { await runCmd('corepack', projDirPath, ['pnpm', 'install']); + } else { + await runCmd('volta', projDirPath, ['run', 'yarn']); } await runCmd( - project === 'ember' ? 'volta run yarn docs' : 'corepack pnpm run build:docs', + project === 'ember-data' ? 'corepack pnpm run build:docs' : 'volta run yarn docs', projDirPath, ); @@ -86,16 +87,20 @@ let buildDocs = async projDirPath => { removeSync(projYuiDocFile); removeSync(`${docsPath}/json-docs/${project}/${version}`); - const yuiDocFile = path.join( - projDirPath, - project === 'ember' ? 'docs/data.json' : 'packages/-ember-data/dist/docs/data.json', - ); + const paths = { + ember: 'docs/data.json', + 'ember-cli': 'docs/build/data.json', + 'ember-data': 'packages/-ember-data/dist/docs/data.json', + }; + + const yuiDocFile = path.join(projDirPath, paths[project]); copyFileSync(yuiDocFile, projYuiDocFile); }; let dirMap = { ember: emberProjectPath, 'ember-data': emberDataProjectPath, + 'ember-cli': emberCliProjectPath, }; await buildDocs(dirMap[project]); diff --git a/index.js b/index.js index fc55633..b20fee9 100755 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ function semverVersion(value) { program .addOption( new Option('-p, --projects ', 'the projects that you want to run this for') - .choices(['ember', 'ember-data']) + .choices(['ember', 'ember-data', 'ember-cli']) .makeOptionMandatory(), ) .addOption( diff --git a/lib/rev-docs.js b/lib/rev-docs.js index 3a96375..7ab493e 100644 --- a/lib/rev-docs.js +++ b/lib/rev-docs.js @@ -55,7 +55,7 @@ function revProjVersionFiles(project, ver) { ); }); - fs.writeJsonSync(projVerRevFile, projVerRevContent); + fs.writeJsonSync(projVerRevFile, projVerRevContent, { spaces: 2 }); opProgress.succeed('Revving done!'); }