Skip to content

Commit

Permalink
fix(ui/themes, cli): fix themes types
Browse files Browse the repository at this point in the history
affects: @varlet/cli, @varlet/ui
  • Loading branch information
haoziqaq committed Nov 23, 2021
1 parent 3457394 commit f29511a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/varlet-cli/src/compiler/compileModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
STYLE_DIR_NAME,
LIB_DIR,
} from '../shared/constant'
import { getPublicDirs, isDir, isLess, isScript, isSFC } from '../shared/fsUtils'
import { getPublicDirs, isDir, isDTS, isLess, isScript, isSFC } from '../shared/fsUtils'
import { compileSFC } from './compileSFC'
import { compileESEntry, compileCommonJSEntry, compileScriptFile } from './compileScript'
import { compileLess } from './compileStyle'
Expand All @@ -37,7 +37,7 @@ export async function compileDir(dir: string) {

;[TESTS_DIR_NAME, EXAMPLE_DIR_NAME, DOCS_DIR_NAME].includes(filename) && removeSync(file)

if (filename === STYLE_DIR_NAME) {
if (isDTS(file) || filename === STYLE_DIR_NAME) {
return Promise.resolve()
}

Expand Down
2 changes: 2 additions & 0 deletions packages/varlet-cli/src/shared/fsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const isJSX = (file: string): boolean => pathExistsSync(file) && extname(

export const isTSX = (file: string): boolean => pathExistsSync(file) && extname(file) === '.tsx'

export const isDTS = (file: string): boolean => pathExistsSync(file) && file.endsWith('.d.ts')

export const isScript = (file: string): boolean => pathExistsSync(file) && SCRIPTS_EXTENSIONS.includes(extname(file))

export const isLess = (file: string): boolean => pathExistsSync(file) && extname(file) === '.less'
Expand Down
3 changes: 3 additions & 0 deletions packages/varlet-ui/src/themes/dark/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { StyleVars } from '../../../types'

export default StyleVars

0 comments on commit f29511a

Please sign in to comment.