-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
160 changed files
with
2,701 additions
and
882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
'@udecode/plate-alignment': minor | ||
'@udecode/plate-autoformat': minor | ||
'@udecode/plate-basic-elements': minor | ||
'@udecode/plate-basic-marks': minor | ||
'@udecode/plate-block-quote': minor | ||
'@udecode/plate-break': minor | ||
'@udecode/plate-caption': minor | ||
'@udecode/plate-ui': minor | ||
'@udecode/plate-cloud': minor | ||
'@udecode/plate-code-block': minor | ||
'@udecode/plate-combobox': minor | ||
'@udecode/plate-comments': minor | ||
'@udecode/plate-common': minor | ||
'@udecode/plate-core': minor | ||
'@udecode/plate-cursor': minor | ||
'@udecode/plate-dnd': minor | ||
'@udecode/plate-emoji': minor | ||
'@udecode/plate-excalidraw': minor | ||
'@udecode/plate-find-replace': minor | ||
'@udecode/plate-floating': minor | ||
'@udecode/plate-font': minor | ||
'@udecode/plate-heading': minor | ||
'@udecode/plate-highlight': minor | ||
'@udecode/plate-horizontal-rule': minor | ||
'@udecode/plate-indent': minor | ||
'@udecode/plate-indent-list': minor | ||
'@udecode/plate-juice': minor | ||
'@udecode/plate-kbd': minor | ||
'@udecode/plate-line-height': minor | ||
'@udecode/plate-link': minor | ||
'@udecode/plate-list': minor | ||
'@udecode/plate-media': minor | ||
'@udecode/plate-mention': minor | ||
'@udecode/plate-node-id': minor | ||
'@udecode/plate-normalizers': minor | ||
'@udecode/plate-paragraph': minor | ||
'@udecode/plate': minor | ||
'@udecode/plate-utils': minor | ||
'@udecode/plate-reset-node': minor | ||
'@udecode/plate-resizable': minor | ||
'@udecode/plate-select': minor | ||
'@udecode/plate-selection': minor | ||
'@udecode/plate-serializer-csv': minor | ||
'@udecode/plate-serializer-docx': minor | ||
'@udecode/plate-serializer-html': minor | ||
'@udecode/plate-serializer-md': minor | ||
'@udecode/slate': minor | ||
'@udecode/slate-react': minor | ||
'@udecode/slate-utils': minor | ||
'@udecode/plate-suggestion': minor | ||
'@udecode/plate-tabbable': minor | ||
'@udecode/plate-table': minor | ||
'@udecode/plate-test-utils': minor | ||
'@udecode/plate-trailing-block': minor | ||
'@udecode/utils': minor | ||
'@udecode/plate-yjs': minor | ||
--- | ||
|
||
use tsup as bundler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,4 +117,5 @@ packages/plate/docs/ | |
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
.turbo | ||
.turbo | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,98 @@ | ||
// import { createContentlayerPlugin } from 'next-contentlayer'; | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
// Enable React strict mode. | ||
// https://nextjs.org/docs/api-reference/next.config.js/react-strict-mod | ||
reactStrictMode: true, | ||
const nextConfig = async (phase, { defaultConfig }) => { | ||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
const config = { | ||
// Enable React strict mode. | ||
// https://nextjs.org/docs/api-reference/next.config.js/react-strict-mod | ||
reactStrictMode: true, | ||
|
||
// Configure domains to allow for optimized image loading. | ||
// https://nextjs.org/docs/basic-features/image-optimization#domains | ||
images: { | ||
domains: [ | ||
'cdn.discordapp.com', | ||
'lh3.googleusercontent.com', | ||
'avatars.githubusercontent.com', | ||
], | ||
}, | ||
// Configure domains to allow for optimized image loading. | ||
// https://nextjs.org/docs/basic-features/image-optimization#domains | ||
images: { | ||
domains: [ | ||
'cdn.discordapp.com', | ||
'lh3.googleusercontent.com', | ||
'avatars.githubusercontent.com', | ||
], | ||
}, | ||
|
||
// typescript: { | ||
// ignoreBuildErrors: true, | ||
// }, | ||
// eslint: { | ||
// ignoreDuringBuilds: true, | ||
// }, | ||
// typescript: { | ||
// ignoreBuildErrors: true, | ||
// }, | ||
// eslint: { | ||
// ignoreDuringBuilds: true, | ||
// }, | ||
|
||
staticPageGenerationTimeout: 1200, | ||
staticPageGenerationTimeout: 1200, | ||
|
||
// Enable experimental features. | ||
experimental: { | ||
esmExternals: false, | ||
serverActions: true, | ||
// Specify external packages that should be excluded from server-side rendering. | ||
// https://beta.nextjs.org/docs/api-reference/next-config#servercomponentsexternalpackages | ||
serverComponentsExternalPackages: ['@prisma/client'], | ||
}, | ||
// Enable experimental features. | ||
experimental: { | ||
esmExternals: false, | ||
serverActions: true, | ||
// Specify external packages that should be excluded from server-side rendering. | ||
// https://beta.nextjs.org/docs/api-reference/next-config#servercomponentsexternalpackages | ||
serverComponentsExternalPackages: ['@prisma/client'], | ||
}, | ||
|
||
// redirects() { | ||
// return [ | ||
// { | ||
// source: '/components', | ||
// destination: '/docs/components/accordion', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/docs/components', | ||
// destination: '/docs/components/accordion', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/examples', | ||
// destination: '/examples/dashboard', | ||
// permanent: false, | ||
// }, | ||
// { | ||
// source: '/docs/primitives/:path*', | ||
// destination: '/docs/components/:path*', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/figma', | ||
// destination: '/docs/figma', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/docs/forms', | ||
// destination: '/docs/forms/react-hook-form', | ||
// permanent: false, | ||
// }, | ||
// ]; | ||
// }, | ||
}; | ||
// redirects() { | ||
// return [ | ||
// { | ||
// source: '/components', | ||
// destination: '/docs/components/accordion', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/docs/components', | ||
// destination: '/docs/components/accordion', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/examples', | ||
// destination: '/examples/dashboard', | ||
// permanent: false, | ||
// }, | ||
// { | ||
// source: '/docs/primitives/:path*', | ||
// destination: '/docs/components/:path*', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/figma', | ||
// destination: '/docs/figma', | ||
// permanent: true, | ||
// }, | ||
// { | ||
// source: '/docs/forms', | ||
// destination: '/docs/forms/react-hook-form', | ||
// permanent: false, | ||
// }, | ||
// ]; | ||
// }, | ||
}; | ||
if (phase === 'phase-development-server') { | ||
const fs = await import('node:fs'); | ||
const glob = await import('glob').then((mod) => mod.default); | ||
|
||
const packageNames = new glob.GlobSync( | ||
'../../packages/**/package.json' | ||
).found | ||
.map((file) => { | ||
try { | ||
const packageJson = JSON.parse(fs.readFileSync(file, 'utf8')); | ||
return packageJson.name; | ||
} catch (error) { | ||
return null; | ||
} | ||
}) | ||
.filter((pkg) => pkg?.startsWith('@udecode')); | ||
|
||
// const withContentlayer = createContentlayerPlugin({ | ||
// Additional Contentlayer config options | ||
// }); | ||
config.transpilePackages = packageNames; | ||
} | ||
|
||
return config; | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import { defineConfig } from 'tsup'; | ||
|
||
const PACKAGE_ROOT_PATH = process.cwd(); | ||
const INPUT_FILE_PATH = path.join(PACKAGE_ROOT_PATH, 'src/index.ts'); | ||
const INPUT_FILE = fs.existsSync(INPUT_FILE_PATH) | ||
? INPUT_FILE_PATH | ||
: path.join(PACKAGE_ROOT_PATH, 'src/index.tsx'); | ||
|
||
export default defineConfig((opts) => { | ||
return { | ||
...opts, | ||
entry: [INPUT_FILE], | ||
format: ['cjs', 'esm'], | ||
external: [], | ||
skipNodeModulesBundle: true, | ||
dts: true, | ||
sourcemap: true, | ||
clean: true, | ||
minify: false, | ||
onSuccess: async () => { | ||
if (opts.watch) { | ||
console.info('Watching for changes...'); | ||
return; | ||
} | ||
|
||
console.info('Build succeeded!'); | ||
}, | ||
|
||
silent: true, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { readFileSync } from 'node:fs'; | ||
import { GlobSync } from 'glob'; | ||
import { defineConfig, Expression } from 'turbowatch'; | ||
|
||
const foundPackageJson = new GlobSync('packages/*/package.json').found; | ||
|
||
type PathToPackageNameMap = Map<string, string>; | ||
|
||
const allPackages = foundPackageJson.reduce<PathToPackageNameMap>( | ||
(acc, current) => { | ||
try { | ||
const packageJson = readFileSync(current, 'utf8'); | ||
const packageJsonParsed = JSON.parse(packageJson) as { | ||
dependencies: Record<string, string>; | ||
name: string | undefined; | ||
}; | ||
|
||
const packageName = packageJsonParsed.name; | ||
|
||
if (!packageName) { | ||
return acc; | ||
} | ||
|
||
acc.set(current, packageName); | ||
return acc; | ||
} catch (_) {} | ||
|
||
return acc; | ||
}, | ||
new Map() | ||
); | ||
|
||
const dirList = [...allPackages.keys()].map( | ||
(dir) => ['dirname', dir.replace('/package.json', '')] satisfies Expression | ||
); | ||
|
||
export default defineConfig({ | ||
project: process.cwd(), | ||
triggers: [ | ||
{ | ||
expression: [ | ||
'allof', | ||
['not', ['anyof', ['dirname', 'node_modules'], ['dirname', 'dist']]], | ||
['anyof', ...dirList], | ||
[ | ||
'anyof', | ||
['match', '*.ts', 'basename'], | ||
['match', '*.tsx', 'basename'], | ||
['match', '*.js', 'basename'], | ||
], | ||
], | ||
interruptible: true, | ||
name: 'build', | ||
onChange: async ({ spawn, files, abortSignal }) => { | ||
const changedPackages = new Set<string>(); | ||
for (const file of files) { | ||
const pkgJsonPath = file.name | ||
.replace(`${process.cwd()}/`, '') | ||
.replace(/\/src\/.*/, '/package.json'); | ||
|
||
const packageName = allPackages.get(pkgJsonPath); | ||
|
||
if (!packageName) { | ||
continue; | ||
} | ||
|
||
changedPackages.add(packageName); | ||
} | ||
|
||
if (changedPackages.size === 0) { | ||
return; | ||
} | ||
|
||
await spawn`turbo run build --filter=${[...changedPackages].join(',')}`; | ||
if (abortSignal?.aborted) return; | ||
}, | ||
}, | ||
], | ||
}); |
Oops, something went wrong.