Dfact Extension
A VS Code and Cursor extension for Dfact project management and deployment.
Features
- Authentication: Secure login/logout functionality with browser-based authentication
- Project Management: Create and manage projects with Applications and Services
- Build Templates: Choose from various build templates and frameworks
- Deployment: Deploy applications with environment-specific configurations
- Log Management: Fetch and view deployment logs
- Dictionary Editor: Edit configuration dictionaries through a web interface
Supported Editors
This extension is compatible with both:
- VS Code (v1.91.0+)
- Cursor (v1.0.0+)
Installation
For VS Code
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Dfact Extension"
- Click Install
For Cursor
- Open Cursor
- Go to Extensions (Ctrl+Shift+X)
- Search for "Dfact Extension"
- Click Install
Usage
Authentication
- Click on the Dfact icon in the activity bar
- Click "Login" to authenticate
- Follow the browser-based authentication flow
- Your tokens will be securely stored
Creating Projects
- Right-click on a folder in the explorer
- Select "Create Projects" to create a new project structure
- Choose your build template and framework
- Configure your application preferences
Deployment
- Right-click on your application folder
- Select "Deploy" to deploy your application
- Choose your target environment
- Monitor deployment progress
Viewing Logs
- Right-click on your service folder
- Select "Fetch Logs" to retrieve deployment logs
- Logs will be saved locally for review
Commands
The extension provides several commands accessible through the command palette:
Authentication.login - Login to Dfact
Authentication.logout - Logout from Dfact
Authentication.testToken - Test your authentication token
extension.createApp - Create a new application
extension.createAppService - Create a new application service
extension.chooseBuild - Choose a build template
extension.triggerBuild - Trigger a build
extension.openGrid - Open dictionary editor
extension.saveBuild - Save build configuration
extension.choosePreference - Choose application preferences
extension.fetchLogs - Fetch deployment logs
extension.deploy - Deploy application
Configuration
The extension uses secure storage for authentication tokens and maintains state for:
- Read-only files
- Workshop folder names
- User preferences
Development
Building the Extension
npm install
npm run compile
Running Tests
npm test
Development Mode
npm run watch
Compatibility Notes
- The extension automatically detects whether it's running in VS Code or Cursor
- All VS Code APIs used are compatible with Cursor
- Webview resources use the appropriate URI scheme for each editor
- Authentication flow works identically in both editors
Troubleshooting
Authentication Issues
- Ensure you have a valid Dfact account
- Check that your browser allows popups for the authentication flow
- Try logging out and logging back in
Build Issues
- Verify that you have selected a valid framework and template
- Check that your project structure follows the expected format
- Ensure you have the necessary permissions for your organization
Deployment Issues
- Verify that your application is properly configured
- Check that your target environment is available
- Review deployment logs for specific error messages
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This extension is provided as-is for learning purposes.
Support
For issues and questions, please check the extension's documentation or contact the development team.
| |