diff --git a/build.ts b/build.ts index d45086b4..9a22cca2 100644 --- a/build.ts +++ b/build.ts @@ -1,5 +1,7 @@ // +import { $ } from "bun"; + const minify = true; { @@ -41,4 +43,22 @@ const minify = true; console.log({ logs, outputs, success }); } +{ + console.log("> @numerique-gouv/moncomptepro install"); + const { stdout } = await $`npm i` + .cwd("node_modules/@numerique-gouv/moncomptepro") + .env({ + ...process.env, + CYPRESS_INSTALL_BINARY: "0", + }); + console.log(stdout.toString()); +} +{ + console.log("> @numerique-gouv/moncomptepro build"); + const { stdout } = await $`npm exec tsc`.cwd( + "node_modules/@numerique-gouv/moncomptepro", + ); + console.log(stdout.toString()); +} + export {}; diff --git a/bun.lockb b/bun.lockb index d8de8665..b4302f5d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/~/infra/moncomptepro/lib/package.json b/packages/~/infra/moncomptepro/lib/package.json index 7c750365..8cc4e842 100644 --- a/packages/~/infra/moncomptepro/lib/package.json +++ b/packages/~/infra/moncomptepro/lib/package.json @@ -15,7 +15,7 @@ } }, "dependencies": { - "@numerique-gouv/moncomptepro": "numerique-gouv/moncomptepro#f26af544c636f071bf6efc4343bfe4f9e98fddb5", + "@numerique-gouv/moncomptepro": "numerique-gouv/moncomptepro#0769297f523ad4a57ba878cb57be27dcecbbf896", "@~/app.core": "workspace:*", "consola": "3.2.3", "zod": "3.23.8" diff --git a/packages/~/infra/moncomptepro/lib/src/sdk.ts b/packages/~/infra/moncomptepro/lib/src/sdk.ts index 1375d3e3..e089774e 100644 --- a/packages/~/infra/moncomptepro/lib/src/sdk.ts +++ b/packages/~/infra/moncomptepro/lib/src/sdk.ts @@ -1,50 +1,9 @@ // -import type Pg from "pg"; -import type { MCP_EmailDomain_Type } from "./moncomptepro"; - -// -// -// - -// HACK(douglasduteil): disable typescript check on @numerique-gouv/moncomptepro -// -// As the @numerique-gouv/moncomptepro/database is not yet published as a standalone package -// we need to disable the typescript check on it to avoid many typescript errors -// - -const MONCOMPTEPRO_MODULE = "@numerique-gouv/moncomptepro"; - -// import "@numerique-gouv/moncomptepro/src/connectors/postgres"; -const POSTGRES_CONNECTOR_MODULE: { - setDatabaseConnection(newPool: Pg.Pool): void; -} = await import(`${MONCOMPTEPRO_MODULE}/src/connectors/postgres`); - -// import "@numerique-gouv/moncomptepro/src/managers/organization/main"; -const MAIN_ORGANIZATION_MANAGER_MODULE: { - markDomainAsVerified(options: { - organization_id: number; - domain: string; - domain_verification_type: MCP_EmailDomain_Type; - }): Promise; -} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/main`); - -// import "@numerique-gouv/moncomptepro/src/managers/organization/join"; -const JOIN_ORGANIZATION_MANAGER_MODULE: { - forceJoinOrganization(options: { - organization_id: number; - user_id: number; - is_external?: boolean; - }): Promise; -} = await import(`${MONCOMPTEPRO_MODULE}/src/managers/organization/join`); - // // // -export const setDatabaseConnection = - POSTGRES_CONNECTOR_MODULE.setDatabaseConnection; -export const markDomainAsVerified = - MAIN_ORGANIZATION_MANAGER_MODULE.markDomainAsVerified; -export const forceJoinOrganization = - JOIN_ORGANIZATION_MANAGER_MODULE.forceJoinOrganization; +export { setDatabaseConnection } from "@numerique-gouv/moncomptepro/connectors/postgres"; +export { forceJoinOrganization } from "@numerique-gouv/moncomptepro/managers/organization/join"; +export { markDomainAsVerified } from "@numerique-gouv/moncomptepro/managers/organization/markDomainAsVerified";