Create a Baseline Extension

This topic applies to

Applies to

SuiteCommerce Web Stores

A Baseline Extension is a set of files, installed locally in your extension development directory. You use these files as a basis to build any extension for your SuiteCommerce site.

When you run the gulp extension:create command, the developer tools create this baseline extension in a Workspace directory within your top-level extension development directory. The baseline extension starts out with one module that you design, based on your needs. It can include any combination of the following file types within one new module:

  • Templates

  • Sass

  • Configuration

  • JavaScript

  • SuiteScript

To create a baseline extension:

  1. Open a command line or terminal.

  2. Access the top-level extension development directory you created when you installed the extension developer tools.

  3. Enter the following command:

    gulp extension:create
  4. When prompted, enter the following information:

    Important

    Unless otherwise directed, create all entries using only alphanumeric characters without spaces.


    Pressing enter results in the default value.

    • Set Your Extension Fantasy Name – Provide a name for your extension as you want it to appear in the NetSuite user interface. This can contain special characters and spaces. For example: My Cool Extension!

    • Set Your Extension Name – Provide a name for your extension within your development environment.

    • Set the Vendor Name – Enter your business vendor or partner name.

    • Assign a Version Number– Add a version number for your extension.

      Important

      To take advantage of extension update requirements, use semantic versioning (SemVer) notation. For more information, see https://semver.org/.


    • Set a Description for Your Extension – Provide some text to describe your extension. This string can contain spaces and special characters.

    • This Extension Supports – Select one of the following options:

      • SuiteCommerce Online – To create an extension for SuiteCommerce or SuiteCommerce Advanced.

      • SuiteCommerce InStore – To create an extension for SuiteCommerce InStore.

      An asterisk (*) identifies a selected option. Press the spacebar to select. Use arrow keys to scroll. Press the A key to select all. Press the I key to invert your selections.

    • Set the Initial Module Name – Name the module to be created as part of the baseline extension. Each extension needs at least one module to contain your extension files.

    • This Extension Will Be Applied To – Select one or more applications that your extension requires. Your options are: Shopping, Checkout, or My Account.

    • For This Extension You Will Be Using – Select one or more file types that your extension should include. Your options are: JavaScript, SuiteScript, Templates, Sass, and Configuration.

    • Select extension to add module – Select the name of the extension to contain this module. This option only appears if your Workspace directory contains more than one extension.

After following these prompts, you can optionally build on this baseline by adding additional modules. Consider the following topics:

When you have completed building baseline extension files in your developer environment, you are ready to develop your extension. See Extensions for details.

What Happens When You Create Extension files?

When you run the gulp extension:create command, the extension developer tools:

  • Create the Workspace directory in your top-level development directory, unless it already exists.

  • Create a subdirectory to house all of your extension’s code. This is where you develop your extension.

  • Create a manifest.json file. This file includes all the information required to compile resources for your extension.

Example

You run the gulp extension:create command and build a baseline extension, MyCoolExtension with a module called MyCoolModule. You set this extension to include all available files.

In this example, your Workspace directory structure should look similar to following:

Workspace/
      MyCoolExtension/
         assets/
            fonts/
            img/
            services/
         Modules/
            MyCoolModule/
               Configuration/
               JavaScript/
               Sass/
               SuiteScript/
               Templates/
         manifest.json