@openrewrite/recipes-react 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/migration/change-component-prop-value.d.ts.map +1 -1
- package/dist/migration/change-component-prop-value.js +14 -4
- package/dist/migration/change-component-prop-value.js.map +1 -1
- package/dist/mui/adapt-v4-theme.d.ts +8 -0
- package/dist/mui/adapt-v4-theme.d.ts.map +1 -0
- package/dist/mui/adapt-v4-theme.js +65 -0
- package/dist/mui/adapt-v4-theme.js.map +1 -0
- package/dist/mui/add-component-prop.d.ts +18 -0
- package/dist/mui/add-component-prop.d.ts.map +1 -0
- package/dist/mui/add-component-prop.js +53 -0
- package/dist/mui/add-component-prop.js.map +1 -0
- package/dist/mui/add-emotion-prepend.d.ts +8 -0
- package/dist/mui/add-emotion-prepend.d.ts.map +1 -0
- package/dist/mui/add-emotion-prepend.js +71 -0
- package/dist/mui/add-emotion-prepend.js.map +1 -0
- package/dist/mui/change-module-specifier.d.ts +14 -0
- package/dist/mui/change-module-specifier.d.ts.map +1 -0
- package/dist/mui/change-module-specifier.js +95 -0
- package/dist/mui/change-module-specifier.js.map +1 -0
- package/dist/mui/convert-mui-imports.d.ts +14 -0
- package/dist/mui/convert-mui-imports.d.ts.map +1 -0
- package/dist/mui/convert-mui-imports.js +195 -0
- package/dist/mui/convert-mui-imports.js.map +1 -0
- package/dist/mui/convert-prop-to-sx.d.ts +22 -0
- package/dist/mui/convert-prop-to-sx.d.ts.map +1 -0
- package/dist/mui/convert-prop-to-sx.js +99 -0
- package/dist/mui/convert-prop-to-sx.js.map +1 -0
- package/dist/mui/index.d.ts +32 -0
- package/dist/mui/index.d.ts.map +1 -0
- package/dist/mui/index.js +67 -0
- package/dist/mui/index.js.map +1 -0
- package/dist/mui/jsx-attributes.d.ts +27 -0
- package/dist/mui/jsx-attributes.d.ts.map +1 -0
- package/dist/mui/jsx-attributes.js +140 -0
- package/dist/mui/jsx-attributes.js.map +1 -0
- package/dist/mui/mark-manual-migration.d.ts +16 -0
- package/dist/mui/mark-manual-migration.d.ts.map +1 -0
- package/dist/mui/mark-manual-migration.js +73 -0
- package/dist/mui/mark-manual-migration.js.map +1 -0
- package/dist/mui/mark-palette-mode-usage.d.ts +12 -0
- package/dist/mui/mark-palette-mode-usage.d.ts.map +1 -0
- package/dist/mui/mark-palette-mode-usage.js +50 -0
- package/dist/mui/mark-palette-mode-usage.js.map +1 -0
- package/dist/mui/move-component-prop-to-slot.d.ts +22 -0
- package/dist/mui/move-component-prop-to-slot.d.ts.map +1 -0
- package/dist/mui/move-component-prop-to-slot.js +87 -0
- package/dist/mui/move-component-prop-to-slot.js.map +1 -0
- package/dist/mui/move-primary-text-to-children.d.ts +12 -0
- package/dist/mui/move-primary-text-to-children.d.ts.map +1 -0
- package/dist/mui/move-primary-text-to-children.js +52 -0
- package/dist/mui/move-primary-text-to-children.js.map +1 -0
- package/dist/mui/move-system-props-to-sx.d.ts +16 -0
- package/dist/mui/move-system-props-to-sx.d.ts.map +1 -0
- package/dist/mui/move-system-props-to-sx.js +122 -0
- package/dist/mui/move-system-props-to-sx.js.map +1 -0
- package/dist/mui/mui-components.d.ts +8 -0
- package/dist/mui/mui-components.d.ts.map +1 -0
- package/dist/mui/mui-components.js +41 -0
- package/dist/mui/mui-components.js.map +1 -0
- package/dist/mui/mui-tag-visitor.d.ts +5 -0
- package/dist/mui/mui-tag-visitor.d.ts.map +1 -0
- package/dist/mui/mui-tag-visitor.js +54 -0
- package/dist/mui/mui-tag-visitor.js.map +1 -0
- package/dist/mui/pre-v5-recipe.d.ts +14 -0
- package/dist/mui/pre-v5-recipe.d.ts.map +1 -0
- package/dist/mui/pre-v5-recipe.js +88 -0
- package/dist/mui/pre-v5-recipe.js.map +1 -0
- package/dist/mui/remove-component-prop.d.ts +18 -0
- package/dist/mui/remove-component-prop.d.ts.map +1 -0
- package/dist/mui/remove-component-prop.js +55 -0
- package/dist/mui/remove-component-prop.js.map +1 -0
- package/dist/mui/remove-root-ref.d.ts +8 -0
- package/dist/mui/remove-root-ref.d.ts.map +1 -0
- package/dist/mui/remove-root-ref.js +61 -0
- package/dist/mui/remove-root-ref.js.map +1 -0
- package/dist/mui/remove-spacing-px-suffix.d.ts +8 -0
- package/dist/mui/remove-spacing-px-suffix.d.ts.map +1 -0
- package/dist/mui/remove-spacing-px-suffix.js +62 -0
- package/dist/mui/remove-spacing-px-suffix.js.map +1 -0
- package/dist/mui/rename-component-prop.d.ts +20 -0
- package/dist/mui/rename-component-prop.d.ts.map +1 -0
- package/dist/mui/rename-component-prop.js +66 -0
- package/dist/mui/rename-component-prop.js.map +1 -0
- package/dist/mui/rename-joy-css-variables.d.ts +8 -0
- package/dist/mui/rename-joy-css-variables.d.ts.map +1 -0
- package/dist/mui/rename-joy-css-variables.js +51 -0
- package/dist/mui/rename-joy-css-variables.js.map +1 -0
- package/dist/mui/rename-theme-palette-type.d.ts +8 -0
- package/dist/mui/rename-theme-palette-type.d.ts.map +1 -0
- package/dist/mui/rename-theme-palette-type.js +61 -0
- package/dist/mui/rename-theme-palette-type.js.map +1 -0
- package/dist/mui/replace-box-border-radius.d.ts +10 -0
- package/dist/mui/replace-box-border-radius.d.ts.map +1 -0
- package/dist/mui/replace-box-border-radius.js +50 -0
- package/dist/mui/replace-box-border-radius.js.map +1 -0
- package/dist/mui/replace-breakpoints-width.d.ts +8 -0
- package/dist/mui/replace-breakpoints-width.d.ts.map +1 -0
- package/dist/mui/replace-breakpoints-width.js +46 -0
- package/dist/mui/replace-breakpoints-width.js.map +1 -0
- package/dist/mui/replace-component-class.d.ts +18 -0
- package/dist/mui/replace-component-class.d.ts.map +1 -0
- package/dist/mui/replace-component-class.js +126 -0
- package/dist/mui/replace-component-class.js.map +1 -0
- package/dist/mui/replace-components-with-slots.d.ts +14 -0
- package/dist/mui/replace-components-with-slots.d.ts.map +1 -0
- package/dist/mui/replace-components-with-slots.js +69 -0
- package/dist/mui/replace-components-with-slots.js.map +1 -0
- package/dist/mui/replace-import-paths.d.ts +14 -0
- package/dist/mui/replace-import-paths.d.ts.map +1 -0
- package/dist/mui/replace-import-paths.js +101 -0
- package/dist/mui/replace-import-paths.js.map +1 -0
- package/dist/mui/replace-in-string-literals.d.ts +15 -0
- package/dist/mui/replace-in-string-literals.d.ts.map +1 -0
- package/dist/mui/replace-in-string-literals.js +62 -0
- package/dist/mui/replace-in-string-literals.js.map +1 -0
- package/dist/mui/replace-list-item-button-prop.d.ts +12 -0
- package/dist/mui/replace-list-item-button-prop.d.ts.map +1 -0
- package/dist/mui/replace-list-item-button-prop.js +80 -0
- package/dist/mui/replace-list-item-button-prop.js.map +1 -0
- package/dist/mui/replace-tabs-scroll-buttons.d.ts +8 -0
- package/dist/mui/replace-tabs-scroll-buttons.d.ts.map +1 -0
- package/dist/mui/replace-tabs-scroll-buttons.js +41 -0
- package/dist/mui/replace-tabs-scroll-buttons.js.map +1 -0
- package/dist/mui/replace-theme-color-functions.d.ts +8 -0
- package/dist/mui/replace-theme-color-functions.d.ts.map +1 -0
- package/dist/mui/replace-theme-color-functions.js +72 -0
- package/dist/mui/replace-theme-color-functions.js.map +1 -0
- package/dist/mui/replace-theme-spacing-unit.d.ts +8 -0
- package/dist/mui/replace-theme-spacing-unit.d.ts.map +1 -0
- package/dist/mui/replace-theme-spacing-unit.js +77 -0
- package/dist/mui/replace-theme-spacing-unit.js.map +1 -0
- package/dist/mui/replace-typography-round.d.ts +8 -0
- package/dist/mui/replace-typography-round.d.ts.map +1 -0
- package/dist/mui/replace-typography-round.js +44 -0
- package/dist/mui/replace-typography-round.js.map +1 -0
- package/dist/mui/shift-hidden-down-props.d.ts +10 -0
- package/dist/mui/shift-hidden-down-props.d.ts.map +1 -0
- package/dist/mui/shift-hidden-down-props.js +49 -0
- package/dist/mui/shift-hidden-down-props.js.map +1 -0
- package/dist/mui/theme-access.d.ts +5 -0
- package/dist/mui/theme-access.d.ts.map +1 -0
- package/dist/mui/theme-access.js +21 -0
- package/dist/mui/theme-access.js.map +1 -0
- package/dist/mui/update-theme-breakpoints.d.ts +10 -0
- package/dist/mui/update-theme-breakpoints.d.ts.map +1 -0
- package/dist/mui/update-theme-breakpoints.js +58 -0
- package/dist/mui/update-theme-breakpoints.js.map +1 -0
- package/dist/mui/upgrade-grid-props.d.ts +16 -0
- package/dist/mui/upgrade-grid-props.d.ts.map +1 -0
- package/dist/mui/upgrade-grid-props.js +90 -0
- package/dist/mui/upgrade-grid-props.js.map +1 -0
- package/dist/react19/use-context-hook.d.ts.map +1 -1
- package/dist/react19/use-context-hook.js +2 -0
- package/dist/react19/use-context-hook.js.map +1 -1
- package/dist/search/find-enzyme-usage.d.ts +4 -0
- package/dist/search/find-enzyme-usage.d.ts.map +1 -1
- package/dist/search/find-enzyme-usage.js +91 -7
- package/dist/search/find-enzyme-usage.js.map +1 -1
- package/dist/testing/enzyme-host-components.d.ts +12 -0
- package/dist/testing/enzyme-host-components.d.ts.map +1 -1
- package/dist/testing/enzyme-host-components.js +100 -0
- package/dist/testing/enzyme-host-components.js.map +1 -1
- package/dist/testing/enzyme-render-blockers.d.ts +13 -4
- package/dist/testing/enzyme-render-blockers.d.ts.map +1 -1
- package/dist/testing/enzyme-render-blockers.js +162 -6
- package/dist/testing/enzyme-render-blockers.js.map +1 -1
- package/dist/testing/enzyme-to-react-testing-library.d.ts +9 -2
- package/dist/testing/enzyme-to-react-testing-library.d.ts.map +1 -1
- package/dist/testing/enzyme-to-react-testing-library.js +163 -16
- package/dist/testing/enzyme-to-react-testing-library.js.map +1 -1
- package/dist/testing/enzyme-usage.d.ts +7 -0
- package/dist/testing/enzyme-usage.d.ts.map +1 -1
- package/dist/testing/enzyme-usage.js +8 -1
- package/dist/testing/enzyme-usage.js.map +1 -1
- package/dist/testing/enzyme-wrapper-scope.d.ts +8 -5
- package/dist/testing/enzyme-wrapper-scope.d.ts.map +1 -1
- package/dist/testing/enzyme-wrapper-scope.js +16 -4
- package/dist/testing/enzyme-wrapper-scope.js.map +1 -1
- package/dist/zustand/redux-stores.d.ts +2 -0
- package/dist/zustand/redux-stores.d.ts.map +1 -1
- package/dist/zustand/redux-stores.js +120 -6
- package/dist/zustand/redux-stores.js.map +1 -1
- package/dist/zustand/redux-to-zustand.d.ts.map +1 -1
- package/dist/zustand/redux-to-zustand.js +10 -4
- package/dist/zustand/redux-to-zustand.js.map +1 -1
- package/dist/zustand/zustand-plan.d.ts +7 -0
- package/dist/zustand/zustand-plan.d.ts.map +1 -1
- package/dist/zustand/zustand-plan.js +141 -21
- package/dist/zustand/zustand-plan.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +10 -0
- package/src/migration/change-component-prop-value.ts +19 -8
- package/src/mui/adapt-v4-theme.ts +43 -0
- package/src/mui/add-component-prop.ts +43 -0
- package/src/mui/add-emotion-prepend.ts +48 -0
- package/src/mui/change-module-specifier.ts +71 -0
- package/src/mui/convert-mui-imports.ts +184 -0
- package/src/mui/convert-prop-to-sx.ts +89 -0
- package/src/mui/index.ts +31 -0
- package/src/mui/jsx-attributes.ts +133 -0
- package/src/mui/mark-manual-migration.ts +53 -0
- package/src/mui/mark-palette-mode-usage.ts +36 -0
- package/src/mui/move-component-prop-to-slot.ts +84 -0
- package/src/mui/move-primary-text-to-children.ts +41 -0
- package/src/mui/move-system-props-to-sx.ts +118 -0
- package/src/mui/mui-components.ts +40 -0
- package/src/mui/mui-tag-visitor.ts +36 -0
- package/src/mui/pre-v5-recipe.ts +82 -0
- package/src/mui/remove-component-prop.ts +43 -0
- package/src/mui/remove-root-ref.ts +41 -0
- package/src/mui/remove-spacing-px-suffix.ts +43 -0
- package/src/mui/rename-component-prop.ts +55 -0
- package/src/mui/rename-joy-css-variables.ts +41 -0
- package/src/mui/rename-theme-palette-type.ts +42 -0
- package/src/mui/replace-box-border-radius.ts +42 -0
- package/src/mui/replace-breakpoints-width.ts +28 -0
- package/src/mui/replace-component-class.ts +97 -0
- package/src/mui/replace-components-with-slots.ts +61 -0
- package/src/mui/replace-import-paths.ts +100 -0
- package/src/mui/replace-in-string-literals.ts +44 -0
- package/src/mui/replace-list-item-button-prop.ts +59 -0
- package/src/mui/replace-tabs-scroll-buttons.ts +31 -0
- package/src/mui/replace-theme-color-functions.ts +55 -0
- package/src/mui/replace-theme-spacing-unit.ts +59 -0
- package/src/mui/replace-typography-round.ts +29 -0
- package/src/mui/shift-hidden-down-props.ts +44 -0
- package/src/mui/theme-access.ts +18 -0
- package/src/mui/update-theme-breakpoints.ts +47 -0
- package/src/mui/upgrade-grid-props.ts +82 -0
- package/src/react19/use-context-hook.ts +2 -0
- package/src/search/find-enzyme-usage.ts +80 -7
- package/src/testing/enzyme-host-components.ts +110 -0
- package/src/testing/enzyme-render-blockers.ts +174 -9
- package/src/testing/enzyme-to-react-testing-library.ts +159 -25
- package/src/testing/enzyme-usage.ts +13 -0
- package/src/testing/enzyme-wrapper-scope.ts +27 -6
- package/src/zustand/redux-stores.ts +119 -5
- package/src/zustand/redux-to-zustand.ts +12 -5
- package/src/zustand/zustand-plan.ts +159 -18
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ConvertMuiImports = void 0;
|
|
19
|
+
const rewrite_1 = require("@openrewrite/rewrite");
|
|
20
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
21
|
+
const java_1 = require("@openrewrite/rewrite/java");
|
|
22
|
+
const mui_components_1 = require("./mui-components");
|
|
23
|
+
const STYLES = new Set(["StyledEngineProvider", "THEME_ID", "ThemeProvider", "adaptV4Theme", "alpha", "createColorScheme", "createStyles",
|
|
24
|
+
"createTheme", "createMuiTheme", "createTransitions", "css", "darken", "decomposeColor", "duration", "easing", "emphasize", "experimental_extendTheme",
|
|
25
|
+
"experimental_sx", "extendTheme", "getContrastRatio", "getLuminance", "getOverlayAlpha", "hexToRgb", "hslToRgb", "keyframes", "lighten",
|
|
26
|
+
"makeStyles", "recomposeColor", "responsiveFontSizes", "rgbToHex", "shouldSkipGeneratingVar", "styled", "useTheme", "useThemeProps",
|
|
27
|
+
"withStyles", "withTheme", "CssVarsProvider", "Experimental_CssVarsProvider", "getInitColorSchemeScript", "useColorScheme"]);
|
|
28
|
+
function parse(statement) {
|
|
29
|
+
var _a, _b, _c, _d;
|
|
30
|
+
const specifier = (_a = statement.moduleSpecifier) === null || _a === void 0 ? void 0 : _a.element;
|
|
31
|
+
const clause = statement.importClause;
|
|
32
|
+
if ((specifier === null || specifier === void 0 ? void 0 : specifier.kind) !== java_1.J.Kind.Literal || !clause || clause.typeOnly)
|
|
33
|
+
return undefined;
|
|
34
|
+
const literal = specifier;
|
|
35
|
+
const parsed = { statement, module: (0, javascript_1.moduleNameOf)(literal), quote: (_c = (_b = literal.valueSource) === null || _b === void 0 ? void 0 : _b.charAt(0)) !== null && _c !== void 0 ? _c : "'", defaultLocal: (_d = clause.name) === null || _d === void 0 ? void 0 : _d.element.simpleName, named: [], other: false };
|
|
36
|
+
const bindings = clause.namedBindings;
|
|
37
|
+
if (bindings && bindings.kind !== javascript_1.JS.Kind.NamedImports)
|
|
38
|
+
parsed.other = true;
|
|
39
|
+
if ((bindings === null || bindings === void 0 ? void 0 : bindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
40
|
+
for (const { element } of bindings.elements.elements) {
|
|
41
|
+
if (element.kind !== javascript_1.JS.Kind.ImportSpecifier) {
|
|
42
|
+
parsed.other = true;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const named = element.specifier;
|
|
46
|
+
const typeOnly = element.importType.element;
|
|
47
|
+
if ((0, java_1.isIdentifier)(named))
|
|
48
|
+
parsed.named.push({ imported: named.simpleName, local: named.simpleName, typeOnly });
|
|
49
|
+
else if (named.kind === javascript_1.JS.Kind.Alias && (0, java_1.isIdentifier)(named.alias)) {
|
|
50
|
+
const property = named.propertyName.element;
|
|
51
|
+
parsed.named.push({ imported: (0, java_1.isIdentifier)(property) ? property.simpleName : String(property.value), local: named.alias.simpleName, typeOnly });
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
parsed.other = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return parsed;
|
|
58
|
+
}
|
|
59
|
+
const spec = (s) => `${s.typeOnly ? "type " : ""}${s.imported === s.local ? s.local : `${s.imported} as ${s.local}`}`;
|
|
60
|
+
const importSource = (t, quote) => {
|
|
61
|
+
const parts = [t.defaultLocal, t.named.length ? `{ ${t.named.map(spec).join(", ")} }` : undefined].filter(Boolean).join(", ");
|
|
62
|
+
return `import ${parts} from ${quote}${t.module}${quote};`;
|
|
63
|
+
};
|
|
64
|
+
function build(cursor, like, source) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
return yield (0, javascript_1.template) `${(0, javascript_1.raw)(source)}`.apply(like, cursor);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
class ConvertMuiImports extends rewrite_1.Recipe {
|
|
70
|
+
constructor(options) {
|
|
71
|
+
super(options);
|
|
72
|
+
this.name = "org.openrewrite.react.mui.convert-mui-imports";
|
|
73
|
+
this.displayName = "Convert how Material UI is imported";
|
|
74
|
+
this.description = "Rewrites imports of a Material UI package between the package root and one module per component, or from private deep paths to public ones. Type-only imports and namespace imports are left alone.";
|
|
75
|
+
}
|
|
76
|
+
editor() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const mode = this.mode;
|
|
79
|
+
const packages = this.packageNames.split(",").map(s => s.trim()).filter(Boolean);
|
|
80
|
+
const alternatives = packages.map(mui_components_1.escapeRegExp).join("|");
|
|
81
|
+
const deep = new RegExp(`^(${alternatives})/((?:[^/]+/)*[^/]+)$`);
|
|
82
|
+
const optimal = new RegExp(`^(${alternatives})/([^/]+)/([^/]+)$`);
|
|
83
|
+
const replace = (p, firstTarget, index) => {
|
|
84
|
+
if (p.other || p.module.includes("internal/"))
|
|
85
|
+
return undefined;
|
|
86
|
+
const targets = new Map();
|
|
87
|
+
const target = (module) => { var _a; return (_a = targets.get(module)) !== null && _a !== void 0 ? _a : targets.set(module, { module, named: [] }).get(module); };
|
|
88
|
+
const kept = [];
|
|
89
|
+
if (mode === "path") {
|
|
90
|
+
const pkg = packages.find(x => x === p.module);
|
|
91
|
+
if (!pkg || p.defaultLocal || !p.named.length)
|
|
92
|
+
return undefined;
|
|
93
|
+
const material = pkg.endsWith("/material") || pkg.endsWith("/core");
|
|
94
|
+
for (const s of p.named) {
|
|
95
|
+
if (s.typeOnly)
|
|
96
|
+
kept.push(s);
|
|
97
|
+
else if (material && STYLES.has(s.imported))
|
|
98
|
+
target(`${pkg}/styles`).named.push(s);
|
|
99
|
+
else if (material && s.imported.endsWith("Classes") && s.imported !== "Classes") {
|
|
100
|
+
const base = s.imported.replace(/Classes$/, "");
|
|
101
|
+
target(`${pkg}/${base.charAt(0).toUpperCase()}${base.slice(1)}`).named.push(s);
|
|
102
|
+
}
|
|
103
|
+
else
|
|
104
|
+
target(`${pkg}/${s.imported}`).defaultLocal = s.local;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else if (mode === "top-level") {
|
|
108
|
+
const match = deep.exec(p.module);
|
|
109
|
+
if (!match)
|
|
110
|
+
return undefined;
|
|
111
|
+
const moduleName = match[2].split("/").pop();
|
|
112
|
+
if (p.defaultLocal) {
|
|
113
|
+
if (!/^[A-Z]/.test(moduleName))
|
|
114
|
+
return undefined;
|
|
115
|
+
target(match[1]).named.push({ imported: moduleName, local: p.defaultLocal, typeOnly: false });
|
|
116
|
+
}
|
|
117
|
+
for (const s of p.named)
|
|
118
|
+
target(match[1]).named.push(s);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
const match = optimal.exec(p.module);
|
|
122
|
+
if (!match)
|
|
123
|
+
return undefined;
|
|
124
|
+
if (p.defaultLocal)
|
|
125
|
+
target(`${match[1]}/${match[2]}`).named.push({ imported: match[3], local: p.defaultLocal, typeOnly: false });
|
|
126
|
+
for (const s of p.named)
|
|
127
|
+
target(`${match[1]}/${match[2]}`).named.push(s);
|
|
128
|
+
}
|
|
129
|
+
if (!targets.size)
|
|
130
|
+
return undefined;
|
|
131
|
+
const result = [...targets.values()];
|
|
132
|
+
if (kept.length)
|
|
133
|
+
result.push({ module: p.module, named: kept });
|
|
134
|
+
for (const t of result)
|
|
135
|
+
if (!firstTarget.has(t.module))
|
|
136
|
+
firstTarget.set(t.module, index);
|
|
137
|
+
return result;
|
|
138
|
+
};
|
|
139
|
+
return (0, rewrite_1.check)((0, rewrite_1.not)((0, javascript_1.isVendoredOrBundled)()), new class extends javascript_1.JavaScriptVisitor {
|
|
140
|
+
visitJsCompilationUnit(cu, ctx) {
|
|
141
|
+
const _super = Object.create(null, {
|
|
142
|
+
visitJsCompilationUnit: { get: () => super.visitJsCompilationUnit }
|
|
143
|
+
});
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const result = yield _super.visitJsCompilationUnit.call(this, cu, ctx);
|
|
146
|
+
const parsed = result.statements.map(s => s.element.kind === javascript_1.JS.Kind.Import ? parse(s.element) : undefined);
|
|
147
|
+
const firstTarget = new Map();
|
|
148
|
+
const replacements = parsed.map((p, i) => p && replace(p, firstTarget, i));
|
|
149
|
+
if (!replacements.some(Boolean))
|
|
150
|
+
return result;
|
|
151
|
+
const merged = new Map();
|
|
152
|
+
replacements.forEach((targets, i) => targets === null || targets === void 0 ? void 0 : targets.forEach(t => {
|
|
153
|
+
var _a;
|
|
154
|
+
const existing = merged.get(t.module);
|
|
155
|
+
if (!existing)
|
|
156
|
+
merged.set(t.module, Object.assign(Object.assign({}, t), { named: [...t.named] }));
|
|
157
|
+
else {
|
|
158
|
+
(_a = existing.defaultLocal) !== null && _a !== void 0 ? _a : (existing.defaultLocal = t.defaultLocal);
|
|
159
|
+
existing.named.push(...t.named.filter(n => !existing.named.some(e => e.imported === n.imported && e.local === n.local)));
|
|
160
|
+
}
|
|
161
|
+
}));
|
|
162
|
+
const statements = [];
|
|
163
|
+
for (let i = 0; i < result.statements.length; i++) {
|
|
164
|
+
const statement = result.statements[i];
|
|
165
|
+
const p = parsed[i];
|
|
166
|
+
const targets = replacements[i];
|
|
167
|
+
if (!p || !targets) {
|
|
168
|
+
statements.push(statement);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
let first = true;
|
|
172
|
+
for (const t of targets) {
|
|
173
|
+
if (firstTarget.get(t.module) !== i)
|
|
174
|
+
continue;
|
|
175
|
+
const node = yield build(new rewrite_1.Cursor(statement.element, this.cursor), p.statement, importSource(merged.get(t.module), p.quote));
|
|
176
|
+
const prefix = first ? p.statement.prefix : Object.assign(Object.assign({}, p.statement.prefix), { comments: [], whitespace: "\n" });
|
|
177
|
+
statements.push(Object.assign(Object.assign({}, statement), { element: Object.assign(Object.assign({}, node), { prefix }) }));
|
|
178
|
+
first = false;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return Object.assign(Object.assign({}, result), { statements });
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}());
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.ConvertMuiImports = ConvertMuiImports;
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, rewrite_1.Option)({ displayName: "Mode", description: "`path` for one module per component, `top-level` for the package root, `optimal` for public module paths.", example: "path", valid: ["path", "top-level", "optimal"] })
|
|
191
|
+
], ConvertMuiImports.prototype, "mode", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, rewrite_1.Option)({ displayName: "Package names", description: "The packages to rewrite, separated by commas.", example: "@mui/material,@mui/icons-material" })
|
|
194
|
+
], ConvertMuiImports.prototype, "packageNames", void 0);
|
|
195
|
+
//# sourceMappingURL=convert-mui-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-mui-imports.js","sourceRoot":"","sources":["../../src/mui/convert-mui-imports.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAuG;AACvG,gEAAwH;AACxH,oDAA0D;AAC1D,qDAA8C;AAG9C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,EAAE,cAAc;IACrI,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B;IACtJ,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,iB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|
|
3
|
+
readonly name = "org.openrewrite.react.mui.convert-prop-to-sx";
|
|
4
|
+
readonly displayName: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
componentName: string;
|
|
7
|
+
propName: string;
|
|
8
|
+
sxProperty: string;
|
|
9
|
+
sxValue: string;
|
|
10
|
+
equivalents?: string;
|
|
11
|
+
packageName?: string;
|
|
12
|
+
constructor(options?: {
|
|
13
|
+
componentName?: string;
|
|
14
|
+
propName?: string;
|
|
15
|
+
sxProperty?: string;
|
|
16
|
+
sxValue?: string;
|
|
17
|
+
equivalents?: string;
|
|
18
|
+
packageName?: string;
|
|
19
|
+
});
|
|
20
|
+
editor(): Promise<TreeVisitor<any, ExecutionContext>>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=convert-prop-to-sx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-prop-to-sx.d.ts","sourceRoot":"","sources":["../../src/mui/convert-prop-to-sx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAU,MAAM,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAiCnF,qBAAa,eAAgB,SAAQ,MAAM;IACvC,QAAQ,CAAC,IAAI,kDAAkD;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAiD;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAgN;IAG5O,aAAa,EAAG,MAAM,CAAC;IAGvB,QAAQ,EAAG,MAAM,CAAC;IAGlB,UAAU,EAAG,MAAM,CAAC;IAGpB,OAAO,EAAG,MAAM,CAAC;IAGjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;gBAET,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;IAIhJ,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;CA4B9D"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ConvertPropToSx = void 0;
|
|
19
|
+
const rewrite_1 = require("@openrewrite/rewrite");
|
|
20
|
+
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
22
|
+
const jsx_attributes_1 = require("./jsx-attributes");
|
|
23
|
+
const mui_tag_visitor_1 = require("./mui-tag-visitor");
|
|
24
|
+
function withSpacedObject(attribute) {
|
|
25
|
+
const embedded = attribute.value.element;
|
|
26
|
+
const inner = embedded.expression.element;
|
|
27
|
+
let expression = inner;
|
|
28
|
+
if ((0, jsx_attributes_1.isObjectLiteral)(inner))
|
|
29
|
+
expression = (0, jsx_attributes_1.spaced)(inner);
|
|
30
|
+
else if (inner.kind === java_1.J.Kind.Ternary) {
|
|
31
|
+
const ternary = inner;
|
|
32
|
+
if ((0, jsx_attributes_1.isObjectLiteral)(ternary.truePart.element))
|
|
33
|
+
expression = Object.assign(Object.assign({}, ternary), { truePart: Object.assign(Object.assign({}, ternary.truePart), { element: (0, jsx_attributes_1.spaced)(ternary.truePart.element) }) });
|
|
34
|
+
}
|
|
35
|
+
return Object.assign(Object.assign({}, attribute), { value: Object.assign(Object.assign({}, attribute.value), { element: Object.assign(Object.assign({}, embedded), { expression: Object.assign(Object.assign({}, embedded.expression), { element: expression }) }) }) });
|
|
36
|
+
}
|
|
37
|
+
class ConvertPropToSx extends rewrite_1.Recipe {
|
|
38
|
+
constructor(options) {
|
|
39
|
+
super(options);
|
|
40
|
+
this.name = "org.openrewrite.react.mui.convert-prop-to-sx";
|
|
41
|
+
this.displayName = "Replace a component prop with an `sx` style";
|
|
42
|
+
this.description = "Replaces a prop of a Material UI component with a property of its `sx` prop, such as `<Divider light />` with `<Divider sx={{ opacity: '0.6' }} />`. The style is not added when the `sx` already sets it.";
|
|
43
|
+
}
|
|
44
|
+
editor() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a;
|
|
47
|
+
const { propName, sxProperty, sxValue } = this;
|
|
48
|
+
const keys = [sxProperty, ...((_a = this.equivalents) !== null && _a !== void 0 ? _a : "").split(",").map(k => k.trim()).filter(Boolean)];
|
|
49
|
+
return (0, mui_tag_visitor_1.muiTagEditor)(this.componentName, this.packageName, (tag, cursor) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const attribute = (0, jsx_attributes_1.findAttribute)(tag, propName);
|
|
51
|
+
if (!attribute)
|
|
52
|
+
return tag;
|
|
53
|
+
const value = (0, jsx_attributes_1.attributeExpression)(attribute);
|
|
54
|
+
if (value.kind === java_1.J.Kind.Literal && value.value === false)
|
|
55
|
+
return (0, jsx_attributes_1.replaceAttribute)(tag, attribute, undefined);
|
|
56
|
+
const always = !attribute.value || (value.kind === java_1.J.Kind.Literal && value.value === true);
|
|
57
|
+
const sx = (0, jsx_attributes_1.findAttribute)(tag, "sx");
|
|
58
|
+
const without = (0, jsx_attributes_1.replaceAttribute)(tag, attribute, undefined);
|
|
59
|
+
if (!sx) {
|
|
60
|
+
const source = always ? `{ ${sxProperty}: ${sxValue} }` : null;
|
|
61
|
+
const created = source
|
|
62
|
+
? yield (0, jsx_attributes_1.newAttribute)(cursor, tag, "sx", source.startsWith("{") ? `{${source}}` : source)
|
|
63
|
+
: yield (0, javascript_1.template) `<X sx={${value} ? ${(0, javascript_1.raw)(`{ ${sxProperty}: ${sxValue} }`)} : undefined} />`.apply(tag, cursor).then(p => p.attributes[0].element);
|
|
64
|
+
return (0, jsx_attributes_1.appendAttribute)(without, withSpacedObject(created));
|
|
65
|
+
}
|
|
66
|
+
const object = (0, jsx_attributes_1.attributeObject)(sx);
|
|
67
|
+
if (!object || !always)
|
|
68
|
+
return tag;
|
|
69
|
+
if (keys.some(k => (0, jsx_attributes_1.findProperty)(object, k)))
|
|
70
|
+
return without;
|
|
71
|
+
const property = yield (0, jsx_attributes_1.newPropertyFromSource)(cursor, tag, sxProperty, sxValue);
|
|
72
|
+
const updated = (0, jsx_attributes_1.appendProperty)(object, property);
|
|
73
|
+
const embedded = sx.value.element;
|
|
74
|
+
const replacement = Object.assign(Object.assign({}, sx), { value: Object.assign(Object.assign({}, sx.value), { element: Object.assign(Object.assign({}, embedded), { expression: Object.assign(Object.assign({}, embedded.expression), { element: updated }) }) }) });
|
|
75
|
+
return (0, jsx_attributes_1.replaceAttribute)((0, jsx_attributes_1.replaceAttribute)(tag, attribute, undefined), sx, replacement);
|
|
76
|
+
}));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.ConvertPropToSx = ConvertPropToSx;
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, rewrite_1.Option)({ displayName: "Component name", description: "The Material UI component.", example: "Divider" })
|
|
83
|
+
], ConvertPropToSx.prototype, "componentName", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, rewrite_1.Option)({ displayName: "Prop name", description: "The prop to replace.", example: "light" })
|
|
86
|
+
], ConvertPropToSx.prototype, "propName", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, rewrite_1.Option)({ displayName: "Style property", description: "The `sx` property that replaces it.", example: "opacity" })
|
|
89
|
+
], ConvertPropToSx.prototype, "sxProperty", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, rewrite_1.Option)({ displayName: "Style value", description: "The value of the property, as source code.", example: "'0.6'" })
|
|
92
|
+
], ConvertPropToSx.prototype, "sxValue", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, rewrite_1.Option)({ displayName: "Equivalent properties", description: "Other `sx` properties that already set the style, separated by commas.", example: "mb", required: false })
|
|
95
|
+
], ConvertPropToSx.prototype, "equivalents", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, rewrite_1.Option)({ displayName: "Package name", description: "A package that re-exports Material UI.", example: "@org/ui", required: false })
|
|
98
|
+
], ConvertPropToSx.prototype, "packageName", void 0);
|
|
99
|
+
//# sourceMappingURL=convert-prop-to-sx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-prop-to-sx.js","sourceRoot":"","sources":["../../src/mui/convert-prop-to-sx.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAmF;AACnF,oDAA4C;AAC5C,gEAAuE;AACvE,qDAG0B;AAC1B,uDAA+C;AAG/C,SAA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AE,EAAE,EAAE,WAAW,CAAC,CAAC;YAC1F,CAAC,CAAA,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AAvDD,0CAuDC;AAjDG;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,SAAS,EAAC,CAAC;sDAChF;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;iDACxE;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,qCAAqC,EAAE,OAAO,EAAE,SAAS,EAAC,CAAC;mDAC5F;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,4CAA4C,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;gDACjG;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,uBAAuB,EAAE,WAAW,EAAE,wEAAwE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;oDACjJ;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAC,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC;oDAC7G"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { AdaptV4Theme } from "./adapt-v4-theme";
|
|
2
|
+
export { AddComponentProp } from "./add-component-prop";
|
|
3
|
+
export { AddEmotionPrepend } from "./add-emotion-prepend";
|
|
4
|
+
export { ChangeModuleSpecifier } from "./change-module-specifier";
|
|
5
|
+
export { ConvertMuiImports } from "./convert-mui-imports";
|
|
6
|
+
export { ConvertPropToSx } from "./convert-prop-to-sx";
|
|
7
|
+
export { MarkManualMigration } from "./mark-manual-migration";
|
|
8
|
+
export { MarkPaletteModeUsage } from "./mark-palette-mode-usage";
|
|
9
|
+
export { MoveComponentPropToSlot } from "./move-component-prop-to-slot";
|
|
10
|
+
export { MovePrimaryTextToChildren } from "./move-primary-text-to-children";
|
|
11
|
+
export { MoveSystemPropsToSx } from "./move-system-props-to-sx";
|
|
12
|
+
export { RemoveComponentProp } from "./remove-component-prop";
|
|
13
|
+
export { RemoveRootRef } from "./remove-root-ref";
|
|
14
|
+
export { RemoveSpacingPxSuffix } from "./remove-spacing-px-suffix";
|
|
15
|
+
export { RenameComponentProp } from "./rename-component-prop";
|
|
16
|
+
export { RenameJoyCssVariables } from "./rename-joy-css-variables";
|
|
17
|
+
export { RenameThemePaletteType } from "./rename-theme-palette-type";
|
|
18
|
+
export { ReplaceBoxBorderRadius } from "./replace-box-border-radius";
|
|
19
|
+
export { ReplaceBreakpointsWidth } from "./replace-breakpoints-width";
|
|
20
|
+
export { ReplaceComponentClass } from "./replace-component-class";
|
|
21
|
+
export { ReplaceComponentsWithSlots } from "./replace-components-with-slots";
|
|
22
|
+
export { ReplaceSvgIconImports, ReplaceMaterialUiImportPaths } from "./replace-import-paths";
|
|
23
|
+
export { ReplaceInStringLiterals } from "./replace-in-string-literals";
|
|
24
|
+
export { ReplaceListItemButtonProp } from "./replace-list-item-button-prop";
|
|
25
|
+
export { ReplaceTabsScrollButtons } from "./replace-tabs-scroll-buttons";
|
|
26
|
+
export { ReplaceThemeColorFunctions } from "./replace-theme-color-functions";
|
|
27
|
+
export { ReplaceThemeSpacingUnit } from "./replace-theme-spacing-unit";
|
|
28
|
+
export { ReplaceTypographyRound } from "./replace-typography-round";
|
|
29
|
+
export { ShiftHiddenDownProps } from "./shift-hidden-down-props";
|
|
30
|
+
export { UpdateThemeBreakpoints } from "./update-theme-breakpoints";
|
|
31
|
+
export { UpgradeGridProps } from "./upgrade-grid-props";
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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C,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,wBAAwB,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpgradeGridProps = exports.UpdateThemeBreakpoints = exports.ShiftHiddenDownProps = exports.ReplaceTypographyRound = exports.ReplaceThemeSpacingUnit = exports.ReplaceThemeColorFunctions = exports.ReplaceTabsScrollButtons = exports.ReplaceListItemButtonProp = exports.ReplaceInStringLiterals = exports.ReplaceMaterialUiImportPaths = exports.ReplaceSvgIconImports = exports.ReplaceComponentsWithSlots = exports.ReplaceComponentClass = exports.ReplaceBreakpointsWidth = exports.ReplaceBoxBorderRadius = exports.RenameThemePaletteType = exports.RenameJoyCssVariables = exports.RenameComponentProp = exports.RemoveSpacingPxSuffix = exports.RemoveRootRef = exports.RemoveComponentProp = exports.MoveSystemPropsToSx = exports.MovePrimaryTextToChildren = exports.MoveComponentPropToSlot = exports.MarkPaletteModeUsage = exports.MarkManualMigration = exports.ConvertPropToSx = exports.ConvertMuiImports = exports.ChangeModuleSpecifier = exports.AddEmotionPrepend = exports.AddComponentProp = exports.AdaptV4Theme = void 0;
|
|
4
|
+
var adapt_v4_theme_1 = require("./adapt-v4-theme");
|
|
5
|
+
Object.defineProperty(exports, "AdaptV4Theme", { enumerable: true, get: function () { return adapt_v4_theme_1.AdaptV4Theme; } });
|
|
6
|
+
var add_component_prop_1 = require("./add-component-prop");
|
|
7
|
+
Object.defineProperty(exports, "AddComponentProp", { enumerable: true, get: function () { return add_component_prop_1.AddComponentProp; } });
|
|
8
|
+
var add_emotion_prepend_1 = require("./add-emotion-prepend");
|
|
9
|
+
Object.defineProperty(exports, "AddEmotionPrepend", { enumerable: true, get: function () { return add_emotion_prepend_1.AddEmotionPrepend; } });
|
|
10
|
+
var change_module_specifier_1 = require("./change-module-specifier");
|
|
11
|
+
Object.defineProperty(exports, "ChangeModuleSpecifier", { enumerable: true, get: function () { return change_module_specifier_1.ChangeModuleSpecifier; } });
|
|
12
|
+
var convert_mui_imports_1 = require("./convert-mui-imports");
|
|
13
|
+
Object.defineProperty(exports, "ConvertMuiImports", { enumerable: true, get: function () { return convert_mui_imports_1.ConvertMuiImports; } });
|
|
14
|
+
var convert_prop_to_sx_1 = require("./convert-prop-to-sx");
|
|
15
|
+
Object.defineProperty(exports, "ConvertPropToSx", { enumerable: true, get: function () { return convert_prop_to_sx_1.ConvertPropToSx; } });
|
|
16
|
+
var mark_manual_migration_1 = require("./mark-manual-migration");
|
|
17
|
+
Object.defineProperty(exports, "MarkManualMigration", { enumerable: true, get: function () { return mark_manual_migration_1.MarkManualMigration; } });
|
|
18
|
+
var mark_palette_mode_usage_1 = require("./mark-palette-mode-usage");
|
|
19
|
+
Object.defineProperty(exports, "MarkPaletteModeUsage", { enumerable: true, get: function () { return mark_palette_mode_usage_1.MarkPaletteModeUsage; } });
|
|
20
|
+
var move_component_prop_to_slot_1 = require("./move-component-prop-to-slot");
|
|
21
|
+
Object.defineProperty(exports, "MoveComponentPropToSlot", { enumerable: true, get: function () { return move_component_prop_to_slot_1.MoveComponentPropToSlot; } });
|
|
22
|
+
var move_primary_text_to_children_1 = require("./move-primary-text-to-children");
|
|
23
|
+
Object.defineProperty(exports, "MovePrimaryTextToChildren", { enumerable: true, get: function () { return move_primary_text_to_children_1.MovePrimaryTextToChildren; } });
|
|
24
|
+
var move_system_props_to_sx_1 = require("./move-system-props-to-sx");
|
|
25
|
+
Object.defineProperty(exports, "MoveSystemPropsToSx", { enumerable: true, get: function () { return move_system_props_to_sx_1.MoveSystemPropsToSx; } });
|
|
26
|
+
var remove_component_prop_1 = require("./remove-component-prop");
|
|
27
|
+
Object.defineProperty(exports, "RemoveComponentProp", { enumerable: true, get: function () { return remove_component_prop_1.RemoveComponentProp; } });
|
|
28
|
+
var remove_root_ref_1 = require("./remove-root-ref");
|
|
29
|
+
Object.defineProperty(exports, "RemoveRootRef", { enumerable: true, get: function () { return remove_root_ref_1.RemoveRootRef; } });
|
|
30
|
+
var remove_spacing_px_suffix_1 = require("./remove-spacing-px-suffix");
|
|
31
|
+
Object.defineProperty(exports, "RemoveSpacingPxSuffix", { enumerable: true, get: function () { return remove_spacing_px_suffix_1.RemoveSpacingPxSuffix; } });
|
|
32
|
+
var rename_component_prop_1 = require("./rename-component-prop");
|
|
33
|
+
Object.defineProperty(exports, "RenameComponentProp", { enumerable: true, get: function () { return rename_component_prop_1.RenameComponentProp; } });
|
|
34
|
+
var rename_joy_css_variables_1 = require("./rename-joy-css-variables");
|
|
35
|
+
Object.defineProperty(exports, "RenameJoyCssVariables", { enumerable: true, get: function () { return rename_joy_css_variables_1.RenameJoyCssVariables; } });
|
|
36
|
+
var rename_theme_palette_type_1 = require("./rename-theme-palette-type");
|
|
37
|
+
Object.defineProperty(exports, "RenameThemePaletteType", { enumerable: true, get: function () { return rename_theme_palette_type_1.RenameThemePaletteType; } });
|
|
38
|
+
var replace_box_border_radius_1 = require("./replace-box-border-radius");
|
|
39
|
+
Object.defineProperty(exports, "ReplaceBoxBorderRadius", { enumerable: true, get: function () { return replace_box_border_radius_1.ReplaceBoxBorderRadius; } });
|
|
40
|
+
var replace_breakpoints_width_1 = require("./replace-breakpoints-width");
|
|
41
|
+
Object.defineProperty(exports, "ReplaceBreakpointsWidth", { enumerable: true, get: function () { return replace_breakpoints_width_1.ReplaceBreakpointsWidth; } });
|
|
42
|
+
var replace_component_class_1 = require("./replace-component-class");
|
|
43
|
+
Object.defineProperty(exports, "ReplaceComponentClass", { enumerable: true, get: function () { return replace_component_class_1.ReplaceComponentClass; } });
|
|
44
|
+
var replace_components_with_slots_1 = require("./replace-components-with-slots");
|
|
45
|
+
Object.defineProperty(exports, "ReplaceComponentsWithSlots", { enumerable: true, get: function () { return replace_components_with_slots_1.ReplaceComponentsWithSlots; } });
|
|
46
|
+
var replace_import_paths_1 = require("./replace-import-paths");
|
|
47
|
+
Object.defineProperty(exports, "ReplaceSvgIconImports", { enumerable: true, get: function () { return replace_import_paths_1.ReplaceSvgIconImports; } });
|
|
48
|
+
Object.defineProperty(exports, "ReplaceMaterialUiImportPaths", { enumerable: true, get: function () { return replace_import_paths_1.ReplaceMaterialUiImportPaths; } });
|
|
49
|
+
var replace_in_string_literals_1 = require("./replace-in-string-literals");
|
|
50
|
+
Object.defineProperty(exports, "ReplaceInStringLiterals", { enumerable: true, get: function () { return replace_in_string_literals_1.ReplaceInStringLiterals; } });
|
|
51
|
+
var replace_list_item_button_prop_1 = require("./replace-list-item-button-prop");
|
|
52
|
+
Object.defineProperty(exports, "ReplaceListItemButtonProp", { enumerable: true, get: function () { return replace_list_item_button_prop_1.ReplaceListItemButtonProp; } });
|
|
53
|
+
var replace_tabs_scroll_buttons_1 = require("./replace-tabs-scroll-buttons");
|
|
54
|
+
Object.defineProperty(exports, "ReplaceTabsScrollButtons", { enumerable: true, get: function () { return replace_tabs_scroll_buttons_1.ReplaceTabsScrollButtons; } });
|
|
55
|
+
var replace_theme_color_functions_1 = require("./replace-theme-color-functions");
|
|
56
|
+
Object.defineProperty(exports, "ReplaceThemeColorFunctions", { enumerable: true, get: function () { return replace_theme_color_functions_1.ReplaceThemeColorFunctions; } });
|
|
57
|
+
var replace_theme_spacing_unit_1 = require("./replace-theme-spacing-unit");
|
|
58
|
+
Object.defineProperty(exports, "ReplaceThemeSpacingUnit", { enumerable: true, get: function () { return replace_theme_spacing_unit_1.ReplaceThemeSpacingUnit; } });
|
|
59
|
+
var replace_typography_round_1 = require("./replace-typography-round");
|
|
60
|
+
Object.defineProperty(exports, "ReplaceTypographyRound", { enumerable: true, get: function () { return replace_typography_round_1.ReplaceTypographyRound; } });
|
|
61
|
+
var shift_hidden_down_props_1 = require("./shift-hidden-down-props");
|
|
62
|
+
Object.defineProperty(exports, "ShiftHiddenDownProps", { enumerable: true, get: function () { return shift_hidden_down_props_1.ShiftHiddenDownProps; } });
|
|
63
|
+
var update_theme_breakpoints_1 = require("./update-theme-breakpoints");
|
|
64
|
+
Object.defineProperty(exports, "UpdateThemeBreakpoints", { enumerable: true, get: function () { return update_theme_breakpoints_1.UpdateThemeBreakpoints; } });
|
|
65
|
+
var upgrade_grid_props_1 = require("./upgrade-grid-props");
|
|
66
|
+
Object.defineProperty(exports, "UpgradeGridProps", { enumerable: true, get: function () { return upgrade_grid_props_1.UpgradeGridProps; } });
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mui/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAAtC,8GAAA,YAAY,OAAA;AACpB,2DAAsD;AAA9C,sHAAA,gBAAgB,OAAA;AACxB,6DAAwD;AAAhD,wHAAA,iBAAiB,OAAA;AACzB,qEAAgE;AAAxD,gIAAA,qBAAqB,OAAA;AAC7B,6DAAwD;AAAhD,wHAAA,iBAAiB,OAAA;AACzB,2DAAqD;AAA7C,qHAAA,eAAe,OAAA;AACvB,iEAA4D;AAApD,4HAAA,mBAAmB,OAAA;AAC3B,qEAA+D;AAAvD,+HAAA,oBAAoB,OAAA;AAC5B,6EAAsE;AAA9D,sIAAA,uBAAuB,OAAA;AAC/B,iFAA0E;AAAlE,0IAAA,yBAAyB,OAAA;AACjC,qEAA8D;AAAtD,8HAAA,mBAAmB,OAAA;AAC3B,iEAA4D;AAApD,4HAAA,mBAAmB,OAAA;AAC3B,qDAAgD;AAAxC,gHAAA,aAAa,OAAA;AACrB,uEAAiE;AAAzD,iIAAA,qBAAqB,OAAA;AAC7B,iEAA4D;AAApD,4HAAA,mBAAmB,OAAA;AAC3B,uEAAiE;AAAzD,iIAAA,qBAAqB,OAAA;AAC7B,yEAAmE;AAA3D,mIAAA,sBAAsB,OAAA;AAC9B,yEAAmE;AAA3D,mIAAA,sBAAsB,OAAA;AAC9B,yEAAoE;AAA5D,oIAAA,uBAAuB,OAAA;AAC/B,qEAAgE;AAAxD,gIAAA,qBAAqB,OAAA;AAC7B,iFAA2E;AAAnE,2IAAA,0BAA0B,OAAA;AAClC,+DAA2F;AAAnF,6HAAA,qBAAqB,OAAA;AAAE,oIAAA,4BAA4B,OAAA;AAC3D,2EAAqE;AAA7D,qIAAA,uBAAuB,OAAA;AAC/B,iFAA0E;AAAlE,0IAAA,yBAAyB,OAAA;AACjC,6EAAuE;AAA/D,uIAAA,wBAAwB,OAAA;AAChC,iFAA2E;AAAnE,2IAAA,0BAA0B,OAAA;AAClC,2EAAqE;AAA7D,qIAAA,uBAAuB,OAAA;AAC/B,uEAAkE;AAA1D,kIAAA,sBAAsB,OAAA;AAC9B,qEAA+D;AAAvD,+HAAA,oBAAoB,OAAA;AAC5B,uEAAkE;AAA1D,kIAAA,sBAAsB,OAAA;AAC9B,2DAAsD;AAA9C,sHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Cursor } from "@openrewrite/rewrite";
|
|
2
|
+
import { JS, JSX } from "@openrewrite/rewrite/javascript";
|
|
3
|
+
import { J } from "@openrewrite/rewrite/java";
|
|
4
|
+
type TagAttribute = JSX.Attribute | JSX.SpreadAttribute;
|
|
5
|
+
export declare function findAttribute(tag: JSX.Tag, name: string): JSX.Attribute | undefined;
|
|
6
|
+
export declare const hasSpread: (tag: JSX.Tag) => boolean;
|
|
7
|
+
export declare function attributeExpression(attribute: JSX.Attribute): J;
|
|
8
|
+
export declare const isObjectLiteral: (e: J | undefined) => e is J.NewClass;
|
|
9
|
+
export declare function attributeObject(attribute: JSX.Attribute): J.NewClass | undefined;
|
|
10
|
+
export declare const objectProperties: (object: J.NewClass) => J.RightPadded<any>[];
|
|
11
|
+
export declare function propertyKey(property: any): string | undefined;
|
|
12
|
+
export declare function findProperty(object: J.NewClass, key: string): JS.PropertyAssignment | undefined;
|
|
13
|
+
export declare const bare: <T extends J>(node: T) => T;
|
|
14
|
+
export declare const withAttributes: (tag: JSX.Tag, attributes: J.RightPadded<TagAttribute>[]) => JSX.Tag;
|
|
15
|
+
export declare function newAttribute(cursor: Cursor, tag: JSX.Tag, name: string, value: J | string): Promise<JSX.Attribute>;
|
|
16
|
+
export declare function newObjectAttribute(cursor: Cursor, tag: JSX.Tag, name: string, key: string, value: J): Promise<JSX.Attribute>;
|
|
17
|
+
export declare function spaced(object: J.NewClass): J.NewClass;
|
|
18
|
+
export declare function newObject(cursor: Cursor, tag: JSX.Tag, key: string, value: J): Promise<J.NewClass>;
|
|
19
|
+
export declare function newProperty(cursor: Cursor, tag: JSX.Tag, key: string, value: J): Promise<J.RightPadded<any>>;
|
|
20
|
+
export declare function appendProperty(object: J.NewClass, property: J.RightPadded<any>): J.NewClass;
|
|
21
|
+
export declare function replaceAttribute(tag: JSX.Tag, old: JSX.Attribute, replacement: JSX.Attribute | undefined): JSX.Tag;
|
|
22
|
+
export declare function appendAttribute(tag: JSX.Tag, attribute: JSX.Attribute): JSX.Tag;
|
|
23
|
+
export declare function newPropertyFromSource(cursor: Cursor, anchor: J, key: string, source: string): Promise<J.RightPadded<any>>;
|
|
24
|
+
export declare function sourceExpression(cursor: Cursor, anchor: J, source: string): Promise<J>;
|
|
25
|
+
export declare function renameTag(tag: JSX.Tag, name: string): JSX.Tag;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingUR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