Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
event: deploy_staging
github_pat: ${{ secrets.K8S_WEBSERVICES_PAT }}

- uses: slackapi/slack-github-action@v1.26.0
- uses: slackapi/slack-github-action@v2.1.1
with:
channel-id: 'C0779L6QQT1' #'saas-deployment'
webhook-type: webhook-trigger
#'saas-deployment'
webhook: ${{ secrets.DEPLOYMENT_SLACK_BOT }}
payload: |
{
"text": ":rocket: webcomponents.ipedis.com has been released on staging ! :tada: ( ${{ github.ref_name }} )"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.DEPLOYMENT_SLACK_BOT }}
16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -31,4 +31,12 @@ jobs:
run: npm run test

- name: e2e all packages
run: npm run e2e
run: true || npm run e2e # temporarily disabled
axe-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dequelabs/axe-linter-action@v1
with:
api_key: ${{ secrets.AXE_LINTER_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ Thumbs.db

packages/*/.stencil
.angular
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
4 changes: 2 additions & 2 deletions apps/demo/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22-alpine AS build
FROM node:24-alpine AS build
WORKDIR /app/src
RUN apk add --no-cache --virtual .build-deps alpine-sdk python3

Expand All @@ -8,7 +8,7 @@ RUN npm install
COPY . ./
RUN npm run build

FROM node:22-alpine
FROM node:24-alpine
WORKDIR /usr/app
COPY --from=build /app/src/dist/demo ./
CMD node server/server.mjs
Expand Down
3 changes: 2 additions & 1 deletion apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
"defaultConfiguration": "development",
"continuous": true
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
Expand Down
58 changes: 26 additions & 32 deletions apps/demo/server.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import {
AngularNodeAppEngine,
createNodeRequestHandler,
isMainModule,
writeResponseToNodeResponse,
} from '@angular/ssr/node';
import express from 'express';
import { fileURLToPath } from 'node:url';
import { dirname, join, resolve } from 'node:path';
import bootstrap from './src/main.server';

// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
const browserDistFolder = resolve(serverDistFolder, '../browser');
const indexHtml = join(serverDistFolder, 'index.server.html');

const commonEngine = new CommonEngine();
const angularNodeAppEngine = new AngularNodeAppEngine();

server.set('view engine', 'html');
server.set('views', browserDistFolder);

server.use('/assets', express.static(join(browserDistFolder, 'assets')));

// Example Express Rest API endpoints;
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get(
'**',
server.use(
express.static(browserDistFolder, {
maxAge: '1y',
index: 'index.html',
}),
})
);

// All regular routes use the Angular engine
server.get('**', (req, res, next) => {
const { protocol, originalUrl, baseUrl, headers } = req;

commonEngine
.render({
bootstrap,
documentFilePath: indexHtml,
url: `${protocol}://${headers.host}${originalUrl}`,
publicPath: browserDistFolder,
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
})
.then((html) => res.send(html))
.catch((err) => next(err));
server.use((req, res, next) => {
angularNodeAppEngine.handle(req, {
server: 'express',
}).then(response => {
return response ? writeResponseToNodeResponse(response, res) : next();
}).catch(err => next(err));
});

return server;
}

function run(): void {
const port = process.env['PORT'] ? parseInt(process.env['PORT']) : 4000;
const server = app();

if (isMainModule(import.meta.url)) {
const port = process.env['PORT'] ? parseInt(process.env['PORT']) : 4001;
const ip = process.env['IP'] || '0.0.0.0';
// Start up the Node server
const server = app();
server.listen(port, ip, () => {
console.log(`Node Express server listening on http://${ip}:${port}`);

server.listen(port,ip, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}

run();
console.log('Node Express server started');

// This exposes the RequestHandler
export const reqHandler = createNodeRequestHandler(server);
10 changes: 3 additions & 7 deletions apps/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
Component,
CUSTOM_ELEMENTS_SCHEMA,
Inject,
OnInit,
} from '@angular/core';
import { Component, CUSTOM_ELEMENTS_SCHEMA, OnInit, inject } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { HeaderComponent } from './features/header/header.component';
import { AsideComponent } from './features/aside/aside.component';
Expand All @@ -27,8 +22,9 @@ import { CommonModule } from '@angular/common';
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppComponent implements OnInit {
private titleService = inject<TitleService>(TitleService);

isMenuVisible = false;
constructor(@Inject(TitleService) private titleService: TitleService) {}

ngOnInit() {
this.titleService.init();
Expand Down
9 changes: 4 additions & 5 deletions apps/demo/src/app/core/services/title.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { NavigationEnd, Router } from '@angular/router';
import { filter, map, mergeMap } from 'rxjs/operators';
Expand All @@ -7,10 +7,9 @@ import { filter, map, mergeMap } from 'rxjs/operators';
providedIn: 'root',
})
export class TitleService {
constructor(
private router: Router,
private titleService: Title,
) {}
private router = inject(Router);
private titleService = inject(Title);


init() {
this.router.events
Expand Down
49 changes: 25 additions & 24 deletions apps/demo/src/app/features/accordion/accordion.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,31 @@
role="button"
[attr.aria-expanded]="isOpen || alwaysOpen ? 'true' : 'false'"
[attr.aria-controls]="contentId"
>
<h3>{{ title }}</h3>
<div
class="icon"
*ngIf="!alwaysOpen"
[ngClass]="{ open: isOpen }"
aria-hidden="true"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M4.5 15L12 7.5L19.5 15"
stroke="#2E3243"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<h3>{{ title }}</h3>
@if (!alwaysOpen) {
<div
class="icon"
[ngClass]="{ open: isOpen }"
aria-hidden="true"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
>
<path
d="M4.5 15L12 7.5L19.5 15"
stroke="#2E3243"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
}
</div>
<div
class="content"
Expand All @@ -40,7 +41,7 @@ <h3>{{ title }}</h3>
[id]="contentId"
[attr.aria-labelledby]="headerId"
[attr.aria-hidden]="!(isOpen || alwaysOpen)"
>
>
<ng-content></ng-content>
</div>
</div>
17 changes: 4 additions & 13 deletions apps/demo/src/app/features/accordion/accordion.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
Component,
Input,
ElementRef,
Renderer2,
AfterViewInit,
OnInit,
} from '@angular/core';
import { Component, Input, ElementRef, Renderer2, AfterViewInit, OnInit, inject } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
Expand All @@ -16,17 +9,15 @@ import { CommonModule } from '@angular/common';
styleUrls: ['./accordion.component.scss'],
})
export class AccordionComponent implements AfterViewInit, OnInit {
private el = inject(ElementRef);
private renderer = inject(Renderer2);

@Input() title = '';
@Input() alwaysOpen = false;
isOpen = false;
contentId = '';
headerId = '';

constructor(
private el: ElementRef,
private renderer: Renderer2,
) {}

ngOnInit() {
this.contentId = `accordion-content-${Math.random().toString(36).substr(2, 9)}`;
this.headerId = `accordion-header-${Math.random().toString(36).substr(2, 9)}`;
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/src/app/features/aside/aside.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
Output,
OnInit,
} from '@angular/core';
import { CommonModule } from '@angular/common';

import { RouterLink, RouterLinkActive } from '@angular/router';

@Component({
selector: 'app-demo-aside',
standalone: true,
imports: [CommonModule, RouterLink, RouterLinkActive],
imports: [RouterLink, RouterLinkActive],
templateUrl: './aside.component.html',
styleUrls: ['./aside.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/src/app/features/card/card.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';

import { RouterModule } from '@angular/router';

@Component({
selector: 'app-card',
standalone: true,
imports: [CommonModule, RouterModule],
imports: [RouterModule],
templateUrl: './card.component.html',
styleUrl: './card.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Loading