Skip to content

Commit

Permalink
feat: support for serve, build, start scripts and plugin repos
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarnawsky committed Oct 11, 2024
1 parent d676fcd commit 08493ff
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### Version 1.95

- Support for NextJS projects using static exports with an `out` folder
- Support for Non-Ionic projects using `serve`, `build` and `start` scripts
- Support for Capacitor Plugin monorepos

### Version 1.94

Expand Down
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.94.2",
"version": "1.95.0",
"icon": "media/ionic.png",
"publisher": "Ionic",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions src/ionic-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function guessBuildCommand(project: Project): string | undefined {
const packageFile = JSON.parse(readFileSync(filename, 'utf8'));
if (packageFile.scripts['ionic:build']) {
return npmRun('ionic:build');
} else if (packageFile.scripts['build']) {
return npmRun('build');
}
}
return undefined;
Expand Down
6 changes: 4 additions & 2 deletions src/ionic-serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ function guessServeCommand(project: Project): string | undefined {
const packageFile = JSON.parse(readFileSync(filename, 'utf8'));
if (packageFile.scripts['ionic:serve']) {
return npmRun('ionic:serve');
}
if (packageFile.scripts?.serve) {
} else if (packageFile.scripts?.serve) {
return npmRun('serve');
} else if (packageFile.scripts?.start) {
return npmRun('start');
}
}
return undefined;
}

async function findNextPort(port: number, host: string | undefined): Promise<number> {
let availablePort = port;
while (await isPortInUse(availablePort, host)) {
Expand Down
6 changes: 5 additions & 1 deletion src/monorepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ function checkFolder(filename: string): FolderType {
pck?.dependencies?.['@capacitor/android'] ||
pck?.dependencies?.['@angular/core']
);
return isIonic ? FolderType.hasIonic : pck.dependencies ? FolderType.hasDependencies : FolderType.unknown;
return isIonic
? FolderType.hasIonic
: pck.dependencies || pck.devDependencies
? FolderType.hasDependencies
: FolderType.unknown;
} catch {
return FolderType.unknown;
}
Expand Down

0 comments on commit 08493ff

Please sign in to comment.