Gulp Command Reference for Theme and Extension Developer Tools

Theme Developer Gulp Commands

CommandDescription
gulp theme:fetchDownloads the active theme and extension files (Sass, HTML, and other assets) for the specified domain. You must have already activated a theme using the Manage Extensions wizard in NetSuite for this command to run. This command places these files in the top-level directory’s Theme directory. If this is the first time running this command, the development tools create subdirectories for these files.
gulp theme:fetch –accountUse the –account parameter only for release 2021.2.1 and later accounts that have account-specific domains.Specify your account number with the gulp command to enable access to the NetSuite account. For example, if your account number is 123456, you can enter the following command to successfully authenticate and fetch from your NetSuite account:gulp theme:fetch --account 123456For sandbox accounts, specify your account number as shown in this example:gulp theme:fetch --account 123456–sb1For more information, see URLs for Account-Specific Domains.
gulp theme:fetch –toFetches a theme from NetSuite as usual, but this command prompts for login credentials.
gulp theme:localCompiles all Sass and HTML template files for a theme into a functional application. This command also updates the theme manifest.json.After compilation, this command starts a local server. This server watches for changes to Sass and HTML template files. After the server starts, any changes you make to your theme files or extension overrides are automatically recompiled and visible in the browser.
gulp theme:local –preserve-manifestPerforms the same action as gulp theme:local, but it does not update the manifest. Use this command to test your theme locally if you have made any manual changes to the manifest.json file for the theme.
gulp theme:deployCompiles Sass, HTML, and asset files into a DeployDistribution folder. This command also updates the theme manifest.json.If you are deploying changes to a published theme, the development tools prompt you for a Vendor Name, Theme Name, Theme Version, Description, and Application when you initially run this command. This command forces you to name a new theme.If you are deploying customizations to a custom theme, this command does not prompt you for this information and gives you the option to create a new theme or update the existing theme.The development tools then create a folder for the theme in the NetSuite File Cabinet and deploy the customized theme’s code.In addition to compiling the application, this command creates the .nsdeploy file, if it does not already exist.
gulp theme:deploy –accountUse the –account parameter only for release 2021.2.1 and later accounts that have account-specific domains.Specify your account number with the gulp command to enable access to the NetSuite account. For example, if your account number is 123456, you can enter the following command to successfully authenticate and deploy to your NetSuite account:gulp theme:deploy --account 123456For sandbox accounts, specify your account number as shown in this example:gulp theme:deploy --account 123456–sb1For more information, see URLs for Account-Specific Domains.
gulp theme:deploy –preserve-manifestPerforms the same action as gulp theme:deploy, but it does not update the manifest. Use this command to deploy your theme if you have made any manual changes to the manifest.json file for the theme.
gulp theme:deploy –advancedDeploys as an update of the current custom theme, but resets the prompts regarding the Vendor Name, Theme Name, Theme Version, Description, and Application. This command also rewrites this information in the theme’s manifest.json file.This command only takes effect on custom themes.
gulp theme:deploy –createCreates a new theme instead of updating the existing theme.
gulp theme:deploy –skip-compilationDeploys the current contents of the DeployDistribution folder without compiling the application. Although the developer tools do not deploy a compiled set of files, the default action is to compile files as a final test of your code. Using this command skips this check.
gulp theme:deploy –source templatesDeploys only the HTML template files.
gulp theme:deploy –source sassDeploys only Sass files.
gulp theme:deploy –source assetsDeploys only theme asset files.
gulp theme:deploy –source skinsDeploys only theme skin preset files.
gulp extension:deploy –source <multiple>Deploys more than one type of source code when you separate multiple source deployments by commas. For example, gulp extension:deploy --source templates,sass
gulp theme:deploy –toDeploys to NetSuite as usual, but resets the login credentials, rewriting the .nsdeploy file.
gulp theme:update-manifestUpdates the theme’s manifest.json file without requiring a deployment.
gulp validateValidates the theme’s manifest.json file and confirms that the file does not list any files that do not exist in the theme folder.
gulp clearRemoves the DeployDistribution and LocalDistribution directories and the .nsdeploy file.
gulpDisplays a list of all gulp commands.

Extension Developer Gulp Commands

CommandDescription
gulp extension:createCreates an example extension (with one example module) to use as a baseline for development. This command creates all necessary folders to store and maintain your customizations within your top-level extension development directory.
gulp extension:create-moduleCreates an additional module within your extension. This command prompts you for information about the module you want to create and the extension within which you want to create it.
gulp extension:fetchDownloads the active theme and compiles all theme resources (Sass, HTML, and other assets). This command places theme files in the top-level extension development directory’s Extras folder. If this is the first time running this command, the development tools create subdirectories for these files.Note Any downloaded theme files are only provided for testing your extensions locally. You do not customize any theme files in your top-level extension development directory.
If you choose to continue development on a previously deployed, custom extension, this command also downloads these files, placing them in your Workspace/<EXTENSION_FOLDER>. The extensions must be activated using the Extension Manager.Note This command does not download published extensions. You cannot customize published content.
gulp extension:fetch –accountUse the –account parameter only for release 2021.2.1 and later accounts that have account-specific domains.Specify your account number with the gulp command to enable access to the NetSuite account. For example, if your account number is 123456, you can enter the following command to successfully authenticate and fetch from your NetSuite account:gulp extension:fetch --account 123456For sandbox accounts, specify your account number as shown in this example:gulp extension:fetch --account 123456–sb1
gulp extension:fetch <arg>Downloads the files of a specific extension, where <arg> is the name of the extension. This can be helpful if you want to use a previously deployed extension as a baseline for a new one. You can fetch multiple extensions, separated by a comma.
For example: gulp extension:fetch --fetch Badges,CartExtension.
Note Extensions must be active to download code or to view them on a local server.
gulp extension:localCompiles your custom extension files into a functional application and places them in a LocalDistibution folder.After compilation, this command starts a local server. This server watches for changes to any extension files. After the server starts, any changes you make to your extension files are automatically recompiled and visible in the browser.
gulp extension:local –preserve-manifestPerforms the same action as gulp extension:local, but it does not update the manifest. Use this command to test your extension locally if you have made any manual changes to the manifest.json file for the extension.
gulp extension:deployCompiles your custom extension files into a functional application and places them into a DeployDistribution folder.If you have more than one extension in your top-level development directory, this command prompts you to declare which extension to deploy.If you have never deployed the extension, this command prompts you for information about the extension.The development tools then create a folder for the extension in the NetSuite File Cabinet and deploy the customized extension code.In addition to compiling the application, this command creates the .nsdeploy file, if it does not already exist.
gulp extension:deploy –accountUse the –account parameter only for release 2021.2.1 and later accounts that have account-specific domains.Specify your account number with the gulp command to enable access to the NetSuite account. For example, if your account number is 123456, you can enter the following command to successfully authenticate and deploy to your NetSuite account:gulp extension:deploy --account 123456For sandbox accounts, specify your account number as shown in this example:gulp extension:deploy --account 123456–sb1
gulp extension:deploy –preserve-manifestPerforms the same action as gulp extension:deploy, but it does not update the manifest. Use this command to deploy your extension if you have made any manual changes to the manifest.json file for the extension.
gulp extension:deploy –advancedDeploys an update of the extension, but resets the prompts regarding the Vendor Name, Extension Name, Version, Description, Application, etc. This command also rewrites this information in the extension manifest.json file.
gulp extension:deploy –skip-compilationDeploys the current contents of the DeployDistribution folder without compiling the application. Although the developer tools do not deploy a compiled set of files, the default action is to compile files as a final test of your code. Using this command skips this check.
gulp extension:deploy –source configurationCompiles and deploys only configuration JSON files.
gulp extension:deploy –source javascriptCompiles and deploys only JavaScript files.
gulp extension:deploy –source ssp-librariesCompiles and deploys only ssp-libraries.
gulp extension:deploy –source servicesCompiles and deploys only services.
gulp extension:deploy –source sassCompiles and deploys only Sass files.
gulp extension:deploy –source templatesCompiles and deploys only HTML files.
gulp extension:deploy –source assetsCompiles and deploys only assets.
gulp extension:deploy –source <multiple>Deploys more than one type of source code when you separate multiple source deployments by commas. For example, gulp extension:deploy --source templates,sass
gulp extension:update-manifestUpdates the extension’s manifest.json file without requiring a deployment.
gulp validateValidates the theme’s manifest.json file and confirms that the file does not list any files that do not exist in the theme folder.
gulp clearRemoves the DeployDistribution and LocalDistribution directories and the .nsdeploy file.
gulpDisplays a list of all gulp commands.

Leave a comment

Your email address will not be published. Required fields are marked *