diff --git a/git-tags.js b/git-tags.js new file mode 100644 index 0000000..ae56b22 --- /dev/null +++ b/git-tags.js @@ -0,0 +1,10 @@ +var gittags = require("git-tags"); +var fs = require("fs"); +gittags.get(function (err, tags) { + if (err) throw err; + const obj = { + version: tags[0], + }; + fs.writeFileSync("version.json", JSON.stringify(obj), "utf8"); + console.log(tags); +}); diff --git a/package.json b/package.json index f92d720..50c3afa 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "next dev", "build": "next build", + "tag": "node git-tags.js", "start": "next start", "lint": "next lint", "format": "prettier --write \"./**/*.{tsx,ts,js}\"" @@ -29,6 +30,7 @@ "@types/react-dom": "18.0.5", "eslint": "8.17.0", "eslint-config-next": "12.1.6", + "git-tags": "^0.2.4", "prettier": "^2.6.2", "typescript": "4.7.3" } diff --git a/pages/index.tsx b/pages/index.tsx index 5b2ceb0..97ef90d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -4,7 +4,6 @@ import { Header } from "components/Layout"; import { Table } from "components/Table"; import { Box, StyledOcticon, Text } from "@primer/react"; import { HeartFillIcon } from "@primer/octicons-react"; - const Home: NextPage = () => { return ( <> diff --git a/version.json b/version.json new file mode 100644 index 0000000..ba4f0f8 --- /dev/null +++ b/version.json @@ -0,0 +1 @@ +{"version":"v0.0.1"} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index b09aa13..e2b881d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2307,6 +2307,14 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +git-tags@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/git-tags/-/git-tags-0.2.4.tgz#b24c71d5d7df8dd587a36998e9521e20dde259c5" + integrity sha512-5YqXZoX2sqFI0j/eDKB1QgplJSMywWMvmuv1kKOmoDEuXL+Q3YTf9lGmCgBG2BrMQ7pOQiMe16QCZmbU1mNqcA== + dependencies: + lodash "^2.4.1" + semver "^3.0.1" + glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -2811,6 +2819,11 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e" + integrity sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw== + lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -3433,6 +3446,11 @@ secp256k1@^4.0.1, secp256k1@^4.0.2: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +semver@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-3.0.1.tgz#720ac012515a252f91fb0dd2e99a56a70d6cf078" + integrity sha512-MrF9mHWFtD/0eV4t3IheoXnGWTdw17axm5xqzOWyPsOMVnTtRAZT6uwPwslQXH5SsiaBLiMuu8NX8DtXWZfDwg== + semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"