Skip to content

Conversation

mhartington
Copy link
Contributor

This splits out the builders and schematics into two separate packages. The reason behind this is that the schematics and builders always had separate goals. This will update @ionic/angular-toolkit to only include the schematics for @ionic/angular apps, no builders.

A new package @ionic/cordova-builders will be created that will have all the custom build tools needed for older Ionic/Cordova apps.

Migration

For folks using @ionic/angular and Capacitor, you can update to the latest (once release) and remove the older ionic-cordova-build entries from your angular.json

               "devServerTarget": "app:serve:ci"
             }
           }
-        },
-        "ionic-cordova-build": {
-          "builder": "@ionic/angular-toolkit:cordova-build",
-          "options": {
-            "browserTarget": "app:build"
-          },
-          "configurations": {
-            "production": {
-              "browserTarget": "app:build:production"
-            }
-          }
-        },
-        "ionic-cordova-serve": {
-          "builder": "@ionic/angular-toolkit:cordova-serve",
-          "options": {
-            "cordovaBuildTarget": "app:ionic-cordova-build",
-            "devServerTarget": "app:serve"
-          },
-          "configurations": {
-            "production": {
-              "cordovaBuildTarget": "app:ionic-cordova-build:production",
-              "devServerTarget": "app:serve:production"
-            }
-          }
         }
       }
     }

And you're good to go! You'll still have access to the schematics so things like ionic g page will work as expected.

For Ionic/Cordova users, you will need to install the new @ionic/cordova-builders package.

npm install @ionic/cordova-builders

Then you can update the existing ionic-cordova-build task to call the new package.

           }
         },
         "ionic-cordova-build": {
-          "builder": "@ionic/angular-toolkit:cordova-build",
+          "builder": "@ionic/cordova-builders:cordova-build",
           "options": {
             "browserTarget": "app:build"
           },
@@ -155,7 +155,7 @@
           }
         },
         "ionic-cordova-serve": {
-          "builder": "@ionic/angular-toolkit:cordova-serve",
+          "builder": "@ionic/cordova-builders:cordova-serve",
           "options": {
             "cordovaBuildTarget": "app:ionic-cordova-build",
             "devServerTarget": "app:serve"

Everything should still work as expected, but if you do run into any problems, please open an issue 😄

this splits angular-toolkit into two packages. @ionic/angular-toolkit provides schematics for
angular. @ionic/cordova-builders provides a collection of custom builders for ionic/angular +
cordova app

BREAKING CHANGE: ionic/angular + cordova users will now need to install @ionic/cordova-builders and
update their angular.json to reflect the new package name
@mhartington mhartington merged commit ea939fe into main Jan 18, 2022
mhartington added a commit that referenced this pull request Jan 18, 2022
* feat: split packages and create mono-repo

this splits angular-toolkit into two packages. @ionic/angular-toolkit provides schematics for
angular. @ionic/cordova-builders provides a collection of custom builders for ionic/angular +
cordova app

BREAKING CHANGE: ionic/angular + cordova users will now need to install @ionic/cordova-builders and
update their angular.json to reflect the new package name

* chore(): fix package description
@mhartington mhartington mentioned this pull request Jan 19, 2022
@crhistianramirez
Copy link

This may be a dumb question, but if I have an ionic/capacitor app but I still use cordova plugins can I go the simple route or do I need the @ionic/cordova-builders package?

@mhartington
Copy link
Contributor Author

You do not need the cordova-builders package since you are using capacitor as the main tool

@jeffjulian
Copy link

You might consider updating the Readme.md file for angular-toolkit to mention the instructions for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants