create-package

The create-package command creates a new Frontity package in a project. Launch this command from the root of the Frontity project

npx frontity create-package [package-name] [options]

Arguments

[package-name]

This argument sets the name of your Frontity package. The create-package command will create a folder named [package-name] under packages. It will also add the proper dependency in the package.json of your Frontity project

[options]

Option

Description

-n <value>, --namespace <value>

Sets the namespace for this package

--no-prompt

Skips prompting the user for options

-h, --open

Output usage information

The --no-prompt option

You can set the name of the package as an environmental variable called FRONTITY_NAME.

If you pass the --no-prompt flag, the CLI will use the name from that FRONTITY_NAME.

If the CLI cannot find a FRONTITY_NAME environmental variable, it will prompt for the name of the package

This is the scheme followed by the CLI to get the name of the package

Examples

  • Create a custom theme package named my-custom-project

> npx frontity create-package my-custom-theme
? Enter the namespace of the package: theme
โœ” Adding package.json.
โœ” Adding src/index.js.
โœ” Installing package my-custom-theme.
โ€‹
New package "my-custom-theme" created.