Compare commits

...

31 Commits

Author SHA1 Message Date
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
439ff3775d chore: update to eslint 10 (#32646)
Some checks are pending
autofix.ci / autofix (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Main CI Pipeline / Check Changed Files (push) Waiting to run
Main CI Pipeline / API Tests (push) Blocked by required conditions
Main CI Pipeline / Web Tests (push) Blocked by required conditions
Main CI Pipeline / Style Check (push) Waiting to run
Main CI Pipeline / VDB Tests (push) Blocked by required conditions
Main CI Pipeline / DB Migration Test (push) Blocked by required conditions
2026-02-27 19:44:54 +08:00
Varun Chawla
233e12e631 fix: correct mock return type in CodeBasedExtension test (#32058) 2026-02-27 20:40:51 +09: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
20 changed files with 1391 additions and 1045 deletions

View File

@@ -77,7 +77,7 @@ def _restx_mask_defaults(app: Flask):
def test_code_based_extension_get_returns_service_data(app: Flask, monkeypatch: pytest.MonkeyPatch):
service_result = {"entrypoint": "main:agent"}
service_result = [{"entrypoint": "main:agent"}]
service_mock = MagicMock(return_value=service_result)
monkeypatch.setattr(
"controllers.console.extension.CodeBasedExtensionService.get_code_based_extension",

View File

@@ -33,7 +33,7 @@ Then, configure the environment variables. Create a file named `.env.local` in t
cp .env.example .env.local
```
```
```txt
# For production release, change this to PRODUCTION
NEXT_PUBLIC_DEPLOY_ENV=DEVELOPMENT
# The deployment edition, SELF_HOSTED

View File

@@ -61,8 +61,7 @@ const ParamsConfig = ({
if (tempDataSetConfigs.retrieval_model === RETRIEVE_TYPE.multiWay) {
if (tempDataSetConfigs.reranking_enable
&& tempDataSetConfigs.reranking_mode === RerankingModeEnum.RerankingModel
&& !isCurrentRerankModelValid
) {
&& !isCurrentRerankModelValid) {
errMsg = t('datasetConfig.rerankModelRequired', { ns: 'appDebug' })
}
}

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

@@ -46,8 +46,7 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
if (!errorMessages
&& payload.body.type === BodyType.binary
&& ((!(payload.body.data as BodyPayload)[0]?.file) || (payload.body.data as BodyPayload)[0]?.file?.length === 0)
) {
&& ((!(payload.body.data as BodyPayload)[0]?.file) || (payload.body.data as BodyPayload)[0]?.file?.length === 0)) {
errorMessages = t('errorMsg.fieldRequired', { ns: 'workflow', field: t('nodes.http.binaryFileVariable', { ns: 'workflow' }) })
}

View File

@@ -8169,11 +8169,6 @@
"count": 3
}
},
"i18n-config/README.md": {
"no-irregular-whitespace": {
"count": 1
}
},
"i18n/de-DE/billing.json": {
"no-irregular-whitespace": {
"count": 1

View File

@@ -6,7 +6,7 @@ This directory contains i18n tooling and configuration. Translation files live u
## File Structure
```
```txt
web/i18n
├── en-US
│ ├── app.json
@@ -36,7 +36,7 @@ By default we will use `LanguagesSupported` to determine which languages are sup
1. Create a new folder for the new language.
```
```txt
cd web/i18n
cp -r en-US id-ID
```
@@ -98,7 +98,7 @@ export const languages = [
{
value: 'ru-RU',
name: 'Русский(Россия)',
example: ' Привет, Dify!',
example: 'Привет, Dify!',
supported: false,
},
{

View File

@@ -3,7 +3,7 @@
"type": "module",
"version": "1.13.0",
"private": true,
"packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a",
"packageManager": "pnpm@10.27.0",
"imports": {
"#i18n": {
"react-server": "./i18n-config/lib.server.ts",
@@ -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",
@@ -165,14 +168,15 @@
"zustand": "5.0.9"
},
"devDependencies": {
"@antfu/eslint-config": "7.2.0",
"@antfu/eslint-config": "7.6.1",
"@chromatic-com/storybook": "5.0.0",
"@egoist/tailwindcss-icons": "1.9.2",
"@eslint-react/eslint-plugin": "2.9.4",
"@eslint-react/eslint-plugin": "2.13.0",
"@iconify-json/heroicons": "1.2.3",
"@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",
@@ -208,21 +212,22 @@
"@types/semver": "7.7.1",
"@types/sortablejs": "1.15.8",
"@types/uuid": "10.0.0",
"@typescript-eslint/parser": "8.54.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": "9.39.2",
"eslint-plugin-better-tailwindcss": "https://pkg.pr.new/hyoban/eslint-plugin-better-tailwindcss@c0161c7",
"eslint-plugin-hyoban": "0.11.1",
"eslint": "10.0.2",
"eslint-plugin-better-tailwindcss": "4.3.1",
"eslint-plugin-hyoban": "0.11.2",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "0.5.0",
"eslint-plugin-sonarjs": "3.0.6",
"eslint-plugin-storybook": "10.2.6",
"eslint-plugin-react-refresh": "0.5.2",
"eslint-plugin-sonarjs": "4.0.0",
"eslint-plugin-storybook": "10.2.13",
"husky": "9.1.7",
"iconify-import-svg": "0.1.1",
"jsdom": "27.3.0",
@@ -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.0",
@@ -240,15 +246,17 @@
"tsx": "4.21.0",
"typescript": "5.9.3",
"uglify-js": "3.19.3",
"vinext": "https://pkg.pr.new/hyoban/vinext@c165a1f",
"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": {
"overrides": {
"@monaco-editor/loader": "1.5.0",
"@nolyfill/safe-buffer": "npm:safe-buffer@^5.2.1",
"@stylistic/eslint-plugin": "https://pkg.pr.new/@stylistic/eslint-plugin@258f9d8",
"array-includes": "npm:@nolyfill/array-includes@^1",
"array.prototype.findlast": "npm:@nolyfill/array.prototype.findlast@^1",
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@^1",

2242
web/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,64 @@
import type { Plugin } from 'vite'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import mdx from '@mdx-js/rollup'
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'
? [
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,
]
: [
mdx(),
vinext(),
]),
tsconfigPaths(),
],
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'],
},
},
}))