fix(knip.config.ts): revert changes

revert changes
This commit is contained in:
snomiao
2025-09-12 00:41:53 +00:00
parent b1c6622825
commit 18694842e5
2 changed files with 48 additions and 48 deletions

View File

@@ -11,7 +11,7 @@ on:
jobs: jobs:
update-locales: update-locales:
# Branch detection: Only run for manual dispatch or version-bump-* branches from main repo # Branch detection: Only run for manual dispatch or version-bump-* branches from main repo
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) || startsWith(github.head_ref, 'sno-fix-playwright-babel'))
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3 - uses: Comfy-Org/ComfyUI_frontend_setup_action@v3

View File

@@ -2,23 +2,23 @@ import type { KnipConfig } from 'knip'
const config: KnipConfig = { const config: KnipConfig = {
entry: [ entry: [
'{build,scripts}/**/*.{js,ts}',
'src/assets/css/style.css',
'src/main.ts', 'src/main.ts',
'src/scripts/ui/menu/index.ts', 'vite.config.mts',
'src/types/index.ts' 'vite.electron.config.mts',
'vite.types.config.mts',
'eslint.config.js',
'tailwind.config.js',
'postcss.config.js',
'playwright.config.ts',
'playwright.i18n.config.ts',
'vitest.config.ts',
'scripts/**/*.{js,ts}'
], ],
project: ['**/*.{js,ts,vue}', '*.{js,ts,mts}'], project: [
ignoreBinaries: ['only-allow', 'openapi-typescript'], 'src/**/*.{js,ts,vue}',
ignoreDependencies: [ 'tests-ui/**/*.{js,ts,vue}',
// Weird importmap things 'browser_tests/**/*.{js,ts}',
'@iconify/json', 'scripts/**/*.{js,ts}'
'@primeuix/forms',
'@primeuix/styled',
'@primeuix/utils',
'@primevue/icons',
// Dev
'@trivago/prettier-plugin-sort-imports'
], ],
ignore: [ ignore: [
// Generated files // Generated files
@@ -32,14 +32,9 @@ const config: KnipConfig = {
'coverage/**', 'coverage/**',
// i18n config // i18n config
'.i18nrc.cjs', '.i18nrc.cjs',
// Vitest litegraph config
'vitest.litegraph.config.ts',
// Test setup files // Test setup files
'browser_tests/globalSetup.ts', 'browser_tests/globalSetup.ts',
'browser_tests/globalTeardown.ts', 'browser_tests/globalTeardown.ts',
'browser_tests/globalSetupWithI18n.ts',
'browser_tests/globalTeardownWithI18n.ts',
'browser_tests/i18nSetup.ts',
'browser_tests/utils/**', 'browser_tests/utils/**',
// Scripts // Scripts
'scripts/**', 'scripts/**',
@@ -48,35 +43,40 @@ const config: KnipConfig = {
'vite.types.config.mts', 'vite.types.config.mts',
// Auto generated manager types // Auto generated manager types
'src/types/generatedManagerTypes.ts', 'src/types/generatedManagerTypes.ts',
'src/types/comfyRegistryTypes.ts', // Design system components (may not be used immediately)
// Used by a custom node (that should move off of this) 'src/components/button/IconGroup.vue',
'src/scripts/ui/components/splitButton.ts' 'src/components/button/MoreButton.vue',
'src/components/button/TextButton.vue',
'src/components/card/CardTitle.vue',
'src/components/card/CardDescription.vue',
'src/components/input/SingleSelect.vue'
], ],
compilers: { ignoreExportsUsedInFile: true,
// https://github.com/webpro-nl/knip/issues/1008#issuecomment-3207756199 // Vue-specific configuration
css: (text: string) => vue: true,
[ // Only check for unused files, disable all other rules
...text.replaceAll('plugin', 'import').matchAll(/(?<=@)import[^;]+/g) // TODO: Gradually enable other rules - see https://github.com/Comfy-Org/ComfyUI_frontend/issues/4888
].join('\n') rules: {
binaries: 'off',
classMembers: 'off',
dependencies: 'off',
devDependencies: 'off',
duplicates: 'off',
enumMembers: 'off',
exports: 'off',
nsExports: 'off',
nsTypes: 'off',
types: 'off',
unlisted: 'off'
}, },
vite: { // Include dependencies analysis
config: ['vite?(.*).config.mts'] includeEntryExports: true,
}, // Workspace configuration for monorepo-like structure
vitest: { workspaces: {
config: ['vitest?(.*).config.ts'], '.': {
entry: [ entry: ['src/main.ts', 'playwright.i18n.config.ts']
'**/*.{bench,test,test-d,spec}.?(c|m)[jt]s?(x)', }
'**/__mocks__/**/*.[jt]s?(x)' }
]
},
playwright: {
config: ['playwright?(.*).config.ts'],
entry: ['**/*.@(spec|test).?(c|m)[jt]s?(x)', 'browser_tests/**/*.ts']
},
tags: [
'-knipIgnoreUnusedButUsedByCustomNodes',
'-knipIgnoreUnusedButUsedByVueNodesBranch'
]
} }
export default config export default config