⚠️ WARNING: This is a proof of concept extension. Use at your own risk. Features may be incomplete or unstable. API calls to IBM Cloud may cause delays in responsiveness.
IBM Catalog JSON Editor is a Visual Studio Code extension designed to streamline the management and editing of complex ibm_catalog.json
files. Tailored for IBM Cloud architects and developers, this extension offers an intuitive side panel that visualizes the JSON structure in a tree format, facilitating easy navigation, editing, and IBM Cloud integration.
-
File Management
- Auto-detection of
ibm_catalog.json
files in the workspace. - Create new catalog files with a default structure.
- Real-time file system watching and synchronization.
- Locate existing catalog files in the workspace.
- Auto-detection of
-
Tree View Navigation
- Color-coded hierarchical display of JSON structure.
- Expandable/collapsible nodes for easy navigation.
- Custom icons for different value types.
- Tree state persistence across sessions.
- Left-click interacts with elements, while double-click, Space, or Enter triggers the edit mode.
-
IBM Cloud Integration
- Secure API key management and authentication.
- Login through the status bar.
- Real-time catalog ID lookup when logged in.
- Offering and flavors lookups are available if logged in.
- If not logged in, cached data is used when available; otherwise, lookups are not accessible.
-
Smart Editing and Dependency Management
- Catalog ID Interaction:
- Catalog IDs can be double-clicked or selected with
Space/Enter
to display a list of available catalogs for the current logged-in API key. - If a catalog ID is edited, the prompt will display offerings within that catalog.
- Catalog IDs can be double-clicked or selected with
- Dependencies Management:
- Add Dependencies:
- Use the + icon beside dependencies arrays to add new dependencies.
- Supports adding both regular and swappable dependencies.
- Guided prompts help in selecting catalogs, offerings, versions, and flavors.
- Edit Dependencies:
- Inline editing of dependency properties such as
catalog_id
,id
,version
,flavors
, etc. - When editing versions, a list of available versions is provided based on the selected offering.
- Inline editing of dependency properties such as
- Flavors Interaction:
- When editing flavors, the extension provides a list of flavors available for the selected offering and dependency.
- Supports adding multiple flavors to a dependency.
- Swappable Dependencies:
- Manage swappable dependency groups.
- Set default dependencies within swappable groups.
- Add Dependencies:
- Configuration Management:
- Edit Configuration Fields:
- Use the Edit action on the
configuration
node to manage configuration fields. - Select properties to delete from configuration fields to simplify the configuration objects.
- Use the Edit action on the
- Add Configuration Fields:
- Use the + icon to add new configuration fields.
- Guided prompts assist in defining new configuration fields.
- Edit Configuration Fields:
- Input Mapping Section:
- Use the + icon beside input mapping to add a new mapping.
- Supports adding mappings of various types, including
version_input
,dependency_input
,dependency_output
, andvalue
. - Guided prompts help in selecting appropriate mapping sources and targets.
- Dependency Output Editing:
- When a dependency output is edited, a list of available dependency outputs for the matching offering and flavor is shown.
- Dependency Input Editing:
- When selecting dependency inputs, a list of inputs from the configuration section in
ibm_catalog.json
is presented.
- When selecting dependency inputs, a list of inputs from the configuration section in
- Version Input Editing:
- Selecting the version input displays the configuration keys available for mapping.
- Inline Value Editing:
- Type-specific input controls make editing smoother.
- Auto-save on Changes:
- All changes are auto-saved to prevent data loss.
- Catalog ID Interaction:
-
Performance Optimization
- Local caching of IBM Cloud data for improved performance.
- Debounced file system operations to reduce unnecessary processing.
- Background data fetching keeps the UI responsive.
- Cached data ensures subsequent interactions are instant after the first fetch.
- Cache management commands are available, and users can log out and back in to clear the cache.
-
Developer Tools
- Configurable debug logging for troubleshooting.
- Visual status indicators for sync operations.
- Command palette integration for easy access.
- Detailed error messaging to guide the user through issues.
https://marketplace.visualstudio.com/items?itemName=DanielButler.ibm-catalog-json-editor
- Open VS Code.
- Click the Extensions icon in the Activity Bar (
Cmd+Shift+X
). - Search for "IBM Catalog JSON Editor".
- Click "Install".
- Download the
.vsix
file from Releases. - Install via the command:
code --install-extension ibm-catalog-json-editor-x.x.x.vsix
-
Open an IBM Catalog JSON File
- Open your
ibm_catalog.json
file in Visual Studio Code.
- Open your
-
Navigate the Catalog
- Use the IBM Catalog JSON Editor view to navigate through your catalog elements.
-
Add or Edit Elements
- Adding Elements:
- Use the + icon beside arrays (e.g.,
dependencies
,configuration
,input_mapping
) to add new elements. - Guided prompts assist in adding dependencies, configuration fields, flavors, and input mappings.
- Use the + icon beside arrays (e.g.,
- Editing Elements:
- Double-click, Space, or Enter to trigger the edit mode for elements.
- Inline editing supports various data types with context-aware prompts.
- Edit Configuration Fields:
- Use the Edit action on the
configuration
node to manage configuration fields. - Select properties to delete from configuration fields to simplify them.
- Use the Edit action on the
- Adding Elements:
-
Manage Dependencies and Configurations
- Dependencies:
- Easily manage and add both regular and swappable dependencies within your catalog configurations through the UI.
- When adding or editing dependencies, relevant options are provided based on the selected context, including catalogs, offerings, versions, and flavors.
- Configurations:
- Manage configuration fields by adding new fields or editing existing ones.
- Use the property selection feature to remove unwanted properties from configuration fields.
- Dependencies:
-
Input Mapping Management
- Add Input Mappings:
- Use the + icon beside
input_mapping
to add new mappings. - Select the type of mapping and follow guided prompts to define the mapping.
- Use the + icon beside
- Edit Input Mappings:
- Edit existing mappings with context-aware prompts.
- Supports mapping to
version_input
,dependency_input
,dependency_output
, andvalue
.
- Add Input Mappings:
Fetching offerings from IBM Cloud can take some time initially. During this time, prompts related to these operations will not be available until the data has been fetched. However, subsequent interactions are instant due to caching. To clear cached data:
- Use the command IBM Catalog: Clear Cache.
- Alternatively, log out and back in to clear the cache.
This project is licensed under the Apache 2.0.
If you encounter any issues or have questions about the IBM Catalog JSON Editor extension, please open an issue on the GitHub repository.