Skip to content

Commit

Permalink
chore: replace fast-glob with tinyglobby (#6274)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Sep 6, 2024
1 parent 0282564 commit c321a3f
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 402 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@vite-pwa/assets-generator": "^0.2.4",
"@vite-pwa/vitepress": "^0.5.0",
"@vitejs/plugin-vue": "^5.1.2",
"fast-glob": "^3.3.2",
"https-localhost": "^4.7.1",
"tinyglobby": "^0.2.5",
"unocss": "^0.62.0",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.2.8",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
"changelogithub": "^0.13.9",
"esbuild": "^0.23.0",
"eslint": "^9.9.0",
"fast-glob": "^3.3.2",
"magic-string": "^0.30.11",
"pathe": "^1.1.2",
"rimraf": "^6.0.1",
"rollup": "^4.20.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-license": "^3.5.2",
"tinyglobby": "^0.2.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"vite": "^5.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url'
import fs from 'node:fs'
import { defineConfig } from 'vite'
import { resolve } from 'pathe'
import fg from 'fast-glob'
import { globSync } from 'tinyglobby'

export default defineConfig({
server: {
Expand Down Expand Up @@ -51,7 +51,7 @@ export default defineConfig({
await waitFor(() => fs.existsSync(ui))
clearTimeout(timeout)

const files = fg.sync('**/*', { cwd: ui })
const files = globSync(['**/*'], { cwd: ui, expandDirectories: false })

if (fs.existsSync(browser)) {
fs.rmSync(browser, { recursive: true })
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/node/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { fileURLToPath } from 'node:url'
import { promisify } from 'node:util'
import { gzip, constants as zlibConstants } from 'node:zlib'
import { basename, dirname, relative, resolve } from 'pathe'
import { globSync } from 'tinyglobby'
import c from 'tinyrainbow'
import fg from 'fast-glob'
import { stringify } from 'flatted'
import type {
File,
Expand Down Expand Up @@ -111,7 +111,7 @@ export default class HTMLReporter implements Reporter {
await fs.writeFile(metaFile, data, 'base64')
const ui = resolve(distDir, 'client')
// copy ui
const files = fg.sync('**/*', { cwd: ui })
const files = globSync(['**/*'], { cwd: ui, expandDirectories: false })
await Promise.all(
files.map(async (f) => {
if (f === 'index.html') {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
},
"dependencies": {
"@vitest/utils": "workspace:*",
"fast-glob": "^3.3.2",
"fflate": "^0.8.2",
"flatted": "^3.3.1",
"pathe": "^1.1.2",
"sirv": "^2.0.4",
"tinyglobby": "^0.2.5",
"tinyrainbow": "^1.2.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit c321a3f

Please sign in to comment.