From 1de01f1461318cbc308fe6c71cbe4066c7905779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20de=20Vasconcelos?= Date: Mon, 15 Jul 2024 23:32:19 +0100 Subject: [PATCH] Add version number --- nextjs/Dockerfile | 2 ++ nextjs/bump-version.js | 19 ------------------- nextjs/components/AppVersion/AppVersion.js | 10 ++++++++++ .../AppVersion/AppVersion.module.css | 17 +++++++++++++++++ nextjs/components/AppWrapper/AppWrapper.js | 8 +++++++- nextjs/package.json | 3 +-- 6 files changed, 37 insertions(+), 22 deletions(-) delete mode 100644 nextjs/bump-version.js create mode 100644 nextjs/components/AppVersion/AppVersion.js create mode 100644 nextjs/components/AppVersion/AppVersion.module.css diff --git a/nextjs/Dockerfile b/nextjs/Dockerfile index e71732a..ee7deb1 100644 --- a/nextjs/Dockerfile +++ b/nextjs/Dockerfile @@ -33,6 +33,8 @@ WORKDIR /app COPY --from=dependencies /app/node_modules ./node_modules COPY . . +RUN npx @helperkits/bumper bump + RUN npm run build diff --git a/nextjs/bump-version.js b/nextjs/bump-version.js deleted file mode 100644 index be84319..0000000 --- a/nextjs/bump-version.js +++ /dev/null @@ -1,19 +0,0 @@ -const packageJson = require('./package.json'); -const fs = require('fs'); - -const now = new Date(); -const year = now.getFullYear(); -const month = padNumber(now.getMonth() + 1); -const day = padNumber(now.getDate()); -const hours = padNumber(now.getHours()); -const minutes = padNumber(now.getMinutes()); - -const version = `${year}.${month}.${day}-${hours}${minutes}`; - -packageJson.version = version; - -fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 4)); - -function padNumber(number) { - return number.toString().padStart(2, '0'); -} diff --git a/nextjs/components/AppVersion/AppVersion.js b/nextjs/components/AppVersion/AppVersion.js new file mode 100644 index 0000000..31e07f9 --- /dev/null +++ b/nextjs/components/AppVersion/AppVersion.js @@ -0,0 +1,10 @@ +/* * */ + +import styles from './AppVersion.module.css'; +import pjson from '../../package.json'; + +/* * */ + +export default function AppVersion() { + return

{pjson.version}

; +} diff --git a/nextjs/components/AppVersion/AppVersion.module.css b/nextjs/components/AppVersion/AppVersion.module.css new file mode 100644 index 0000000..689ecd5 --- /dev/null +++ b/nextjs/components/AppVersion/AppVersion.module.css @@ -0,0 +1,17 @@ +/* * */ +/* CONTAINER */ + +.container { + width: 100%; + margin: 0 auto; + max-width: 1000px; + padding: 15px var(--size-lg) 30px var(--size-lg); + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + gap: 150px; + font-size: 10px; + font-weight: 600; + color: rgba(0, 0, 0, 0.25); +} diff --git a/nextjs/components/AppWrapper/AppWrapper.js b/nextjs/components/AppWrapper/AppWrapper.js index 1d46429..59621fb 100644 --- a/nextjs/components/AppWrapper/AppWrapper.js +++ b/nextjs/components/AppWrapper/AppWrapper.js @@ -1,9 +1,15 @@ /* * */ +import AppVersion from '../AppVersion/AppVersion'; import styles from './AppWrapper.module.css'; /* * */ export default function AppWrapper({ children }) { - return
{children}
; + return ( +
+ {children} + +
+ ); } diff --git a/nextjs/package.json b/nextjs/package.json index dd37643..30f0a79 100644 --- a/nextjs/package.json +++ b/nextjs/package.json @@ -1,10 +1,9 @@ { "name": "@museudamulher/website", - "version": "2024.03.13-2223", + "version": "1.0.0", "private": true, "scripts": { "dev": "next dev", - "bump": "node bump-version.js", "build": "next build", "start": "next start", "lint": "next lint"