Update ci internal applications (#21837)

Fix `twenty-last-contact` ci

- add tests
- add tsgo
- update package commands

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/21837?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
martmull
2026-06-19 13:42:15 +02:00
committed by GitHub
parent 1bd7be36e0
commit 576f88b5c5
13 changed files with 174 additions and 55 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ jobs:
// keep this PR small while the remaining apps are made CI-ready. Remove an
// app from this list once its checks pass, and delete the list entirely
// once every application is covered.
const CI_EXCLUDED_APPLICATIONS = ['call-recording', 'exa', 'people-data-labs', 'self-hosting', 'twenty-discord', 'twenty-fireflies', 'twenty-for-twenty', 'twenty-last-contact', 'twenty-linear', 'twenty-meeting-bot', 'twenty-partners', 'twenty-slack'];
const CI_EXCLUDED_APPLICATIONS = ['call-recording', 'exa', 'people-data-labs', 'self-hosting', 'twenty-discord', 'twenty-fireflies', 'twenty-for-twenty', 'twenty-linear', 'twenty-meeting-bot', 'twenty-partners', 'twenty-slack'];
const eventName = process.env.EVENT_NAME;
const changedFiles = JSON.parse(process.env.CHANGED_FILES || '[]');
const changedApps = new Set();
@@ -1,37 +1,57 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript"],
"plugins": ["react", "typescript", "import", "unicorn"],
"categories": {
"correctness": "off"
},
"ignorePatterns": ["node_modules", "dist"],
"rules": {
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"no-console": "off",
"no-control-regex": "off",
"no-debugger": "error",
"no-duplicate-imports": "error",
"no-undef": "off",
"no-unused-vars": "off",
"no-redeclare": "off",
"import/no-duplicates": "error",
"typescript/no-redeclare": "error",
"typescript/ban-ts-comment": "error",
"typescript/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
],
"typescript/no-empty-function": "off",
"typescript/no-explicit-any": "off",
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"typescript/no-explicit-any": "off"
},
"overrides": [
{
"files": ["**/*.logic-function.ts", "**/logic-functions/**/*.ts"],
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["twenty-shared", "twenty-shared/*"],
"message": "Logic functions must not import from twenty-shared directly. Import runtime types and helpers from `twenty-sdk/logic-function` instead so the logic-function bundle stays minimal."
}
]
}
]
}
}
]
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"react/jsx-key": "off",
"react/display-name": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-no-useless-fragment": "off",
"react/jsx-props-no-spreading": ["error", { "explicitSpread": "ignore" }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
@@ -13,6 +13,7 @@
"twenty": "twenty",
"lint": "oxlint -c .oxlintrc.json .",
"lint:fix": "oxlint --fix -c .oxlintrc.json .",
"typecheck": "tsgo --noEmit -p tsconfig.spec.json",
"test": "vitest run",
"test:watch": "vitest",
"test:unit": "vitest run --config vitest.unit.config.ts"
@@ -20,15 +21,14 @@
"devDependencies": {
"@types/node": "^24.7.2",
"@types/react": "^19.0.0",
"@typescript/native-preview": "^7.0.0-dev.20260116.1",
"oxlint": "^0.16.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"twenty-sdk": "^2.13.0",
"twenty-client-sdk": "^2.14.0",
"twenty-sdk": "^2.14.0",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^4.0.0"
},
"dependencies": {
"twenty-client-sdk": "^2.13.0"
}
}
@@ -5,7 +5,9 @@ const { queryMock, mutationMock } = vi.hoisted(() => ({
mutationMock: vi.fn(),
}));
vi.mock('twenty-client-sdk/core', () => ({
CoreApiClient: vi.fn(() => ({ query: queryMock, mutation: mutationMock })),
CoreApiClient: vi.fn(function () {
return { query: queryMock, mutation: mutationMock };
}),
}));
import onCalendarEventStarted from '../on-calendar-event-started';
@@ -5,7 +5,9 @@ const { queryMock, mutationMock } = vi.hoisted(() => ({
mutationMock: vi.fn(),
}));
vi.mock('twenty-client-sdk/core', () => ({
CoreApiClient: vi.fn(() => ({ query: queryMock, mutation: mutationMock })),
CoreApiClient: vi.fn(function () {
return { query: queryMock, mutation: mutationMock };
}),
}));
import onCalendarInteraction from '../on-calendar-interaction';
@@ -5,7 +5,9 @@ const { queryMock, mutationMock } = vi.hoisted(() => ({
mutationMock: vi.fn(),
}));
vi.mock('twenty-client-sdk/core', () => ({
CoreApiClient: vi.fn(() => ({ query: queryMock, mutation: mutationMock })),
CoreApiClient: vi.fn(function () {
return { query: queryMock, mutation: mutationMock };
}),
}));
import onEmailInteraction from '../on-email-interaction';
@@ -53,7 +53,7 @@ const handler = async (): Promise<void> => {
});
calendarEventIds.push(
...(calendarEvents?.edges.map((edge) => edge.node.id) ?? []),
...(calendarEvents?.edges.map((edge: { node: { id: string } }) => edge.node.id) ?? []),
);
calendarEventsHasNextPage = calendarEvents?.pageInfo.hasNextPage ?? false;
calendarEventsCursor = calendarEvents?.pageInfo.endCursor ?? undefined;
@@ -1,13 +1,19 @@
import { defineLogicFunction, ObjectRecordUpdateEvent } from 'twenty-sdk/define';
import type { DatabaseEventPayload } from 'twenty-sdk/logic-function';
import { CoreApiClient, CoreSchema } from 'twenty-client-sdk/core';
import { defineLogicFunction, type ObjectRecordUpdateEvent } from 'twenty-sdk/define';
import { type DatabaseEventPayload } from 'twenty-sdk/logic-function';
import { CoreApiClient } from 'twenty-client-sdk/core';
import { CALENDAR_INTERACTION_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
import { updatePersonLastContactAtFromCalendar } from 'src/utils/update-person-last-contact-at-from-calendar';
const handler = async (event: DatabaseEventPayload<
ObjectRecordUpdateEvent<CoreSchema.CalendarEventParticipant>
>): Promise<void> => {
type CalendarEventParticipantUpdate = {
personId?: string | null;
};
const handler = async (
event: DatabaseEventPayload<
ObjectRecordUpdateEvent<CalendarEventParticipantUpdate>
>,
): Promise<void> => {
const personId = event.properties.after.personId;
if (!personId) {
@@ -23,7 +29,7 @@ export default defineLogicFunction({
universalIdentifier: CALENDAR_INTERACTION_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER,
name: 'on-calendar-interaction',
description:
'Updates a person\'s last-contacted fields when a new calendar event participant is created (past events only).',
"Updates a person's last-contacted fields when a new calendar event participant is created (past events only).",
timeoutSeconds: 60,
databaseEventTriggerSettings: {
eventName: 'calendarEventParticipant.updated',
@@ -1,11 +1,16 @@
import { defineLogicFunction, ObjectRecordUpdateEvent } from 'twenty-sdk/define';
import { defineLogicFunction, type ObjectRecordUpdateEvent } from 'twenty-sdk/define';
import type { DatabaseEventPayload } from 'twenty-sdk/logic-function';
import { CoreApiClient, CoreSchema } from 'twenty-client-sdk/core';
import { CoreApiClient } from 'twenty-client-sdk/core';
import { EMAIL_INTERACTION_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER } from 'src/constants/universal-identifiers';
import { updatePersonLastContactAtIfNewer } from 'src/utils/update-person-last-contact-at';
const handler = async (event: DatabaseEventPayload<ObjectRecordUpdateEvent<CoreSchema.MessageParticipant>>): Promise<void> => {
type MessageParticipantUpdate = {
personId?: string | null;
messageId?: string | null;
};
const handler = async (event: DatabaseEventPayload<ObjectRecordUpdateEvent<MessageParticipantUpdate>>): Promise<void> => {
const personId = event.properties.after.personId;
const messageId = event.properties.after.messageId;
@@ -1,4 +1,4 @@
import { CoreApiClient } from 'twenty-client-sdk/core';
import { type CoreApiClient } from 'twenty-client-sdk/core';
import { updatePersonLastContactAtIfNewer } from 'src/utils/update-person-last-contact-at';
@@ -1,4 +1,4 @@
import { CoreApiClient } from 'twenty-client-sdk/core';
import { type CoreApiClient } from 'twenty-client-sdk/core';
export const updatePersonLastContactAtIfNewer = async (
client: CoreApiClient,
@@ -6,7 +6,7 @@
"outDir": "./dist",
"rootDir": ".",
"jsx": "react-jsx",
"moduleResolution": "node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
@@ -783,6 +783,87 @@ __metadata:
languageName: node
linkType: hard
"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260616.1"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-darwin-x64@npm:7.0.0-dev.20260616.1"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-linux-arm64@npm:7.0.0-dev.20260616.1"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard
"@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-linux-arm@npm:7.0.0-dev.20260616.1"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-linux-x64@npm:7.0.0-dev.20260616.1"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard
"@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-win32-arm64@npm:7.0.0-dev.20260616.1"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260616.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview-win32-x64@npm:7.0.0-dev.20260616.1"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@typescript/native-preview@npm:^7.0.0-dev.20260116.1":
version: 7.0.0-dev.20260616.1
resolution: "@typescript/native-preview@npm:7.0.0-dev.20260616.1"
dependencies:
"@typescript/native-preview-darwin-arm64": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-darwin-x64": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-linux-arm": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-linux-arm64": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-linux-x64": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-win32-arm64": "npm:7.0.0-dev.20260616.1"
"@typescript/native-preview-win32-x64": "npm:7.0.0-dev.20260616.1"
dependenciesMeta:
"@typescript/native-preview-darwin-arm64":
optional: true
"@typescript/native-preview-darwin-x64":
optional: true
"@typescript/native-preview-linux-arm":
optional: true
"@typescript/native-preview-linux-arm64":
optional: true
"@typescript/native-preview-linux-x64":
optional: true
"@typescript/native-preview-win32-arm64":
optional: true
"@typescript/native-preview-win32-x64":
optional: true
bin:
tsgo: bin/tsgo.js
checksum: 10c0/e858f6a5bc41e615d3a87381ac33c938cbaa3553c47f4f1c3e06682fd96303f624ecd457542b7980a7eb29f73b54da19e8a52650246cc98a145c4a46aa743b40
languageName: node
linkType: hard
"@vitest/expect@npm:4.1.8":
version: 4.1.8
resolution: "@vitest/expect@npm:4.1.8"
@@ -1673,11 +1754,12 @@ __metadata:
dependencies:
"@types/node": "npm:^24.7.2"
"@types/react": "npm:^19.0.0"
"@typescript/native-preview": "npm:^7.0.0-dev.20260116.1"
oxlint: "npm:^0.16.0"
react: "npm:^19.0.0"
react-dom: "npm:^19.0.0"
twenty-client-sdk: "npm:^2.13.0"
twenty-sdk: "npm:^2.13.0"
twenty-client-sdk: "npm:^2.14.0"
twenty-sdk: "npm:^2.14.0"
typescript: "npm:^5.9.3"
vite-tsconfig-paths: "npm:^4.2.1"
vitest: "npm:^4.0.0"
@@ -2413,22 +2495,22 @@ __metadata:
languageName: node
linkType: hard
"twenty-client-sdk@npm:2.13.0, twenty-client-sdk@npm:^2.13.0":
version: 2.13.0
resolution: "twenty-client-sdk@npm:2.13.0"
"twenty-client-sdk@npm:2.14.0, twenty-client-sdk@npm:^2.14.0":
version: 2.14.0
resolution: "twenty-client-sdk@npm:2.14.0"
dependencies:
"@genql/runtime": "npm:^2.10.0"
esbuild: "npm:^0.28.1"
graphql: "npm:^16.8.1"
lodash: "npm:^4.17.21"
prettier: "npm:^3.8.3"
checksum: 10c0/740464acec94c1d4cc5fa50ed6b190a7f1d1681963f61437a6c704835c05ffe0f5a13e254e57601a99b07bbe0f68483dee19211731853aafbcc15ec79f8039ce
checksum: 10c0/eb222a726e21fc98f3a624f9acac7d47f0c769b989911889036665dac7c7c88698ec99beb844bf51a42e1696ea0a067bae8cf47fd751965af52a3720835242f0
languageName: node
linkType: hard
"twenty-sdk@npm:^2.13.0":
version: 2.13.0
resolution: "twenty-sdk@npm:2.13.0"
"twenty-sdk@npm:^2.14.0":
version: 2.14.0
resolution: "twenty-sdk@npm:2.14.0"
dependencies:
"@sniptt/guards": "npm:^0.2.0"
axios: "npm:^1.16.0"
@@ -2445,12 +2527,12 @@ __metadata:
react: "npm:^19.2.0"
react-dom: "npm:^19.2.0"
tinyglobby: "npm:^0.2.15"
twenty-client-sdk: "npm:2.13.0"
twenty-client-sdk: "npm:2.14.0"
typescript: "npm:^5.9.3"
uuid: "npm:^13.0.2"
bin:
twenty: dist/cli.cjs
checksum: 10c0/51c350abe5d344fcad3c961a77632fd3cb2d91e357d0562b3eb02f05f66dbc41221c5463d0f91c022316a16af03a05ad43f038d9534c0ae31c060008d0e48672
checksum: 10c0/c4211772f8dd2ba81074a74be5f616c4c264d6bf8a174c5724be6d1c9a8cb3ca68a2674653bb58c059dae4bf1b0f43f91991e73d6a01395807206f0ac44afb08
languageName: node
linkType: hard