-
Notifications
You must be signed in to change notification settings - Fork 0
Workflow AngularTemplate
Step-by-step guide to create a production-ready template by importing and customizing the angularTemp grammar.
This workflow teaches you how to:
- Access the Crodox app
- Import the pre-built template from angularTemp
- Study the template structure and patterns
- Customize the template for your needs
- Build and test a workbench with real code
Start here: https://crodox-app.com/home
- Access to Crodox app at https://crodox-app.com/home
- GitHub account (for authentication)
- Familiarity with Crodox basics (optionally, complete Workflow-SimpleDemo first)
- Open https://crodox-app.com/home in your browser
- Enter your email and request a verification code
- Check your email and enter the code
- Authorize the Crodox GitHub app
- Complete your profile setup
You are now logged into Crodox.
- Click the Template Editor icon (
<>) in the left sidebar - Click the Templates tab
- Enter a name for your template (e.g.,
AngularExtractor_v1) - Click the + button to create it
The template editor opens with a blank grammar field.
- In the template editor, click the Template menu (top-left)
- Select Import Template from Repository
- A dropdown appears showing available repositories
- Select angularTemp (github)
- Click Import
The .crodox.json grammar from angularTemp is now loaded into your editor.
You now have:
- ✅ A working grammar for Angular component extraction
- ✅ A reference for TypeScript/HTML pattern matching
- ✅ Patch definitions configured for re-integration
The grammar editor displays the complete angularTemp template structure:
Key sections to review:
-
File Type Patterns –
<~ file.ts ~>,<~ file.html ~>, etc.- Shows which file types the grammar targets
-
Component Definitions –
<: component :>,<: service :>,<: module :>- Describes what Angular artifacts are recognized
-
Hierarchy & Children –
<- provider, directive ->- Shows how components relate to each other
-
Visible Objects – Named with
<<name>>and<<selector>>- These become selectable in the workbench UI
For learning: Don't modify this grammar yet. Just read through and understand the patterns.
- Click Save to store your imported template
- Crodox validates the grammar (should be ✅ valid)
- Your template is now saved and ready to use
- In the Project Explorer (center-left), open the Repository dropdown
- You should see angularTemp in the list
- Select angularTemp (github)
The project explorer now shows the Angular source code from angularTemp.
- Expand the folder tree in the project explorer:
- Click src to expand the source directory
- Click app to expand the application folder
- Navigate to a component file (e.g.,
dashboardfolder) - Click on a
.tsor.component.tsfile
The file loads in the preview panel, and your grammar runs against it.
In the Trial Extraction Field (center panel), review what the grammar extracted:
You should see:
- Component definitions with IDs
- Service providers
- Module registrations
- Function and variable declarations
Understanding the results:
- ✅ Many components extracted → Grammar successfully parses Angular patterns
- ✅ Hierarchy is correct → Parent/child relationships match your code structure
- ❌ Missing components → Grammar may need refinement
- In the Patch Maker (center-right panel), open the Template Repository dropdown
- Select angularTemp (github)
- Patch conditions load below, showing how modifications are applied
Key information:
- Conditions – Rules that trigger specific transformations
- Modifications – Code changes applied to matched components
- Preview – The right panel shows the exact diff that would be generated
This is how angularTemp re-integrates extracted components into a target project.
If you want to modify the template for your own Angular project:
- Click the Grammar Editor
- Identify the patterns you want to change
- Update
<: component :>or other definitions as needed - Click Save to validate
- Select your own repository in the Project Explorer to test
Common customizations:
- Add support for new artifact types (e.g.,
<: interceptor :>) - Change file patterns to match your naming convention
- Refine visibility rules to highlight critical components
Once your template is working:
- Click the Workbench icon (circular arrow) in the left sidebar
- Enter a workbench name (e.g.,
AngularTemp_Analysis_v1) - Select your template from the dropdown
- Choose angularTemp as the source repository (or your own Angular project)
- Select the files and components you want to analyze
- Click Create Workbench
Crodox analyzes the selected code and generates patches for re-integration.
In the workbench:
- Extracted Components – Browse all identified components
- Patch Preview – See what code changes would be generated
- Create Pull Request – Generate a PR with the patches
- Codespace – Edit the workbench in a browser-based VS Code environment
- Test on Your Project – Replace angularTemp with your own Angular repository
- Extend the Template – Add custom patterns and artifact types
- Workflow-End-to-End – See the full journey from template to PR
- Template-Editor – Full documentation on editor features
- Don't modify the original – Export the angularTemp template before major changes
- Test incrementally – After each change, reload a test file to see the impact
- Use the preview – The right panel shows exactly what Crodox sees in your code
- Document your changes – Add comments to your grammar explaining custom patterns
| Issue | Solution |
|---|---|
| Import fails | Ensure GitHub access is authorized and angularTemp is visible |
| Grammar validation error | Check the error message; the imported grammar should always be valid |
| No components extracted | Select a TypeScript file (.ts) not a text file; angularTemp targets TypeScript |
| Workbench creation fails | Ensure you have at least one template and one repository selected |
Start building: https://crodox-app.com/home
Template Repository: https://github.com/crodox-app/angularTemp
- Getting Started
- Sign-Up
- Home Screen
- Creating Your First Template
- Template Editor
- Application Navigation
- Syntax Overview
- Workflow: End-to-End
- Workflow: Test with simpleDemo
- Workflow: Build Template from angularTemp
- Demo Repositories
- Template
- Workbench
- GitHub Integration
- GitHub App Installation
- GitHub Repository Setup
- GitHub Re-linking
- Settings
- Overview
- Declarations
- Types
- Scoping