From 4daf4a6d4886c7b069107ae188761ed3ed498454 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 12 May 2024 11:52:11 +0200 Subject: [PATCH] [DEV] update dev version --- .island/release.bash | 15 +++++++ package.json | 8 ++-- pnpm-lock.yaml | 88 +++++++++++++++++++------------------- src/model/settings-item.ts | 79 ++++++++++++++++++++++++++++++++++ version.txt | 1 + 5 files changed, 143 insertions(+), 48 deletions(-) create mode 100755 .island/release.bash create mode 100644 src/model/settings-item.ts create mode 100644 version.txt diff --git a/.island/release.bash b/.island/release.bash new file mode 100755 index 0000000..1b9de2c --- /dev/null +++ b/.island/release.bash @@ -0,0 +1,15 @@ +#!/bin/bash + +version_file="version.txt" + +if grep -q "dev" "$version_file"; then + # update all dependency + new_version=$(cat $version_file) + sed -i "s|\"version\":.*\".*\"|\"version\":\"$new_version\"|" package.json + pnpm install + pnpm run update_packages +else + # in case of release ==> can not do it automatically ... + echo not implemented +fi + diff --git a/package.json b/package.json index 1c9bef3..6b92dcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kangaroo-and-rabbit/kar-cw", - "version": "0.2.2", + "version":"0.2.2-dev", "sideEffects": false, "scripts": { "dev": "ng build kar-cw --watch --configuration development", @@ -27,9 +27,9 @@ "tslib": "^2.6.2" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.6", - "@angular/cli": "^17.3.6", - "@angular/compiler-cli": "^17.3.6", + "@angular-devkit/build-angular": "^17.3.7", + "@angular/cli": "^17.3.7", + "@angular/compiler-cli": "^17.3.8", "@types/jasmine": "~5.1.4", "jasmine-core": "~5.1.2", "karma": "~6.4.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5fe12e4..9a70601 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,14 +38,14 @@ dependencies: devDependencies: '@angular-devkit/build-angular': - specifier: ^17.3.6 - version: 17.3.6(@angular/compiler-cli@17.3.6)(karma@6.4.3)(ng-packagr@17.3.0)(typescript@5.4.5) + specifier: ^17.3.7 + version: 17.3.7(@angular/compiler-cli@17.3.8)(karma@6.4.3)(ng-packagr@17.3.0)(typescript@5.4.5) '@angular/cli': - specifier: ^17.3.6 - version: 17.3.6 + specifier: ^17.3.7 + version: 17.3.7 '@angular/compiler-cli': - specifier: ^17.3.6 - version: 17.3.6(@angular/compiler@17.3.6)(typescript@5.4.5) + specifier: ^17.3.8 + version: 17.3.8(@angular/compiler@17.3.6)(typescript@5.4.5) '@types/jasmine': specifier: ~5.1.4 version: 5.1.4 @@ -69,7 +69,7 @@ devDependencies: version: 2.1.0(jasmine-core@5.1.2)(karma-jasmine@5.1.0)(karma@6.4.3) ng-packagr: specifier: ^17.3.0 - version: 17.3.0(@angular/compiler-cli@17.3.6)(tslib@2.6.2)(typescript@5.4.5) + version: 17.3.0(@angular/compiler-cli@17.3.8)(tslib@2.6.2)(typescript@5.4.5) npm-check-updates: specifier: ^16.14.20 version: 16.14.20 @@ -87,18 +87,18 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: true - /@angular-devkit/architect@0.1703.6: - resolution: {integrity: sha512-Ck501FD/QuOjeKVFs7hU92w8+Ffetv0d5Sq09XY2/uygo5c/thMzp9nkevaIWBxUSeU5RqYZizDrhFVgYzbbOw==} + /@angular-devkit/architect@0.1703.7: + resolution: {integrity: sha512-SwXbdsZqEE3JtvujCLChAii+FA20d1931VDjDYffrGWdQEViTBAr4NKtDr/kOv8KkgiL3fhGibPnRNUHTeAMtg==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} dependencies: - '@angular-devkit/core': 17.3.6 + '@angular-devkit/core': 17.3.7 rxjs: 7.8.1 transitivePeerDependencies: - chokidar dev: true - /@angular-devkit/build-angular@17.3.6(@angular/compiler-cli@17.3.6)(karma@6.4.3)(ng-packagr@17.3.0)(typescript@5.4.5): - resolution: {integrity: sha512-K4CEZvhQZUUOpmXPVoI1YBM8BARbIlqE6FZRxakmnr+YOtVTYE5s+Dr1wgja8hZIohNz6L7j167G9Aut7oPU/w==} + /@angular-devkit/build-angular@17.3.7(@angular/compiler-cli@17.3.8)(karma@6.4.3)(ng-packagr@17.3.0)(typescript@5.4.5): + resolution: {integrity: sha512-AsV80kiFMIPIhm3uzJgOHDj4u6JteUkZedPTKAFFFJC7CTat1luW5qx306vfF7wj62aMvUl5g9HFWaeLghTQGA==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} peerDependencies: '@angular/compiler-cli': ^17.0.0 @@ -139,10 +139,10 @@ packages: optional: true dependencies: '@ampproject/remapping': 2.3.0 - '@angular-devkit/architect': 0.1703.6 - '@angular-devkit/build-webpack': 0.1703.6(webpack-dev-server@4.15.1)(webpack@5.90.3) - '@angular-devkit/core': 17.3.6 - '@angular/compiler-cli': 17.3.6(@angular/compiler@17.3.6)(typescript@5.4.5) + '@angular-devkit/architect': 0.1703.7 + '@angular-devkit/build-webpack': 0.1703.7(webpack-dev-server@4.15.1)(webpack@5.90.3) + '@angular-devkit/core': 17.3.7 + '@angular/compiler-cli': 17.3.8(@angular/compiler@17.3.6)(typescript@5.4.5) '@babel/core': 7.24.0 '@babel/generator': 7.23.6 '@babel/helper-annotate-as-pure': 7.22.5 @@ -153,7 +153,7 @@ packages: '@babel/preset-env': 7.24.0(@babel/core@7.24.0) '@babel/runtime': 7.24.0 '@discoveryjs/json-ext': 0.5.7 - '@ngtools/webpack': 17.3.6(@angular/compiler-cli@17.3.6)(typescript@5.4.5)(webpack@5.90.3) + '@ngtools/webpack': 17.3.7(@angular/compiler-cli@17.3.8)(typescript@5.4.5)(webpack@5.90.3) '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.1.7) ansi-colors: 4.1.3 autoprefixer: 10.4.18(postcss@8.4.35) @@ -178,7 +178,7 @@ packages: magic-string: 0.30.8 mini-css-extract-plugin: 2.8.1(webpack@5.90.3) mrmime: 2.0.0 - ng-packagr: 17.3.0(@angular/compiler-cli@17.3.6)(tslib@2.6.2)(typescript@5.4.5) + ng-packagr: 17.3.0(@angular/compiler-cli@17.3.8)(tslib@2.6.2)(typescript@5.4.5) open: 8.4.2 ora: 5.4.1 parse5-html-rewriting-stream: 7.0.0 @@ -227,14 +227,14 @@ packages: - webpack-cli dev: true - /@angular-devkit/build-webpack@0.1703.6(webpack-dev-server@4.15.1)(webpack@5.90.3): - resolution: {integrity: sha512-pJu0et2SiF0kfXenHSTtAART0omzbWpLgBfeUo4hBh4uwX5IaT+mRpYpr8gCXMq+qsjoQp3HobSU3lPDeBn+bg==} + /@angular-devkit/build-webpack@0.1703.7(webpack-dev-server@4.15.1)(webpack@5.90.3): + resolution: {integrity: sha512-gpt2Ia5I1gmdp3hdbtB7tkZTba5qWmKeVhlCYswa/LvbceKmkjedoeNRAoyr1UKM9GeGqt6Xl1B2eHzCH+ykrg==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} peerDependencies: webpack: ^5.30.0 webpack-dev-server: ^4.0.0 dependencies: - '@angular-devkit/architect': 0.1703.6 + '@angular-devkit/architect': 0.1703.7 rxjs: 7.8.1 webpack: 5.90.3(esbuild@0.20.1) webpack-dev-server: 4.15.1(webpack@5.90.3) @@ -242,8 +242,8 @@ packages: - chokidar dev: true - /@angular-devkit/core@17.3.6: - resolution: {integrity: sha512-FVbkT9dEwHEvjnxr4mvMNSMg2bCFoGoP4X68xXU9dhLEUpC05opLvfbaR3Qh543eCJ5AstosBFVzB/krfIkOvA==} + /@angular-devkit/core@17.3.7: + resolution: {integrity: sha512-qpZ7BShyqS/Jqld36E7kL02cyb2pjn1Az1p9439SbP8nsvJgYlsyjwYK2Kmcn/Wi+TZGIKxkqxgBBw9vqGgeJw==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} peerDependencies: chokidar: ^3.5.2 @@ -259,11 +259,11 @@ packages: source-map: 0.7.4 dev: true - /@angular-devkit/schematics@17.3.6: - resolution: {integrity: sha512-2G1YuPInd8znG7uUgKOS7z72Aku50lTzB/2csWkWPJLAFkh7vKC8QZ40x8S1nC9npVYPhI5CRLX/HVpBh9CyxA==} + /@angular-devkit/schematics@17.3.7: + resolution: {integrity: sha512-d7NKSwstdxYLYmPsbcYO3GOFNfXxXwOyHxSqDa1JNKoSzMdbLj4tvlCpfXw0ThNM7gioMx8aLBaaH1ac+yk06Q==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} dependencies: - '@angular-devkit/core': 17.3.6 + '@angular-devkit/core': 17.3.7 jsonc-parser: 3.2.1 magic-string: 0.30.8 ora: 5.4.1 @@ -272,15 +272,15 @@ packages: - chokidar dev: true - /@angular/cli@17.3.6: - resolution: {integrity: sha512-poKaRPeI+hFqX+AxIaEriaIggFVcC3XqlT9E1/uBC2rfHirE1n5F9Z7xqEDtMHduKwLbNXhQIPoKIKya8+Hnew==} + /@angular/cli@17.3.7: + resolution: {integrity: sha512-JgCav3sdRCoJHwLXxmF/EMzArYjwbqB+AGUW/xIR98oZET8QxCB985bOFUAm02SkAEUVcMJvjxec+WCaa60m/A==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} hasBin: true dependencies: - '@angular-devkit/architect': 0.1703.6 - '@angular-devkit/core': 17.3.6 - '@angular-devkit/schematics': 17.3.6 - '@schematics/angular': 17.3.6 + '@angular-devkit/architect': 0.1703.7 + '@angular-devkit/core': 17.3.7 + '@angular-devkit/schematics': 17.3.7 + '@schematics/angular': 17.3.7 '@yarnpkg/lockfile': 1.1.0 ansi-colors: 4.1.3 ini: 4.1.2 @@ -313,12 +313,12 @@ packages: tslib: 2.6.2 dev: false - /@angular/compiler-cli@17.3.6(@angular/compiler@17.3.6)(typescript@5.4.5): - resolution: {integrity: sha512-LaoUkY6uzcNocIEHJBvexvuU0a333IRQaG3Sj5IXhM1t864wTsfycn6yWJcQ7PhklB8BtNqiMbUQuEFtkxT8pg==} + /@angular/compiler-cli@17.3.8(@angular/compiler@17.3.6)(typescript@5.4.5): + resolution: {integrity: sha512-/TsbCmk7QJUEEZnRdNzi6znsPfoDJuy6vHDqcwWVEcw7y6W7DjirSFmtT9u1QwrV67KM6kOh22+RvPdGM8sPmg==} engines: {node: ^18.13.0 || >=20.9.0} hasBin: true peerDependencies: - '@angular/compiler': 17.3.6 + '@angular/compiler': 17.3.8 typescript: '>=5.2 <5.5' dependencies: '@angular/compiler': 17.3.6(@angular/core@17.3.6) @@ -2414,15 +2414,15 @@ packages: call-bind: 1.0.7 dev: true - /@ngtools/webpack@17.3.6(@angular/compiler-cli@17.3.6)(typescript@5.4.5)(webpack@5.90.3): - resolution: {integrity: sha512-equxbgh2DKzZtiFMoVf1KD4yJcH1q8lpqQ/GSPPQUvONcmHrr+yqdRUdaJ7oZCyCYmXF/nByBxtMKtJr6nKZVg==} + /@ngtools/webpack@17.3.7(@angular/compiler-cli@17.3.8)(typescript@5.4.5)(webpack@5.90.3): + resolution: {integrity: sha512-kQNS68jsPQlaWAnKcVeFKNHp6K90uQANvq+9oXb/i+JnYWzuBsHzn2r8bVdMmvjd1HdBRiGtg767XRk3u+jgRw==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} peerDependencies: '@angular/compiler-cli': ^17.0.0 typescript: '>=5.2 <5.5' webpack: ^5.54.0 dependencies: - '@angular/compiler-cli': 17.3.6(@angular/compiler@17.3.6)(typescript@5.4.5) + '@angular/compiler-cli': 17.3.8(@angular/compiler@17.3.6)(typescript@5.4.5) typescript: 5.4.5 webpack: 5.90.3(esbuild@0.20.1) dev: true @@ -2797,12 +2797,12 @@ packages: fsevents: 2.3.3 dev: true - /@schematics/angular@17.3.6: - resolution: {integrity: sha512-jCNZdjHSVrI8TrrCnCoXC8GYvQRj7zh+SDdmm91Ve8dbikYNmBOKYLuPaCTsmojWx7ytv962yLlgKzpaa2bbfw==} + /@schematics/angular@17.3.7: + resolution: {integrity: sha512-HaJroKaberriP4wFefTTSVFrtU9GMvnG3I6ELbOteOyKMH7o2V91FXGJDJ5KnIiLRlBmC30G3r+9Ybc/rtAYkw==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} dependencies: - '@angular-devkit/core': 17.3.6 - '@angular-devkit/schematics': 17.3.6 + '@angular-devkit/core': 17.3.7 + '@angular-devkit/schematics': 17.3.7 jsonc-parser: 3.2.1 transitivePeerDependencies: - chokidar @@ -6419,7 +6419,7 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /ng-packagr@17.3.0(@angular/compiler-cli@17.3.6)(tslib@2.6.2)(typescript@5.4.5): + /ng-packagr@17.3.0(@angular/compiler-cli@17.3.8)(tslib@2.6.2)(typescript@5.4.5): resolution: {integrity: sha512-kMSqxeDgv88SWCoapWNRRN1UdBgwu9/Pw/j7u2WFGmzrIWUFivNWBBSSL94kMxr2La+Z9wMwiL8EwKNvmCpg2A==} engines: {node: ^18.13.0 || >=20.9.0} hasBin: true @@ -6432,7 +6432,7 @@ packages: tailwindcss: optional: true dependencies: - '@angular/compiler-cli': 17.3.6(@angular/compiler@17.3.6)(typescript@5.4.5) + '@angular/compiler-cli': 17.3.8(@angular/compiler@17.3.6)(typescript@5.4.5) '@rollup/plugin-json': 6.1.0(rollup@4.14.1) '@rollup/plugin-node-resolve': 15.2.3(rollup@4.14.1) '@rollup/wasm-node': 4.14.1 diff --git a/src/model/settings-item.ts b/src/model/settings-item.ts new file mode 100644 index 0000000..6632d54 --- /dev/null +++ b/src/model/settings-item.ts @@ -0,0 +1,79 @@ +import { CheckerParameter } from "../component/entry-validator/entry-validator"; +import { isInArray, isNullOrUndefined, isObject, isString, isOptionalOf, isBoolean, isNumber, isUndefined } from "../utils"; + + +export enum SettingType { + VALUE = 'VALUE', + LINE = 'LINE', + BOOLEAN = 'BOOLEAN', + NUMBER = 'NUMBER', + STRING = 'STRING', + PASSWORD = 'PASSWORD', +} +export function isSettingType(data: any): data is SettingType { + return isInArray(data, ['VALUE', 'LINE', 'NUMBER', 'BOOLEAN', 'STRING', 'PASSWORD']); +} + +export interface SettingsItem { + // Type of the menu Node + type: SettingType; + // Unique key reference + key?: string; + // Displayed Title + title?: string; + // Description of the parameter + description?: string; + // placeholder of the parameter + placeholder?: string; + // Parameter key to SET/GET or the sub-menu + value?: boolean | string | Number; + // when data is change the value is set here undefined if not correct (must be set @ undefined): + newValue?: boolean | string | Number; + // checker to validate the data: + checker?: CheckerParameter + // result of the checker (must be set @ undefined): + state?: boolean | string; + // The element is require to have a valid form. + require?: boolean +} + +export function isSettingsItem(data: any): data is SettingsItem { + if (isNullOrUndefined(data)) { + return false; + } + if (!isObject(data)) { + return false; + } + if (!isSettingType(data.type)) { + return false; + } + if (!isString(data.key)) { + return false; + } + if (!isOptionalOf(data.title, isString)) { + return false; + } + if (!isOptionalOf(data.description, isString)) { + return false; + } + if (!isOptionalOf(data.placeholder, isString)) { + return false; + } + if ( + !isOptionalOf(data.value, isBoolean) && + !isOptionalOf(data.value, isString) && + !isOptionalOf(data.value, isNumber) + ) { + return false; + } + if (!isUndefined(data.newValue)) { + return false; + } + if (!isOptionalOf(data.state, isString)) { + return false; + } + if (!isOptionalOf(data.require, isBoolean)) { + return false; + } + return true; +} \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..192232a --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.2.2-dev