-
Notifications
You must be signed in to change notification settings - Fork 24
Floyd: Fix GitHub issue: [UPGRADE] Capacitor 4 → 7 migration ## Overview Upgra #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,16 @@ | ||
| import { CapacitorConfig } from '@capacitor/cli'; | ||
|
|
||
| const config: CapacitorConfig = { | ||
| appId: 'co.studenthub.staff', | ||
| appName: 'Studenthub Staff', | ||
| appId: 'com.bawes.studenthubstaff', | ||
| appName: 'StudentHub Staff', | ||
| webDir: 'www', | ||
| bundledWebRuntime: false | ||
| // CRITICAL: Explicitly set androidScheme to 'https' to prevent WebView origin | ||
| // change that would wipe local storage data when upgrading from Capacitor 4 to 7. | ||
| // In Capacitor 4, the default scheme was 'http'; in Capacitor 6+, it changed to 'https'. | ||
| // Setting this explicitly preserves existing user data. | ||
| server: { | ||
| androidScheme: 'https', | ||
| }, | ||
| }; | ||
|
|
||
| export default config; | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,103 +1,66 @@ | ||||||||||
| { | ||||||||||
| "name": "studenthub-staff", | ||||||||||
| "version": "0.0.1", | ||||||||||
| "author": "BAWES", | ||||||||||
| "homepage": "http://bawes.net/", | ||||||||||
| "author": "Ionic Framework", | ||||||||||
| "homepage": "https://ionicframework.com/", | ||||||||||
|
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metadata reverted to Ionic starter defaults — likely unintended.
🛠️ Suggested fix- "author": "Ionic Framework",
- "homepage": "https://ionicframework.com/",
+ "author": "BAWES",
+ "homepage": "http://bawes.net/",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| "scripts": { | ||||||||||
| "ng": "ng", | ||||||||||
| "start": "ng serve", | ||||||||||
| "build": "ng build", | ||||||||||
| "watch": "ng build --watch --configuration development", | ||||||||||
| "test": "ng test", | ||||||||||
| "lint": "ng lint", | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Confirm angular.json still declares a lint target (which would require the eslint builder).
fd -t f 'angular.json' --exec sh -c 'echo "=== {} ==="; cat {}'
# Confirm no eslint config remains orphaned.
fd -t f -H -E node_modules '(^|/)(\.eslintrc(\.json|\.js|\.cjs|\.yml|\.yaml)?|eslint\.config\.(js|cjs|mjs|ts))$'Repository: BAWES-Universe/studenthub-staff Length of output: 9344 🏁 Script executed: #!/bin/bash
# Check package.json content, specifically around the mentioned lines
head -70 package.json | tail -65Repository: BAWES-Universe/studenthub-staff Length of output: 2113 🏁 Script executed: #!/bin/bash
# Check if .eslintrc.json exists and view its content
if [ -f .eslintrc.json ]; then
echo "=== .eslintrc.json exists ==="
cat .eslintrc.json
else
echo ".eslintrc.json does not exist"
fiRepository: BAWES-Universe/studenthub-staff Length of output: 1165 🏁 Script executed: #!/bin/bash
# Search for any ESLint-related dependencies in package.json
rg '@angular-eslint|@typescript-eslint|"eslint"' package.jsonRepository: BAWES-Universe/studenthub-staff Length of output: 57 Remove
Either re-add the Angular ESLint stack compatible with Angular 19 ( 🤖 Prompt for AI Agents |
||||||||||
| "serve-kk": "ionic serve --configuration=krushn", | ||||||||||
| "build:devserver": "ng build --configuration=dev --service-worker", | ||||||||||
| "build:production": "ng build --configuration=production --service-worker ", | ||||||||||
| "ionic:serve:khalid": "ionic serve --configuration=khalid", | ||||||||||
| "sentry:sourcemaps": "sentry-cli sourcemaps inject --org pogi --project sh-staff-app ./www && sentry-cli sourcemaps upload --org pogi --project sh-staff-app ./www" | ||||||||||
| "e2e": "ng e2e", | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check whether any e2e folder/config is present in the repo that this script would target.
fd -t d -H -E node_modules '^(e2e|cypress|playwright|tests-e2e)$'
fd -t f -H -E node_modules '^(cypress\.config\.(t|j)s|playwright\.config\.(t|j)s|protractor\.conf\.(t|j)s)$'
# Check angular.json for an e2e builder.
rg -nP '"e2e"\s*:\s*\{' --type=jsonRepository: BAWES-Universe/studenthub-staff Length of output: 57 🏁 Script executed: cat -n package.json | head -70Repository: BAWES-Universe/studenthub-staff Length of output: 2577 🏁 Script executed: rg -n "devDependencies" -A 20 package.jsonRepository: BAWES-Universe/studenthub-staff Length of output: 806 🏁 Script executed: cat -n angular.json 2>/dev/null | head -100Repository: BAWES-Universe/studenthub-staff Length of output: 3993
Either install and configure one of the supported runners (e.g., 🤖 Prompt for AI Agents |
||||||||||
| "cap:sync": "npx cap sync", | ||||||||||
| "cap:open:ios": "npx cap open ios", | ||||||||||
| "cap:open:android": "npx cap open android" | ||||||||||
| }, | ||||||||||
| "private": true, | ||||||||||
| "dependencies": { | ||||||||||
| "@angular/common": "^15.0.0", | ||||||||||
| "@angular/core": "^15.0.0", | ||||||||||
| "@angular/forms": "^15.0.0", | ||||||||||
| "@angular/platform-browser": "^15.0.0", | ||||||||||
| "@angular/platform-browser-dynamic": "^15.0.0", | ||||||||||
| "@angular/router": "^15.0.0", | ||||||||||
| "@angular/service-worker": "^15.2.3", | ||||||||||
| "@auth0/auth0-angular": "^1.11.1", | ||||||||||
| "@awesome-cordova-plugins/core": "^6.6.0", | ||||||||||
| "@awesome-cordova-plugins/file": "^6.2.0", | ||||||||||
| "@capacitor/android": "^4.6.1", | ||||||||||
| "@capacitor/app": "^4.1.1", | ||||||||||
| "@capacitor/camera": "^4.1.4", | ||||||||||
| "@capacitor/core": "^4.7.1", | ||||||||||
| "@capacitor/filesystem": "^4.1.4", | ||||||||||
| "@capacitor/geolocation": "^4.1.0", | ||||||||||
| "@capacitor/haptics": "4.1.0", | ||||||||||
| "@capacitor/keyboard": "4.1.0", | ||||||||||
| "@capacitor/splash-screen": "^4.1.2", | ||||||||||
| "@capacitor/status-bar": "^4.1.1", | ||||||||||
| "@ckeditor/ckeditor5-angular": "^4.0.0", | ||||||||||
| "@ckeditor/ckeditor5-build-classic": "^35.4.0", | ||||||||||
| "@codetrix-studio/capacitor-google-auth": "^3.4.0-rc.0", | ||||||||||
| "@ionic/angular": "^6.1.9", | ||||||||||
| "@ionic/storage-angular": "^3.0.6", | ||||||||||
| "@ngx-translate/core": "^14.0.0", | ||||||||||
| "@ngx-translate/http-loader": "^7.0.0", | ||||||||||
| "@sentry/browser": "^7.92.0", | ||||||||||
| "@sentry/cli": "^2.24.1", | ||||||||||
| "@tinymce/tinymce-angular": "^7.0.0", | ||||||||||
| "algoliasearch": "^4.23.3", | ||||||||||
| "angular-instantsearch": "^4.4.0", | ||||||||||
| "aws-sdk": "^2.1279.0", | ||||||||||
| "chart.js": "^4.1.1", | ||||||||||
| "cordova-plugin-file": "^7.0.0", | ||||||||||
| "cordova-plugin-nativestorage": "^2.3.2", | ||||||||||
| "date-fns": "^2.29.3", | ||||||||||
| "file-saver": "^2.0.5", | ||||||||||
| "ion2-calendar": "^3.5.0", | ||||||||||
| "ionicons": "^6.0.3", | ||||||||||
| "mixpanel-browser": "^2.45.0", | ||||||||||
| "moment": "^2.30.1", | ||||||||||
| "ng5-slider": "^1.2.6", | ||||||||||
| "rxjs": "~7.5.0", | ||||||||||
| "@angular/common": "^19.0.0", | ||||||||||
| "@angular/core": "^19.0.0", | ||||||||||
| "@angular/forms": "^19.0.0", | ||||||||||
| "@angular/platform-browser": "^19.0.0", | ||||||||||
| "@angular/platform-browser-dynamic": "^19.0.0", | ||||||||||
| "@angular/router": "^19.0.0", | ||||||||||
| "@capacitor/android": "^7.0.0", | ||||||||||
| "@capacitor/app": "^7.0.0", | ||||||||||
| "@capacitor/browser": "^7.0.0", | ||||||||||
| "@capacitor/camera": "^7.0.0", | ||||||||||
| "@capacitor/core": "^7.0.0", | ||||||||||
| "@capacitor/filesystem": "^7.0.0", | ||||||||||
| "@capacitor/haptics": "^7.0.0", | ||||||||||
| "@capacitor/ios": "^7.0.0", | ||||||||||
| "@capacitor/keyboard": "^7.0.0", | ||||||||||
| "@capacitor/network": "^7.0.0", | ||||||||||
| "@capacitor/preferences": "^7.0.0", | ||||||||||
| "@capacitor/push-notifications": "^7.0.0", | ||||||||||
| "@capacitor/share": "^7.0.0", | ||||||||||
| "@capacitor/splash-screen": "^7.0.0", | ||||||||||
| "@capacitor/status-bar": "^7.0.0", | ||||||||||
| "@ionic/angular": "^8.0.0", | ||||||||||
| "@ionic/angular-toolkit": "^11.0.0", | ||||||||||
| "rxjs": "~7.8.0", | ||||||||||
| "tslib": "^2.3.0", | ||||||||||
| "zone.js": "~0.11.4" | ||||||||||
| "zone.js": "~0.15.0" | ||||||||||
| }, | ||||||||||
|
Comment on lines
18
to
45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Surface any source imports of packages dropped in this PR.
patterns=(
'@auth0/'
'@sentry/'
'@ckeditor/'
'tinymce'
'aws-sdk'
'cordova-'
'@ionic-native/'
'@angular/service-worker'
'@angular/animations'
'tailwindcss'
)
for p in "${patterns[@]}"; do
echo "=== imports of: $p ==="
rg -nP --type=ts --type=html -g '!**/node_modules/**' -g '!**/dist/**' "from\s+['\"][^'\"]*${p}[^'\"]*['\"]|import\s+['\"][^'\"]*${p}[^'\"]*['\"]|require\(\s*['\"][^'\"]*${p}[^'\"]*['\"]\s*\)"
done
# Also list any *.module.ts that still imports HttpClientModule/ServiceWorkerModule etc. that may rely on removed deps.
rg -nP --type=ts -g '!**/node_modules/**' 'ServiceWorkerModule|BrowserAnimationsModule|NoopAnimationsModule'Repository: BAWES-Universe/studenthub-staff Length of output: 5344 Remove unresolved imports before merging; packages were deleted but source still references them. The PR removes runtime dependencies but leaves active imports in the source tree that will cause TypeScript compilation to fail:
Either re-add these packages to dependencies with Capacitor 7 equivalents where applicable, or remove the corresponding source imports and module registrations before merging. 🤖 Prompt for AI Agents |
||||||||||
| "devDependencies": { | ||||||||||
| "@angular-devkit/build-angular": "^15.0.0", | ||||||||||
| "@angular-eslint/builder": "^14.0.0", | ||||||||||
| "@angular-eslint/eslint-plugin": "^14.0.0", | ||||||||||
| "@angular-eslint/eslint-plugin-template": "^14.0.0", | ||||||||||
| "@angular-eslint/template-parser": "^14.0.0", | ||||||||||
| "@angular/cli": "^15.0.4", | ||||||||||
| "@angular/compiler": "^15.0.0", | ||||||||||
| "@angular/compiler-cli": "^15.0.0", | ||||||||||
| "@angular/language-service": "^15.0.0", | ||||||||||
| "@capacitor/cli": "4.6.1", | ||||||||||
| "@ionic/angular-toolkit": "^6.0.0", | ||||||||||
| "@types/jasmine": "~4.0.0", | ||||||||||
| "@types/node": "^12.11.1", | ||||||||||
| "@typescript-eslint/eslint-plugin": "5.3.0", | ||||||||||
| "@typescript-eslint/parser": "5.3.0", | ||||||||||
| "autoprefixer": "^10.4.20", | ||||||||||
| "eslint": "^7.6.0", | ||||||||||
| "eslint-plugin-import": "2.22.1", | ||||||||||
| "eslint-plugin-jsdoc": "30.7.6", | ||||||||||
| "eslint-plugin-prefer-arrow": "1.2.2", | ||||||||||
| "jasmine-core": "~4.3.0", | ||||||||||
| "jasmine-spec-reporter": "~5.0.0", | ||||||||||
| "@angular-devkit/build-angular": "^19.0.0", | ||||||||||
| "@angular/cli": "^19.0.0", | ||||||||||
| "@angular/compiler": "^19.0.0", | ||||||||||
| "@angular/compiler-cli": "^19.0.0", | ||||||||||
| "@angular/language-service": "^19.0.0", | ||||||||||
| "@capacitor/cli": "^7.0.0", | ||||||||||
| "@types/jasmine": "~5.1.0", | ||||||||||
| "@types/jasminewd2": "~2.0.13", | ||||||||||
| "@types/node": "^22.0.0", | ||||||||||
| "jasmine-core": "~5.1.0", | ||||||||||
| "jasmine-spec-reporter": "~7.0.0", | ||||||||||
| "karma": "~6.4.0", | ||||||||||
| "karma-chrome-launcher": "~3.1.0", | ||||||||||
| "karma-coverage": "~2.2.0", | ||||||||||
| "karma-coverage-istanbul-reporter": "~3.0.2", | ||||||||||
| "karma-chrome-launcher": "~3.2.0", | ||||||||||
| "karma-coverage-istanbul-reporter": "~3.0.3", | ||||||||||
| "karma-jasmine": "~5.1.0", | ||||||||||
| "karma-jasmine-html-reporter": "~2.0.0", | ||||||||||
| "postcss": "^8.4.49", | ||||||||||
| "tailwindcss": "^3.4.16", | ||||||||||
| "ts-node": "~8.3.0", | ||||||||||
| "typescript": "~4.8.4" | ||||||||||
| }, | ||||||||||
| "description": "Staff portal of studenthub" | ||||||||||
| "karma-jasmine-html-reporter": "^2.1.0", | ||||||||||
| "ts-node": "~10.9.0", | ||||||||||
| "typescript": "~5.6.0" | ||||||||||
| } | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing
appIdbreaks automatic updates for existing users.Changing the application identifier from
'co.studenthub.staff'to'com.bawes.studenthubstaff'creates a completely different app identity on both Android and iOS. Existing users will not receive this as an update—they will need to manually uninstall the old app and install the new one, which typically results in local data loss unless an explicit migration strategy is in place.Recommended actions:
🤖 Prompt for AI Agents