diff --git a/src/project-roots.ts b/src/project-roots.ts index e3f361b1..221e76e1 100644 --- a/src/project-roots.ts +++ b/src/project-roots.ts @@ -3,7 +3,7 @@ import * as path from 'path'; import { logError, logInfo } from './utils/logger'; import { URI } from 'vscode-uri'; -import { isGlimmerXProject, isELSAddonRoot, isRootStartingWithFilePath, safeWalkAsync, asyncGetPackageJSON } from './utils/layout-helpers'; +import { isEmberLikeProject, isELSAddonRoot, isRootStartingWithFilePath, safeWalkAsync, asyncGetPackageJSON } from './utils/layout-helpers'; import Server from './server'; @@ -83,7 +83,7 @@ export default class ProjectRoots { async findProjectsInsideRoot(workspaceRoot: string) { const roots = await safeWalkAsync(workspaceRoot, { directories: false, - globs: ['**/ember-cli-build.js', '**/package.json'], + globs: ['**/ember-cli-build.js', '**/ember-cli-build.cjs', '**/package.json'], ignore: ['**/.git/**', '**/bower_components/**', '**/dist/**', '**/node_modules/**', '**/tmp/**'], }); @@ -97,7 +97,7 @@ export default class ProjectRoots { if (filePath.endsWith('package.json')) { try { - if (await isGlimmerXProject(fullPath)) { + if (await isEmberLikeProject(fullPath)) { await this.onProjectAdd(fullPath); } } catch (e) { diff --git a/src/utils/layout-helpers.ts b/src/utils/layout-helpers.ts index afd21d52..f60c2c22 100644 --- a/src/utils/layout-helpers.ts +++ b/src/utils/layout-helpers.ts @@ -300,10 +300,14 @@ export function getDepIfExists(pack: PackageInfo, depName: string): string | nul return version; } -export async function isGlimmerXProject(root: string) { +export async function isEmberLikeProject(root: string) { const pack = await asyncGetPackageJSON(root); - return hasDep(pack, '@glimmerx/core') || hasDep(pack, 'glimmer-lite-core'); + const isGlimmerXProject = hasDep(pack, '@glimmerx/core') || hasDep(pack, 'glimmer-lite-core'); + const isEmberAddon = 'ember-addon' in pack; + const isEmberApp = 'ember' in pack; + + return isGlimmerXProject || isEmberAddon || isEmberApp; } export async function getProjectAddonsRoots(