
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
@sebgroup/green-core-ng
Advanced tools
Angular wrappers for @sebgroup/green-core web components.
Status: Beta
@sebgroup/green-core-ng provides type-safe Angular component wrappers for all Green Design System web components. These wrappers are automatically generated from the Custom Elements Manifest, ensuring they stay in sync with the underlying web components while providing a native Angular development experience.
The wrappers eliminates the need to use CUSTOM_ELEMENTS_SCHEMA.
@sebgroup/green-core-ng is versioned and released in tandem with @sebgroup/green-core, and includes @sebgroup/green-core as a dependency. Angular consumers should generally only need to specify @sebgroup/green-core-ng as a direct dependency in their package.json, and the correct version of the underlying @sebgroup/green-core should be automatically installed.
@Input properties automatically sync to web component properties@Output EventEmittersControlValueAccessor and work seamlessly with Angular formsRouterLink directivenpm install @sebgroup/green-core-ng
Import components directly in your standalone components or NgModules:
import { Component } from '@angular/core';
import { GdsButtonComponent, GdsInputComponent } from '@sebgroup/green-core-ng';
@Component({
selector: 'app-example',
standalone: true,
imports: [GdsButtonComponent, GdsInputComponent],
template: `
<gds-input
label="Email"
type="email"
[(ngModel)]="email">
</gds-input>
<gds-button (click)="submit()">
Submit
</gds-button>
`
})
export class ExampleComponent {
email = '';
submit() {
console.log('Email:', this.email);
}
}
Pipeline Steps:
@sebgroup/green-core are built with Litcomponent-meta module i Core, and accessed by this libarary from there.generate-wrappers.ts) fetches the component-meta data to determine:
.component.ts).component.spec.ts)index.ts)ng-packagrgraph TB
subgraph "1. @sebgroup/green-core"
A[Web Components TypeScript Source Files<br/>libs/core/src/components/]
A --> B[CEM Analyzer<br/>npx cem analyze --litelement]
B --> C[custom-elements.json<br/>Custom Elements Manifest]
C --> E[component-meta<br/>CemParser.parseAllComponents]
E --> F[Extract Properties]
E --> G[Extract Events]
E --> H[Extract Slots]
E --> I[Extract Methods]
E --> J[Detect Special Types<br/>Form Controls, Links]
F & G & H & I & J --> K[ComponentData Objects]
end
subgraph "2. @sebgroup/green-core-ng"
K --> L[AngularGenerator]
L --> M[Generate Imports<br/>Angular decorators, base classes]
L --> N[Generate Component Class<br/>@Component decorator + metadata]
L --> O[Generate Properties<br/>@Input with transformations]
L --> P[Generate Events<br/>@Output EventEmitters]
L --> Q[Generate Lifecycle Hooks<br/>OnInit, OnChanges, AfterViewInit]
M & N & O & P & Q --> R[Component Files]
K --> S[TestGenerator]
S --> T[Test Files<br/>.component.spec.ts]
R --Output--> V["src/generated/*"]
V --> W["ng-packagr<br/>nx/angular:package"]
subgraph "Build & package"
W --> X["dist/libs/core-ng/<br/>Published NPM Package"]
end
end
class B,D,L,S,W process
Property Synchronization (@ProxyInputs decorator):
@Input properties are defined with the same names and types as web component properties@ProxyInputs decorator intercepts ngOnChanges and ngAfterViewInit lifecycle hooksEvent Handling:
ngOnInitgds-event-name to gdsEventName (kebab case to camel case)@Output EventEmitters(gdsClose)="handler()"Change Detection:
ChangeDetectionStrategy.OnPush for performancelibs/core-ng/
├── src/
│ ├── generated/ # Auto-generated component wrappers. This directory is gitignored
│ ├── form-control-base.ts # Base class for form control components
│ ├── proxy-inputs.decorator.ts # Decorator for property syncing
│ └── index.ts # Main entry point
│
├── build-scripts/
│ ├── generate-wrappers.ts # Orchestrates the generation process
│ ├── generator.ts # Core generator logic. Component code generation templates are in here
│ └── test-generator.ts # Test generator
│
├── documentation/ # Implementation docs
Components that extend GdsFormControlElement in Green Core automatically implement ControlValueAccessor. This means they work out-of-the-box with:
formControl, formControlName, formGroupngModel, ngModelGroupinvalid propertyComponents with an href property (like gds-link, gds-button, gds-menu-button) automatically integrate with Angular's RouterLink. No additional directives needed - the integration is built in!
Wrappers are automatically regenerated during the build process, but you can trigger generation manually:
# Only generate component wrapper sources, withoput build or test
nx run core-ng:generate-wrappers
# Generates wrappers and runs the generated test suite
nx run core-ng:test
# Gnereates the wrappers and builds with @nx/angular:package
nx run core-ng:build
⚠️ Do not manually edit files in src/generated/ - they will be overwritten on the next generation.
Instead:
build-scripts/form-control-base.ts, proxy-inputs.decorator.ts)libs/core/src/utils/helpers/component-meta.tsEssentially, the wrappers are dummy classes decorated with Angulars @Component, @Input and @Output decorators.
By using the web components element name as the selector for the decorated class, Angular is "tricked" into creating an instance of the web component at run-time.
@Component({
selector: 'gds-button', // <-- Angular will create a <gds-button> element in DOM
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<ng-content></ng-content>` // <-- Wrapper itself contains no template or logic, other than <ng-content>
})
The generator extracts component structure info from the Custom Elements Manifest and maps it to Angular component properties:
// In web component (Green Core):
@property()
variant: 'primary' | 'secondary' = 'primary'
// Generated Angular wrapper:
@Input()
variant?: GdsButton['variant'] // Type: 'primary' | 'secondary' | undefined
This approach ensures:
Kebab-case properties are converted to camelCase to align more with Angular conventions.
@Output decorators are added for all events, and any kebab-cased events (like gds-close) will be automatically mapped to a camelCased output (gdsClose) for better alignment with Angular conventions.
Boolean inputs automatically use Angular's booleanAttribute transform:
@Input({ transform: booleanAttribute })
disabled?: GdsButton['disabled']
This allows both attribute and property binding:
<!-- Both work -->
<gds-button disabled></gds-button>
<gds-button [disabled]="true"></gds-button>
FAQs
Angular wrappers for @sebgroup/green-core web components.
We found that @sebgroup/green-core-ng demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.