-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.ts
61 lines (55 loc) Β· 1.59 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import {Plugin, Project, SettingsType} from '@yarnpkg/core';
import {PortablePath} from '@yarnpkg/fslib';
import {PatchFetcher} from './PatchFetcher';
import {PatchResolver} from './PatchResolver';
import PatchCommitCommand from './commands/patchCommit';
import PatchCommand from './commands/patch';
import * as patchUtils from './patchUtils';
export {PatchFetcher};
export {PatchResolver};
export {PatchCommitCommand};
export {PatchCommand};
export {patchUtils};
export interface Hooks {
/**
* Registers a builtin patch that can be referenced using the dedicated
* syntax: `patch:builtin<name>`. This is for instance how the TypeScript
* patch is automatically registered.
*/
getBuiltinPatch?: (
project: Project,
name: string,
) => Promise<string | null | void>;
}
declare module '@yarnpkg/core' {
interface ConfigurationValueMap {
enableInlineHunks: boolean;
patchFolder: PortablePath;
}
}
const plugin: Plugin = {
configuration: {
enableInlineHunks: {
description: `If true, the installs will print unmatched patch hunks`,
type: SettingsType.BOOLEAN,
default: false,
},
patchFolder: {
description: `Folder where the patch files must be written`,
type: SettingsType.ABSOLUTE_PATH,
default: `./.yarn/patches`,
},
},
commands: [
PatchCommitCommand,
PatchCommand,
],
fetchers: [
PatchFetcher,
],
resolvers: [
PatchResolver,
],
};
// eslint-disable-next-line arca/no-default-export
export default plugin;