Skip to content

Commit

Permalink
fix: reduce warnings of subfolders with ionic projects
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarnawsky committed Oct 23, 2024
1 parent 2e829ee commit 5a5e410
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ionic",
"displayName": "Ionic",
"description": "Official extension for Ionic and Capacitor development",
"version": "1.97.1",
"version": "1.97.2",
"icon": "media/ionic.png",
"publisher": "Ionic",
"keywords": [
Expand Down
13 changes: 9 additions & 4 deletions src/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getPnpmWorkspaces } from './monorepos-pnpm';
import { PackageManager } from './node-commands';
import { getLernaWorkspaces } from './monorepos-lerna';
import { join } from 'path';
import { writeError, write } from './logging';
import { write, writeWarning } from './logging';
import { NpmDependency, NpmOutdatedDependency } from './npm-model';
import { ExtensionContext, commands, window, workspace } from 'vscode';
import { existsSync, readFileSync, readdirSync } from 'fs';
Expand Down Expand Up @@ -240,15 +240,20 @@ function getFolderBasedProjects(prj: Project): Array<MonoRepoProject> {
}
}

let subFolderWarning = false;

const rootFolderType = checkFolder(join(prj.folder, 'package.json'));
if (rootFolderType == FolderType.hasIonic) {
if (projects.length == 0 || prj.folder == projects[0].path) {
// Sub folder is the root folder (eg ionic multi-app without a root)
} else {
// Its definitely an Ionic or Capacitor project in the root but we have sub folders that look like Ionic projects so throw error
writeError(
`This folder has Capacitor/Ionic dependencies but there are subfolders that do too which will be ignored (eg ${exampleFolder})`,
);
if (!subFolderWarning && exampleFolder != '') {
writeWarning(
`This folder has Capacitor/Ionic dependencies but there are subfolders that do too which will be ignored (eg ${exampleFolder})`,
);
subFolderWarning = true;
}

return [];
}
Expand Down

0 comments on commit 5a5e410

Please sign in to comment.