Skip to content

Commit

Permalink
Merge pull request #34 from fantonangeli/sync-main
Browse files Browse the repository at this point in the history
Sync main branch with Apache main branch
  • Loading branch information
rgdoliveira committed Aug 8, 2024
2 parents de32b00 + 336a713 commit 536e5f6
Show file tree
Hide file tree
Showing 1,176 changed files with 23,744 additions and 39,275 deletions.
4 changes: 0 additions & 4 deletions DISCLAIMER
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

* Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
* Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
*

* Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
* Some files, particularly test files, and those not supporting comments, may
Expand Down
4 changes: 0 additions & 4 deletions examples/base64png-editor-chrome-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
2 changes: 1 addition & 1 deletion examples/base64png-editor-chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/chrome": "^0.0.193",
"copy-webpack-plugin": "^11.0.0",
"rimraf": "^3.0.2",
"typescript": "^4.6.2",
"typescript": "^5.5.3",
"webpack": "^5.88.2",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
Expand Down
5 changes: 2 additions & 3 deletions examples/base64png-editor-chrome-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "@kie-tools/tsconfig/tsconfig.json",
"extends": "@kie-tools/tsconfig/tsconfig.esm.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false
},
"include": ["src"]
}
}
4 changes: 0 additions & 4 deletions examples/base64png-editor-vscode-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
2 changes: 1 addition & 1 deletion examples/base64png-editor-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/vscode": "1.67.0",
"@vscode/vsce": "^2.22.0",
"rimraf": "^3.0.2",
"typescript": "^4.6.2",
"typescript": "^5.5.3",
"webpack": "^5.88.2",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
Expand Down
5 changes: 2 additions & 3 deletions examples/base64png-editor-vscode-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "@kie-tools/tsconfig/tsconfig.json",
"extends": "@kie-tools/tsconfig/tsconfig.esm.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false
},
"include": ["src"]
}
}
4 changes: 0 additions & 4 deletions examples/base64png-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
2 changes: 1 addition & 1 deletion examples/base64png-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"@types/react-dom": "^17.0.5",
"copyfiles": "^2.4.1",
"rimraf": "^3.0.2",
"typescript": "^4.6.2"
"typescript": "^5.5.3"
}
}
7 changes: 3 additions & 4 deletions examples/base64png-editor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "@kie-tools/tsconfig/tsconfig.json",
"extends": "@kie-tools/tsconfig/tsconfig.esm.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
"jsx": "react-jsx"
}
}
4 changes: 0 additions & 4 deletions examples/commit-message-validation-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
4 changes: 0 additions & 4 deletions examples/drools-process-usertasks-quarkus-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
4 changes: 0 additions & 4 deletions examples/ping-pong-view-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):

- Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
-

- Hibernate, an LGPL project, is being used. Hibernate is in the process of
relicensing to ASL v2
- Some files, particularly test files, and those not supporting comments, may
Expand Down
19 changes: 4 additions & 15 deletions examples/ping-pong-view-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": 1,
"newProjectRoot": "projects",
"cli": {
"packageManager": "pnpm"
"packageManager": "pnpm",
"analytics": false
},
"projects": {
"ping-pong-view-angular": {
Expand Down Expand Up @@ -65,21 +66,10 @@
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ping-pong-view-angular:build:production"
},
"development": {
"browserTarget": "ping-pong-view-angular:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ping-pong-view-angular:build"
}
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
Expand Down Expand Up @@ -145,6 +135,5 @@
}
}
}
},
"defaultProject": "ping-pong-view-angular"
}
}
25 changes: 11 additions & 14 deletions examples/ping-pong-view-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,25 @@
"build:wc-lib": "tsc --project tsconfig.lib.json"
},
"dependencies": {
"@angular/animations": "^14.2.0",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/elements": "^14.2.0",
"@angular/forms": "^14.2.0",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@angular/common": "^18.1.2",
"@angular/compiler": "^18.1.2",
"@angular/core": "^18.1.2",
"@angular/elements": "^18.1.2",
"@angular/platform-browser": "^18.1.2",
"@angular/platform-browser-dynamic": "^18.1.2",
"@kie-tools-core/envelope": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"@kie-tools-examples/ping-pong-view": "workspace:*",
"rxjs": "^7.4.0",
"zone.js": "^0.11.4"
"zone.js": "^0.14.8"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.0",
"@angular/cli": "^14.2.0",
"@angular/compiler-cli": "^14.2.0",
"@angular-devkit/build-angular": "^18.1.2",
"@angular/cli": "^18.1.2",
"@angular/compiler-cli": "^18.1.2",
"@kie-tools/root-env": "workspace:*",
"@kie-tools/tsconfig": "workspace:*",
"rimraf": "^3.0.2",
"typescript": "^4.6.2"
"typescript": "^5.5.3"
}
}
6 changes: 3 additions & 3 deletions examples/ping-pong-view-angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/

import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";

import { AppComponent } from "./app.component";
import { PingPongModule } from "./ping-pong/ping-pong.module";
import { PingPongComponent } from "./ping-pong/ping-pong.component";
import { BrowserModule } from "@angular/platform-browser";

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, PingPongModule],
imports: [BrowserModule, PingPongComponent],
providers: [],
bootstrap: [AppComponent],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function getCurrentTime() {

@Injectable()
export class PingPongApiService implements PingPongFactory {
channelApi: MessageBusClientApi<PingPongChannelApi>;
initArgs: PingPongInitArgs;
channelApi?: MessageBusClientApi<PingPongChannelApi>;
initArgs?: PingPongInitArgs;
log = new ReplaySubject<LogEntry>(10);
logCleared = new Subject();
lastPingTimestamp = new BehaviorSubject<number>(0);
Expand All @@ -64,22 +64,22 @@ export class PingPongApiService implements PingPongFactory {
// Subscribe to ping notifications.
this.pingSubscription = this.channelApi.notifications.pingPongView__ping.subscribe((pingSource) => {
// If this instance sent the PING, we ignore it.
if (pingSource === this.initArgs.name) {
if (pingSource === initArgs.name) {
return;
}

// Add a new line to our log, stating that we received a ping.
this.log.next({ line: `PING from '${pingSource}'.`, time: getCurrentTime() });

// Acknowledges the PING message by sending back a PONG message.
this.channelApi.notifications.pingPongView__pong.send(this.initArgs.name, pingSource);
channelApi.notifications.pingPongView__pong.send(initArgs.name, pingSource);
});

// Subscribe to pong notifications.
this.pongSubscription = this.channelApi.notifications.pingPongView__pong.subscribe(
(pongSource: string, replyingTo: string) => {
// If this instance sent the PONG, or if this PONG was not meant to this instance, we ignore it.
if (pongSource === this.initArgs.name || replyingTo !== this.initArgs.name) {
if (pongSource === initArgs.name || replyingTo !== initArgs.name) {
return;
}

Expand Down Expand Up @@ -109,13 +109,17 @@ export class PingPongApiService implements PingPongFactory {

// Send a ping to the channel.
ping() {
this.channelApi.notifications.pingPongView__ping.send(this.initArgs.name);
this.lastPingTimestamp.next(getCurrentTime());
if (this.initArgs && this.channelApi) {
this.channelApi.notifications.pingPongView__ping.send(this.initArgs.name);
this.lastPingTimestamp.next(getCurrentTime());
}
}

clearSubscriptions() {
this.pingSubscription && this.channelApi.notifications.pingPongView__ping.unsubscribe(this.pingSubscription);
this.pongSubscription && this.channelApi.notifications.pingPongView__pong.unsubscribe(this.pongSubscription);
if (this.channelApi) {
this.pingSubscription && this.channelApi.notifications.pingPongView__ping.unsubscribe(this.pingSubscription);
this.pongSubscription && this.channelApi.notifications.pingPongView__pong.unsubscribe(this.pongSubscription);
}
}

clearInterval() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ import { Component, Input, OnInit } from "@angular/core";
import * as PingPongViewEnvelope from "@kie-tools-examples/ping-pong-view/dist/envelope";
import { ContainerType } from "@kie-tools-core/envelope/dist/api";
import { Observable, scan } from "rxjs";
import { CommonModule } from "@angular/common";

@Component({
standalone: true,
selector: "app-ping-pong",
templateUrl: "./ping-pong.component.html",
styleUrls: ["./ping-pong.component.css"],
providers: [PingPongApiService],
imports: [CommonModule],
})
export class PingPongComponent implements OnInit {
@Input() containerType: ContainerType;
Expand All @@ -50,10 +53,10 @@ export class PingPongComponent implements OnInit {
config: { containerType: this.containerType, envelopeId: this.envelopeId! },
bus: { postMessage: (message, _targetOrigin, transfer) => window.parent.postMessage(message, "*", transfer) },
pingPongViewFactory: this.pingPongApiService,
}).then(() => {
// Create an observable variable with the 10 latest values of the log.
this.subscribeToLogUpdates();
this.pingPongApiService.logCleared.subscribe(() => this.subscribeToLogUpdates());
});

// Create an observable variable with the 10 latest values of the log.
this.subscribeToLogUpdates();
this.pingPongApiService.logCleared.subscribe(() => this.subscribeToLogUpdates());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@

import { Component, Input } from "@angular/core";
import { ContainerType } from "@kie-tools-core/envelope/dist/api";
import { PingPongComponent } from "../ping-pong/ping-pong.component";
import { PingPongApiService } from "../ping-pong/ping-pong-api.service";

@Component({
standalone: true,
selector: "ping-pong-wc",
template: `<app-ping-pong [containerType]="containerType" [envelopeId]="envelopeId"></app-ping-pong>`,
providers: [PingPongApiService],
imports: [PingPongComponent],
})
export class PingPongWcComponent {
@Input("containertype") containerType: ContainerType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@
* under the License.
*/

import { WebComponentModule } from "./web-component.module";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { createApplication } from "@angular/platform-browser";
import { ApplicationRef } from "@angular/core";
import { createCustomElement } from "@angular/elements";
import { PingPongWcComponent } from "./web-component.component";
import { PingPongApiService } from "../ping-pong/ping-pong-api.service";

const bootstrap = () => platformBrowserDynamic().bootstrapModule(WebComponentModule);
bootstrap().catch((err) => console.error(err));
(async () => {
const app: ApplicationRef = await createApplication({ providers: [PingPongApiService] });

// Define Web Components
const pingPongWcComponent = createCustomElement(PingPongWcComponent, { injector: app.injector });
customElements.define("ping-pong-angular", pingPongWcComponent);
})();
5 changes: 5 additions & 0 deletions examples/ping-pong-view-angular/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
*/
import "zone.js"; // Included with Angular CLI.

// Zone JS messes a different class for promises called __zone_symbol__Promise,
// making `instanceof Promise` conditions fail.
// This makes it so that __zone_symbol__Promise has the same prototype as the native Promise.
Object.setPrototypeOf((window as any).__zone_symbol__Promise.prototype, Promise.prototype);

/***************************************************************************************************
* APPLICATION IMPORTS
*/
6 changes: 1 addition & 5 deletions examples/ping-pong-view-angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "@kie-tools/tsconfig/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"moduleResolution": "node"
},
"extends": "@kie-tools/tsconfig/tsconfig.esm.json",
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/ping-pong-view-angular/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/wc/lib",
"outDir": "./dist/wc",
"types": []
},
"files": ["lib/index.ts"]
Expand Down
Loading

0 comments on commit 536e5f6

Please sign in to comment.