Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/docs-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"chokidar": "^3.5.3",
"find-up": "^6.3.0",
"gettext-parser": "^5.0.0",
"glob": "^8.0.3",
"gray-matter": "^4.0.3",
"lunr": "^2.3.9",
"lunr-languages": "^1.9.0",
Expand All @@ -48,7 +47,8 @@
"postcss-rtlcss": "^5.7.1",
"puppeteer": "^18.2.1",
"rev-hash": "^3.0.0",
"semver-compare": "^1.0.0"
"semver-compare": "^1.0.0",
"tinyglobby": "^0.2.15"
},
"devDependencies": {
"@types/lunr": "^2.3.4",
Expand Down
12 changes: 5 additions & 7 deletions packages/docs-builder/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { dirname, join as joinPath, resolve as resolvePath } from 'node:path'
import { fileURLToPath } from 'node:url'

import { findUp, pathExists } from 'find-up'
import glob from 'glob'
import postcss from 'postcss'
import postcssRtlCss from 'postcss-rtlcss'
import semverCompare from 'semver-compare'
import { globSync } from 'tinyglobby'

import { Assets } from './assets'
import type { BuildMode, LangConfig } from './config'
Expand Down Expand Up @@ -195,9 +195,8 @@ async function buildLang(
// Copy all other assets from the "shared src" directory. Note that glob paths
// have forward slashes only, so convert backslashes here.
const sharedSrcPath = context.config.sourceDir.replaceAll('\\', '/')
const sharedSrcFiles = glob.sync(`${sharedSrcPath}/*`, { nodir: true })
for (const f of sharedSrcFiles) {
const relPath = f.replace(`${sharedSrcPath}/`, '')
const sharedSrcFiles = globSync(`${sharedSrcPath}/*`, { cwd: sharedSrcPath, onlyFiles: true })
for (const relPath of sharedSrcFiles) {
if (!relPath.endsWith('.html') && !relPath.endsWith('base.css')) {
copyToBase(context.config.sourceDir, relPath)
}
Expand All @@ -215,9 +214,8 @@ async function buildLang(
'/'
)
const langPath = `${localizationDir}/${lang}`
const files = glob.sync(`${langPath}/images/**/*`, { nodir: true })
for (const f of files) {
const relPath = f.replace(`${langPath}/`, '')
const files = globSync(`${langPath}/images/**/*`, { cwd: langPath, onlyFiles: true })
for (const relPath of files) {
assets.copyWithHash(resolvePath(langPath), relPath, context.outDir)
}
}
Expand Down
105 changes: 63 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.