diff --git a/src/model/AppVersion.ts b/src/model/AppVersion.ts
new file mode 100644
index 0000000..0272dd5
--- /dev/null
+++ b/src/model/AppVersion.ts
@@ -0,0 +1,8 @@
+export interface AppVersion {
+ tag: string;
+ ipfsHash: string;
+ releaseDate: string;
+ description?: string;
+}
+
+
diff --git a/src/router/index.ts b/src/router/index.ts
index a1ccc85..66bed9f 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -4,6 +4,7 @@ import FaqView from "@/views/FaqView.vue";
import ManageBidsView from "@/views/ManageBidsView.vue";
import SellerView from "@/views/SellerView.vue";
import ExploreView from "@/views/ExploreView.vue";
+import VersionsView from "@/views/VersionsView.vue";
const router = createRouter({
history: import.meta.env.MODE === 'production' && import.meta.env.BASE_URL === './'
@@ -41,6 +42,11 @@ const router = createRouter({
name: "explore",
component: ExploreView,
},
+ {
+ path: "/versions",
+ name: "versions",
+ component: VersionsView,
+ },
],
});
diff --git a/src/utils/versions.ts b/src/utils/versions.ts
new file mode 100644
index 0000000..8ce31d7
--- /dev/null
+++ b/src/utils/versions.ts
@@ -0,0 +1,24 @@
+import type { AppVersion } from "@/model/AppVersion";
+
+export const appVersions: AppVersion[] = [
+ {
+ tag: "1.0.0",
+ ipfsHash: "bafybeiagfqnxnb5zdrks6dicfm7kxjdtzzzzm2ouluxgdseg2hrrotayzi",
+ releaseDate: "2023-01-28",
+ description: "Initial release"
+ },
+];
+
+export function getLatestVersion(): AppVersion | null {
+ return appVersions.length > 0 ? appVersions[0] : null;
+}
+
+export function getVersionByTag(tag: string): AppVersion | null {
+ return appVersions.find((v) => v.tag === tag) || null;
+}
+
+export function getIpfsUrl(ipfsHash: string): string {
+ return `https://${ipfsHash}.ipfs.dweb.link`;
+}
+
+
diff --git a/src/views/VersionsView.vue b/src/views/VersionsView.vue
new file mode 100644
index 0000000..43a8e89
--- /dev/null
+++ b/src/views/VersionsView.vue
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+ Visualize todas as versões do P2Pix. Cada versão está
+ disponível no IPFS para acesso permanente e descentralizado.
+
+
+
+ Versão atual: {{ currentVersion }}
+
+
+
+
+
+
+
+
+
+ Data de lançamento:
+ {{ formatDate(version.releaseDate) }}
+
+
+ {{ version.description }}
+
+
+
+
+
+
+
+
+
Nenhuma versão cadastrada ainda.
+
+
+
+
+
+
+
+
diff --git a/vite.config.ts b/vite.config.ts
index 34dc68c..4501aec 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -6,11 +6,17 @@ import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import svgLoader from "vite-svg-loader";
-function getGitCommitHash(): string {
+function getGitTag(): string {
try {
- return execSync("git rev-parse --short HEAD").toString().trim();
+ const tag = execSync("git describe --tags --abbrev=0").toString().trim();
+ return tag || "";
} catch (error) {
- return "unknown";
+ try {
+ const tags = execSync("git tag --sort=-version:refname").toString().trim().split("\n");
+ return tags.length > 0 ? tags[0] : "unknown";
+ } catch (fallbackError) {
+ return "";
+ }
}
}
@@ -21,7 +27,7 @@ export default defineConfig({
target: "esnext",
},
define: {
- __APP_VERSION__: JSON.stringify(getGitCommitHash()),
+ __APP_VERSION__: JSON.stringify(getGitTag()),
},
optimizeDeps: {
esbuildOptions: {