-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
replacements.ts
71 lines (65 loc) · 2.38 KB
/
replacements.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
62
63
64
65
66
67
68
69
70
71
import replacementGroupsJson from '../../../data/replacements.json';
import type { Preset } from '../types';
import type { PresetTemplate, Replacement } from './auto-generate-replacements';
import { addPresets } from './auto-generate-replacements';
const { $schema, ...replacementPresets } = replacementGroupsJson;
/* eslint sort-keys: ["error", "asc", {"caseSensitive": false, "natural": true}] */
export const presets: Record<string, Preset> = replacementPresets;
const muiReplacement: Replacement[] = [
[['@material-ui/codemod'], '@mui/codemod'],
[['@material-ui/core'], '@mui/material'],
[['@material-ui/icons'], '@mui/icons-material'],
[['@material-ui/lab'], '@mui/lab'],
[['@material-ui/private-theming'], '@mui/private-theming'],
[['@material-ui/styled-engine'], '@mui/styled-engine'],
[['@material-ui/styled-engine-sc'], '@mui/styled-engine-sc'],
[['@material-ui/styles'], '@mui/styles'],
[['@material-ui/system'], '@mui/system'],
[['@material-ui/types'], '@mui/types'],
[['@material-ui/unstyled'], '@mui/core'],
];
const mui: PresetTemplate = {
description:
'The `material-ui` monorepo org was renamed from `@material-ui` to `@mui`.',
packageRules: [
{
matchCurrentVersion: '>=4.0.0 <5.0.0',
matchDatasources: ['npm'],
replacements: muiReplacement,
replacementVersion: '5.0.0',
},
],
title: 'material-ui-to-mui',
};
const messageFormat: PresetTemplate = {
description:
'The `messageformat` monorepo package naming scheme changed from `messageFormat-{{package}}` to `@messageformat/{{package}}`.',
packageRules: [
{
matchCurrentVersion: '>=2.0.0 <3.0.0',
matchDatasources: ['npm'],
replacements: [
[['messageformat-cli'], '@messageformat/cli'],
[['messageformat'], '@messageformat/core'],
],
replacementVersion: '3.0.0',
},
{
matchCurrentVersion: '>=0.4.0 <1.0.0',
matchDatasources: ['npm'],
replacements: [
[['messageformat-convert'], '@messageformat/convert'],
[['react-message-context'], '@messageformat/react'],
],
replacementVersion: '1.0.0',
},
{
matchCurrentVersion: '>=4.0.0 <5.0.0',
matchDatasources: ['npm'],
replacements: [[['messageformat-parser'], '@messageformat/parser']],
replacementVersion: '5.0.0',
},
],
title: 'messageFormat-to-scoped',
};
addPresets(presets, messageFormat, mui);