Commit ffba2723 by 杨明

Merge branch 'hotfix_remove_excess_files' of http://192.168.3.233:8090/h5/glsk-a…

…i-assistant into hotfix_remove_excess_files
2 parents 408e5ce4 fbc434b8
...@@ -16,7 +16,7 @@ NEXT_PUBLIC_MARKETPLACE_API_PREFIX=https://marketplace.dify.ai/api/v1 ...@@ -16,7 +16,7 @@ NEXT_PUBLIC_MARKETPLACE_API_PREFIX=https://marketplace.dify.ai/api/v1
NEXT_PUBLIC_MARKETPLACE_URL_PREFIX=https://marketplace.dify.ai NEXT_PUBLIC_MARKETPLACE_URL_PREFIX=https://marketplace.dify.ai
# SENTRY # SENTRY
NEXT_PUBLIC_SENTRY_DSN= NEXT_PUBLIC_SENTRY_DSN=https://90ddfaad2eac44f3b25cd4298ae7af14@sentry.glsx.com.cn/45
# Disable Next.js Telemetry (https://nextjs.org/telemetry) # Disable Next.js Telemetry (https://nextjs.org/telemetry)
NEXT_TELEMETRY_DISABLED=1 NEXT_TELEMETRY_DISABLED=1
......
{
"extends":["next/core-web-vitals","eslint:recommended","plugin:react/recommended"]
}
{
"extends": "stylelint-config-standard-scss"
}
...@@ -38,11 +38,11 @@ export const useStore = create<State & Action>(set => ({ ...@@ -38,11 +38,11 @@ export const useStore = create<State & Action>(set => ({
showAgentLogModal: false, showAgentLogModal: false,
setShowAgentLogModal: showAgentLogModal => set(() => ({ showAgentLogModal })), setShowAgentLogModal: showAgentLogModal => set(() => ({ showAgentLogModal })),
showMessageLogModal: false, showMessageLogModal: false,
setShowMessageLogModal: showMessageLogModal => set(() => { setShowMessageLogModal: showMessageLogModal =>
set(() => {
if (showMessageLogModal) { if (showMessageLogModal) {
return { showMessageLogModal } return { showMessageLogModal }
} } else {
else {
return { return {
showMessageLogModal, showMessageLogModal,
currentLogModalActiveTab: 'DETAIL', currentLogModalActiveTab: 'DETAIL',
......
/* /*
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn * @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2025-04-22 09:29:17 * @Date: 2025-04-22 09:29:17
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn * @LastEditors: liimin 17653212@qq.com
* @LastEditTime: 2025-04-28 13:55:48 * @LastEditTime: 2025-05-14 21:01:23
* @FilePath: \glsk-ai-assistant\app\components\base\answer-icon\index.tsx * @FilePath: \glsk-ai-assistant\app\components\base\answer-icon\index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
"use client"; 'use client'
import type { FC } from "react"; import type { FC } from 'react'
import { init } from "emoji-mart"; import { init } from 'emoji-mart'
import data from "@emoji-mart/data"; import data from '@emoji-mart/data'
import classNames from "@/utils/classnames"; import classNames from '@/utils/classnames'
import type { AppIconType } from "@/types/app"; import type { AppIconType } from '@/types/app'
init({ data }); init({ data })
export type AnswerIconProps = { export type AnswerIconProps = {
iconType?: AppIconType | null; iconType?: AppIconType | null
icon?: string | null; icon?: string | null
background?: string | null; background?: string | null
imageUrl: string; imageUrl: string
}; }
const AnswerIcon: FC<AnswerIconProps> = ({ const AnswerIcon: FC<AnswerIconProps> = ({ iconType, background, imageUrl }) => {
iconType, const wrapperClassName = classNames('flex', 'items-center', 'justify-center', 'w-full', 'h-full', 'rounded-full', 'text-xl')
background,
imageUrl,
}) => {
const wrapperClassName = classNames(
"flex",
"items-center",
"justify-center",
"w-full",
"h-full",
"rounded-full",
"text-xl"
);
return ( return (
<div className={wrapperClassName}> <div className={wrapperClassName}>
<img <img src={imageUrl} className="h-full w-full rounded-full" alt="answer icon" />
src={imageUrl}
className="h-full w-full rounded-full"
alt="answer icon"
/>
</div> </div>
); )
}; }
export default AnswerIcon; export default AnswerIcon
/*
* @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:34
* @LastEditors: liimin 17653212@qq.com
* @LastEditTime: 2025-05-15 19:42:09
* @FilePath: \ai-assistant\app\components\sentry-initor.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
'use client' 'use client'
import { useEffect } from 'react' import { useEffect } from 'react'
import * as Sentry from '@sentry/react' import * as Sentry from '@sentry/react'
const isDevelopment = process.env.NODE_ENV === 'development' const isDevelopment = process.env.NODE_ENV === 'development'
const sentryDsn = 'https://90ddfaad2eac44f3b25cd4298ae7af14@sentry.glsx.com.cn/45'
const SentryInit = ({ const SentryInit = ({ children }: { children: React.ReactNode }) => {
children,
}: { children: React.ReactNode }) => {
useEffect(() => { useEffect(() => {
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn') const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn') || sentryDsn
if (!isDevelopment && SENTRY_DSN) { if (SENTRY_DSN) {
Sentry.init({ Sentry.init({
dsn: SENTRY_DSN, dsn: SENTRY_DSN,
integrations: [ integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
tracesSampleRate: 0.1, tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1, replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0, replaysOnErrorSampleRate: 1.0,
......
import { GLOB_TESTS, combine, javascript, node, stylistic, typescript, unicorn } from '@antfu/eslint-config'
import globals from 'globals'
import storybook from 'eslint-plugin-storybook'
// import { fixupConfigRules } from '@eslint/compat'
import tailwind from 'eslint-plugin-tailwindcss'
import reactHooks from 'eslint-plugin-react-hooks'
// import reactRefresh from 'eslint-plugin-react-refresh'
export default combine(
stylistic({
lessOpinionated: true,
// original @antfu/eslint-config does not support jsx
jsx: false,
semi: false,
quotes: 'single',
overrides: {
// original config
'style/indent': ['error', 2],
'style/quotes': ['error', 'single'],
'curly': ['error', 'multi-or-nest', 'consistent'],
'style/comma-spacing': ['error', { before: false, after: true }],
'style/quote-props': ['warn', 'consistent-as-needed'],
// these options does not exist in old version
// maybe useless
'style/indent-binary-ops': 'off',
'style/multiline-ternary': 'off',
'antfu/top-level-function': 'off',
'antfu/curly': 'off',
'antfu/consistent-chaining': 'off',
// copy from eslint-config-antfu 0.36.0
'style/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'style/dot-location': ['error', 'property'],
'style/object-curly-newline': ['error', { consistent: true, multiline: true }],
'style/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
'style/template-curly-spacing': ['error', 'never'],
'style/keyword-spacing': 'off',
// not exist in old version, and big change
'style/member-delimiter-style': 'off',
},
}),
javascript({
overrides: {
// handled by unused-imports/no-unused-vars
'no-unused-vars': 'off',
},
}),
typescript({
overrides: {
// original config
'ts/consistent-type-definitions': ['warn', 'type'],
// useful, but big change
'ts/no-empty-object-type': 'off',
},
}),
unicorn(),
node(),
// use nextjs config will break @eslint/config-inspector
// use `ESLINT_CONFIG_INSPECTOR=true pnpx @eslint/config-inspector` to check the config
// ...process.env.ESLINT_CONFIG_INSPECTOR
// ? []
// TODO: remove this when upgrade to nextjs 15
// : fixupConfigRules(compat.extends('next')),
{
rules: {
// performance issue, and not used.
'@next/next/no-html-link-for-pages': 'off',
},
},
{
ignores: ['**/node_modules/*', '**/dist/', '**/build/', '**/out/', '**/.next/', '**/public/*', '**/*.json'],
},
{
// orignal config
rules: {
// orignal ts/no-var-requires
'ts/no-require-imports': 'off',
'no-console': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react/display-name': 'off',
'array-callback-return': [
'error',
{
allowImplicit: false,
checkForEach: false,
},
],
// copy from eslint-config-antfu 0.36.0
camelcase: 'off',
'default-case-last': 'error',
// antfu use eslint-plugin-perfectionist to replace this
// will cause big change, so keep the original sort-imports
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false,
},
],
// antfu migrate to eslint-plugin-unused-imports
'unused-imports/no-unused-vars': 'warn',
'unused-imports/no-unused-imports': 'warn',
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2025,
...globals.node,
React: 'readable',
JSX: 'readable',
},
},
},
storybook.configs['flat/recommended'],
// reactRefresh.configs.recommended,
{
rules: reactHooks.configs.recommended.rules,
plugins: {
'react-hooks': reactHooks,
},
},
// need futher research
{
rules: {
// not exist in old version
'antfu/consistent-list-newline': 'off',
'node/prefer-global/process': 'off',
'node/prefer-global/buffer': 'off',
'node/no-callback-literal': 'off',
// useful, but big change
'unicorn/prefer-number-properties': 'warn',
'unicorn/no-new-array': 'warn',
},
},
// suppress error for `no-undef` rule
{
files: GLOB_TESTS,
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
...globals.jest,
},
},
},
tailwind.configs['flat/recommended'],
{
settings: {
tailwindcss: {
// These are the default values but feel free to customize
callees: ['classnames', 'clsx', 'ctl', 'cn'],
config: 'tailwind.config.js', // returned from `loadConfig()` utility if not provided
cssFiles: ['**/*.css', '!**/node_modules', '!**/.*', '!**/dist', '!**/build', '!**/.storybook', '!**/.next', '!**/.public'],
cssFilesRefreshRate: 5_000,
removeDuplicates: true,
skipClassAttribute: false,
whitelist: [],
tags: [], // can be set to e.g. ['tw'] for use in tw`bg-blue`
classRegex: '^class(Name)?$', // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
},
},
rules: {
// due to 1k lines of tailwind config, these rule have performance issue
'tailwindcss/no-contradicting-classname': 'off',
'tailwindcss/enforces-shorthand': 'off',
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/no-unnecessary-arbitrary-value': 'off',
'tailwindcss/no-arbitrary-value': 'off',
'tailwindcss/classnames-order': 'warn',
'tailwindcss/enforces-negative-arbitrary-values': 'warn',
'tailwindcss/migration-from-tailwind-2': 'warn',
},
},
)
...@@ -156,10 +156,12 @@ export type SiteConfig = { ...@@ -156,10 +156,12 @@ export type SiteConfig = {
// introduction: string // introduction: string
// } // }
export type AppVoicesListResponse = [{ export type AppVoicesListResponse = [
{
name: string name: string
value: string value: string
}] },
]
// export type TracingStatus = { // export type TracingStatus = {
// enabled: boolean // enabled: boolean
......
...@@ -15,9 +15,7 @@ const withMDX = require('@next/mdx')({ ...@@ -15,9 +15,7 @@ const withMDX = require('@next/mdx')({
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
webpack: (config, { dev, isServer }) => { webpack: (config, { dev, isServer }) => {
if (!dev) {
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' })) config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }))
}
return config return config
}, },
productionBrowserSourceMaps: false, // enable browser source map generation during the production build productionBrowserSourceMaps: false, // enable browser source map generation during the production build
......
...@@ -128,6 +128,8 @@ ...@@ -128,6 +128,8 @@
"magicast": "^0.3.5", "magicast": "^0.3.5",
"sass": "^1.80.3", "sass": "^1.80.3",
"storybook": "8.5.0", "storybook": "8.5.0",
"stylelint": "^16.19.1",
"stylelint-config-standard-scss": "^15.0.0",
"tailwindcss": "^3.4.14", "tailwindcss": "^3.4.14",
"typescript": "4.9.5", "typescript": "4.9.5",
"uglify-js": "^3.19.3" "uglify-js": "^3.19.3"
......
packages:
- 'app/**'
- 'libs/**'
- 'packages/**'
ignoredBuiltDependencies: ignoredBuiltDependencies:
- canvas - canvas
- core-js-pure - core-js-pure
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!