Skip to content

Commit 206eb8e

Browse files
committed
Upgrade AvalynxRef to version 1.0.2.
Updated version references in package.json, README files, and examples. Added a German README translation, improved Jest configuration for coverage collection with thresholds, and excluded coverage directory in .gitignore. Minor code adjustments include enhanced `module.exports` implementation and coverage annotation. Upgraded devDependencies for consistent builds.
1 parent 3f75dad commit 206eb8e

9 files changed

Lines changed: 178 additions & 16 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/.idea/
2-
/node_modules/
3-
/package-lock.json
42
/ai.txt
3+
/coverage/
4+
/node_modules/

README.de.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# AvalynxRef
2+
3+
[![npm version](https://img.shields.io/npm/v/avalynx-ref)](https://www.npmjs.com/package/avalynx-ref)
4+
[![npm downloads](https://img.shields.io/npm/dt/avalynx-ref)](https://www.npmjs.com/package/avalynx-ref)
5+
[![jsDelivr](https://img.shields.io/jsdelivr/npm/hm/avalynx-ref)](https://www.jsdelivr.com/package/npm/avalynx-ref)
6+
[![License](https://img.shields.io/npm/l/avalynx-ref)](LICENSE)
7+
[![Tests](https://github.com/avalynx/avalynx-ref/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/avalynx/avalynx-ref/actions/workflows/tests.yml)
8+
[![codecov](https://codecov.io/gh/avalynx/avalynx-ref/branch/main/graph/badge.svg)](https://codecov.io/gh/avalynx/avalynx-ref)
9+
[![GitHub stars](https://img.shields.io/github/stars/avalynx/avalynx-ref?style=flat&logo=github)](https://github.com/avalynx/avalynx-ref)
10+
11+
AvalynxRef ist eine Implementierung eines Referenzsystem (Ref), ähnlich wie Refs in React oder Vue, das zur Aktualisierung von DOM-Elementen mit einem bestimmten Wert entwickelt wurde. Dies ermöglicht eine reaktive Verknüpfung zwischen JavaScript-Daten und der Benutzeroberfläche.
12+
13+
## Funktionen
14+
15+
- **Leichtgewichtig**: AvalynxRef ist eine leichtgewichtige Bibliothek, die keine Abhängigkeiten erfordert.
16+
- **Ref-System**: Verwenden Sie Refs, um DOM-Elemente mit einem bestimmten Wert zu aktualisieren.
17+
18+
## Beispiel
19+
20+
Hier ist ein einfaches Beispiel für die Verwendung von AvalynxRef in Ihrem Projekt:
21+
22+
* [Übersicht](https://avalynx-ref.jbs-newmedia.de/examples/index.html)
23+
* [Zufallswerte](https://avalynx-ref.jbs-newmedia.de/examples/random-values.html)
24+
25+
## Installation
26+
27+
Um AvalynxRef in Ihrem Projekt zu verwenden, können Sie es direkt in Ihre HTML-Datei einbinden.
28+
29+
Binden Sie AvalynxRef ein:
30+
31+
```html
32+
<script src="pfad/zu/avalynx-ref.js"></script>
33+
```
34+
35+
Ersetzen Sie `pfad/zu/avalynx-ref.js` durch den tatsächlichen Pfad zur Datei in Ihrem Projekt.
36+
37+
## Installation über jsDelivr ([Link](https://cdn.jsdelivr.net/npm/avalynx-ref/))
38+
39+
AvalynxRef ist auch über [jsDelivr](https://www.jsdelivr.com/) verfügbar. Sie können es wie folgt in Ihr Projekt einbinden:
40+
41+
```html
42+
<script src="https://cdn.jsdelivr.net/npm/avalynx-ref@1.0.2/dist/js/avalynx-ref.min.js"></script>
43+
```
44+
45+
## Installation über NPM ([Link](https://www.npmjs.com/package/avalynx-ref))
46+
47+
AvalynxRef ist auch als npm-Paket verfügbar. Sie können es mit dem folgenden Befehl zu Ihrem Projekt hinzufügen:
48+
49+
```bash
50+
npm install avalynx-ref
51+
```
52+
53+
Nach der Installation können Sie AvalynxRef wie folgt in Ihre JavaScript-Datei importieren:
54+
55+
```javascript
56+
import { AvalynxRef } from 'avalynx-ref';
57+
```
58+
59+
## Installation über Symfony AssetMapper
60+
61+
```bash
62+
php bin/console importmap:require avalynx-ref
63+
```
64+
65+
Nach der Installation können Sie AvalynxRef wie folgt in Ihre JavaScript-Datei importieren:
66+
67+
```javascript
68+
import { AvalynxRef } from 'avalynx-ref';
69+
```
70+
71+
## Installation über Symfony AssetComposer
72+
73+
Weitere Informationen zum Symfony AssetComposer Bundle finden Sie [hier](https://github.com/jbsnewmedia/asset-composer-bundle).
74+
75+
```twig
76+
{% do addAssetComposer('avalynx/avalynx-ref/dist/js/avalynx-ref.js') %}
77+
```
78+
79+
Stellen Sie sicher, dass Sie auch das JS/CSS von Bootstrap in Ihr Projekt einbinden, damit AvalynxRef korrekt angezeigt wird.
80+
81+
## Installation über Composer ([Link](https://packagist.org/packages/avalynx/avalynx-ref))
82+
83+
AvalynxRef ist auch als Composer-Paket verfügbar. Sie können es mit dem folgenden Befehl zu Ihrem Projekt hinzufügen:
84+
85+
```bash
86+
composer require avalynx/avalynx-loader
87+
```
88+
89+
Nach der Installation können Sie AvalynxLoader wie folgt in Ihre HTML-Datei einbinden:
90+
91+
```html
92+
<script src="vendor/avalynx/avalynx-loader/dist/js/avalynx-loader.js"></script>
93+
```
94+
95+
## Verwendung
96+
97+
Um AvalynxRef in Ihrem Projekt zu verwenden, binden Sie die JavaScript-Datei AvalynxRef in Ihr Projekt ein und initialisieren Sie die Klasse mit dem entsprechenden Selektor.
98+
99+
```javascript
100+
const myRef = new AvalynxRef("#myElement");
101+
myRef.value = "Aktualisierter Inhalt";
102+
```
103+
104+
oder verwenden Sie die Option `isHtml`, um den Wert als HTML zu behandeln:
105+
106+
```javascript
107+
const myRef = new AvalynxRef("#myElement", { isHtml: true });
108+
myRef.value = "<p>Aktualisierter Inhalt</p>";
109+
```
110+
111+
## Optionen
112+
113+
AvalynxRef ermöglicht die folgenden Optionen zur Anpassung:
114+
115+
- `selector`: (string) Der Selektor, der für die Zielbestimmung von Tabellen im DOM verwendet werden soll (Standard: `'.avalynx-ref'`).
116+
- `options`: Ein Objekt, das die folgenden Schlüssel enthält:
117+
- `isHtml`: (boolean) Behandelt den Wert als HTML (Standard: `false`).
118+
119+
## Geplante Funktionen
120+
- Callback-Funktion für Wertänderungen
121+
122+
## Beitragen
123+
124+
Beiträge sind willkommen! Wenn Sie etwas beitragen möchten, forken Sie bitte das Repository und senden Sie einen Pull-Request mit Ihren Änderungen oder Verbesserungen. Wir suchen nach Beiträgen in den folgenden Bereichen:
125+
126+
- Fehlerbehebungen
127+
- Funktionserweiterungen
128+
- Dokumentationsverbesserungen
129+
130+
Bevor Sie Ihren Pull-Request einreichen, stellen Sie bitte sicher, dass Ihre Änderungen gut dokumentiert sind und dem bestehenden Codierungsstil des Projekts entsprechen.
131+
132+
## Lizenz
133+
134+
AvalynxRef ist quelloffene Software, die unter der [MIT-Lizenz](LICENSE) lizenziert ist.
135+
136+
## Kontakt
137+
138+
Wenn Sie Fragen, Funktionswünsche oder Probleme haben, eröffnen Sie bitte ein Issue in unserem [GitHub-Repository](https://github.com/avalynx/avalynx-ref/issues) oder reichen Sie einen Pull-Request ein.
139+
140+
Vielen Dank, dass Sie AvalynxRef für Ihr Projekt in Betracht ziehen!

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# AvalynxRef
22

3+
[![npm version](https://img.shields.io/npm/v/avalynx-ref)](https://www.npmjs.com/package/avalynx-ref)
4+
[![npm downloads](https://img.shields.io/npm/dt/avalynx-ref)](https://www.npmjs.com/package/avalynx-ref)
5+
[![jsDelivr](https://img.shields.io/jsdelivr/npm/hm/avalynx-ref)](https://www.jsdelivr.com/package/npm/avalynx-ref)
6+
[![License](https://img.shields.io/npm/l/avalynx-ref)](LICENSE)
7+
[![Tests](https://github.com/avalynx/avalynx-ref/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/avalynx/avalynx-ref/actions/workflows/tests.yml)
8+
[![codecov](https://codecov.io/gh/avalynx/avalynx-ref/branch/main/graph/badge.svg)](https://codecov.io/gh/avalynx/avalynx-ref)
9+
[![GitHub stars](https://img.shields.io/github/stars/avalynx/avalynx-ref?style=flat&logo=github)](https://github.com/avalynx/avalynx-ref)
10+
311
AvalynxRef is an implementation of a reference (Ref) system, similar to Refs in React or Vue, designed for updating DOM elements with a specified value. This facilitates a reactive linkage between JavaScript data and the user interface.
412

513
## Features
@@ -31,7 +39,7 @@ Replace `path/to/avalynx-ref.js` with the actual path to the file in your projec
3139
AvalynxRef is also available via [jsDelivr](https://www.jsdelivr.com/). You can include it in your project like this:
3240

3341
```html
34-
<script src="https://cdn.jsdelivr.net/npm/avalynx-ref@1.0.1/dist/js/avalynx-ref.min.js"></script>
42+
<script src="https://cdn.jsdelivr.net/npm/avalynx-ref@1.0.2/dist/js/avalynx-ref.min.js"></script>
3543
```
3644

3745
## Installation via NPM ([Link](https://www.npmjs.com/package/avalynx-ref))

dist/js/avalynx-ref.esm.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* AvalynxRef is an implementation of a reference (Ref) system, similar to Refs in React or Vue, designed for updating DOM elements with a specified value. This facilitates a reactive linkage between JavaScript data and the user interface.
55
*
6-
* @version 1.0.1
6+
* @version 1.0.2
77
* @license MIT
88
* @author https://github.com/avalynx/avalynx-ref/graphs/contributors
99
* @website https://github.com/avalynx/
@@ -74,6 +74,7 @@ export class AvalynxRef {
7474
}
7575
}
7676

77+
/* istanbul ignore next */
7778
if (typeof module !== 'undefined' && module.exports) {
7879
module.exports = AvalynxRef
7980
}

dist/js/avalynx-ref.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* AvalynxRef is an implementation of a reference (Ref) system, similar to Refs in React or Vue, designed for updating DOM elements with a specified value. This facilitates a reactive linkage between JavaScript data and the user interface.
55
*
6-
* @version 1.0.1
6+
* @version 1.0.2
77
* @license MIT
88
* @author https://github.com/avalynx/avalynx-ref/graphs/contributors
99
* @website https://github.com/avalynx/
@@ -72,6 +72,7 @@ class AvalynxRef {
7272
}
7373
}
7474

75+
/* istanbul ignore next */
7576
if (typeof module !== 'undefined' && module.exports) {
7677
module.exports = AvalynxRef
7778
}

examples/random-values.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9/build/styles/stackoverflow-light.min.css" id="hljsTheme">
1717
<script>hljs.highlightAll();</script>
1818

19-
<!-- AvalynxRef 1.0.1 -->
20-
<script src="https://cdn.jsdelivr.net/npm/avalynx-ref@1.0.1/dist/js/avalynx-ref.min.js"></script>
19+
<!-- AvalynxRef -->
20+
<script src="../src/js/avalynx-ref.js"></script>
2121

2222
<!-- Example helper -->
2323
<link href="./css/helper.css" rel="stylesheet">

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@ module.exports = {
88
transform: {
99
"^.+\\.js$": "babel-jest"
1010
},
11+
collectCoverage: true,
12+
collectCoverageFrom: ["src/**/*.js"],
13+
coverageReporters: ["text", "lcov", "html"],
14+
coverageThreshold: {
15+
global: {
16+
branches: 100,
17+
functions: 100,
18+
lines: 100,
19+
statements: 100
20+
}
21+
}
1122
};

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "avalynx-ref",
33
"title": "AvalynxRef",
44
"description": "AvalynxRef is a Ref implementation for updating elements with a value like React's Ref or Vue's Ref.",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"license": "MIT",
77
"main": "dist/js/avalynx-ref.js",
88
"module": "dist/js/avalynx-ref.esm.js",
@@ -36,12 +36,12 @@
3636
"build": "shx rm -rf dist; shx mkdir -p dist/js/; shx cp src/js/avalynx-ref.js dist/js/avalynx-ref.js; shx cp src/js/avalynx-ref.js dist/js/avalynx-ref.esm.js; node build.js dist/js/avalynx-ref.esm.js;"
3737
},
3838
"devDependencies": {
39-
"@babel/core": "^7",
40-
"@babel/preset-env": "^7",
41-
"babel-jest": "^29",
42-
"jest": "^29",
43-
"jest-environment-jsdom": "^29",
44-
"shelljs": "^0",
45-
"shx": "^0"
39+
"@babel/core": "^7.29.0",
40+
"@babel/preset-env": "^7.29.0",
41+
"babel-jest": "^30.2.0",
42+
"jest": "^30.2.0",
43+
"jest-environment-jsdom": "^30.2.0",
44+
"shelljs": "^0.10.0",
45+
"shx": "^0.4.0"
4646
}
4747
}

src/js/avalynx-ref.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* AvalynxRef is an implementation of a reference (Ref) system, similar to Refs in React or Vue, designed for updating DOM elements with a specified value. This facilitates a reactive linkage between JavaScript data and the user interface.
55
*
6-
* @version 1.0.1
6+
* @version 1.0.2
77
* @license MIT
88
* @author https://github.com/avalynx/avalynx-ref/graphs/contributors
99
* @website https://github.com/avalynx/
@@ -72,6 +72,7 @@ class AvalynxRef {
7272
}
7373
}
7474

75+
/* istanbul ignore next */
7576
if (typeof module !== 'undefined' && module.exports) {
7677
module.exports = AvalynxRef
7778
}

0 commit comments

Comments
 (0)