Skip to content

Commit

Permalink
refactor: replace fast-glob usage with tinyglobby (angular#60264)
Browse files Browse the repository at this point in the history
Usage of the `fast-glob` package has been replaced with the `tinyglobby` package. The change reduces the number of transitive dependencies related to these packages from 17 to 2 while also maintaining equivalent functionality. This was also changed in the Angular CLI packages.

PR Close angular#60264
  • Loading branch information
alan-agius4 authored and AndrewKushnir committed Mar 7, 2025
1 parent cc0bd25 commit 45f899a
Show file tree
Hide file tree
Showing 33 changed files with 2,780 additions and 2,557 deletions.
4 changes: 2 additions & 2 deletions adev/shared-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"@webcontainer/api": "^1.1.8",
"diff": "~7.0.0",
"emoji-regex": "~10.4.0",
"fast-glob": "~3.3.2",
"fflate": "^0.8.2",
"html-entities": "~2.5.2",
"jsdom": "~26.0.0",
"marked": "~15.0.0",
"mermaid": "^11.0.0",
"shiki": "^3.0.0"
"shiki": "^3.0.0",
"tinyglobby": "^0.2.12"
},
"exports": {
"./styles/*": {
Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/examples/stackblitz/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ts_library(
"//adev/shared-docs/pipeline/guides",
"@npm//@types/jsdom",
"@npm//@types/node",
"@npm//fast-glob",
"@npm//jsdom",
"@npm//tinyglobby",
],
)

Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/examples/stackblitz/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {join} from 'path';
import {readFile} from 'fs/promises';
import {copyFolder, createFolder, removeFolder} from '../shared/file-system';
import jsdom from 'jsdom';
import {glob} from 'fast-glob';
import {glob} from 'tinyglobby';
import {regionParser} from '../../guides/extensions/docs-code/regions/region-parser';
import {appendCopyrightToFile} from '../shared/copyright';
import {FileType} from '../../guides/extensions/docs-code/sanitizers/eslint';
Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/examples/zip/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ts_library(
"//adev/shared-docs/pipeline/examples/shared",
"//adev/shared-docs/pipeline/guides",
"@npm//@types/node",
"@npm//fast-glob",
"@npm//fflate",
"@npm//tinyglobby",
],
)

Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/examples/zip/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {join} from 'path';
import {readFile} from 'fs/promises';
import {copyFolder, createFolder} from '../shared/file-system';
import {glob} from 'fast-glob';
import glob from 'tinyglobby';
import {regionParser} from '../../guides/extensions/docs-code/regions/region-parser';
import {appendCopyrightToFile} from '../shared/copyright';
import {FileType} from '../../guides/extensions/docs-code/sanitizers/eslint';
Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/navigation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ts_library(
"//adev/shared-docs/interfaces",
"@npm//@types/node",
"@npm//@webcontainer/api",
"@npm//fast-glob",
"@npm//tinyglobby",
],
)

Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/tutorials/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ts_library(
"//adev/shared-docs/interfaces",
"@npm//@types/node",
"@npm//@webcontainer/api",
"@npm//fast-glob",
"@npm//tinyglobby",
],
)

Expand Down
4 changes: 2 additions & 2 deletions adev/shared-docs/pipeline/tutorials/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {join, dirname} from 'path';
import {glob} from 'fast-glob';
import {join} from 'path';
import {glob} from 'tinyglobby';
import {
FileAndContentRecord,
PackageJson,
Expand Down
2 changes: 1 addition & 1 deletion adev/shared-docs/pipeline/tutorials/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {glob} from 'fast-glob';
import {glob} from 'tinyglobby';
import {FileAndContentRecord, TutorialConfig} from '../../interfaces';
import {dirname, join} from 'path';
import {existsSync, readFileSync} from 'fs';
Expand Down
4 changes: 2 additions & 2 deletions integration/ng_update_migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@types/node": "file:../../node_modules/@types/node",
"chalk": "2.4.2",
"diff": "4.0.1",
"glob": "7.1.4",
"tinyglobby": "^0.2.12",
"jasmine-core": "3.4.0",
"jasmine-spec-reporter": "4.2.1",
"typescript": "file:../../node_modules/typescript"
}
}
}
4 changes: 2 additions & 2 deletions integration/ng_update_migrations/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
const path = require('path');
const fs = require('fs');
const child_process = require('child_process');
const glob = require('fast-glob');
const {globSync} = require('tinyglobby');
const chalk = require('chalk');
const diff = require('diff');

const projectDir = __dirname;
const cliBinPath = path.join(projectDir, 'node_modules/@angular/cli/bin/ng');

const expectationFiles = glob.sync('**/*_expected.+(ts|html)', {cwd: projectDir});
const expectationFiles = globSync('**/*_expected.+(ts|html)', {cwd: projectDir});

const fromVersion = '12.0.0';
const toVersion = '13.0.0';
Expand Down
Loading

0 comments on commit 45f899a

Please sign in to comment.