From c39eded51268a8acd414354b0cdce1de83380dd3 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 8 Mar 2025 18:39:55 -0500 Subject: [PATCH] Support ember-try.cjs --- lib/utils/config.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils/config.js b/lib/utils/config.js index b1e2ee45..ff596503 100644 --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -19,6 +19,14 @@ function getConfigPath(cwd) { return possibleConfigPath; } + let cjsPath = path.join('config', 'ember-try.cjs'); + + if (fs.existsSync(cjsPath)) { + debug(`using config from config/ember-try.cjs`); + + return cjs; + } + debug('using config from config/ember-try.js'); return path.join('config', 'ember-try.js'); @@ -53,7 +61,7 @@ async function getBaseConfig(options) { return await mergeAutoConfigAndConfigFileData(autoConfig, data); } else { throw new Error( - 'No ember-try configuration found. Please see the README for configuration options', + 'No ember-try configuration found. Please see the README for configuration options' ); } } @@ -69,7 +77,9 @@ async function config(options) { if (typeof configData[oldOption] === 'boolean') { warn( - `${prefix('ember-try DEPRECATION')} The \`${oldOption}\` config option is deprecated. Please use \`packageManager: '${name}'\` instead.`, + `${prefix( + 'ember-try DEPRECATION' + )} The \`${oldOption}\` config option is deprecated. Please use \`packageManager: '${name}'\` instead.` ); delete configData[oldOption];