The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Add release command (#2022)
brendanlaschke3c9cd9ff4a65
diff --git a/infra/dev/yarn.lock b/infra/dev/yarn.lockdeleted file mode 100644index fb57ccd13af..00000000000--- a/infra/dev/yarn.lock+++ /dev/null@@ -1,4 +0,0 @@-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.-# yarn lockfile v1--diff --git a/infra/release/release.js b/infra/release/release.jsnew file mode 100644index 00000000000..bc9cc5ddd09--- /dev/null+++ b/infra/release/release.js@@ -0,0 +1,23 @@+const fs = require("fs");+const semver = require("semver");+const path = require("path");++// Get the version argument from the command line+const [, , version] = process.argv;++if (!semver.valid(version)) {+ console.error(+ "Invalid version. The format should be X.X.X where X is a positive integer (or 0)."+ );+ process.exit(1);+}++const FrontPackageJson = path.join(__dirname, "../../front/package.json");+const ServerPackageJson = path.join(__dirname, "../../server/package.json");++// Update package.json+for (let file of [FrontPackageJson, ServerPackageJson]) {+ let pkgdata = JSON.parse(fs.readFileSync(file));+ pkgdata.version = version;+ fs.writeFileSync(file, JSON.stringify(pkgdata, null, 2), "utf8");+}diff --git a/package.json b/package.jsonnew file mode 100644index 00000000000..20f4e00768f--- /dev/null+++ b/package.json@@ -0,0 +1,9 @@+{+ "name": "twenty",+ "scripts": {+ "release": "node infra/release/release.js"+ },+ "dependencies": {+ "semver": "^7.5.4"+ }+}diff --git a/yarn.lock b/yarn.lockindex fb57ccd13af..50ac73caa81 100644--- a/yarn.lock+++ b/yarn.lock@@ -2,3 +2,21 @@# yarn lockfile v1+lru-cache@^6.0.0:+ version "6.0.0"+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"+ integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==+ dependencies:+ yallist "^4.0.0"++semver@^7.5.4:+ version "7.5.4"+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"+ integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==+ dependencies:+ lru-cache "^6.0.0"++yallist@^4.0.0:+ version "4.0.0"+ resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"+ integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==