Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/api/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
47 changes: 13 additions & 34 deletions apps/api/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,20 @@ dotenv.config({
/** @type {import('next').NextConfig} */
const config = {
serverExternalPackages: ['sharp', 'onnxruntime-node'],
webpack: (cfg) => {
// In e2e mode, swap the real TipTap client for an in-process mock
// so the API server never makes HTTP calls to TipTap Cloud.
if (process.env.E2E === 'true') {
cfg.resolve.alias = {
...cfg.resolve.alias,
'@op/collab': '@op/collab/testing',
};
}

// Grab the existing rule that handles SVG imports
const fileLoaderRule = cfg.module.rules.find((rule) =>
rule.test?.test?.('.svg'),
);

cfg.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ['@svgr/webpack'],
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

return cfg;
},
resolveAlias: {
// In e2e mode, swap the real TipTap client for an in-process mock
// so the API server never makes HTTP calls to TipTap Cloud.
...(process.env.E2E === 'true'
? { '@op/collab': '@op/collab/testing' }
: {}),
},
},
};

Expand Down
8 changes: 4 additions & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "SEE LICENSE in /LICENSE",
"type": "module",
"scripts": {
"build": "next build --webpack",
"build:prod": "cd ../../services/db && pnpm run migrate && cd ../../apps/api && next build --webpack",
"dev": "next dev -p 3300 --webpack",
"dev:e2e": "next dev -p 4300 --webpack",
"build": "next build",
"build:prod": "cd ../../services/db && pnpm run migrate && cd ../../apps/api && next build",
"dev": "next dev -p 3300",
"dev:e2e": "next dev -p 4300",
"format:check": "prettier --log-level=warn --check \"**/*.{ts,tsx}\" \"!.next\"",
"start": "next start",
"typecheck": "tsgo --noEmit"
Expand Down
1 change: 1 addition & 0 deletions apps/app/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
65 changes: 15 additions & 50 deletions apps/app/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getPreviewApiUrl } from '@op/core/previews';
import { withPostHogConfig } from '@posthog/nextjs-config';
import dotenv from 'dotenv';
import createNextIntlPlugin from 'next-intl/plugin';
import Icons from 'unplugin-icons/webpack';

const withNextIntl = createNextIntlPlugin('./src/lib/i18n/request.ts');

Expand Down Expand Up @@ -51,56 +50,22 @@ const config = {
minimumCacheTTL: 31536000, // 1 year — assets are content-addressed
},
serverExternalPackages: ['sharp', 'onnxruntime-node'],

webpack: (cfg, { isServer }) => {
// In e2e mode, swap the real TipTap client for an in-process mock
// so the server never makes HTTP calls to TipTap Cloud.
if (process.env.E2E === 'true') {
cfg.resolve.alias = {
...cfg.resolve.alias,
'@op/collab': '@op/collab/testing',
};
}

// Grab the existing rule that handles SVG imports
const fileLoaderRule = cfg.module.rules.find((rule) =>
rule.test?.test?.('.svg'),
);

cfg.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ['@svgr/webpack'],
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
);

cfg.plugins.push(
Icons({
compiler: 'jsx',
jsx: 'react',
}),
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

if (!isServer) {
cfg.resolve.fallback = {
// Disable the 'tls' module on the client side
tls: false,
};
}

return cfg;
},
resolveAlias: {
// Disable the 'tls' module on the client side
tls: { browser: '' },
// In e2e mode, swap the real TipTap client for an in-process mock
// so the server never makes HTTP calls to TipTap Cloud.
...(process.env.E2E === 'true'
? { '@op/collab': '@op/collab/testing' }
: {}),
},
},
async headers() {
return [
Expand Down
8 changes: 3 additions & 5 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "SEE LICENSE in /LICENSE",
"type": "module",
"scripts": {
"build": "next build --webpack",
"build": "next build",
"check:i18n": "tsx scripts/check-missing-intl-keys.ts",
"dev": "next dev -p 3100 --webpack",
"dev:e2e": "NEXT_PUBLIC_APP_PORT=4100 NEXT_PUBLIC_API_PORT=4300 next dev -p 4100 --webpack",
"dev": "next dev -p 3100",
"dev:e2e": "NEXT_PUBLIC_APP_PORT=4100 NEXT_PUBLIC_API_PORT=4300 next dev -p 4100",
"format:check": "prettier --log-level=warn --check \"**/*.{ts,tsx}\" \"!.next\"",
"start": "next start -p 3100",
"typecheck": "tsgo --noEmit"
Expand Down Expand Up @@ -101,7 +101,6 @@
"zustand": "^5.0.3"
},
"devDependencies": {
"@iconify/json": "2.2.311",
"@op/typescript-config": "workspace:*",
"@tailwindcss/postcss": "4.1.18",
"@tanstack/react-query-devtools": "5.66.11",
Expand All @@ -114,7 +113,6 @@
"postcss": "^8.5.3",
"tailwindcss": "4.1.18",
"typescript": "5.7.3",
"unplugin-icons": "22.1.0",
"vitest": "catalog:"
}
}
2 changes: 1 addition & 1 deletion apps/app/src/components/LoginPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { TextField } from '@op/ui/TextField';
import { cn } from '@op/ui/utils';
import { useSearchParams } from 'next/navigation';
import React, { useCallback } from 'react';
import { FcGoogle as GoogleIcon } from 'react-icons/fc';
import { z } from 'zod';
import { create } from 'zustand';
import GoogleIcon from '~icons/logos/google-icon';

import { CommonLogo } from './CommonLogo';

Expand Down
1 change: 0 additions & 1 deletion apps/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"paths": {
"@/*": ["./src/*"]
},
"types": ["unplugin-icons/types/react"],
"strict": true
},
"include": [
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"prettier-plugin-sql": "^0.18.1"
},
"devDependencies": {
"@iconify/json": "2.2.311",
"@op/core": "workspace:*",
"@op/typescript-config": "workspace:*",
"@react-three/drei": "^10.0.4",
Expand Down Expand Up @@ -107,7 +106,6 @@
"tsx": "^4.19.3",
"turbo": "^2.4.4",
"typescript": "5.7.3",
"unplugin-icons": "22.1.0",
"use-error-boundary": "^2.0.6",
"zod": "catalog:",
"zustand": "^5.0.3"
Expand All @@ -118,7 +116,6 @@
},
"pnpm": {
"overrides": {
"@iconify/json": "$@iconify/json",
"@opentelemetry/sdk-metrics": "^2.2.0",
"@react-three/drei": "$@react-three/drei",
"@react-three/fiber": "$@react-three/fiber",
Expand Down Expand Up @@ -171,7 +168,6 @@
"turbo": "$turbo",
"typescript": "$typescript",
"undici": "5.27.1",
"unplugin-icons": "$unplugin-icons",
"use-error-boundary": "$use-error-boundary",
"zustand": "$zustand"
}
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
},
"devDependencies": {
"@chromatic-com/storybook": "^4.1.3",
"@iconify/json": "2.2.311",
"@op/typescript-config": "workspace:*",
"@storybook/addon-docs": "^10.1.11",
"@storybook/addon-onboarding": "^10.1.11",
Expand All @@ -135,7 +134,6 @@
"storybook": "^10.1.11",
"tailwindcss": "4.1.18",
"typescript": "5.7.3",
"unplugin-icons": "22.1.0",
"vite": "^6.2.0"
}
}
10 changes: 4 additions & 6 deletions packages/ui/src/components/SocialLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import GithubIcon from '~icons/carbon/logo-github';
import LinkedinIcon from '~icons/carbon/logo-linkedin';
import TwitterIcon from '~icons/carbon/logo-x';
import { LuGithub, LuLinkedin, LuTwitter } from 'react-icons/lu';

import { cn } from '../lib/utils';

Expand All @@ -11,9 +9,9 @@ export interface SocialLink {
}

const iconMap = {
github: GithubIcon,
twitter: TwitterIcon,
linkedin: LinkedinIcon,
github: LuGithub,
twitter: LuTwitter,
linkedin: LuLinkedin,
};

const socialLinks: SocialLink[] = [
Expand Down
1 change: 0 additions & 1 deletion packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["unplugin-icons/types/react"],
"paths": {
"@/*": ["./src/*"]
}
Expand Down
Loading
Loading