mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 05:34:21 +08:00
This reverts commit2b4a9df2d9. Reason for revert: subsequent presubmit uploads should be fixed now. Original change's description: > Revert "Reland "Update stylelint to 14.0.1"" > > This reverts commitf2ea2c940d. > > Reason for revert: https://ci.chromium.org/ui/p/devtools-frontend/builders/try/dtf_presubmit_linux/b8831129368825517985/overview > > Original change's description: > > Reland "Update stylelint to 14.0.1" > > > > This reverts commit6c0f161c95. > > > > Reason for revert: the prerequisite CL (https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259703) has landed > > > > Original change's description: > > > Revert "Update stylelint to 14.0.1" > > > > > > This reverts commit1e08ee816b. > > > > > > Reason for revert: tree is closed due to errors https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Linux/8169/overview > > > > > > Original change's description: > > > > Update stylelint to 14.0.1 > > > > > > > > This also upgrades PostCSS to 8.3.11. > > > > > > > > DISABLE_THIRD_PARTY_CHECK=Updating Stylelint configuration > > > > R=szuend@chromium.org > > > > > > > > Bug: none > > > > Change-Id: I606540b03509d7c6e73f3d490327cd4174e03d31 > > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259541 > > > > Reviewed-by: Simon Zünd <szuend@chromium.org> > > > > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> > > > > > > Bug: none > > > Change-Id: Icb1c02b41dbccc3b4fc5760f5dd0b78eca078b61 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3263399 > > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > > > Owners-Override: Alex Rudenko <alexrudenko@chromium.org> > > > Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> > > > > DISABLE_THIRD_PARTY_CHECK=Updating Stylelint configuration > > > > Bug: none > > Change-Id: If132a67ee4253d27114caedd66c5ee61c774a6c7 > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264206 > > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> > > Reviewed-by: Simon Zünd <szuend@chromium.org> > > Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> > > Bug: none > Change-Id: Idc6c9f5cc1e225c752799461eb0344e94b4ad1e5 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264222 > Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> DISABLE_THIRD_PARTY_CHECK=Updating Stylelint configuration Bug: none Change-Id: I609941d48b46bfcf454b03dcc75a76d460fbe674 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264223 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
187 lines
5.9 KiB
TypeScript
187 lines
5.9 KiB
TypeScript
import {Options as FastGlobOptions, Entry as FastGlobEntry} from 'fast-glob';
|
|
|
|
declare namespace globby {
|
|
type ExpandDirectoriesOption =
|
|
| boolean
|
|
| readonly string[]
|
|
| {files?: readonly string[]; extensions?: readonly string[]};
|
|
|
|
type Entry = FastGlobEntry;
|
|
|
|
interface GlobbyOptions extends FastGlobOptions {
|
|
/**
|
|
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below.
|
|
|
|
Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.
|
|
|
|
@default true
|
|
|
|
@example
|
|
```
|
|
import globby = require('globby');
|
|
|
|
(async () => {
|
|
const paths = await globby('images', {
|
|
expandDirectories: {
|
|
files: ['cat', 'unicorn', '*.jpg'],
|
|
extensions: ['png']
|
|
}
|
|
});
|
|
|
|
console.log(paths);
|
|
//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
|
|
})();
|
|
```
|
|
*/
|
|
readonly expandDirectories?: ExpandDirectoriesOption;
|
|
|
|
/**
|
|
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
|
|
|
|
@default false
|
|
*/
|
|
readonly gitignore?: boolean;
|
|
}
|
|
|
|
interface GlobTask {
|
|
readonly pattern: string;
|
|
readonly options: GlobbyOptions;
|
|
}
|
|
|
|
interface GitignoreOptions {
|
|
readonly cwd?: string;
|
|
readonly ignore?: readonly string[];
|
|
}
|
|
|
|
type FilterFunction = (path: string) => boolean;
|
|
}
|
|
|
|
interface Gitignore {
|
|
/**
|
|
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
|
|
*/
|
|
sync: (options?: globby.GitignoreOptions) => globby.FilterFunction;
|
|
|
|
/**
|
|
`.gitignore` files matched by the ignore config are not used for the resulting filter function.
|
|
|
|
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
|
|
|
|
@example
|
|
```
|
|
import {gitignore} from 'globby';
|
|
|
|
(async () => {
|
|
const isIgnored = await gitignore();
|
|
console.log(isIgnored('some/file'));
|
|
})();
|
|
```
|
|
*/
|
|
(options?: globby.GitignoreOptions): Promise<globby.FilterFunction>;
|
|
}
|
|
|
|
declare const globby: {
|
|
/**
|
|
Find files and directories using glob patterns.
|
|
|
|
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
|
|
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
@returns The matching paths.
|
|
*/
|
|
sync: ((
|
|
patterns: string | readonly string[],
|
|
options: globby.GlobbyOptions & {objectMode: true}
|
|
) => globby.Entry[]) & ((
|
|
patterns: string | readonly string[],
|
|
options?: globby.GlobbyOptions
|
|
) => string[]);
|
|
|
|
/**
|
|
Find files and directories using glob patterns.
|
|
|
|
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
|
|
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
@returns The stream of matching paths.
|
|
|
|
@example
|
|
```
|
|
import globby = require('globby');
|
|
|
|
(async () => {
|
|
for await (const path of globby.stream('*.tmp')) {
|
|
console.log(path);
|
|
}
|
|
})();
|
|
```
|
|
*/
|
|
stream: (
|
|
patterns: string | readonly string[],
|
|
options?: globby.GlobbyOptions
|
|
) => NodeJS.ReadableStream;
|
|
|
|
/**
|
|
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
|
|
|
|
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
@returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
|
|
*/
|
|
generateGlobTasks: (
|
|
patterns: string | readonly string[],
|
|
options?: globby.GlobbyOptions
|
|
) => globby.GlobTask[];
|
|
|
|
/**
|
|
Note that the options affect the results.
|
|
|
|
This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options).
|
|
|
|
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3).
|
|
@returns Whether there are any special glob characters in the `patterns`.
|
|
*/
|
|
hasMagic: (
|
|
patterns: string | readonly string[],
|
|
options?: FastGlobOptions
|
|
) => boolean;
|
|
|
|
readonly gitignore: Gitignore;
|
|
|
|
(
|
|
patterns: string | readonly string[],
|
|
options: globby.GlobbyOptions & {objectMode: true}
|
|
): Promise<globby.Entry[]>;
|
|
|
|
/**
|
|
Find files and directories using glob patterns.
|
|
|
|
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
|
|
|
|
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
|
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
|
|
@returns The matching paths.
|
|
|
|
@example
|
|
```
|
|
import globby = require('globby');
|
|
|
|
(async () => {
|
|
const paths = await globby(['*', '!cake']);
|
|
|
|
console.log(paths);
|
|
//=> ['unicorn', 'rainbow']
|
|
})();
|
|
```
|
|
*/
|
|
(
|
|
patterns: string | readonly string[],
|
|
options?: globby.GlobbyOptions
|
|
): Promise<string[]>;
|
|
};
|
|
|
|
export = globby;
|