chore: Version auf 1.1.256 erhöht – automatische Synchronisierung durch Husky
This commit is contained in:
@@ -4,6 +4,15 @@ Alle bedeutenden Änderungen an diesem Projekt werden in dieser Datei dokumentie
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [1.1.256] – 2025-06-12
|
||||||
|
|
||||||
|
### 🔧 Version
|
||||||
|
|
||||||
|
- 📦 Version automatisch erhöht über `bumpVersion.js`
|
||||||
|
- Synchronisierung von `package.json` und `config/appVersion.js`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [1.1.253] – 2025-06-11
|
## [1.1.253] – 2025-06-11
|
||||||
|
|
||||||
### ✨ Features
|
### ✨ Features
|
||||||
|
|||||||
@@ -164,7 +164,9 @@ User-ID.
|
|||||||
|
|
||||||
wird mit husky Bibliothek automatisch erhöht bei "git commit message"
|
wird mit husky Bibliothek automatisch erhöht bei "git commit message"
|
||||||
|
|
||||||
→ Wird in der Fußzeile angezeigt.
|
→ Wird in der Fußzeile angezeigt. Die Version wird automatisch erhöht über ein Script
|
||||||
|
(`scripts/bumpVersion.js`), das per Husky vor jedem Commit ausgeführt wird.
|
||||||
|
Die Version steht sowohl in `package.json` als auch in `config/appVersion.js`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.256";
|
export const APP_VERSION = "1.1.257";
|
||||||
|
|||||||
5
package-lock.json
generated
5
package-lock.json
generated
@@ -1,9 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "11.06.2025 NodeMap",
|
"name": "nodemap",
|
||||||
|
"version": "1.1.256",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
|
"name": "nodemap",
|
||||||
|
"version": "1.1.256",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"name": "nodemap",
|
||||||
|
"version": "1.1.256",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -1,36 +1,39 @@
|
|||||||
|
// @/scripts/bumpVersion.js
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
// Pfad zur appVersion.js
|
// Pfade definieren
|
||||||
const versionFilePath = path.join(__dirname, "../config/appVersion.js");
|
const versionFilePath = path.join(__dirname, "../config/appVersion.js");
|
||||||
|
const packageJsonPath = path.join(__dirname, "../package.json");
|
||||||
|
|
||||||
// Datei einlesen
|
// Aktuelle Version aus appVersion.js lesen
|
||||||
let content = fs.readFileSync(versionFilePath, "utf8");
|
let appVersionContent = fs.readFileSync(versionFilePath, "utf8");
|
||||||
|
|
||||||
// Version auslesen (wichtig: export const muss dabei sein wegen Next.js)
|
|
||||||
const versionRegex = /export const APP_VERSION = "(\d+)\.(\d+)\.(\d+)"/;
|
const versionRegex = /export const APP_VERSION = "(\d+)\.(\d+)\.(\d+)"/;
|
||||||
const match = content.match(versionRegex);
|
const match = appVersionContent.match(versionRegex);
|
||||||
|
|
||||||
if (!match) {
|
if (!match) {
|
||||||
console.error("Konnte Version nicht finden!");
|
console.error("❌ Konnte APP_VERSION nicht finden!");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let major = Number(match[1]);
|
let [_, major, minor, patch] = match.map(Number);
|
||||||
let minor = Number(match[2]);
|
let newPatch = patch + 1;
|
||||||
let patch = Number(match[3]);
|
const newVersion = `${major}.${minor}.${newPatch}`;
|
||||||
|
|
||||||
// Patch erhöhen
|
// 🟢 appVersion.js aktualisieren
|
||||||
patch++;
|
appVersionContent = appVersionContent.replace(
|
||||||
|
versionRegex,
|
||||||
|
`export const APP_VERSION = "${newVersion}"`
|
||||||
|
);
|
||||||
|
fs.writeFileSync(versionFilePath, appVersionContent, "utf8");
|
||||||
|
|
||||||
// Neue Version zusammenbauen
|
// 🟢 package.json aktualisieren
|
||||||
const newVersion = `${major}.${minor}.${patch}`;
|
const pkgPath = path.resolve(packageJsonPath);
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath));
|
||||||
|
pkg.version = newVersion;
|
||||||
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), "utf8");
|
||||||
|
|
||||||
// Dateiinhalt ersetzen
|
// ✅ Log (optional bei DEBUG)
|
||||||
const newContent = content.replace(versionRegex, `export const APP_VERSION = "${newVersion}"`);
|
|
||||||
|
|
||||||
// Datei speichern
|
|
||||||
fs.writeFileSync(versionFilePath, newContent, "utf8");
|
|
||||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||||
console.log(`✅ Version erhöht auf: ${newVersion}`);
|
console.log(`✅ Version erhöht auf: ${newVersion}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user