Skip to content

Commit aefbd04

Browse files
authored
feat(editor): in-browser editor playground with preview, and project handling
2 parents 93b905b + f166f03 commit aefbd04

112 files changed

Lines changed: 10066 additions & 4437 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/nxcloud.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: NxCloud
22

3-
env:
4-
APP_CONFIG_FILE: 'apps/blog/info.json'
5-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
6-
73
on:
84
push:
95
branches:
@@ -17,19 +13,25 @@ permissions:
1713
jobs:
1814
main:
1915
runs-on: ubuntu-latest
16+
17+
env:
18+
NX_BASE: origin/master
19+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
20+
2021
steps:
2122
- uses: actions/checkout@v4
2223
with:
2324
fetch-depth: 0
25+
filter: tree:0
2426

25-
- uses: actions/setup-node@v3
27+
- uses: actions/setup-node@v6
2628
with:
27-
node-version: 22.8.0
29+
node-version: 22.20.0
2830

2931
- uses: pnpm/action-setup@v4
3032
name: Install pnpm
3133
with:
32-
version: 9.15.4
34+
version: 10.19.0
3335
run_install: false
3436

3537
- name: Get pnpm store directory
@@ -44,8 +46,11 @@ jobs:
4446
restore-keys: |
4547
${{ runner.os }}-pnpm-store-
4648
49+
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
50+
4751
- name: Install dependencies
4852
run: pnpm install --frozen-lockfile
4953

5054
- uses: nrwl/nx-set-shas@v4
55+
- run: npx nx-cloud record -- nx format:check
5156
- run: pnpm exec nx affected -t lint test build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.15.1
1+
v22.20.0

.nxignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
playground

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/.nx/cache
55
/.nx/workspace-data
66
.next
7+
next-env.d.ts
78
pnpm-lock.yaml
89
dist
910
node_modules
11+
playground

.vscode/settings.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{
22
"css.customData": [".vscode/tailwind.json"],
3-
"editor.tabSize": 2,
4-
"editor.formatOnSave": true,
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"css.validate": false,
64
"editor.codeActionsOnSave": {
7-
"source.fixAll.eslint": "explicit"
5+
"source.fixAll": "explicit",
6+
"source.organizeImports": "explicit"
87
},
8+
"editor.defaultFormatter": "esbenp.prettier-vscode",
9+
"editor.formatOnSave": true,
10+
"editor.inlineSuggest.enabled": true,
911
"// activates tailwindcss intellisense for libraries": "",
1012
"editor.quickSuggestions": {
1113
"strings": true
1214
},
13-
"css.validate": false,
14-
"editor.inlineSuggest.enabled": true,
15+
"editor.tabSize": 2,
16+
"eslint.format.enable": true,
17+
"eslint.validate": ["typescript", "javascript", "tsx", "jsx", "json"],
1518
"// adds tailwindcss intellisense support within cva function calls": "",
1619
"tailwindCSS.experimental.classRegex": [
1720
["cva\\(((?:[^()]|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
1821
["cx\\(((?:[^()]|\\([^()]*\\))*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
19-
],
20-
"eslint.validate": ["json"]
22+
]
2123
}

apps/blog/eslint.config.mjs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
import { FlatCompat } from '@eslint/eslintrc'
2-
import { dirname } from 'path'
3-
import { fileURLToPath } from 'url'
4-
import js from '@eslint/js'
5-
import { fixupConfigRules } from '@eslint/compat'
1+
import { defineConfig } from 'eslint/config'
2+
63
import nx from '@nx/eslint-plugin'
4+
import nextPlugin from 'eslint-config-next'
5+
import reactHooksPlugin from 'eslint-plugin-react-hooks'
76
import baseConfig from '../../eslint.config.mjs'
8-
const compat = new FlatCompat({
9-
baseDirectory: dirname(fileURLToPath(import.meta.url)),
10-
recommendedConfig: js.configs.recommended,
11-
})
127

13-
// eslint-disable-next-line import/no-anonymous-default-export
14-
export default [
15-
...fixupConfigRules(compat.extends('next')),
16-
...fixupConfigRules(compat.extends('next/core-web-vitals')),
8+
export default defineConfig([
179
...baseConfig,
1810
...nx.configs['flat/react-typescript'],
11+
nextPlugin,
12+
{
13+
plugins: {
14+
'react-hooks': reactHooksPlugin,
15+
},
16+
rules: {
17+
'react-hooks/rules-of-hooks': 'warn',
18+
'react-hooks/exhaustive-deps': 'warn',
19+
'react-hooks/set-state-in-effect': 'warn',
20+
},
21+
},
1922
{
2023
ignores: ['.next/**/*', './src/data/**/*', './public/_*', 'next-env.d.ts'],
2124
},
22-
]
25+
])

apps/blog/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
21
declare module '*.svg' {
32
const content: any
43
export const ReactComponent: any

apps/blog/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/blog/next.config.mjs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// @ts-check
2-
import { composePlugins, withNx } from '@nx/next'
3-
42
import createMDX from '@next/mdx'
5-
import remarkGfm from 'remark-gfm'
6-
import remarkSugarHigh from 'remark-sugar-high'
3+
import { composePlugins } from '@nx/next'
74
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
85
import rehypeSlug from 'rehype-slug'
6+
import remarkGfm from 'remark-gfm'
7+
import remarkSugarHigh from 'remark-sugar-high'
98

109
const ONE_YEAR_IN_SECONDS = 60 * 60 * 24 * 365
1110

@@ -33,11 +32,21 @@ const nextConfig = {
3332
},
3433
],
3534
},
35+
{
36+
source: '/:path*',
37+
headers: [
38+
{
39+
key: 'Cross-Origin-Embedder-Policy',
40+
value: 'require-corp',
41+
},
42+
{
43+
key: 'Cross-Origin-Opener-Policy',
44+
value: 'same-origin',
45+
},
46+
],
47+
},
3648
]
3749
},
38-
nx: {
39-
svgr: false,
40-
},
4150
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
4251
poweredByHeader: false,
4352
reactStrictMode: true,
@@ -58,7 +67,10 @@ const nextConfig = {
5867
webpack: (config, { dev }) => {
5968
// resolve imports with extension names on dev mode (e.g. import ansi from "./ansi.js")
6069
config.resolve.extensionAlias = {
61-
'.js': ['.ts', '.tsx', '.js'],
70+
'.js': ['.ts', '.tsx', '.js', '.jsx'],
71+
'.mjs': ['.mts', '.mjs'],
72+
'.cjs': ['.cts', '.cjs'],
73+
'.jsx': ['.tsx', '.jsx'],
6274
}
6375
return config
6476
},
@@ -83,6 +95,6 @@ const withMdx = createMDX({
8395
},
8496
})
8597

86-
const withPlugins = composePlugins(withNx, withMdx)
98+
const withPlugins = composePlugins(withMdx)
8799

88100
export default withPlugins(nextConfig)

apps/blog/package.json

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,59 @@
44
"private": true,
55
"description": "A blog built with Next.js and MDX.",
66
"dependencies": {
7-
"@effect/platform-node": "^0.86.4",
8-
"@effect/printer": "^0.44.8",
9-
"@effect/printer-ansi": "^0.44.8",
10-
"@effect/rpc": "^0.62.4",
11-
"@effect/typeclass": "^0.35.8",
7+
"@blog/utils": "workspace:*",
8+
"@dprint/formatter": "^0.4.1",
9+
"@effect-atom/atom-react": "^0.4.0",
10+
"@effect/cli": "^0.72.0",
11+
"@effect/platform": "^0.93.0",
12+
"@effect/platform-node": "^0.100.0",
13+
"@monaco-editor/react": "^4.7.0",
14+
"@shadcn/ui": "workspace:*",
1215
"@vercel/analytics": "^1.5.0",
13-
"@vercel/edge-config": "^1.4.0",
16+
"@vercel/edge-config": "^1.4.3",
1417
"@vercel/speed-insights": "^1.2.0",
15-
"bcryptjs": "^3.0.2",
18+
"@webcontainer/api": "^1.6.1",
19+
"@xterm/addon-fit": "^0.10.0",
20+
"@xterm/xterm": "^5.5.0",
21+
"bcryptjs": "^3.0.3",
1622
"class-variance-authority": "^0.7.1",
17-
"codice": "^1.3.2",
18-
"date-fns": "^3.6.0",
19-
"effect": "^3.16.8",
20-
"esbuild": "^0.25.10",
21-
"framer-motion": "^12.7.4",
22-
"jose": "^6.0.11",
23-
"lucide-react": "^0.503.0",
24-
"next": "^15.5.4",
23+
"codice": "^1.5.2",
24+
"date-fns": "^4.1.0",
25+
"effect": "^3.19.2",
26+
"esbuild": "^0.25.12",
27+
"file-saver": "^2.0.5",
28+
"framer-motion": "^12.23.24",
29+
"jose": "^6.1.0",
30+
"jotai": "^2.15.1",
31+
"jszip": "^3.10.1",
32+
"lucide-react": "^0.553.0",
33+
"monaco-editor": "^0.54.0",
34+
"next": "^16.0.1",
2535
"next-themes": "^0.4.6",
26-
"react": "^19.1.1",
27-
"react-day-picker": "^8.10.1",
28-
"react-dom": "^19.1.1",
36+
"react": "^19.2.0",
37+
"react-day-picker": "^9.7.0",
38+
"react-dom": "^19.2.0",
39+
"react-resizable-panels": "^3.0.6",
2940
"recharts": "^2.15.3",
30-
"sonner": "^2.0.3",
31-
"tailwindcss": "^4.1.4",
32-
"unfurl.js": "^6.4.0"
41+
"sonner": "^2.0.7",
42+
"tailwindcss": "^4.1.17",
43+
"zod": "^4.1.12"
3344
},
3445
"devDependencies": {
35-
"@blog/utils": "workspace:*",
36-
"@effect/cli": "^0.64.2",
37-
"@effect/platform": "^0.91.1",
38-
"@mdx-js/loader": "^3.1.0",
39-
"@mdx-js/react": "^3.1.0",
40-
"@next/mdx": "^15.3.1",
41-
"@shadcn/ui": "workspace:*",
42-
"@tailwindcss/postcss": "^4.1.4",
43-
"@tailwindcss/typography": "^0.5.16",
46+
"@mdx-js/loader": "^3.1.1",
47+
"@mdx-js/react": "^3.1.1",
48+
"@next/mdx": "^16.0.1",
49+
"@tailwindcss/postcss": "^4.1.17",
50+
"@tailwindcss/typography": "^0.5.19",
51+
"@types/file-saver": "^2.0.7",
4452
"@types/mdx": "^2.0.13",
45-
"@zod/mini": "4.0.0-beta.20250430T185432",
46-
"clsx": "^2.1.1",
47-
"dotenv": "^16.5.0",
53+
"dotenv": "^17.2.3",
4854
"image-size": "^2.0.2",
49-
"prettier": "^3.6.2",
55+
"postcss": "^8.5.6",
5056
"rehype-autolink-headings": "^7.1.0",
5157
"rehype-slug": "^6.0.0",
5258
"remark-gfm": "^4.0.1",
5359
"remark-sugar-high": "^0.6.0",
54-
"tailwind-merge": "^3.2.0",
55-
"tw-animate-css": "^1.2.9"
60+
"tw-animate-css": "^1.4.0"
5661
}
5762
}

0 commit comments

Comments
 (0)