From b730d74a116480c7f0a824648bacda9709597334 Mon Sep 17 00:00:00 2001 From: Lazar Djurdjevic Date: Thu, 2 Jul 2026 12:56:34 +0200 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20Summary=20of=20Changes=20=20=20=20?= =?UTF-8?q?=20=20=E2=9C=85=20@baloise/web-app-validators-angular=20(valida?= =?UTF-8?q?tors-angular/package.json)=20=20=20=20=20=20Updated=20main:=20d?= =?UTF-8?q?ist/fesm2020/baloise-web-app-validators-angular.mjs=20=E2=86=92?= =?UTF-8?q?=20dist/fesm2022/baloise-web-app-validators-angular.mjs=20=20?= =?UTF-8?q?=20=20=20=20Updated=20module:=20dist/fesm2015/baloise-web-app-v?= =?UTF-8?q?alidators-angular.js=20=E2=86=92=20dist/fesm2022/baloise-web-ap?= =?UTF-8?q?p-validators-angular.mjs=20=20=20=20=20=20Added=20"type":=20"mo?= =?UTF-8?q?dule"=20for=20ES=20module=20support=20=20=20=20=20=20Added=20ex?= =?UTF-8?q?ports=20field=20with=20proper=20subpath=20exports=20for=20moder?= =?UTF-8?q?n=20bundlers=20=20=20=20=20=20=E2=9C=85=20@baloise/web-app-pipe?= =?UTF-8?q?s-angular=20(pipes-angular/package.json)=20=20=20=20=20=20Updat?= =?UTF-8?q?ed=20main:=20dist/fesm2020/baloise-web-app-pipes-angular.mjs=20?= =?UTF-8?q?=E2=86=92=20dist/fesm2022/baloise-web-app-pipes-angular.mjs=20?= =?UTF-8?q?=20=20=20=20=20Updated=20module:=20dist/fesm2015/baloise-web-ap?= =?UTF-8?q?p-pipes-angular.js=20=E2=86=92=20dist/fesm2022/baloise-web-app-?= =?UTF-8?q?pipes-angular.mjs=20=20=20=20=20=20Added=20"type":=20"module"?= =?UTF-8?q?=20for=20ES=20module=20support=20=20=20=20=20=20Added=20exports?= =?UTF-8?q?=20field=20with=20proper=20subpath=20exports=20for=20modern=20b?= =?UTF-8?q?undlers=20=20=20=20=20=20These=20changes=20ensure=20that:=20=20?= =?UTF-8?q?=20=20=20=20Modern=20bundlers=20(esbuild,=20Angular=2017+)=20ca?= =?UTF-8?q?n=20properly=20resolve=20these=20packages=20=20=20=20=20=20The?= =?UTF-8?q?=20correct=20fesm2022=20paths=20are=20used=20instead=20of=20the?= =?UTF-8?q?=20non-existent=20fesm2020/fesm2015=20files=20=20=20=20=20=20Th?= =?UTF-8?q?e=20exports=20field=20provides=20proper=20entry=20point=20confi?= =?UTF-8?q?guration=20for=20different=20module=20formats=20=20=20=20=20=20?= =?UTF-8?q?Type=20definitions=20are=20correctly=20exposed=20via=20the=20ty?= =?UTF-8?q?pes=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pipes-angular/package.json | 18 +++++++++++++++--- packages/validators-angular/package.json | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/pipes-angular/package.json b/packages/pipes-angular/package.json index 088370a..756d4c7 100644 --- a/packages/pipes-angular/package.json +++ b/packages/pipes-angular/package.json @@ -55,11 +55,23 @@ "files": [ "dist/" ], - "main": "dist/fesm2020/baloise-web-app-pipes-angular.mjs", - "module": "dist/fesm2015/baloise-web-app-pipes-angular.js", + "type": "module", + "main": "dist/fesm2022/baloise-web-app-pipes-angular.mjs", + "module": "dist/fesm2022/baloise-web-app-pipes-angular.mjs", "es2015": "dist/fesm2015/baloise-web-app-pipes-angular.mjs", "es2020": "dist/fesm2020/baloise-web-app-pipes-angular.mjs", "esm2020": "dist/esm2020/baloise-web-app-pipes-angular.mjs", "typings": "dist/index.d.ts", - "sideEffects": false + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "esm2022": "./dist/esm2022/baloise-web-app-pipes-angular.mjs", + "esm": "./dist/esm2022/baloise-web-app-pipes-angular.mjs", + "default": "./dist/fesm2022/baloise-web-app-pipes-angular.mjs" + }, + "./package.json": { + "default": "./package.json" + } + } } diff --git a/packages/validators-angular/package.json b/packages/validators-angular/package.json index d0a2199..ce50dc1 100644 --- a/packages/validators-angular/package.json +++ b/packages/validators-angular/package.json @@ -56,11 +56,23 @@ "files": [ "dist/" ], - "main": "dist/fesm2020/baloise-web-app-validators-angular.mjs", - "module": "dist/fesm2015/baloise-web-app-validators-angular.js", + "type": "module", + "main": "dist/fesm2022/baloise-web-app-validators-angular.mjs", + "module": "dist/fesm2022/baloise-web-app-validators-angular.mjs", "es2015": "dist/fesm2015/baloise-web-app-validators-angular.mjs", "es2020": "dist/fesm2020/baloise-web-app-validators-angular.mjs", "esm2020": "dist/esm2020/baloise-web-app-validators-angular.mjs", "typings": "dist/index.d.ts", - "sideEffects": false + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "esm2022": "./dist/esm2022/baloise-web-app-validators-angular.mjs", + "esm": "./dist/esm2022/baloise-web-app-validators-angular.mjs", + "default": "./dist/fesm2022/baloise-web-app-validators-angular.mjs" + }, + "./package.json": { + "default": "./package.json" + } + } } From f1d8833eba8a05d3395b1cd1f6442e3ac96db6c3 Mon Sep 17 00:00:00 2001 From: Lazar Djurdjevic Date: Thu, 2 Jul 2026 13:02:04 +0200 Subject: [PATCH 2/3] fix: update build generator script extension to .cjs --- packages/pipes-angular/package.json | 2 +- packages/validators-angular/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pipes-angular/package.json b/packages/pipes-angular/package.json index 756d4c7..af1f4ca 100644 --- a/packages/pipes-angular/package.json +++ b/packages/pipes-angular/package.json @@ -23,7 +23,7 @@ "banner": "node ../../.build/banner.js pipes-angular", "update:registry": "sed -i -e \"s#nexus.balgroupit.com/repository/npm#registry.npmjs.org#g\" package-lock.json\n", "build": "npm run banner && npm run clean && npm run build:generator && npm run build:compile", - "build:generator": "node .build/generator.script.js", + "build:generator": "node .build/generator.script.cjs", "build:compile": "ng-packagr -p ng-package.json", "clean": "rimraf src/pipes.ts && rimraf dist" }, diff --git a/packages/validators-angular/package.json b/packages/validators-angular/package.json index ce50dc1..abd27b6 100644 --- a/packages/validators-angular/package.json +++ b/packages/validators-angular/package.json @@ -23,7 +23,7 @@ "banner": "node ../../.build/banner.js validators-angular", "update:registry": "sed -i -e \"s#nexus.balgroupit.com/repository/npm#registry.npmjs.org#g\" package-lock.json\n", "build": "npm run banner && npm run clean && npm run build:generator && npm run build:compile", - "build:generator": "node .build/generator.script.js", + "build:generator": "node .build/generator.script.cjs", "build:compile": "ng-packagr -p ng-package.json", "clean": "rimraf src/validators.ts && rimraf dist" }, From 0a0d31bc55221d70213042beed0ee4a4ea9e063d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:08:04 +0000 Subject: [PATCH 3/3] fix: add generator.script.cjs for pipes-angular and validators-angular --- .../pipes-angular/.build/generator.script.cjs | 50 +++++++++++++++++++ .../.build/generator.script.cjs | 46 +++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 packages/pipes-angular/.build/generator.script.cjs create mode 100644 packages/validators-angular/.build/generator.script.cjs diff --git a/packages/pipes-angular/.build/generator.script.cjs b/packages/pipes-angular/.build/generator.script.cjs new file mode 100644 index 0000000..472bb16 --- /dev/null +++ b/packages/pipes-angular/.build/generator.script.cjs @@ -0,0 +1,50 @@ +/** + * angular - pipes + * -------------------------------------- + * This script reads the pipes.json and creates + * out of this information the pipess.ts file, which + * adds the pipes to the angular framework. + */ + +const path = require('path') +const file = require('../../../.build/file') +const { title } = require('../../../.build/log') +const utilities = require('../../../.build/utilities') + +const run = async () => { + await title('angular : pipes') + const files = await utilities.read({ fileName: 'pipes' }) + const pipes = files.map(f => f.functions[0]) + + const functions = pipes.map(f => f.name) + const utilPipes = pipes.map(f => ` ${f.name.charAt(0).toUpperCase() + f.name.slice(1)}Pipe`) + const utilPipesClass = pipes.map(f => + [ + '@Pipe({', + ` name: '${f.name}'`, + '})', + `export class ${f.name.charAt(0).toUpperCase() + f.name.slice(1)}Pipe implements PipeTransform {`, + ` transform = ${f.name}`, + '}', + '', + ].join('\n'), + ) + + const content = [ + '// generated file by .build/generator.script.js', + '', + `import { Pipe, PipeTransform } from '@angular/core';`, + `import {`, + ` ${functions.join(',\n ')}`, + `} from '@baloise/web-app-pipes'`, + '', + utilPipesClass.join('\n'), + 'export const PIPES = [', + utilPipes.join(',\n'), + ']', + ].join('\n') + + await file.save(path.join(__dirname, '../src/pipes.ts'), content) +} + +run() diff --git a/packages/validators-angular/.build/generator.script.cjs b/packages/validators-angular/.build/generator.script.cjs new file mode 100644 index 0000000..a9b8c5d --- /dev/null +++ b/packages/validators-angular/.build/generator.script.cjs @@ -0,0 +1,46 @@ +const path = require('path') +const file = require('../../../.build/file') +const { title } = require('../../../.build/log') +const utilities = require('../../../.build/utilities') + +const run = async () => { + await title('angular : validators') + const files = await utilities.read({ fileName: 'validators' }) + const validators = files + .reduce((acc, f) => { + return [...acc, ...f.functions] + }, []) + .map(v => { + const params = v.parameters.map(p => `${p.name}: ${p.type}`) + params.push(`errorName = '${v.name}'`) + return ` + export function ${v.name}(${params.join(', ')}): ValidatorFn { + return (control: AbstractControl): { [key: string]: any } | null => { + return validate(BalValidators.${v.name}(${v.parameters.map(p => p.name).join(', ')})(control.value), errorName, control) + } + }` + }) + + const content = [ + '// generated file by .build/generator.script.js', + '', + `import { AbstractControl, ValidatorFn } from '@angular/forms';`, + `import { BalValidators, BalValidatorFn } from '@baloise/web-app-validators'`, + ` + function createError(key: string, control: AbstractControl) { + return { + [\`\${key}\`]: { value: control.value }, + } + } + + function validate(result: boolean, key: string, control: AbstractControl) { + return result === undefined || result === true ? null : createError(key, control) + }`, + validators.join('\n'), + '', + ].join('\n') + + await file.save(path.join(__dirname, '../src/validators.ts'), content) +} + +run()