Folder Structure for SuiteCommerce Extensions Development
Understand the folder structure for SuiteCommerce extensions, including assets, modules, and entry points for best practices.
The folder structure for SuiteCommerce extensions is crucial for organizing your development environment effectively. It dictates how your code is structured and how various components interact. Below, we'll break down the key aspects of the folder structure and provide useful code samples to assist in your development process.
Understanding the Folder Structure
The primary directory for your extension will reside in a top-level development directory under a folder named after your extension. Each extension gets its own subdirectory within the Workspace directory. Within this subdirectory, a Modules folder usually contains your extension’s modules. Here’s an example layout:
1<TopLevelDevelopmentDirectory>2 Workspace3 MyCoolExtension4 assets5 Modules6 MyCoolModule7 manifest.jsonModule Folder Flexibility
It's important to note that while the default convention is to name each module folder after the extension, you are not strictly required to do so. Your directory can adopt any naming scheme that fits your project. Below is another potential structure:
1<TopLevelDevelopmentDirectory>2 Workspace3 MyCoolExtension4 assets5 Modules6 ModuleOne7 JavaScript8 ModuleOne.js9 ModuleTwo10 JavaScript11 ModuleTwo.js12 manifest.jsonCreating Entry Point Files
To allow your modules to integrate properly with the SuiteCommerce framework, you will create entry point files in your module directories. Below is an example of how to structure these files:
1"text-purple-400">define('ModuleOne'2, [3 // dependencies4]5, "text-purple-400">function6 () {7 'use strict';8 9 "text-purple-400">return {10 mountToApp: "text-purple-400">function () {11 console.log('ModuleOne loaded!');12 }13 };14})Note that for ModuleTwo.js, you should change ModuleOne in the definition to ModuleTwo accordingly. This modular approach allows flexibility in your coding strategy and promotes reusability across your SuiteCommerce projects.
Best Practices
- Consistency: Maintain a consistent naming convention for your modules to ensure clarity.
- Documentation: Keep your modules well-documented to assist future development or team collaboration.
- Avoid Manual Edits: As a best practice, do not manually edit files within the generated directories to prevent issues.
By adhering to this structure and following these best practices, you will facilitate a more organized and manageable development experience in SuiteCommerce.
Key Components of the Directory:
| File/Folder | Description |
|---|---|
Modules | Contains all modules related to your extension. |
manifest.json | Defines the metadata for your extension. |
assets | Typically contains static files required by your extension. |
Understanding the folder structure not only improves your workflow but also leverages the full potential of SuiteCommerce development capabilities.
Frequently Asked Questions (4)
What is the purpose of the 'manifest.json' file in a SuiteCommerce extension?
Can I use a custom naming scheme for module folders within a SuiteCommerce extension?
Where should the entry point files be located in a SuiteCommerce extension folder structure?
What should I avoid doing with the generated directory files in SuiteCommerce?
Was this article helpful?
More in SuiteCloud Development Framework
- SuiteCloud Developer Assistant: AI Coding Support in
SuiteCloud Developer Assistant enhances NetSuite development with AI-powered coding features, offering real-time assistance and SuiteScript generation.
- SuiteCloud CLI for Node.js: New Features Overview
Explore the new features of SuiteCloud CLI for Node.js, enhancing SuiteCloud project development with interactive tools.
- SuiteCloud Developer Assistant Feature for Visual Studio
Discover the new SuiteCloud Developer Assistant integrated with Visual Studio Code for enhanced SuiteCloud project development.
- SuiteCloud Development Framework in NetSuite 2026.1
SuiteCloud Development Framework features in NetSuite 2026.1 enhance customization, deployment, and management for developers.
Advertising
Reach SuiteCloud Development Framework Professionals
Put your product in front of NetSuite experts who work with SuiteCloud Development Framework every day.
Sponsor This Category