A unified monorepo for building and maintaining Tekton pipeline visualization tools. This project solves the drift problem between the npm package and VSCode extension by maintaining a single source of truth for all pipeline rendering logic.
tekton-pipeline-renderer/
- React component library for rendering Tekton pipelinestekton-vscode/
- VSCode extension that uses the renderer package- Unified build system - Coordinated development, testing, and release workflow
Single Source of Truth: All pipeline rendering logic lives in tekton-pipeline-renderer/
. The VSCode extension is a thin wrapper that consumes this package.
Change Flow: tekton-pipeline-renderer/
β tekton-vscode/
β Release
The system supports two propagation modes to optimize for different use cases:
tekton-pipeline-renderer/ ββlinkββ> tekton-vscode/
- Fast: Uses
file:../tekton-pipeline-renderer
dependency - Live Updates: Changes in renderer immediately available in extension
- Good for: Active development, debugging, testing
- VSCode Extension: Links to live renderer package
tekton-pipeline-renderer/src/ ββcopyββ> tekton-vscode/src/lib/
- Self-Contained: Physically copies renderer source into extension
- Distribution Ready: No external dependencies
- Good for: Releases, CI/CD, distribution
- VSCode Extension: Contains all renderer code internally
After running npm run propagate:bundle
:
tekton-vscode/
βββ src/
β βββ extension.ts
β βββ lib/
β β βββ tekton-renderer/ β Copied from renderer
β β βββ components/
β β βββ hooks/
β β βββ types/
β β βββ utils/
β β βββ index.ts β Auto-generated exports
β βββ webview/
βββ package.json β External dependency removed
- Node.js 18+
- Yarn 1.22+
# Clone the repository
git clone https://github.com/your-org/tekton-pipeline-combo.git
cd tekton-pipeline-combo
# Install all dependencies (from root - manages all workspaces)
yarn install
# Run the complete CI pipeline
npm run ci
β οΈ Important: Always runyarn install
from the root directory. The monorepo uses yarn workspaces with a singleyarn.lock
file that manages all dependencies for both packages.
# Develop in the renderer package
cd tekton-pipeline-renderer
npm run dev
# Run the interactive sample app
npm run sample
# Run tests
npm run test
# Development mode (fast, uses file dependency)
npm run propagate
# Test the VSCode extension
npm run test:vscode
# For release (bundles code inside extension)
npm run propagate:bundle
# Build the extension
npm run build:extension
# Clean everything
npm run clean
# Run complete CI pipeline
npm run ci
# Prepare for release
npm run release:prepare
Command | Description |
---|---|
npm run ci |
Complete CI pipeline (clean, install, lint, test, build) |
npm run clean |
Clean all build artifacts |
npm run build |
Build both packages |
npm run test |
Run all tests |
npm run lint |
Lint all code |
npm run propagate |
Sync changes (development mode - file dependency) |
npm run propagate:bundle |
Bundle renderer code inside VSCode extension |
npm run release:check |
Comprehensive release validation |
npm run sample |
Run the React sample app |
Command | Description |
---|---|
npm run build |
Build the npm package |
npm run sample |
Interactive demo app |
npm run test |
Run React component tests |
npm run npm:publish |
Publish to npm |
Command | Description |
---|---|
npm run build |
Build the extension |
npm run test:extension |
Run VSCode extension tests |
npm run vscode:package |
Create .vsix file |
- Unit Tests: React components, hooks, utilities
- Integration Tests: YAML parsing, data processing
- Sample App: Interactive testing environment
- Extension Activation: Verify extension loads correctly
- Command Registration: Test all contributed commands
- Webview Integration: Test pipeline visualization in VSCode
- Matrix Testing: Node.js 18.x and 20.x
- Progressive Validation: Lint β Test β Build β Propagate β Integration Test
- Artifact Generation: Ready-to-release packages
tekton-pipeline-combo/
βββ π¦ tekton-pipeline-renderer/ # NPM package (single source of truth)
β βββ src/components/ # React components
β βββ src/hooks/ # Custom hooks
β βββ src/utils/ # Utilities (YAML parsing, etc.)
β βββ src/types/ # TypeScript definitions
β βββ example/ # Interactive sample app
β βββ samples/ # Sample pipeline YAML files
βββ π tekton-vscode/ # VSCode extension
β βββ src/extension.ts # Extension entry point
β βββ src/webview/ # Webview integration
β βββ src/test/ # VSCode extension tests
βββ π§ scripts/ # Build and automation scripts
βββ π .cursorrules # Development workflow rules
βββ π .github/workflows/ # CI/CD pipeline
- React components for pipeline visualization
- YAML parsing utilities
- Type definitions for Tekton resources
- Hooks for data processing
- Tests for rendering logic
- Sample application updates
- VSCode extension entry point (
extension.ts
) - VSCode-specific commands and providers
- Webview integration code
- Extension configuration and manifests
- VSCode extension tests
- React components for pipeline rendering
- YAML parsing logic (unless VSCode-specific)
- Duplicate type definitions
- Rendering algorithms or layout logic
- NEVER edit files in
src/lib/
(auto-generated by propagation)
# Ensure everything is tested and built
npm run release:check
# Publish to npm
npm run npm:publish
# Create the .vsix package
npm run vscode:package
# Install locally for testing
code --install-extension tekton-vscode/tekton-pipeline-visualizer-*.vsix
# Publish to marketplace (requires publisher setup)
npx vsce publish
tekton-pipeline-renderer/ βββ
ββ Separate implementations
tekton-vscode/ βββ (prone to drift)
tekton-pipeline-renderer/ βββ
ββ One implementation
tekton-vscode/ βββ (propagated automatically)
- π Dual Propagation Modes: Development (file dependency) + Release (true bundling)
- π¦ True Bundling: Renderer code physically copied into VSCode extension
- π§ͺ Comprehensive Testing: React tests + VSCode extension tests
- π¦ Dual Packaging: NPM package + VSCode extension from same source
- π¨ Interactive Development: Sample app for immediate feedback
- π CI/CD Ready: GitHub Actions workflow included
- π Enforced Workflow: Cursor rules prevent architectural violations
- Create the component in
tekton-pipeline-renderer/src/components/
- Test with
npm run test:renderer
- Verify with
npm run sample
- Propagate with
npm run propagate
(development) - Integration test with
npm run test:vscode
- Bundle with
npm run propagate:bundle
(for release)
- Open
tekton-vscode/
in VSCode - Run the extension in debug mode (F5)
- Test with sample pipelines
- Check the developer console for errors
- Update in
tekton-pipeline-renderer/package.json
- Run
npm run propagate
to sync to VSCode extension (development) - Run
npm run propagate:bundle
to bundle for release - Test both packages with
npm run test
- Follow the cursor rules (
.cursorrules
) - Make changes in the appropriate package
- Run
npm run ci
before committing - Use
npm run propagate
after renderer changes
MIT License - see LICENSE for details.
Built with β€οΈ to solve the package drift problem and maintain a single source of truth for Tekton pipeline visualization.