Skip to content

Commit 83e48cf

Browse files
committed
feat(cordova): use cordova-res by default
cordova-res is a utility built by Ionic for generating icon and splash screen resources locally. See the GitHub repo: https://github.com/ionic-team/cordova-res BREAKING CHANGE: `ionic cordova resources` no longer generates resources using Ionic servers by default. Instead, `cordova-res` is used to generate resources locally. PSD and AI file formats are no longer supported in this new flow. The old behavior is available by specifying `--no-cordova-res`.
1 parent eadcba0 commit 83e48cf

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

packages/ionic/src/commands/cordova/resources.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LOGGER_LEVELS, MetadataGroup, createPrefixedFormatter } from '@ionic/cli-framework';
1+
import { LOGGER_LEVELS, createPrefixedFormatter } from '@ionic/cli-framework';
22
import { prettyPath } from '@ionic/cli-framework/utils/format';
33
import { cacheFileChecksum, copy, pathExists } from '@ionic/utils-fs';
44
import { ERROR_COMMAND_NOT_FOUND, SubprocessError } from '@ionic/utils-subprocess';
@@ -23,25 +23,21 @@ export class ResourcesCommand extends CordovaCommand implements CommandPreRun {
2323
type: 'project',
2424
summary: 'Automatically create icon and splash screen resources',
2525
description: `
26-
Ionic can automatically generate perfectly sized icons and splash screens from source images (${strong('.png')}, ${strong('.psd')}, or ${strong('.ai')}) for your Cordova platforms.
26+
Generate perfectly sized icons and splash screens from PNG source images for your Cordova platforms with this command.
2727
2828
The source image for icons should ideally be at least ${strong('1024×1024px')} and located at ${strong('resources/icon.png')}. The source image for splash screens should ideally be at least ${strong('2732×2732px')} and located at ${strong('resources/splash.png')}. If you used ${input('ionic start')}, there should already be default Ionic resources in the ${strong('resources/')} directory, which you can overwrite.
2929
3030
You can also generate platform-specific icons and splash screens by placing them in the respective ${strong('resources/<platform>/')} directory. For example, to generate an icon for Android, place your image at ${strong('resources/android/icon.png')}.
3131
32-
By default, this command will not regenerate resources whose source image has not changed. To disable this functionality and always overwrite generated images, use ${input('--force')}.
33-
3432
For best results, the splash screen's artwork should roughly fit within a square (${strong('1200×1200px')}) at the center of the image. You can use ${strong('https://code.ionicframework.com/resources/splash.psd')} as a template for your splash screen.
3533
3634
${input('ionic cordova resources')} will automatically update your ${strong('config.xml')} to reflect the changes in the generated images, which Cordova then configures.
3735
36+
This command uses the ${input('cordova-res')} utility[^cordova-res-repo] to generate resources locally. You can also login to your Ionic account and use Ionic servers to generate icons and splash screens with ${input('--no-cordova-res')}.
37+
3838
Cordova reference documentation:
3939
- Icons: ${strong('https://cordova.apache.org/docs/en/latest/config_ref/images.html')}
4040
- Splash Screens: ${strong('https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/')}
41-
42-
This command uses Ionic servers and we require you to be logged into your free Ionic account. Use ${input('ionic login')} to login.
43-
44-
With the experimental ${input('--cordova-res')} option, ${input('ionic cordova resources')} will generate resources locally using the ${input('cordova-res')} utility[^cordova-res-repo].
4541
`,
4642
footnotes: [
4743
{
@@ -57,12 +53,6 @@ With the experimental ${input('--cordova-res')} option, ${input('ionic cordova r
5753
},
5854
],
5955
options: [
60-
{
61-
name: 'force',
62-
summary: 'Force regeneration of resources',
63-
type: Boolean,
64-
aliases: ['f'],
65-
},
6656
{
6757
name: 'icon',
6858
summary: 'Generate icon resources',
@@ -77,9 +67,16 @@ With the experimental ${input('--cordova-res')} option, ${input('ionic cordova r
7767
},
7868
{
7969
name: 'cordova-res',
80-
summary: `Use ${input('cordova-res')} instead of Ionic resource server`,
70+
summary: `Do not generate resources locally; use Ionic servers`,
71+
type: Boolean,
72+
default: true,
73+
},
74+
{
75+
name: 'force',
76+
summary: 'Force regeneration of resources',
8177
type: Boolean,
82-
groups: [MetadataGroup.EXPERIMENTAL],
78+
aliases: ['f'],
79+
hint: weak('(--no-cordova-res)'),
8380
},
8481
],
8582
};

0 commit comments

Comments
 (0)