Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/project-roots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

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

Expand All @@ -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) {
Expand Down
8 changes: 6 additions & 2 deletions src/utils/layout-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading