Skip to content

Commit

Permalink
feat(cli): add migrator for cap3 to cap4 (#5762)
Browse files Browse the repository at this point in the history
* feat(cli): add migrator for cap3 to cap4

* chore: fmt

* chore: verbage

* chore: version fix for betas

* chore: cleanup

* chore: touch ups for spinners and funcs

* chore: fmt

* chore: modify packagejson replacements

* chore: fmt

* chore: use paths from config object

* chore: get variables from template

* Update cli/src/tasks/migrate.ts

Co-authored-by: jcesarmobile <[email protected]>

* chore: add android 12 splash and podfile postinstall

* chore: npm install fix

* chore: fmt

* chore: activity path fix

* chore: post_install add if already exists

* chore: remove comment for init()

* chore: path fix for require_relative

* chore: look for already migrated post_install

* chore: fmt

* chore: remove unused var

* chore: remove more unused

* chore: move app build.gradle edit logic

* chore: only add if not exists

* chore: check for each dep

* Update cli/src/tasks/migrate.ts

Co-authored-by: jcesarmobile <[email protected]>

* chore: fmt

* chore: more fmt

* chore: use latest

Co-authored-by: jcesarmobile <[email protected]>
  • Loading branch information
IT-MikeS and jcesarmobile authored Jul 27, 2022
1 parent f5afa94 commit 7cb660a
Show file tree
Hide file tree
Showing 4 changed files with 941 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"open": "^8.4.0",
"plist": "^3.0.5",
"prompts": "^2.4.2",
"rimraf": "^3.0.2",
"semver": "^7.3.7",
"tar": "^6.1.11",
"tslib": "^2.4.0",
Expand All @@ -66,12 +67,12 @@
"@types/jest": "^26.0.4",
"@types/plist": "^3.0.2",
"@types/prompts": "^2.0.14",
"@types/rimraf": "^3.0.2",
"@types/semver": "^7.3.10",
"@types/tar": "^6.1.1",
"@types/tmp": "^0.2.3",
"@types/xml2js": "0.4.5",
"jest": "^26.1.0",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
"ts-jest": "^26.1.3",
"typescript": "~4.1.2"
Expand Down
14 changes: 13 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function run(): Promise<void> {
try {
const config = await loadConfig();
runProgram(config);
} catch (e) {
} catch (e: any) {
process.exitCode = isFatal(e) ? e.exitCode : 1;
logger.error(e.message ? e.message : String(e));
}
Expand Down Expand Up @@ -224,6 +224,18 @@ export function runProgram(config: Config): void {
}),
);

program
.command('migrate')
.description(
'Migrate your current Capacitor app to the latest major version of Capacitor.',
)
.action(
wrapAction(async () => {
const { migrateCommand } = await import('./tasks/migrate');
await migrateCommand(config);
}),
);

program.arguments('[command]').action(
wrapAction(async cmd => {
if (typeof cmd === 'undefined') {
Expand Down
Loading

0 comments on commit 7cb660a

Please sign in to comment.