Skip to content

Commit

Permalink
chore: upgrades boxyhq jackson (calcom#13477)
Browse files Browse the repository at this point in the history
* chore: upgrades boxyhq jackson

* Update jackson.ts

reduces bundle size

* Update yarn.lock

* Update apps/web/next.config.js

* Upgrades again

---------

Co-authored-by: Keith Williams <[email protected]>
  • Loading branch information
zomars and keithwillcode authored Feb 8, 2024
1 parent f06ef84 commit 2082a4f
Show file tree
Hide file tree
Showing 5 changed files with 1,934 additions and 990 deletions.
12 changes: 11 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,17 @@ const nextConfig = {
images: {
unoptimized: true,
},
webpack: (config, { webpack, buildId }) => {
webpack: (config, { webpack, buildId, isServer }) => {
if (isServer) {
// Module not found fix @see https://github.com/boxyhq/jackson/issues/1535#issuecomment-1704381612
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp:
/(^@google-cloud\/spanner|^@mongodb-js\/zstd|^@sap\/hana-client\/extension\/Stream$|^@sap\/hana-client|^@sap\/hana-client$|^aws-crt|^aws4$|^better-sqlite3$|^bson-ext$|^cardinal$|^cloudflare:sockets$|^hdb-pool$|^ioredis$|^kerberos$|^mongodb-client-encryption$|^mysql$|^oracledb$|^pg-native$|^pg-query-stream$|^react-native-sqlite-storage$|^snappy\/package\.json$|^snappy$|^sql.js$|^sqlite3$|^typeorm-aurora-data-api-driver$)/,
})
);
}

config.plugins.push(
new CopyWebpackPlugin({
patterns: [
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"yarn": "3.4.1"
},
"dependencies": {
"@boxyhq/saml-jackson": "1.8.2",
"@boxyhq/saml-jackson": "1.18.6",
"@calcom/app-store": "*",
"@calcom/app-store-cli": "*",
"@calcom/core": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/features/bookings/Booker/Booker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const BookerComponent = ({
hasDarkBackground ? "dark" : "",
layout === BookerLayouts.MONTH_VIEW ? "block" : "hidden"
)}>
<PoweredBy logoOnly />
<PoweredBy logoOnly />
</m.span>
)}
</div>
Expand Down
13 changes: 8 additions & 5 deletions packages/features/ee/sso/lib/jackson.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import jackson from "@boxyhq/saml-jackson";
import type {
IConnectionAPIController,
IOAuthController,
ISPSSOConfig,
JacksonOption,
ISPSAMLConfig,
} from "@boxyhq/saml-jackson";

import { WEBAPP_URL } from "@calcom/lib/constants";

import { samlDatabaseUrl, samlAudience, samlPath, oidcPath, clientSecretVerifier } from "./saml";
import { clientSecretVerifier, oidcPath, samlAudience, samlDatabaseUrl, samlPath } from "./saml";

// Set the required options. Refer to https://github.com/boxyhq/jackson#configuration for the full list
const opts: JacksonOption = {
Expand All @@ -24,19 +23,23 @@ const opts: JacksonOption = {
},
idpEnabled: true,
clientSecretVerifier,
ory: {
projectId: undefined,
sdkToken: undefined,
},
};

declare global {
/* eslint-disable no-var */
var connectionController: IConnectionAPIController | undefined;
var oauthController: IOAuthController | undefined;
var samlSPConfig: ISPSAMLConfig | undefined;
var samlSPConfig: ISPSSOConfig | undefined;
/* eslint-enable no-var */
}

export default async function init() {
if (!globalThis.connectionController || !globalThis.oauthController || !globalThis.samlSPConfig) {
const ret = await jackson(opts);
const ret = await (await import("@boxyhq/saml-jackson")).controllers(opts);
globalThis.connectionController = ret.connectionAPIController;
globalThis.oauthController = ret.oauthController;
globalThis.samlSPConfig = ret.spConfig;
Expand Down
Loading

0 comments on commit 2082a4f

Please sign in to comment.