Cleanup CI workflows, Remove Twenty CLI, Add Danger.js (#2452)
* Move dockerignore file away from root * Delete Twenty CLI * Create Twenty-utils * Move release script * Add danger.js to yarn * Add danger * Add Bot token * Cancel previous steps CI * Revert "Move dockerignore file away from root" This reverts commit 7ed17bb2bcccd3312a455d35974c9c388687a0a9.
This commit is contained in:
9
packages/twenty-utils/dangerfile.ts
Normal file
9
packages/twenty-utils/dangerfile.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import {message, danger, warn} from "danger"
|
||||
|
||||
const packageChanged = danger.git.modified_files.includes('package.json');
|
||||
const lockfileChanged = danger.git.modified_files.includes('yarn.lock');
|
||||
if (packageChanged && !lockfileChanged) {
|
||||
const message = 'Changes were made to package.json, but not to yarn.lock';
|
||||
const idea = 'Perhaps you need to run `yarn install`?';
|
||||
warn(`${message} - <i>${idea}</i>`);
|
||||
}
|
||||
12
packages/twenty-utils/package.json
Normal file
12
packages/twenty-utils/package.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "twenty-utils",
|
||||
"scripts": {
|
||||
"release": "node release.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"danger": "^11.3.0"
|
||||
}
|
||||
}
|
||||
23
packages/twenty-utils/release.js
Normal file
23
packages/twenty-utils/release.js
Normal file
@ -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");
|
||||
}
|
||||
1083
packages/twenty-utils/yarn.lock
Normal file
1083
packages/twenty-utils/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user