at-builder
v1.2.9
Published
[](https://www.npmjs.com/package/at-builder) [](LICENSE)
Readme
at-builder
A streamlined command-line tool for creating, building, and deploying Adobe Target A/B testing activities with modern web technologies.
🎯 Features
- 🏗️ Project Initialization: Set up new projects with complete configuration
- 🎨 Activity Templates: Generate new activities with customizable variations
- ⚡ Smart Building: Development and production builds with hot reload
- 🚀 Adobe Target Deployment: Direct deployment to Adobe Target activities
- 🩺 Health Diagnostics: Automatic configuration validation and fixing
- 📁 Flexible Structure: Configurable activities folder structure
- 🔧 Environment Management: Automatic .env file handling
- 💻 Modern Toolchain: TypeScript, Webpack, Babel, SCSS support
Installation
Install the package globally using NPM:
npm install -g at-builder🚀 Quick Start
- Initialize a new project:
atb init- Create a new activity:
atb new- Build your activity:
atb build- Deploy to Adobe Target:
atb deploy📋 Commands Reference
Core Commands
| Command | Description | Options |
|---------|-------------|---------|
| atb init | Initialize project with configuration files | |
| atb new | Create new Adobe Target activity with variations | |
| atb build | Build activity for development | --prod for production |
| atb dev | Start development server with file watching | --browser to open browser |
| atb deploy | Deploy activity to Adobe Target | --dry-run for testing |
| atb doctor | Diagnose and fix configuration issues | --fix to auto-fix |
Examples
# Initialize new project
atb init
# Create new activity
atb new
# Development build with hot reload
atb build
# Production build for Adobe Target
atb build --prod
# Development server with browser
atb dev --browser
# Deploy to Adobe Target
atb deploy
# Check project configuration
atb doctor
# Auto-fix configuration issues
atb doctor --fix🔧 Project Structure
After initialization, your project will have:
your-project/
├── .env # Environment configuration
├── adobe.config.js # Adobe Target API settings
├── watch-config.json # Build configuration
├── package.json # NPM configuration
└── Activities/ # Your activities folder
└── your-activity/ # Activity folder (auto-created)
├── Variation-1/ # Test variations
│ ├── index.js # Entry point
│ ├── css/
│ │ └── style.scss
│ ├── scripts/
│ │ └── app.js
│ └── constants/
│ └── index.js
├── Vanalytics/ # Analytics tracking
└── shared/ # Shared configuration⚙️ Configuration
Environment Variables (.env)
# Project Structure
ACTIVITIES_BASE_FOLDER="Activities"
ACTIVITY_FOLDER_NAME="your-activity-name"
# Development Settings
NODE_ENV="development"
PUPPETEER_LANDING_PAGE=""
TARGET_URL=""
LOGIN_URL=""
VARIATION="Variation-1"
# Adobe Target Deployment
ADOBE_CLIENT_ID="your-client-id"
ADOBE_CLIENT_SECRET="your-client-secret"Adobe Target Configuration (adobe.config.js)
module.exports = {
BASE_URL: 'https://mc.adobe.io/target/activities/',
IMS_TOKEN_URL: 'https://ims-na1.adobelogin.com/ims/token/v1',
IMS_SCOPE: 'openid,target_sdk'
};🔄 Workflow
- Setup: Run
atb initto create project configuration - Create: Run
atb newto generate activity templates - Develop: Modify variations in
/Activities/{name}/Variation-*/ - Test: Run
atb buildfor development testing - Build: Run
atb build --prodfor production deployment - Deploy: Run
atb deployto deploy to Adobe Target
🩺 Troubleshooting
Health Check
# Diagnose configuration issues
atb doctor
# Automatically fix issues
atb doctor --fixCommon Issues
- Missing .env file: Run
atb initoratb doctor --fix - Build errors: Check
ACTIVITY_FOLDER_NAMEin .env - Deploy failures: Verify Adobe credentials in .env
- Missing activity folder: Create activity with
atb new
🚨 Advanced Configuration
Custom Activities Folder
You can customize the activities folder location:
# Use a different activities folder
ACTIVITIES_BASE_FOLDER="MyActivities"Build Scripts Integration
Add to your project's package.json:
{
"scripts": {
"build:target": "atb build --prod",
"deploy:target": "atb deploy",
"dev:target": "atb dev --browser"
}
}🔌 API Integration
For programmatic usage:
const { getVersion, getHelpInfo } = require("at-builder");
// Get version
console.log(getVersion());
// Get help information
console.log(getHelpInfo());🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 Changelog
v1.2.3
- ✨ Added
deploycommand for Adobe Target deployment - 🩺 Added
doctorcommand for configuration diagnostics - 🔧 Automatic .env file updates when creating activities
- 📁 Configurable activities folder structure
- ⚡ Improved environment variable validation
- 🚀 Enhanced error handling and user guidance
Previous Versions
- v1.2.2: Build improvements and bug fixes
- v1.2.1: Enhanced CLI interface
- v1.2.0: Initial public release
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Repository: https://github.com/upesenga/at-builder
- Issues: https://github.com/upesenga/at-builder/issues
- Author: Upendra Sengar
- License: MIT
Made with ❤️ for Adobe Target developers
