Embrace nx monorepo structure with root package.json (#3255)

* Upgrade to node 18.17.1 and regroup dependencies in root package.json

* Sort package.json

* Fix lint

* Migrate zapier
This commit is contained in:
Charles Bochet
2024-01-05 14:59:58 +01:00
committed by GitHub
parent f35b40c428
commit f7034d6e7d
16 changed files with 488 additions and 739 deletions

View File

@ -1,44 +1,55 @@
import { danger, warn, markdown, schedule } from "danger";
import todos from "danger-plugin-todos";
import { danger, markdown, schedule, warn } from 'danger';
import todos from 'danger-plugin-todos';
function getMdSection(category: string, message: string) {
return `# ${category} <br>${message}`;
}
// Check if package.json was changed, but not yarn.lock
const packageChanged = danger.git.modified_files.find(x=>x.includes("package.json"));
const lockfileChanged = danger.git.modified_files.find(x=>x.includes("yarn.lock"));
const packageChanged = danger.git.modified_files.find((x) =>
x.includes('package.json'),
);
const lockfileChanged = danger.git.modified_files.find((x) =>
x.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`?";
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>`);
}
// Check if .env.example was changed, but not enviroment variable documentation
const envChanged =
danger.git.modified_files.find(x=>x.includes(".env.example")) ||
danger.git.modified_files.find(x=>x.includes("environment.service.ts"));
danger.git.modified_files.find((x) => x.includes('.env.example')) ||
danger.git.modified_files.find((x) => x.includes('environment.service.ts'));
const envDocsChanged = danger.git.modified_files.includes(
"enviroment-variables.mdx"
'enviroment-variables.mdx',
);
if (envChanged && !envDocsChanged) {
const message =
"Changes were made to the enviroment variables, but not to the documentation";
'Changes were made to the enviroment variables, but not to the documentation';
const idea =
"Please review your changes and check if a change needs to be documented!";
'Please review your changes and check if a change needs to be documented!';
warn(`${message} - <i>${idea}</i>`);
}
// CLA alert if first time contributor
if (danger.github && danger.github.pr &&
(danger.github.pr.author_association === "FIRST_TIME_CONTRIBUTOR" ||
danger.github.pr.author_association === "NONE")
if (
danger.github &&
danger.github.pr &&
(danger.github.pr.author_association === 'FIRST_TIME_CONTRIBUTOR' ||
danger.github.pr.author_association === 'NONE')
) {
markdown(getMdSection('CLA', `
markdown(
getMdSection(
'CLA',
`
Hello there and welcome to our project!
By submitting your Pull Request, you acknowledge that you agree with the terms of our [Contributor License Agreement](https://github.com/twentyhq/twenty/blob/main/.github/CLA.md).
Although we don't have a dedicated legal counsel, having this kind of agreement can protect us from potential legal issues or patent trolls.
Thank you for your understanding.`))
Thank you for your understanding.`,
),
);
}
// TODOS / Fixme

View File

@ -3,13 +3,5 @@
"private": true,
"scripts": {
"release": "node release.js"
},
"dependencies": {
"danger-plugin-todos": "^1.3.1",
"semver": "^7.5.4",
"typescript": "^5.3.2"
},
"devDependencies": {
"danger": "^11.3.0"
}
}