If you've encountered issues with the gulp extension: create failing, you'll need to manually create a new SuiteCommerce extension. Here’s the step-by-step process.
While executing “gulp extension: create” or “npx gulp extension: create”, you might face an issue indicating that ‘ns-logs’ is missing. The typical response may be to run “npm install ‘ns-logs’”; however, doing so will result in a 404 error. Given that the gulp extension: create is not working, you'll need to proceed with creating a new SuiteCommerce extension manually. Here’s how to do it:
Duplicate an Existing SuiteCommerce Extension
Navigate to Extensions > Workspace and duplicate the folder of an existing extension. Look for an extension that includes all the features your new extension will require, such as templates, SASS, and/or SuiteScript2. Rename the folder to reflect the name of your new extension. Ensure this name contains only letters without any spaces or special characters.
Rename the Extension’s Directories
Within your new extension folder, go to the Modules directory and rename the next folder to correspond with your new extension's name. Additionally, in the JavaScript directories and other features your extension encompasses, rename each file to mirror the new extension name. For instance, “OldExtension.Entry.js” might be changed to “NewExtension.Entry.js”. If the extension you are duplicating has features from the old extension that you won’t need, such as a configuration folder, you can delete that entire folder.
Update manifest.json
Open the manifest.json file in your new extension folder. Adjust the entries for “name,” “fantasyName” (which determines how your extension’s name appears in the Extension Manager; here you can use spaces), “vendor,” “version,” and “description.” In the “JavaScript” section and other relevant feature entries, update the directories for the files to reflect your renamed folders and files. If you’ve eliminated some functionality, like the configuration feature, remove its directory string from the “file” array so it appears empty.
Adjust config.json
Go to your Extensions folder, then navigate to gulp > config > config.json. In the “folders” section under “extensions_path,” you’ll need to include your new extension’s directory in the array. Enter only the workspace folder and the name of your new extension, for example, “Workspace/NewExtension.”
General Cleanup of Your SuiteCommerce Extension
From a functional viewpoint, these steps will allow you to create a new extension without needing Gulp. However, remember to revise the JSDoc headers and define names in each document within your extension to reflect the new extension accurately.
