create-miniapp
Description
Create a new MiniApp in a new directory named after the MiniApp.
The generated MiniApp is a starter HelloWorld MiniApp
that you can use to launch a standalone MiniApp on the iOS or Android platforms in our Runner—using the ern run-ios
and ern run-android
commands.
If you used react-native previously, you'll notice that the generated JavaScript react-native MiniApp is exactly the same react-native starter app as the one provided by react-native. A MiniApp is simply a react-native application. One of the differences with react-native is that we generate our own native projects which use a locally-generated ern
container.
iOS and Android directories are not generated by this command. To generate those directories, run the ern run-ios
or ern run-android
commands.
Syntax
ern create-miniapp <appName>
Arguments
<appName>
The name to use for the MiniApp. The MiniApp name must follow Electrode Native module name rules.
We recommend suffixing the name of MiniApp with suffix
App
Options
--scope/-s <scope>
Specify the NPM package scope to use for the MiniApp.
Add the package scope automatically in the
package.json
of the generated MiniApp.Default Package will be unscoped.
--packageName/-p <name>
Specify the NPM package name to use for the MiniApp.
Add the package name automatically in the
package.json
of the generated MiniApp.Default The command will prompt for the package name to use.
--platformVersion/-v <version>
Specify a platform version if different from the currently activated version.
This option is rarely used.
Default Will use the currently activated platform version.
--skipNpmCheck
Skip the check ensuring package does not already exists in NPM registry.
Default The value defaults to false.
--manifestId <manifestId>
Id of the override Manifest entry to retrieve dependencies versions from (see [override Manifest] for more info)
Examples
ern create-miniapp MyAwesomeApp
Creates a MiniApp named MyAwesomeApp
.
ern create-miniapp MyAwesomeApp --scope MyCompany
Creates a MiniApp named MyAwesomeApp
and use MyCompany
as the scope of the MiniApp NPM package.
ern create-miniapp MyAwesomeApp --packageName my-awesome-app
Creates a MiniApp named MyAwesomeAp
and use my-awesome-app
as the name of the MiniApp NPM package.
Remarks
MiniApp name can only consist of upper and lower case characters. No digits nor special characters can be used.
Package name should be a valid NPM package name.
This command is the
ern
equivalent of thereact-native init
command.
[override Manifest]: ../platform-parts/manifest/override.md
Last updated