Electrode Native
v0.41
v0.41
  • Introduction
  • INTRODUCTION
    • Overview
      • What is Electrode Native
      • Why use Electrode Native
      • What is a MiniApp
      • Electrode Native workflow
      • Native dependencies management
      • JS/Native communication
      • Requirements
      • Upgrading Electrode Native
      • Contributing
  • REFERENCE
    • Bundle Store
    • Composite
    • Container
      • What's inside
      • Publication
      • Integration
      • Initialization
      • Launching MiniApps
    • Cauldron
      • Structure
      • Setup
      • Compatibility checks
      • Guidelines
    • Manifest
      • Override
      • Native Modules
      • Configurable Modules
    • Runner
    • APIs
      • Project Generation
      • Implementation
      • Versioning
      • Guidelines
    • Bridge
      • Message Types
      • Communication
      • Leveraging APIs
    • CLI
      • Global CLI
      • Local CLI
    • GLOSSARY
  • GUIDES
    • Debugging multiple MiniApps
  • CLI COMMANDS
    • add
    • bundlestore
      • create
      • delete
      • upload
      • use
    • binarystore
      • add
      • get
      • remove
    • code-push
      • patch
      • release
      • promote
    • compat-check
    • create-api-impl
    • create-api
    • create-composite
    • create-container
    • create-plugin-config
    • publish-container
    • transform-container
    • create-miniapp
    • link
    • regen-api
    • regen-api-impl
    • run-android
    • run-ios
    • start
    • unlink
    • upgrade-miniapp
    • cauldron add
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron config
      • get
    • cauldron del
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron get
      • config
      • dependency
      • nativeapp
    • cauldron repo
      • add
      • clear
      • current
      • list
      • remove
      • use
    • cauldron update
      • file
      • jsapiimpls
      • miniapps
      • nativeapp
    • cauldron batch
    • cauldron regen-container
    • cauldron upgrade
    • cauldron why
    • github
      • github create-ref
      • github delete-ref
      • github align-dependencies
    • platform
      • plugins
        • list
        • search
      • config
        • set
        • get
        • del
        • list
      • install
      • versions
      • uninstall
      • use
Powered by GitBook
On this page
  • Description
  • Syntax
  • Examples
  • Remarks
  • Related commands
  1. CLI COMMANDS

create-api-impl

Description

  • Create an implementation skeleton project for a specified API

    Note This command does not require that you are the author of the API that you are planning to implement, but it requires that the API has been created first.

Syntax

ern create-api-impl <apiName> [apiImplName]

Arguments

<apiName>

  • The package descriptor of the API for which to create an API implementation project

  • We recommend suffixing the name of API implementation with suffix Impl

[apiImplName]

  • The name of the API implementation project. The API implementation name must follow Electrode Native module name rules.

  • If name of the apiImpl is missing the apiName is converted to came case notation and numbers are removed if any.

Options

--nativeOnly/-n

  • Generate an implementation skeleton project for a native implementation of the API

--jsOnly/-j

  • Generate an implementation skeleton project for a JavaScript implementation of the API

--packageName/-p

  • Specify the NPM package name to use for the API implementation.

  • Add the package name automatically in the package.json of the generated API implementation.

  • Default The command will prompt for the package name to use.

--scope/-s

  • Specify the NPM package scope to use for the API implementation.

  • Add the package scope automatically in the package.json of the generated API implementation.

  • Default Package will be unscoped.

--outputDirectory/-o <directory>

  • Generate the project in a specified output directory

  • Default The project is generated in a new directory named as the API implementation project. The new directory is created in the current working directory.

--hasConfig

  • Indicates if this api implementation requires some config during initialization.

  • This option will be stored and reused during container generation to enforce config initialization

--skipNpmCheck

  • Skip the check ensuring package does not already exists in NPM registry

  • Default The value defaults to false.

--force/-f

  • Force the creation of an API implementation project

  • Caution If there is already an implementation project in the target directory, the new project will overwrite the existing project completely. Use this option only if you are sure that you can overwrite any existing project.

--manifestId <manifestId>

Examples

ern create-api-impl react-native-weather-api

This example shows how to create an API skeleton project named ReactNativeWeatherApiImpl.

ern create-api-impl react-native-weather-api MyApi

This example shows how to create an API skeleton project named MyApi.

ern create-api-impl react-native-weather-api MyApi -p my-weather-api-impl

This example shows how to create an API skeleton project named MyApi. The package name for this project is my-weather-api-impl.

ern create-api-impl react-native-weather-api MyApi -p my-weather-api-impl -s org

This example shows how to create an API skeleton project named MyApi. The package name for this project is @org/my-weather-api-impl.

Remarks

  • If name of the apiImpl is missing the apiName is converted to came case notation and numbers are removed if any.

  • If you do not specify a platform (for example, native v.s JavaScript), you are prompted to select a platform.

Related commands

Previouscompat-checkNextcreate-api

Last updated 4 years ago

Id of the override Manifest entry to retrieve dependencies versions from (see for more info)

| Create an API

override Manifest
ern create-api