Compare commits

..

34 Commits

Author SHA1 Message Date
Stephen Zhou
a9c0f68e2a Merge branch 'main' into 2-25-vinext 2026-02-28 14:46:18 +08:00
Stephen Zhou
87f3c8dd2b lint 2026-02-28 14:45:00 +08:00
Stephen Zhou
905c072932 update 2026-02-28 11:11:11 +08:00
Stephen Zhou
1ba1e3f996 Merge branch 'main' into 2-25-vinext 2026-02-28 11:10:31 +08:00
Stephen Zhou
7aadd238c9 remove mdx 2026-02-27 23:03:31 +08:00
Stephen Zhou
4576b630c3 Update web/vite.config.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-27 19:54:48 +08:00
Stephen Zhou
299e7f2e00 update deps 2026-02-27 19:53:57 +08:00
Stephen Zhou
b04f4d0ba5 update 2026-02-27 19:46:52 +08:00
Stephen Zhou
f91cf26e30 Merge branch 'main' into 2-25-vinext 2026-02-27 19:45:55 +08:00
Stephen Zhou
569c76fbea Merge branch 'main' into 2-25-vinext 2026-02-27 18:20:08 +08:00
Stephen Zhou
90effbdd95 update 2026-02-27 18:19:18 +08:00
Stephen Zhou
7b688d7717 Merge branch 'main' into 2-25-vinext 2026-02-26 19:18:03 +08:00
Stephen Zhou
b70a4d6a4c update 2026-02-26 19:12:59 +08:00
Stephen Zhou
405be69fb5 refactor: remove env load 2026-02-26 19:08:44 +08:00
Stephen Zhou
85019c47ea Merge branch 'main' into 2-25-vinext 2026-02-26 02:29:36 +08:00
Stephen Zhou
db8d61eefb update 2026-02-26 02:26:37 +08:00
Stephen Zhou
8c025a19f0 update 2026-02-26 02:01:16 +08:00
Stephen Zhou
4be7e38cd4 update 2026-02-26 02:00:13 +08:00
Stephen Zhou
511958ae59 update 2026-02-26 01:59:10 +08:00
Stephen Zhou
138855546f fix: mdx import 2026-02-26 01:57:59 +08:00
Stephen Zhou
b10b51d9b3 Merge branch 'main' into 2-25-vinext 2026-02-26 00:08:23 +08:00
Stephen Zhou
6a0b06b9dc update deps 2026-02-26 00:07:27 +08:00
Stephen Zhou
56265a5217 fix: Instrument_Serif 2026-02-25 17:44:14 +08:00
Stephen Zhou
084eeac776 fix: constants shim 2026-02-25 17:38:27 +08:00
Stephen Zhou
3e92f85beb fix: image size plugin 2026-02-25 17:25:52 +08:00
Stephen Zhou
7bd987c6f1 use pkg new pr 2026-02-25 13:01:12 +08:00
Stephen Zhou
af80c10ed3 fix load module 2026-02-25 12:46:41 +08:00
Stephen Zhou
af6218d4b5 update 2026-02-25 11:33:27 +08:00
Stephen Zhou
84fda207a6 update 2026-02-25 11:32:20 +08:00
Stephen Zhou
eb81f0563d jiti v1 2026-02-25 11:31:23 +08:00
Stephen Zhou
cd22550454 load env 2026-02-25 11:28:18 +08:00
Stephen Zhou
1bbc2f147d env 2026-02-25 11:24:32 +08:00
Stephen Zhou
b787c0af7f import ts in next.config 2026-02-25 11:12:35 +08:00
Stephen Zhou
56c8bef073 chore: add vinext as dev server 2026-02-25 11:00:29 +08:00
16 changed files with 561 additions and 319 deletions

6
api/uv.lock generated
View File

@@ -5049,11 +5049,11 @@ wheels = [
[[package]]
name = "pypdf"
version = "6.7.4"
version = "6.7.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/09/dc/f52deef12797ad58b88e4663f097a343f53b9361338aef6573f135ac302f/pypdf-6.7.4.tar.gz", hash = "sha256:9edd1cd47938bb35ec87795f61225fd58a07cfaf0c5699018ae1a47d6f8ab0e3", size = 5304821, upload-time = "2026-02-27T10:44:39.395Z" }
sdist = { url = "https://files.pythonhosted.org/packages/ff/63/3437c4363483f2a04000a48f1cd48c40097f69d580363712fa8b0b4afe45/pypdf-6.7.1.tar.gz", hash = "sha256:6b7a63be5563a0a35d54c6d6b550d75c00b8ccf36384be96365355e296e6b3b0", size = 5302208, upload-time = "2026-02-17T17:00:48.88Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/c1/be/cded021305f5c81b47265b8c5292b99388615a4391c21ff00fd538d34a56/pypdf-6.7.4-py3-none-any.whl", hash = "sha256:527d6da23274a6c70a9cb59d1986d93946ba8e36a6bc17f3f7cce86331492dda", size = 331496, upload-time = "2026-02-27T10:44:37.527Z" },
{ url = "https://files.pythonhosted.org/packages/68/77/38bd7744bb9e06d465b0c23879e6d2c187d93a383f8fa485c862822bb8a3/pypdf-6.7.1-py3-none-any.whl", hash = "sha256:a02ccbb06463f7c334ce1612e91b3e68a8e827f3cee100b9941771e6066b094e", size = 331048, upload-time = "2026-02-17T17:00:46.991Z" },
]
[[package]]

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Completion App API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Completion アプリ API

View File

@@ -1,5 +1,5 @@
import { CodeGroup, Embed } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Advanced Chat App API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# 高度なチャットアプリ API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Chat App API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# チャットアプリ API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Workflow App API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# ワークフローアプリ API

View File

@@ -1,5 +1,5 @@
import { CodeGroup } from '../code.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from '../md.tsx'
import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
# Workflow 应用 API

View File

@@ -1,10 +1,9 @@
import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime'
import type { AppContextValue } from '@/context/app-context'
import type { ModalContextState } from '@/context/modal-context'
import type { ProviderContextState } from '@/context/provider-context'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { fireEvent, render, screen, waitFor } from '@testing-library/react'
import { AppRouterContext } from 'next/dist/shared/lib/app-router-context.shared-runtime'
import { useRouter } from 'next/navigation'
import { Plan } from '@/app/components/billing/type'
import { useAppContext } from '@/context/app-context'
import { useGlobalPublicStore } from '@/context/global-public-context'
@@ -50,6 +49,14 @@ vi.mock('@/service/use-common', () => ({
useLogout: vi.fn(),
}))
vi.mock('next/navigation', async (importOriginal) => {
const actual = await importOriginal<typeof import('next/navigation')>()
return {
...actual,
useRouter: vi.fn(),
}
})
vi.mock('@/context/i18n', () => ({
useDocLink: () => (path: string) => `https://docs.dify.ai${path}`,
}))
@@ -119,15 +126,6 @@ describe('AccountDropdown', () => {
const mockSetShowAccountSettingModal = vi.fn()
const renderWithRouter = (ui: React.ReactElement) => {
const mockRouter = {
push: mockPush,
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
forward: vi.fn(),
refresh: vi.fn(),
} as unknown as AppRouterInstance
const queryClient = new QueryClient({
defaultOptions: {
queries: {
@@ -138,9 +136,7 @@ describe('AccountDropdown', () => {
return render(
<QueryClientProvider client={queryClient}>
<AppRouterContext.Provider value={mockRouter}>
{ui}
</AppRouterContext.Provider>
{ui}
</QueryClientProvider>,
)
}
@@ -166,6 +162,14 @@ describe('AccountDropdown', () => {
vi.mocked(useLogout).mockReturnValue({
mutateAsync: mockLogout,
} as unknown as ReturnType<typeof useLogout>)
vi.mocked(useRouter).mockReturnValue({
push: mockPush,
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
forward: vi.fn(),
refresh: vi.fn(),
})
})
afterEach(() => {

View File

@@ -28,9 +28,12 @@
"scripts": {
"dev": "next dev",
"dev:inspect": "next dev --inspect",
"dev:vinext": "vinext dev",
"build": "next build",
"build:docker": "next build && node scripts/optimize-standalone.js",
"build:vinext": "vinext build",
"start": "node ./scripts/copy-and-start.mjs",
"start:vinext": "vinext start",
"lint": "eslint --cache --concurrency=auto",
"lint:ci": "eslint --cache --concurrency 2",
"lint:fix": "pnpm lint --fix",
@@ -173,6 +176,7 @@
"@iconify-json/ri": "1.2.9",
"@mdx-js/loader": "3.1.1",
"@mdx-js/react": "3.1.1",
"@mdx-js/rollup": "3.1.1",
"@next/eslint-plugin-next": "16.1.6",
"@next/mdx": "16.1.5",
"@rgrove/parse-xml": "4.2.0",
@@ -210,14 +214,15 @@
"@types/uuid": "10.0.0",
"@typescript-eslint/parser": "8.56.1",
"@typescript/native-preview": "7.0.0-dev.20251209.1",
"@vitejs/plugin-react": "5.1.2",
"@vitest/coverage-v8": "4.0.17",
"@vitejs/plugin-react": "5.1.4",
"@vitejs/plugin-rsc": "0.5.21",
"@vitest/coverage-v8": "4.0.18",
"autoprefixer": "10.4.21",
"code-inspector-plugin": "1.3.6",
"cross-env": "10.1.0",
"esbuild": "0.27.2",
"eslint": "10.0.2",
"eslint-plugin-better-tailwindcss": "4.3.1",
"eslint-plugin-better-tailwindcss": "https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@a520d15",
"eslint-plugin-hyoban": "0.11.2",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "0.5.2",
@@ -233,6 +238,7 @@
"postcss": "8.5.6",
"postcss-js": "5.0.3",
"react-scan": "0.4.3",
"react-server-dom-webpack": "19.2.4",
"sass": "1.93.2",
"serwist": "9.5.4",
"storybook": "10.2.13",
@@ -240,9 +246,10 @@
"tsx": "4.21.0",
"typescript": "5.9.3",
"uglify-js": "3.19.3",
"vinext": "https://pkg.pr.new/hyoban/vinext@e283197",
"vite": "7.3.1",
"vite-tsconfig-paths": "6.0.4",
"vitest": "4.0.17",
"vite-tsconfig-paths": "6.1.1",
"vitest": "4.0.18",
"vitest-canvas-mock": "1.1.3"
},
"pnpm": {

714
web/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,14 @@ const _dirname = typeof __dirname !== 'undefined'
? __dirname
: path.dirname(fileURLToPath(import.meta.url))
const disableSVGOptimize = process.env.TAILWIND_MODE === 'ESLINT'
const svgOptimizeConfig = {
cleanupSVG: !disableSVGOptimize,
deOptimisePaths: !disableSVGOptimize,
runSVGO: !disableSVGOptimize,
parseColors: !disableSVGOptimize,
}
const config = {
theme: {
typography,
@@ -167,11 +175,13 @@ const config = {
source: path.resolve(_dirname, 'app/components/base/icons/assets/public'),
prefix: 'custom-public',
ignoreImportErrors: true,
...svgOptimizeConfig,
}),
...importSvgCollections({
source: path.resolve(_dirname, 'app/components/base/icons/assets/vender'),
prefix: 'custom-vender',
ignoreImportErrors: true,
...svgOptimizeConfig,
}),
},
extraProperties: {

View File

@@ -1,16 +1,60 @@
import type { Plugin } from 'vite'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@vitejs/plugin-react'
import vinext from 'vinext'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const isCI = !!process.env.CI
export default defineConfig({
plugins: [tsconfigPaths(), react()],
resolve: {
alias: {
'~@': __dirname,
export default defineConfig(({ mode }) => {
return {
plugins: mode === 'test'
? [
tsconfigPaths(),
react(),
{
// Stub .mdx files so components importing them can be unit-tested
name: 'mdx-stub',
enforce: 'pre',
transform(_, id) {
if (id.endsWith('.mdx'))
return { code: 'export default () => null', map: null }
},
} as Plugin,
]
: [
vinext(),
],
resolve: {
alias: {
'~@': __dirname,
},
},
},
// vinext related config
...(mode !== 'test'
? {
optimizeDeps: {
exclude: ['nuqs'],
},
server: {
port: 3000,
},
}
: {}),
// Vitest config
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./vitest.setup.ts'],
coverage: {
provider: 'v8',
reporter: isCI ? ['json', 'json-summary'] : ['text', 'json', 'json-summary'],
},
},
}
})

View File

@@ -1,27 +0,0 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import viteConfig from './vite.config'
const isCI = !!process.env.CI
export default mergeConfig(viteConfig, defineConfig({
plugins: [
{
// Stub .mdx files so components importing them can be unit-tested
name: 'mdx-stub',
enforce: 'pre',
transform(_, id) {
if (id.endsWith('.mdx'))
return { code: 'export default () => null', map: null }
},
},
],
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./vitest.setup.ts'],
coverage: {
provider: 'v8',
reporter: isCI ? ['json', 'json-summary'] : ['text', 'json', 'json-summary'],
},
},
}))