diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 734fc52..218852c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,8 +82,8 @@ jobs: - name: Install dependencies run: yarn install --frozen-lockfile - - name: Run comprehensive tests - run: xvfb-run -a yarn run ci + - name: Run comprehensive release check + run: xvfb-run -a yarn run release:check - name: Validate packages are ready for release run: | diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index bc96cf4..904e9b1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -33,7 +33,7 @@ npm run sample # Interactive testing # 4. Propagate to VSCode extension cd .. npm run propagate # Development mode (fast) -npm run propagate:bundle # Bundle mode (for release) +npm run propagate # Bundle mode (for release) # 5. Test the extension integration npm run test:vscode @@ -138,64 +138,44 @@ yarn upgrade # Update specific package yarn upgrade some-package@^2.0.0 -# Always propagate after updating renderer dependencies -npm run propagate # Development -npm run propagate:bundle # Release + # Always propagate after updating renderer dependencies + npm run propagate # Bundles renderer code into extension ``` ## π Propagation Process -The propagation script (`scripts/propagate-changes.js`) supports **two modes**: +The propagation script (`scripts/propagate-changes.js`) **bundles the renderer into the VSCode extension**: -### π§ Development Mode: `npm run propagate` - -**What it does:** -1. **Version Synchronization**: Ensures both packages have the same version -2. **Dependency Updates**: Updates VSCode extension to use `file:../tekton-pipeline-renderer` -3. **Sample Files**: Copies sample pipeline files for consistency -4. **Validation**: Runs post-propagation checks - -**Good for:** Active development, fast iteration, debugging - -### π¦ Bundle Mode: `npm run propagate:bundle` +### π¦ Bundle Mode: `npm run propagate` **What it does:** 1. **Code Copying**: Physically copies renderer source to `tekton-vscode/src/lib/` 2. **Dependency Removal**: Removes external renderer dependency 3. **Index Generation**: Creates bundled exports file 4. **Sample Files**: Copies sample pipeline files -5. **Validation**: Ensures bundled extension builds correctly +5. **Version Synchronization**: Ensures both packages have the same version +6. **Validation**: Ensures bundled extension builds correctly + +**Good for:** Development, releases, CI/CD, creating self-contained extensions -**Good for:** Releases, CI/CD, creating self-contained extensions +**Result:** The VSCode extension becomes completely self-contained with all renderer code bundled inside. ### Manual Propagation Examples ```bash -# Development workflow +# Run propagation (always bundles code) npm run propagate -# Creates: file dependency link - -# Release workflow -npm run propagate:bundle # Creates: tekton-vscode/src/lib/tekton-renderer/ with all source code ``` -### What Bundle Mode Creates +### What Propagation Creates ``` -Before bundling: -tekton-vscode/package.json -{ - "dependencies": { - "tekton-pipeline-renderer": "file:../tekton-pipeline-renderer" - } -} - -After bundling: +After propagation: tekton-vscode/package.json { "dependencies": { - // renderer dependency removed + // renderer dependency removed (code is bundled inside) } } @@ -261,12 +241,30 @@ npm run sample ### Pre-Release Checklist +#### π TL;DR - Automated Pre-Release + +```bash +# Run the automated pre-release script (recommended) +npm run pre-release +``` + +**What it does:** +- β Optionally bumps versions (with prompts) +- β Runs complete CI pipeline +- β Bundles renderer code into VSCode extension +- β Runs comprehensive release checks +- β Guides you through manual testing steps +- β Builds packages for release +- β Creates .vsix file for VSCode extension + +#### π Manual Steps (if you prefer to run individually) + ```bash # 1. Run complete CI pipeline npm run ci # 2. Bundle renderer code into extension -npm run propagate:bundle +npm run propagate # 3. Run comprehensive release check npm run release:check diff --git a/QUICKSTART.md b/QUICKSTART.md index c2b21c2..00ed1b8 100644 --- a/QUICKSTART.md +++ b/QUICKSTART.md @@ -92,7 +92,7 @@ npm run propagate npm run test:vscode # 5. For release, use bundle mode -npm run propagate:bundle +npm run propagate ``` ## π§ͺ Test Everything @@ -128,8 +128,8 @@ npm run sample # 2. Make changes in tekton-pipeline-renderer/ # 3. See changes live in browser # 4. When ready, propagate -npm run propagate # Development mode -npm run propagate:bundle # Release mode (true bundling) +npm run propagate # Development mode +npm run propagate # Release mode (true bundling) # 5. Test everything npm run test @@ -160,7 +160,7 @@ git commit -m "feat: your awesome feature" |---------|-------------| | `npm run sample` | Test changes immediately | | `npm run propagate` | After renderer changes (development) | -| `npm run propagate:bundle` | For release builds (true bundling) | +| `npm run propagate` | For release builds (true bundling) | | `npm run ci` | Before committing | | `npm run test` | All the time! | | `npm run vscode:package` | Create VSCode extension | diff --git a/README.md b/README.md index d6994fa..ef53f13 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ tekton-pipeline-renderer/ ββlinkββ> tekton-vscode/ - **Good for**: Active development, debugging, testing - **VSCode Extension**: Links to live renderer package -### π¦ Bundle Mode: `npm run propagate:bundle` +### π¦ Bundle Mode: `npm run propagate` ```bash tekton-pipeline-renderer/src/ ββcopyββ> tekton-vscode/src/lib/ ``` @@ -38,7 +38,7 @@ tekton-pipeline-renderer/src/ ββcopyββ> tekton-vscode/src/lib/ ### π What Bundle Mode Creates -After running `npm run propagate:bundle`: +After running `npm run propagate`: ``` tekton-vscode/ βββ src/ @@ -103,7 +103,7 @@ npm run propagate npm run test:vscode # For release (bundles code inside extension) -npm run propagate:bundle +npm run propagate # Build the extension npm run build:extension @@ -134,7 +134,7 @@ npm run release:prepare | `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 propagate` | Bundle renderer code inside VSCode extension | | `npm run release:check` | Comprehensive release validation | | `npm run sample` | Run the React sample app | @@ -276,7 +276,7 @@ tekton-vscode/ βββ (propagated automatically) 3. **Verify** with `npm run sample` 4. **Propagate** with `npm run propagate` (development) 5. **Integration test** with `npm run test:vscode` -6. **Bundle** with `npm run propagate:bundle` (for release) +6. **Bundle** with `npm run propagate` (for release) ### Debugging the VSCode Extension @@ -289,7 +289,7 @@ tekton-vscode/ βββ (propagated automatically) 1. **Update** in `tekton-pipeline-renderer/package.json` 2. **Run** `npm run propagate` to sync to VSCode extension (development) -3. **Run** `npm run propagate:bundle` to bundle for release +3. **Run** `npm run propagate` to bundle for release 4. **Test** both packages with `npm run test` ## π€ Contributing diff --git a/SETUP_SUMMARY.md b/SETUP_SUMMARY.md index 3c38461..d4fba1e 100644 --- a/SETUP_SUMMARY.md +++ b/SETUP_SUMMARY.md @@ -44,7 +44,7 @@ yarn install # β COMPLETED # Development commands npm run sample # Interactive demo app npm run propagate # Sync changes (development mode) -npm run propagate:bundle # Bundle for release +npm run propagate # Bundle for release npm run test # Run all tests npm run build # Build both packages npm run ci # Complete CI pipeline @@ -69,7 +69,7 @@ npm run npm:publish # Publish renderer to npm - Uses `file:../tekton-pipeline-renderer` dependency - Fast, live updates during development -### Bundle Mode: `npm run propagate:bundle` +### Bundle Mode: `npm run propagate` - Copies renderer source to `tekton-vscode/src/lib/` - Creates self-contained extension for distribution @@ -78,7 +78,7 @@ npm run npm:publish # Publish renderer to npm 1. **Always run `yarn install` from the root** - never from individual packages 2. **Never create lock files in workspaces** - they're auto-ignored now 3. **Use `npm run propagate`** after making renderer changes -4. **Use `npm run propagate:bundle`** for release builds +4. **Use `npm run propagate`** for release builds ## π Next Steps diff --git a/package.json b/package.json index 63b0b88..0edb80a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "tekton-vscode" ], "scripts": { - "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use yarn')\"", + "preinstall": "node -e \"if(process.env.npm_execpath && process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Please use yarn')\"", "install:all": "yarn install --frozen-lockfile", "clean": "yarn workspace tekton-pipeline-renderer run clean && yarn workspace tekton-vscode run clean && rm -rf dist", "build": "yarn run build:renderer && yarn run build:vscode", @@ -28,11 +28,12 @@ "lint": "yarn workspace tekton-pipeline-renderer run lint && yarn workspace tekton-vscode run lint", "lint:fix": "yarn workspace tekton-pipeline-renderer run lint:fix && yarn workspace tekton-vscode run lint:fix", "propagate": "node scripts/propagate-changes.js", - "ci": "yarn run clean && yarn run install:all && yarn run lint && yarn run test && yarn run build", + "ci": "yarn run clean && yarn run lint && yarn run test && yarn run build:renderer", "ci:github": "yarn run lint && yarn run build:renderer && yarn run build:extension && yarn run vscode:package", "pre-push": "yarn run ci:github", - "release:check": "yarn run ci && yarn run propagate && yarn run test", + "release:check": "yarn run ci && yarn run propagate && yarn run build:vscode", "release:prepare": "yarn run release:check && yarn run build:extension", + "pre-release": "node scripts/pre-release.js", "vscode:package": "yarn workspace tekton-vscode run vscode:package", "npm:publish": "yarn workspace tekton-pipeline-renderer run npm:publish" }, diff --git a/scripts/pre-release.js b/scripts/pre-release.js new file mode 100755 index 0000000..20e7b87 --- /dev/null +++ b/scripts/pre-release.js @@ -0,0 +1,178 @@ +#!/usr/bin/env node + +const { execSync } = require('child_process'); +const { readFileSync, writeFileSync } = require('fs'); +const readline = require('readline'); + +// Colors for console output +const colors = { + reset: '\x1b[0m', + bright: '\x1b[1m', + red: '\x1b[31m', + green: '\x1b[32m', + yellow: '\x1b[33m', + blue: '\x1b[34m', + magenta: '\x1b[35m', + cyan: '\x1b[36m' +}; + +function log(message, color = colors.reset) { + console.log(`${color}${message}${colors.reset}`); +} + +function execCommand(command, description) { + log(`\n${colors.cyan}π ${description}...${colors.reset}`); + try { + execSync(command, { stdio: 'inherit' }); + log(`${colors.green}β ${description} completed${colors.reset}`); + return true; + } catch (error) { + log(`${colors.red}β ${description} failed${colors.reset}`); + log(`Command: ${command}`); + log(`Error: ${error.message}`); + return false; + } +} + +function promptUser(question) { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + + return new Promise((resolve) => { + rl.question(`${colors.yellow}${question}${colors.reset}`, (answer) => { + rl.close(); + resolve(answer.toLowerCase().trim()); + }); + }); +} + +function getCurrentVersion(packagePath) { + try { + const pkg = JSON.parse(readFileSync(packagePath, 'utf8')); + return pkg.version; + } catch (error) { + return null; + } +} + +function bumpVersion(packagePath, versionType) { + try { + const command = `cd ${packagePath.replace('/package.json', '')} && npm version ${versionType} --no-git-tag-version`; + execSync(command, { stdio: 'pipe' }); + return getCurrentVersion(packagePath); + } catch (error) { + log(`${colors.red}Failed to bump version in ${packagePath}${colors.reset}`); + return null; + } +} + +async function main() { + log(`${colors.bright}${colors.magenta}π Tekton Pipeline Combo Pre-Release Automation${colors.reset}`); + log(`${colors.bright}This script automates the pre-release checklist from DEVELOPMENT.md${colors.reset}\n`); + + // Step 1: Check if we need version bump + const currentRendererVersion = getCurrentVersion('./tekton-pipeline-renderer/package.json'); + const currentVscodeVersion = getCurrentVersion('./tekton-vscode/package.json'); + + log(`${colors.blue}π¦ Current versions:${colors.reset}`); + log(` Renderer: ${currentRendererVersion}`); + log(` VSCode: ${currentVscodeVersion}`); + + const shouldBumpVersion = await promptUser('\nπ’ Do you want to bump the version? (y/n): '); + + if (shouldBumpVersion === 'y' || shouldBumpVersion === 'yes') { + const versionType = await promptUser('π Version bump type (patch/minor/major): '); + + if (['patch', 'minor', 'major'].includes(versionType)) { + log(`\n${colors.cyan}π Bumping version (${versionType})...${colors.reset}`); + + const newRendererVersion = bumpVersion('./tekton-pipeline-renderer/package.json', versionType); + const newVscodeVersion = bumpVersion('./tekton-vscode/package.json', versionType); + + if (newRendererVersion && newVscodeVersion) { + log(`${colors.green}β Version bumped to ${newRendererVersion}${colors.reset}`); + } else { + log(`${colors.red}β Version bump failed${colors.reset}`); + process.exit(1); + } + } else { + log(`${colors.yellow}β οΈ Invalid version type. Skipping version bump.${colors.reset}`); + } + } + + // Step 2: Run comprehensive release check (includes CI + propagation + final test) + if (!execCommand('yarn run release:check', 'Running comprehensive release check')) { + log(`${colors.red}π₯ Release check failed. Please fix issues before proceeding.${colors.reset}`); + process.exit(1); + } + + // Step 3: Manual testing instructions + log(`\n${colors.bright}${colors.yellow}π MANUAL TESTING REQUIRED${colors.reset}`); + log(`${colors.yellow}Please complete these manual steps:${colors.reset}\n`); + + log(`${colors.blue}1. Test Sample App:${colors.reset}`); + log(` β’ Run: yarn run sample`); + log(` β’ Test different pipeline configurations`); + log(` β’ Verify visualizations render correctly`); + + log(`\n${colors.blue}2. Test VSCode Extension:${colors.reset}`); + log(` β’ cd tekton-vscode && code .`); + log(` β’ Press F5 to launch Extension Development Host`); + log(` β’ Open a .yaml file with Tekton pipeline`); + log(` β’ Right-click β "Visualize Pipeline"`); + log(` β’ Verify webview renders correctly`); + + const testingSatisfied = await promptUser('\nβ Have you completed all manual testing? (y/n): '); + + if (testingSatisfied !== 'y' && testingSatisfied !== 'yes') { + log(`${colors.yellow}βΈοΈ Please complete manual testing and run this script again.${colors.reset}`); + log(`${colors.cyan}π‘ To resume testing:${colors.reset}`); + log(` β’ Sample app: yarn run sample`); + log(` β’ VSCode extension: cd tekton-vscode && code . (then F5)`); + process.exit(0); + } + + // Step 4: Build packages for release + if (!execCommand('yarn run build', 'Building both packages')) { + log(`${colors.red}π₯ Build failed. Please fix build issues.${colors.reset}`); + process.exit(1); + } + + if (!execCommand('yarn run vscode:package', 'Creating VSCode extension package')) { + log(`${colors.red}π₯ VSCode packaging failed.${colors.reset}`); + process.exit(1); + } + + // Success! + log(`\n${colors.bright}${colors.green}π PRE-RELEASE PREPARATION COMPLETE!${colors.reset}`); + log(`${colors.green}All automated checks have passed and packages are ready for release.${colors.reset}\n`); + + log(`${colors.blue}π¦ Next Steps:${colors.reset}`); + log(`${colors.blue}For NPM Package (Renderer):${colors.reset}`); + log(` cd tekton-pipeline-renderer && npm run npm:publish`); + + log(`${colors.blue}For VSCode Extension:${colors.reset}`); + log(` cd tekton-vscode && npx vsce publish`); + log(` (or upload the .vsix file to VSCode Marketplace manually)`); + + const vsixFiles = execSync('find tekton-vscode -name "*.vsix" 2>/dev/null || echo ""', { encoding: 'utf8' }).trim(); + if (vsixFiles) { + log(`${colors.green}π VSIX package created: ${vsixFiles}${colors.reset}`); + } + + log(`\n${colors.cyan}π‘ Pro tip: Review DEVELOPMENT.md for detailed release instructions.${colors.reset}`); +} + +// Handle interrupts gracefully +process.on('SIGINT', () => { + log(`\n${colors.yellow}βΈοΈ Pre-release preparation interrupted.${colors.reset}`); + log(`${colors.cyan}You can resume by running: npm run pre-release${colors.reset}`); + process.exit(0); +}); + +main().catch((error) => { + log(`${colors.red}π₯ Pre-release script failed: ${error.message}${colors.reset}`); + process.exit(1); +}); \ No newline at end of file diff --git a/scripts/propagate-changes.js b/scripts/propagate-changes.js index 00c763d..90f6167 100755 --- a/scripts/propagate-changes.js +++ b/scripts/propagate-changes.js @@ -68,6 +68,48 @@ function syncSampleFiles() { } } +/** + * Recursively copy directory using Node.js (cross-platform) + */ +function copyDirectorySync(src, dest) { + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest, { recursive: true }); + } + + const entries = fs.readdirSync(src, { withFileTypes: true }); + + for (const entry of entries) { + const srcPath = path.join(src, entry.name); + const destPath = path.join(dest, entry.name); + + if (entry.isDirectory()) { + copyDirectorySync(srcPath, destPath); + } else { + fs.copyFileSync(srcPath, destPath); + } + } +} + +/** + * Recursively remove directory using Node.js (cross-platform) + */ +function removeDirectorySync(dir) { + if (fs.existsSync(dir)) { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + removeDirectorySync(fullPath); + } else { + fs.unlinkSync(fullPath); + } + } + + fs.rmdirSync(dir); + } +} + /** * Bundle the renderer package directly into VSCode extension */ @@ -77,12 +119,28 @@ function bundleRendererCode() { const rendererSrcDir = path.join(RENDERER_DIR, 'src'); const vscodeLibDir = path.join(VSCODE_DIR, 'src', 'lib', 'tekton-renderer'); - // Remove existing bundled code + console.log(`π Source directory: ${rendererSrcDir}`); + console.log(`π Target directory: ${vscodeLibDir}`); + + // Verify source directory exists + if (!fs.existsSync(rendererSrcDir)) { + throw new Error(`β Renderer source directory not found: ${rendererSrcDir}`); + } + + // Remove existing bundled code using Node.js if (fs.existsSync(vscodeLibDir)) { - execSync(`rm -rf "${vscodeLibDir}"`, { stdio: 'pipe' }); + console.log('π§Ή Removing existing bundled code...'); + removeDirectorySync(vscodeLibDir); } // Create lib directory + const libParentDir = path.join(VSCODE_DIR, 'src', 'lib'); + if (!fs.existsSync(libParentDir)) { + console.log(`π Creating lib directory: ${libParentDir}`); + fs.mkdirSync(libParentDir, { recursive: true }); + } + + console.log(`π Creating target directory: ${vscodeLibDir}`); fs.mkdirSync(vscodeLibDir, { recursive: true }); // Copy renderer source code (excluding extension-specific files) @@ -101,11 +159,13 @@ function bundleRendererCode() { if (fs.existsSync(srcPath)) { if (fs.statSync(srcPath).isDirectory()) { - execSync(`cp -r "${srcPath}" "${destPath}"`, { stdio: 'pipe' }); + copyDirectorySync(srcPath, destPath); } else { - execSync(`cp "${srcPath}" "${destPath}"`, { stdio: 'pipe' }); + fs.copyFileSync(srcPath, destPath); } console.log(`β Bundled: ${item}`); + } else { + console.warn(`β οΈ Source path not found: ${srcPath}`); } }); @@ -122,6 +182,39 @@ export * from './utils'; fs.writeFileSync(path.join(vscodeLibDir, 'index.ts'), bundledIndexContent); console.log('β Created bundled index file'); + + // Verify the bundled files exist + console.log('π Verifying bundled files...'); + const createdFiles = fs.readdirSync(vscodeLibDir); + console.log('π Created files/directories:', createdFiles.join(', ')); + + // Check if index.ts exists and has content + const indexPath = path.join(vscodeLibDir, 'index.ts'); + if (fs.existsSync(indexPath)) { + const indexSize = fs.statSync(indexPath).size; + console.log(`β index.ts created successfully (${indexSize} bytes)`); + } else { + throw new Error('β index.ts was not created properly'); + } + + // Final verification that the directory structure matches what webpack expects + console.log('π Final verification of bundled structure:'); + try { + const vscodeWebviewDir = path.join(VSCODE_DIR, 'src', 'webview'); + const relativePathToLib = path.relative(vscodeWebviewDir, vscodeLibDir); + console.log(` From webview dir: ${vscodeWebviewDir}`); + console.log(` To lib dir: ${vscodeLibDir}`); + console.log(` Relative path: ${relativePathToLib}`); + console.log(` Expected import: '../lib/tekton-renderer'`); + + if (relativePathToLib !== '../lib/tekton-renderer') { + console.warn(`β οΈ Path mismatch! Expected '../lib/tekton-renderer', got '${relativePathToLib}'`); + } else { + console.log('β Import path verification passed'); + } + } catch (pathError) { + console.warn('β οΈ Could not verify import paths:', pathError.message); + } } /** @@ -151,15 +244,20 @@ function runChecks() { try { // Check if the VSCode extension can resolve dependencies process.chdir(VSCODE_DIR); - execSync('yarn install --check-files', { stdio: 'pipe' }); + console.log('π Checking dependencies...'); + execSync('yarn install --check-files', { stdio: 'inherit' }); console.log('β VSCode extension dependencies are valid'); // Check TypeScript compilation - execSync('yarn run build', { stdio: 'pipe' }); + console.log('π Building VSCode extension...'); + execSync('yarn run build', { stdio: 'inherit' }); console.log('β VSCode extension builds successfully with bundled code'); } catch (error) { - console.error('β Post-propagation checks failed:', error.message); + console.error('β Post-propagation checks failed:'); + console.error('Error message:', error.message); + if (error.stdout) console.error('STDOUT:', error.stdout.toString()); + if (error.stderr) console.error('STDERR:', error.stderr.toString()); process.exit(1); } } @@ -169,8 +267,16 @@ function runChecks() { */ function main() { try { - // Always use bundled approach - copy files for self-contained extension console.log('π Using COPY propagation mode (self-contained extension)'); + + // Debug environment info for CI troubleshooting + console.log('π Environment debug info:'); + console.log(` Working directory: ${process.cwd()}`); + console.log(` Renderer dir: ${RENDERER_DIR}`); + console.log(` VSCode dir: ${VSCODE_DIR}`); + console.log(` Renderer src exists: ${fs.existsSync(path.join(RENDERER_DIR, 'src'))}`); + console.log(` VSCode src exists: ${fs.existsSync(path.join(VSCODE_DIR, 'src'))}`); + bundleRendererCode(); updateToBundledImports(); syncSampleFiles(); @@ -181,6 +287,7 @@ function main() { } catch (error) { console.error('β Failed to propagate changes:', error.message); + console.error('Stack trace:', error.stack); process.exit(1); } } diff --git a/tekton-pipeline-renderer/src/webview/styles.css b/tekton-pipeline-renderer/src/webview/styles.css index c35bcd4..fcef627 100644 --- a/tekton-pipeline-renderer/src/webview/styles.css +++ b/tekton-pipeline-renderer/src/webview/styles.css @@ -214,4 +214,192 @@ body { .pf-c-button:hover { background: var(--vscode-button-hoverBackground) !important; +} + +/* Enhanced PatternFly Overrides for Better VSCode Theme Integration */ + +/* More comprehensive topology styling */ +.pf-topology-node-label { + fill: var(--vscode-editor-foreground) !important; +} + +.pf-topology-node-icon { + fill: var(--vscode-symbolIcon-foreground, var(--vscode-editor-foreground)) !important; +} + +/* Node backgrounds for better contrast */ +.pf-topology-node rect, +.pf-topology-node circle { + fill: var(--vscode-editor-background) !important; + stroke: var(--vscode-panel-border) !important; + stroke-width: 2 !important; +} + +/* Hover states */ +.pf-topology-node:hover rect, +.pf-topology-node:hover circle { + fill: var(--vscode-list-hoverBackground) !important; + stroke: var(--vscode-focusBorder) !important; +} + +/* Selected states */ +.pf-topology-node.pf-m-selected rect, +.pf-topology-node.pf-m-selected circle { + fill: var(--vscode-list-activeSelectionBackground) !important; + stroke: var(--vscode-list-activeSelectionForeground) !important; +} + +/* Group/cluster styling */ +.pf-topology-group { + fill: var(--vscode-panel-background) !important; + stroke: var(--vscode-panel-border) !important; +} + +/* Tooltip styling */ +.pf-c-tooltip { + background: var(--vscode-editorHoverWidget-background) !important; + color: var(--vscode-editorHoverWidget-foreground) !important; + border: 1px solid var(--vscode-editorHoverWidget-border) !important; +} + +/* Control bar enhancements */ +.pf-c-topology-control-bar__button { + background: var(--vscode-button-secondaryBackground) !important; + color: var(--vscode-button-secondaryForeground) !important; +} + +.pf-c-topology-control-bar__button:hover { + background: var(--vscode-button-secondaryHoverBackground) !important; +} + +/* Additional PatternFly component overrides */ +.pf-c-topology-view .pf-c-topology-node__label { + fill: var(--vscode-editor-foreground) !important; + font-family: var(--vscode-font-family) !important; +} + +/* Task node specific styling */ +.pf-c-topology-node.pf-m-task rect { + fill: var(--vscode-editor-background) !important; + stroke: var(--vscode-textLink-foreground) !important; +} + +.pf-c-topology-node.pf-m-task.pf-m-running rect { + fill: var(--vscode-progressBar-background) !important; + stroke: var(--vscode-charts-blue) !important; +} + +.pf-c-topology-node.pf-m-task.pf-m-succeeded rect { + fill: var(--vscode-testing-iconPassed) !important; + stroke: var(--vscode-charts-green) !important; +} + +.pf-c-topology-node.pf-m-task.pf-m-failed rect { + fill: var(--vscode-testing-iconFailed) !important; + stroke: var(--vscode-charts-red) !important; +} + +/* Edge connections styling */ +.pf-c-topology-edge path { + stroke: var(--vscode-panel-border) !important; + stroke-width: 2 !important; +} + +.pf-c-topology-edge.pf-m-success path { + stroke: var(--vscode-charts-green) !important; +} + +.pf-c-topology-edge.pf-m-error path { + stroke: var(--vscode-charts-red) !important; +} + +/* Scrollbar styling for consistency */ +::-webkit-scrollbar { + width: 12px; + background: var(--vscode-scrollbar-shadow); +} + +::-webkit-scrollbar-thumb { + background: var(--vscode-scrollbarSlider-background); + border-radius: 6px; +} + +::-webkit-scrollbar-thumb:hover { + background: var(--vscode-scrollbarSlider-hoverBackground); +} + +::-webkit-scrollbar-track { + background: var(--vscode-scrollbar-shadow); +} + +/* Basic PatternFly Overrides for VS Code Theme */ +.pf-c-topology-view { + background: var(--vscode-editor-background) !important; +} + +.pf-c-topology-view__surface { + background: var(--vscode-editor-background) !important; +} + +/* Force background on SVG and canvas elements */ +.pf-c-topology-view svg, +.pf-c-topology-view canvas, +div.pf-c-topology-view svg, +div.pf-c-topology-view canvas { + background: var(--vscode-editor-background) !important; + background-color: var(--vscode-editor-background) !important; +} + +/* Force background on the main topology surface */ +.pf-c-topology-view__surface, +div.pf-c-topology-view__surface, +.pf-c-topology-view .pf-c-topology-view__surface, +div.pf-c-topology-view div.pf-c-topology-view__surface { + background: var(--vscode-editor-background) !important; + background-color: var(--vscode-editor-background) !important; + fill: var(--vscode-editor-background) !important; +} + +/* Override any PatternFly white/light backgrounds */ +.pf-c-topology-view [fill="#ffffff"], +.pf-c-topology-view [fill="white"], +.pf-c-topology-view [fill="#fff"], +.pf-c-topology-view [fill="rgb(255, 255, 255)"] { + fill: var(--vscode-editor-background) !important; +} + +/* Override React component styling */ +div[data-testid="topology-container"], +div[data-topology-status="rendered"] { + background: var(--vscode-editor-background) !important; + background-color: var(--vscode-editor-background) !important; +} + +/* Force all child elements to inherit proper background */ +.pf-c-topology-view *, +div.pf-c-topology-view * { + background-color: transparent !important; +} + +/* Ensure topology surface gets dark background */ +.pf-c-topology-view__surface, +.pf-c-topology-view .pf-c-topology-view__surface { + background: var(--vscode-editor-background) !important; + background-color: var(--vscode-editor-background) !important; +} + +/* Override inline styles if present */ +div[style*="background"] { + background: var(--vscode-editor-background) !important; +} + +/* Target any remaining white backgrounds */ +*[style*="background-color: white"], +*[style*="background-color: #ffffff"], +*[style*="background-color: #fff"], +*[style*="background: white"], +*[style*="background: #ffffff"], +*[style*="background: #fff"] { + background: var(--vscode-editor-background) !important; + background-color: var(--vscode-editor-background) !important; } \ No newline at end of file diff --git a/tekton-vscode/package.json b/tekton-vscode/package.json index b7f6c44..2fcb89b 100644 --- a/tekton-vscode/package.json +++ b/tekton-vscode/package.json @@ -72,7 +72,7 @@ }, "scripts": { "vscode:prepublish": "npm run build", - "build": "webpack --mode production", + "build": "webpack --mode production && webpack --config webpack.webview.config.js --mode production", "build:extension": "npm run build && vsce package", "dev": "webpack --mode development --watch", "build:webview": "webpack --config webpack.webview.config.js --mode production", diff --git a/tekton-vscode/src/extension.ts b/tekton-vscode/src/extension.ts index 8b3ae20..697d471 100644 --- a/tekton-vscode/src/extension.ts +++ b/tekton-vscode/src/extension.ts @@ -97,7 +97,7 @@ function getWebviewContent(webview: vscode.Webview, extensionUri: vscode.Uri, ya
- + @@ -105,10 +105,11 @@ function getWebviewContent(webview: vscode.Webview, extensionUri: vscode.Uri, yaPlease open a valid Tekton Pipeline or PipelineRun YAML file and run the visualization command.
-Please open a valid Tekton Pipeline or PipelineRun YAML file and run the visualization command.
+