Skip to content

Commit

Permalink
refactor(utils): categorize utils functions
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Sep 11, 2023
1 parent ee27c1f commit 3a3b8d6
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 13 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/utils/src/console/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './formatMs.js'
export * from './logger.js'
export * from './withSpinner.js'
File renamed without changes.
File renamed without changes.
12 changes: 3 additions & 9 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import path from 'upath'

export { debug, colors, fs, globby, hash, ora, path }

export * from './getDirname.js'
export * from './importFile.js'
export * from './formatMs.js'
export * from './isChildPath.js'
export * from './logger.js'
export * from './renderHead.js'
export * from './renderHeadAttrs.js'
export * from './sanitizeFileName.js'
export * from './withSpinner.js'
export * from './console/index.js'
export * from './module/index.js'
export * from './ssr/index.js'
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/utils/src/module/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './getDirname.js'
export * from './importFile.js'
export * from './isChildPath.js'
export * from './sanitizeFileName.js'
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/utils/src/ssr/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './renderHead.js'
export * from './renderHeadAttrs.js'
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest'
import { logger } from '../src/index.js'
import { logger } from '../../src/index.js'

const methods = [
['info', 'log'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { isChildPath } from '../src/index.js'
import { isChildPath } from '../../src/index.js'

const testCases: [[string, string], boolean][] = [
[['/foo', '/foo'], true],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HeadConfig } from '@vuepress/shared'
import { describe, expect, it } from 'vitest'
import { renderHead } from '../src/index.js'
import { renderHead } from '../../src/index.js'

const testCases: [HeadConfig, string][] = [
[['title', {}, 'vuepress site title'], `<title>vuepress site title</title>`],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HeadAttrsConfig } from '@vuepress/shared'
import { describe, expect, it } from 'vitest'
import { renderHeadAttrs } from '../src/index.js'
import { renderHeadAttrs } from '../../src/index.js'

const testCases: [HeadAttrsConfig, string][] = [
[
Expand Down

0 comments on commit 3a3b8d6

Please sign in to comment.