chore(server): run TS files directly (no compilation) (#5134)

* sort of works

* type fixes

* added option to run old way too
This commit is contained in:
Kristaps Fabians Geikins
2025-07-23 12:20:40 +03:00
committed by GitHub
parent e34a44bf66
commit 4b06f42db7
734 changed files with 2713 additions and 2644 deletions
@@ -1,5 +1,5 @@
import { WorkspaceSeat } from '@/modules/gatekeeper/domain/billing'
import { Workspace, WorkspaceAcl } from '@/modules/workspacesCore/domain/types'
import type { WorkspaceSeat } from '@/modules/gatekeeper/domain/billing'
import type { Workspace, WorkspaceAcl } from '@/modules/workspacesCore/domain/types'
export const workspaceEventNamespace = 'workspace' as const
@@ -1,4 +1,4 @@
import { WorkspaceAcl, WorkspaceSeat } from '@/modules/workspacesCore/domain/types'
import type { WorkspaceAcl, WorkspaceSeat } from '@/modules/workspacesCore/domain/types'
export type GetWorkspaceRolesAndSeats = (params: {
workspaceId: string
@@ -1,6 +1,6 @@
import { InviteResourceTarget } from '@/modules/serverinvites/domain/types'
import { WorkspaceInviteResourceType } from '@/modules/workspacesCore/domain/constants'
import { WorkspaceRoles } from '@speckle/shared'
import type { InviteResourceTarget } from '@/modules/serverinvites/domain/types'
import type { WorkspaceInviteResourceType } from '@/modules/workspacesCore/domain/constants'
import type { WorkspaceRoles } from '@speckle/shared'
declare module '@/modules/serverinvites/domain/types' {
interface InviteResourceTargetTypeMap {
@@ -1,5 +1,5 @@
import { WorkspacesModuleDisabledError } from '@/modules/core/errors/workspaces'
import { Resolvers } from '@/modules/core/graph/generated/graphql'
import type { Resolvers } from '@/modules/core/graph/generated/graphql'
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
const { FF_WORKSPACES_MODULE_ENABLED } = getFeatureFlags()
@@ -1,5 +1,5 @@
import { WorkspacesModuleDisabledError } from '@/modules/core/errors/workspaces'
import { Resolvers } from '@/modules/core/graph/generated/graphql'
import type { Resolvers } from '@/modules/core/graph/generated/graphql'
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
import {
filteredSubscribe,
@@ -1,13 +1,13 @@
import { MutationsObjectGraphQLReturn } from '@/modules/core/helpers/graphTypes'
import { LimitedUserRecord } from '@/modules/core/helpers/types'
import { WorkspaceSsoProviderRecord } from '@/modules/workspaces/domain/sso/types'
import { WorkspaceTeamMember } from '@/modules/workspaces/domain/types'
import {
import type { MutationsObjectGraphQLReturn } from '@/modules/core/helpers/graphTypes'
import type { LimitedUserRecord } from '@/modules/core/helpers/types'
import type { WorkspaceSsoProviderRecord } from '@/modules/workspaces/domain/sso/types'
import type { WorkspaceTeamMember } from '@/modules/workspaces/domain/types'
import type {
LimitedWorkspace,
Workspace,
WorkspaceJoinRequest
} from '@/modules/workspacesCore/domain/types'
import { WorkspaceRoles } from '@speckle/shared'
import type { WorkspaceRoles } from '@speckle/shared'
export type WorkspaceGraphQLReturn = Workspace
export type WorkspaceJoinRequestGraphQLReturn = WorkspaceJoinRequest
@@ -1,4 +1,4 @@
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
import type { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
import { moduleLogger } from '@/observability/logging'
export const init: SpeckleModule['init'] = () => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('streams', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('workspace_domains', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspace_acl', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.raw('update workspaces set slug = id')
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('sso_providers', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('user_sso_sessions', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
const WORKSPACES_TABLE = 'workspaces'
const REGIONS_TABLE = 'regions'
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable('workspace_creation_state', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
// there aren't that many workspaces.
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
const USERS_TABLE = 'users'
const WORKSPACES_TABLE = 'workspaces'
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
const WORKSPACE_JOIN_REQUESTS_TABLE = 'workspace_join_requests'
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
const TABLE_NAME = 'workspaces'
const COLUMN_NAME = 'defaultProjectRole'
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
import { chunk } from 'lodash-es'
type WorkspaceAcl = {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,4 +1,4 @@
import { Knex } from 'knex'
import type { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('workspaces', (table) => {
@@ -1,14 +1,14 @@
import { formatJsonArrayRecords } from '@/modules/shared/helpers/dbHelper'
import {
import type {
GetWorkspaceRoleAndSeat,
GetWorkspaceRolesAndSeats
} from '@/modules/workspacesCore/domain/operations'
import {
import type {
WorkspaceSeat,
WorkspaceAcl as WorkspaceAclRecord
} from '@/modules/workspacesCore/domain/types'
import { WorkspaceAcl, WorkspaceSeats } from '@/modules/workspacesCore/helpers/db'
import { Knex } from 'knex'
import type { Knex } from 'knex'
const tables = {
workspaceSeats: (db: Knex) => db<WorkspaceSeat>(WorkspaceSeats.name),
@@ -1,9 +1,9 @@
import {
import type {
GetTotalWorkspaceCountFactory,
GetUserWorkspaceCountFactory,
GetUserWorkspaceSeatsFactory
} from '@/modules/workspacesCore/domain/operations'
import {
import type {
Workspace,
WorkspaceAcl,
WorkspaceSeat
@@ -13,7 +13,7 @@ import {
Workspaces,
WorkspaceSeats
} from '@/modules/workspacesCore/helpers/db'
import { Knex } from 'knex'
import type { Knex } from 'knex'
const tables = {
workspaces: (db: Knex) => db<Workspace>(Workspaces.name),