API Reference
  • Introduction
  • 💻CLI Commands
    • Create commands
      • create
      • create-package
    • Run commands
      • dev
      • serve
    • Build commands
      • build
    • Extra commands
  • 🍱Packages
    • 💙Core package
      • frontity
    • ⚡Features packages
      • @frontity/wp-source
      • @frontity/tiny-router
      • @frontity/html2react
      • @frontity/head-tags
      • @frontity/yoast
      • @frontity/google-ad-manager
      • @frontity/smart-adserver
      • analytics packages
        • @frontity/google-analytics
        • @frontity/google-tag-manager-analytics
        • @frontity/comscore-analytics
      • @frontity/wp-comments
    • 📚Collections packages
      • @frontity/components
      • @frontity/hooks
        • Infinite Scroll Hooks
        • Intersection Observer Hooks
    • 🎨Themes Packages
      • @frontity/twentytwenty-theme
      • @frontity/mars-theme
  • 🔌WordPress Plugins
    • REST API - Head Tags
    • Frontity Embedded Mode
Powered by GitBook
On this page
  • Arguments
  • [package-name]
  • [options]
  • Examples
  • Environment Variables
  • FRONTITY_CREATE_PACKAGE_NAME

Was this helpful?

  1. CLI Commands
  2. Create commands

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

--namespace <value>

--no-prompt

--open

Output usage information

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.

Environment Variables

FRONTITY_CREATE_PACKAGE_NAME

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

Example:

FRONTITY_CREATE_NAME=test-project
PreviouscreateNextRun commands

Last updated 4 years ago

Was this helpful?

Sets the for this package

Skips prompting the user for options. Related environment variable: .

If you pass the flag to the , the CLI will use the name from this FRONTITY_CREATE_PACKAGE_NAME environment variable.

You can see a scheme of the whole workflow of using this FRONTITY_CREATE_PACKAGE_NAME environment variable in the section

💻
namespace
FRONTITY_CREATE_PACKAGE_NAME
create-package
--no-prompt
--no-prompt