Overview
The BAD ASS SALESFORCE STACK (B.A.S.S.) is a powerful set of tools and frameworks for developing Salesforce applications. It leverages React, TypeScript, Ant Design (antd), and ts-force to provide a robust and efficient development environment. With features such as local asset development, hot module reloading, type safety and code completion, and easy deployment to different Salesforce orgs, B.A.S.S. offers a comprehensive solution for Salesforce developers.
Features
- React: Utilizes the popular React framework for building dynamic and interactive UI components.
- TypeScript: Offers type safety and code completion, making development faster and more reliable.
- Ant Design (antd): Provides a set of React components with a sleek and modern design, enhancing the visual aesthetics of the application.
- ts-force: Generates large files to automate repetitive tasks, saving developers time and effort.
- Hot Module Reloading (HMR): Allows for instant updates and previews of changes made in the development environment.
- One-step build and deploy: Simplifies the deployment process by allowing developers to build and deploy their applications with just one command.
- Supports various Salesforce orgs: B.A.S.S. supports developer, sandbox, scratch, and production orgs, accommodating different development and deployment scenarios.
- Testing with vitest: Enables developers to write unit tests for their Salesforce applications using the vitest framework.
- Setup for debugging in VSCode Chrome Debugger: Offers a convenient setup for debugging applications using the VSCode Chrome Debugger extension.
Installation
- Install the following dependencies on your machine:
- npm
- sfdx-cli
- If you are using Windows, make sure you have the ability to execute bash commands such as zip, cp, and mv. Install a bash enumerator like the one included with git or install zip binaries.
- Optionally, configure npm to use bash by running the command:
npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe" - Install Yeoman and generator-bass using npm:
npm install -g yo generator-bass - Generate a new project using Yeoman:
yo bass - The project structure will include the following folders:
- app: Contains the source code for the React application.
- force-app: Stores the Salesforce DX package and related metadata.
- config: Includes configurations for development, build, and tests.
- dist: The build directory.
- Before you can do any development, you need to connect to one or more orgs. Use the command
sfdx force:org:listto see a list of already authenticated orgs. To connect to an existing sandbox, use the commandsfdx force:auth:web:login -sr [ORG_URL] -a [ALIAS]. To create a scratch org, use the commandnpm run new-scratch-org. - Set up the “Target” orgs by defining them in the .npmrc config file. The starter supports three pre-defined targets:
devfor traditional Salesforce org,scratchfor scratch org using Salesforce DX flow, andprodfor releasing the app. Specify the alias or username of the target org in the .npmrc file.- Note: It is recommended to ignore the .npmrc file in your repo to avoid accidentally deploying to unintended orgs.
Summary
The BAD ASS SALESFORCE STACK (B.A.S.S.) provides Salesforce developers with a powerful and efficient development environment. With its integration of React, TypeScript, Ant Design, and ts-force, B.A.S.S. offers a comprehensive set of features for building Salesforce applications. By simplifying the development and deployment processes and providing tools for testing and debugging, B.A.S.S. enhances developers’ productivity and enables them to create high-quality applications with ease.