create-package
The create-package command creates a new Frontity package in a project. Launch this command from the root of the Frontity project
1
npx frontity create-package [package-name] [options]
Copied!

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
--namespace <value>
Sets the namespace for this package
--no-prompt
Skips prompting the user for options. Related environment variable: FRONTITY_CREATE_PACKAGE_NAME.
--open
Output usage information

Examples

  • Create a custom theme package named my-custom-project
1
> npx frontity create-package my-custom-theme
2
? Enter the namespace of the package: theme
3
βœ” Adding package.json.
4
βœ” Adding src/index.js.
5
βœ” Installing package my-custom-theme.
6
​
7
New package "my-custom-theme" created.
Copied!

Environment Variables

FRONTITY_CREATE_PACKAGE_NAME

If you pass the --no-prompt flag to the create-package, the CLI will use the name from this FRONTITY_CREATE_PACKAGE_NAME environment variable.
If the CLI cannot find a FRONTITY_CREATE_PACKAGE_NAME environmental variable, it will prompt for the name of the package
Example:
1
FRONTITY_CREATE_NAME=test-project
Copied!
You can see a scheme of the whole workflow of using this FRONTITY_CREATE_PACKAGE_NAME environment variable in the --no-prompt section
Last modified 1yr ago