Skip to content

v0.2.0 - Producer-Controlled Proxy Pattern

Latest

Choose a tag to compare

@egulatee egulatee released this 13 Feb 16:12
03611d7

🚀 Major Release: Producer-Controlled Proxy Pattern

Complete API rewrite implementing the proxy pattern. Breaking change from v0.1.0.

🎯 Key Achievement

Zero consumer library dependency - Consumers now use standard Pulumi StackReference with no imports from this library.


✨ New API

Producer-Side Functions

  • ✅ createStackAlias() - Simple alias creation
  • ✅ createConditionalAlias() - Pattern-based conditional aliasing
  • ✅ createSimpleAlias() - Convenience wrapper
  • ✅ matchesPattern() - Wildcard pattern matching

Type System

  • ✅ AliasConfig, AliasExports, PatternRule, ConditionalAliasConfig

❌ Removed (Breaking Changes)

  • resolveStackRef() - Consumer-side resolver
  • exportCanonicalPointer() - Producer helper
  • REDIRECT_KEY constant
  • ResolveStackRefOptions, ResolvedStack types
  • CLI tooling and commander dependency

📝 Usage Changes

Consumer Side (Simplified!)

Before (v0.1.0):

import { resolveStackRef } from "@egulatee/pulumi-stack-alias";

const infraStack = resolveStackRef("infrastructure");
const vpcId = infraStack.apply(ref => ref.requireOutput("vpcId"));

After (v0.2.0):

// NO LIBRARY IMPORT - standard Pulumi!
const infraStack = new pulumi.StackReference(
  `${pulumi.getOrganization()}/infrastructure/${pulumi.getStack()}`
);
const vpcId = infraStack.requireOutput("vpcId");

Producer Side

Before (v0.1.0):

if (aliasTarget) {
  export const _canonicalStack = aliasTarget;
}

After (v0.2.0):

import { createStackAlias } from "@egulatee/pulumi-stack-alias";

if (aliasTarget) {
  const alias = createStackAlias({
    targetProject: "infrastructure",
    targetStack: aliasTarget,
    outputs: ["vpcId", "endpoint"],
  });
  
  export const vpcId = alias.vpcId;
  export const endpoint = alias.endpoint;
}

✅ Testing & Quality

  • 33 comprehensive tests (increased from 19)
  • Pattern matching: 9 tests, 100% coverage
  • createStackAlias: 8 tests
  • createConditionalAlias: 10 tests
  • createSimpleAlias: 6 tests
  • All builds passing
  • Linter clean (1 expected warning)

📚 Documentation

  • Complete README rewrite
  • API reference with JSDoc
  • Architecture explanation
  • CI/CD orchestration guide
  • Migration guide from v0.1.0
  • Working examples

🔄 Migration Required

  1. Consumers: Remove library dependency, use standard StackReference
  2. Producers: Update to createStackAlias() API
  3. Deployment: Redeploy all alias stacks
  4. CI/CD: Add alias sync jobs for output freshness

See README for full migration guide.


📦 What's Changed

Full Changelog: v0.1.0...v0.2.0

Commits

  • Rollback to Producer-Controlled Proxy pattern by @egulatee

🙏 Credits

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com