Skip to content

Commit

Permalink
vendor
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Oct 23, 2024
1 parent 6180960 commit 7d6c044
Show file tree
Hide file tree
Showing 6 changed files with 2,025 additions and 2,703 deletions.
2 changes: 1 addition & 1 deletion apps/www/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
28 changes: 11 additions & 17 deletions apps/www/next.config.mjs → apps/www/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import { globSync } from 'glob';
import type { NextConfig } from 'next';

const nextConfig = async (phase, { defaultConfig }) => {
/** @type {import('next').NextConfig} */
const config = {
// Enable React strict mode.
// Enable experimental features.
experimental: {
esmExternals: false,
// Specify external packages that should be excluded from server-side rendering.
// https://beta.nextjs.org/docs/api-reference/next-config#servercomponentsexternalpackages
serverComponentsExternalPackages: ['@prisma/client'],
},
import { globSync } from 'glob';

// Configure domains to allow for optimized image loading.
const nextConfig = async (phase: string) => {
const config: NextConfig = {
// https://nextjs.org/docs/basic-features/image-optimization#domains
images: {
remotePatterns: [
Expand All @@ -35,15 +26,18 @@ const nextConfig = async (phase, { defaultConfig }) => {
],
},

// Configure domains to allow for optimized image loading.
// https://nextjs.org/docs/api-reference/next.config.js/react-strict-mod
reactStrictMode: true,

// typescript: {
// ignoreBuildErrors: true,
// },
// eslint: {
// ignoreDuringBuilds: true,
// },

// https://nextjs.org/docs/api-reference/next.config.js/react-strict-mod
reactStrictMode: true,
serverExternalPackages: ['@prisma/client'],

staticPageGenerationTimeout: 1200,

Expand Down Expand Up @@ -86,8 +80,8 @@ const nextConfig = async (phase, { defaultConfig }) => {
if (phase === 'phase-development-server') {
const fs = await import('node:fs');

const packageNames = new globSync('../../packages/**/package.json')
.map((file) => {
const packageNames = globSync('../../packages/**/package.json')
.map((file: any) => {
try {
const packageJson = JSON.parse(fs.readFileSync(file, 'utf8'));

Expand Down
4 changes: 2 additions & 2 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@
"next-themes": "^0.3.0",
"nuqs": "^1.19.1",
"prismjs": "^1.29.0",
"react": "19.0.0-rc-65a56d0e-20241020",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "19.0.0-rc-65a56d0e-20241020",
"react-dom": "^18.3.1",
"react-lite-youtube-embed": "^2.4.0",
"react-markdown": "9.0.1",
"react-resizable-panels": "^2.0.22",
Expand Down
15 changes: 9 additions & 6 deletions apps/www/src/lib/rehype-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ export function rehypeComponent() {
return (tree: UnistTree) => {
visit(tree as any, (node: UnistNode) => {
if (node.name === 'ComponentSource' || node.name === 'ComponentPreview') {
const name = getNodeAttributeByName(node, 'name')?.value as string;
const name = getNodeAttributeByName(node, 'name')?.value as
| string
| undefined;
const src = getNodeAttributeByName(node, 'src')?.value as
| string
| undefined;

if (name) {
if (node.name === 'ComponentSource') {
if (name && !src) {
if (node.name === 'ComponentSource' && !src) {
try {
for (const style of styles) {
const component = Index[style.name][name];

if (!component) {
if (!component && !src) {
throw new Error(
`Component ${name} not found in ${style.name}`
);
Expand Down Expand Up @@ -136,8 +141,6 @@ export function rehypeComponent() {
const source = getComponentSourceFileContent(node);

if (source) {
const { value: src } = getNodeAttributeByName(node, 'src') || {};

if (node.name === 'ComponentPreview') {
// Replace the Example component with a pre element.
node.children?.push(
Expand Down
1 change: 1 addition & 0 deletions apps/www/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"include": [
".eslintrc.cjs",
"next-env.d.ts",
"next.config.ts",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.cjs",
Expand Down
Loading

0 comments on commit 7d6c044

Please sign in to comment.