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/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
},
"dependencies": {
"@rsbuild/core": "~1.0.14",
"rsbuild-plugin-dts": "workspace:*"
"rsbuild-plugin-dts": "workspace:*",
"tinyglobby": "^0.2.9"
},
"devDependencies": {
"@rslib/tsconfig": "workspace:*",
"@rspack/core": "1.0.8",
"@types/fs-extra": "^11.0.4",
"commander": "^12.1.0",
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"memfs": "^4.14.0",
"picocolors": "1.1.0",
Expand Down
1 change: 0 additions & 1 deletion packages/core/prebundle.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default {
},
dependencies: [
'commander',
'fast-glob',
{
name: 'rslog',
afterBundle(task) {
Expand Down
1 change: 0 additions & 1 deletion packages/core/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default defineConfig({
target: 'node',
externals: {
picocolors: '../compiled/picocolors/index.js',
'fast-glob': '../compiled/fast-glob/index.js',
commander: '../compiled/commander/index.js',
rslog: '../compiled/rslog/index.js',
},
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
mergeRsbuildConfig,
rspack,
} from '@rsbuild/core';
import glob from 'fast-glob';
import { glob } from 'tinyglobby';
import {
DEFAULT_CONFIG_EXTENSIONS,
DEFAULT_CONFIG_NAME,
Expand Down Expand Up @@ -748,6 +748,7 @@ const composeEntryConfig = async (
// Turn entries in array into each separate entry.
const globEntryFiles = await glob(entryFiles, {
cwd: root,
absolute: true,
});

// Filter the glob resolved entry files based on the allowed extensions
Expand Down
1 change: 0 additions & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"paths": {
"commander": ["./compiled/commander"],
"picocolors": ["./compiled/picocolors"],
"fast-glob": ["./compiled/fast-glob"],
"rslog": ["./compiled/rslog"]
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-dts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"dev": "rslib build --watch"
},
"dependencies": {
"fast-glob": "^3.3.2",
"magic-string": "^0.30.12",
"picocolors": "1.1.0"
"picocolors": "1.1.0",
"tinyglobby": "^0.2.9"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.47.9",
Expand Down
12 changes: 6 additions & 6 deletions packages/plugin-dts/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import fsP from 'node:fs/promises';
import { platform } from 'node:os';
import path, { join } from 'node:path';
import { type RsbuildConfig, logger } from '@rsbuild/core';
import fg from 'fast-glob';
import MagicString from 'magic-string';
import color from 'picocolors';
import { convertPathToPattern, glob } from 'tinyglobby';
import ts from 'typescript';
import type { DtsEntry } from './index';

const { convertPathToPattern } = fg;

export function loadTsconfig(tsconfigPath: string): ts.ParsedCommandLine {
const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
const configFileContent = ts.parseJsonConfigFileContent(
Expand Down Expand Up @@ -68,8 +66,8 @@ export const prettyTime = (seconds: number): string => {
return `${format(minutes.toFixed(2))} m`;
};

// fast-glob only accepts posix path
// https://github.com/mrmlnc/fast-glob#convertpathtopatternpath
// tinyglobby only accepts posix path
// https://github.com/SuperchupuDev/tinyglobby?tab=readme-ov-file#api
const convertPath = (path: string) => {
if (platform() === 'win32') {
return convertPathToPattern(path);
Expand Down Expand Up @@ -111,7 +109,9 @@ export async function processDtsFiles(
return;
}

const dtsFiles = await fg(convertPath(join(dir, '/**/*.d.ts')));
const dtsFiles = await glob(convertPath(join(dir, '/**/*.d.ts')), {
absolute: true,
});

for (const file of dtsFiles) {
try {
Expand Down
45 changes: 36 additions & 9 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions scripts/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ systemjs
tailwindcss
taze
templating
tinyglobby
transpiling
treeshaking
tsbuildinfo
Expand Down
4 changes: 2 additions & 2 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"@types/node": "~18.19.39",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"path-serializer": "0.1.3",
"strip-ansi": "^7.1.0",
"test-helper": "workspace:*"
"test-helper": "workspace:*",
"tinyglobby": "^0.2.9"
}
}
14 changes: 7 additions & 7 deletions tests/scripts/helper.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { platform } from 'node:os';
import { join } from 'node:path';
import fg, {
type Options as GlobOptions,
convertPathToPattern,
} from 'fast-glob';
import fse from 'fs-extra';
import { type GlobOptions, convertPathToPattern, glob } from 'tinyglobby';

// fast-glob only accepts posix path
// https://github.com/mrmlnc/fast-glob#convertpathtopatternpath
// tinyglobby only accepts posix path
// https://github.com/SuperchupuDev/tinyglobby?tab=readme-ov-file#api
const convertPath = (path: string) => {
if (platform() === 'win32') {
return convertPathToPattern(path);
Expand All @@ -19,7 +16,10 @@ export const globContentJSON = async (
path: string,
options?: GlobOptions,
): Promise<Record<string, string>> => {
const files = await fg(convertPath(join(path, '**/*')), options);
const files = await glob(convertPath(join(path, '**/*')), {
absolute: true,
...options,
});
const ret: Record<string, string> = {};

await Promise.all(
Expand Down
Loading