diff --git a/lib/src/executables/unify_package_rename.dart b/lib/src/executables/unify_package_rename.dart index d133e884..d97abd01 100644 --- a/lib/src/executables/unify_package_rename.dart +++ b/lib/src/executables/unify_package_rename.dart @@ -20,12 +20,10 @@ import 'package:over_react_codemod/src/executables/mui_migration.dart'; import 'package:over_react_codemod/src/rmui_bundle_update_suggestors/constants.dart'; import 'package:over_react_codemod/src/rmui_bundle_update_suggestors/dart_script_updater.dart'; import 'package:over_react_codemod/src/rmui_bundle_update_suggestors/html_script_updater.dart'; -import 'package:over_react_codemod/src/unify_package_rename_suggestors/constants.dart'; import 'package:over_react_codemod/src/unify_package_rename_suggestors/import_renamer.dart'; import 'package:over_react_codemod/src/unify_package_rename_suggestors/unify_rename_suggestor.dart'; import 'package:over_react_codemod/src/util.dart'; -import '../util/importer.dart'; import '../util/unused_import_remover.dart'; const _changesRequiredOutput = """ @@ -88,20 +86,11 @@ void main(List args) async { exitCode = await runCodemods([ // Make main rename updates. CodemodInfo(paths: dartPaths, sequence: [UnifyRenameSuggestor()]), - // Add WSD entrypoint imports as needed. - CodemodInfo(paths: dartPaths, sequence: [ - importerSuggestorBuilder( - importUri: unifyWsdUri, - importNamespace: unifyWsdNamespace, - ) - ]), // Update rmui imports to unify. CodemodInfo(paths: dartPaths, sequence: [ importRenamerSuggestorBuilder( oldPackageName: 'react_material_ui', newPackageName: 'unify_ui', - oldPackageNamespace: 'mui', - newPackageNamespace: 'unify', ) ]), // Remove any left over unused imports. diff --git a/lib/src/unify_package_rename_suggestors/constants.dart b/lib/src/unify_package_rename_suggestors/constants.dart index e4d92fc6..6cf324c3 100644 --- a/lib/src/unify_package_rename_suggestors/constants.dart +++ b/lib/src/unify_package_rename_suggestors/constants.dart @@ -14,11 +14,7 @@ /// Info on a unify_ui import. class UnifyImportInfo { - UnifyImportInfo(this.uri, - {this.rmuiUri, - this.namespace, - this.possibleMuiNamespaces, - this.showHideInfo}); + UnifyImportInfo(this.uri, {this.rmuiUri, this.namespace, this.showHideInfo}); /// Unify import URI. String uri; @@ -26,9 +22,6 @@ class UnifyImportInfo { /// Recommended Unify version of the import namespace, if applicable. String? namespace; - /// List of common RMUI versions of the namespace for the import, if applicable. - List? possibleMuiNamespaces; - /// Previous RMUI import URI (if it's different from the unify_ui path). String? rmuiUri; @@ -44,15 +37,11 @@ final rmuiImportsToUpdate = [ UnifyImportInfo( 'package:unify_ui/unify_ui.dart', rmuiUri: 'package:react_material_ui/react_material_ui.dart', - namespace: 'unify', - possibleMuiNamespaces: ['mui', 'rmui'], ), UnifyImportInfo( 'package:unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart', rmuiUri: 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart', - namespace: 'alpha_unify', - possibleMuiNamespaces: ['alpha_mui', 'mui_alpha'], ), UnifyImportInfo( 'package:unify_ui/components/list.dart', @@ -62,10 +51,11 @@ final rmuiImportsToUpdate = [ 'package:unify_ui/styles/styled.dart', rmuiUri: 'package:react_material_ui/for_cp_use_only/styled.dart', ), - UnifyImportInfo('package:unify_ui/styles/theme_provider.dart', - rmuiUri: 'package:react_material_ui/styles/theme_provider.dart', - namespace: 'unify_theme', - possibleMuiNamespaces: ['mui_theme']) + UnifyImportInfo( + 'package:unify_ui/components/usage_must_be_approved_by_unify_team_for_legal_reasons/data_grid_premium.dart', + rmuiUri: + 'package:react_material_ui/components/usage_must_be_approved_by_unify_team_for_legal_reasons_rmui/data_grid_premium.dart', + ) ]; /// A map of RMUI component names to their new names in unify_ui. @@ -134,8 +124,5 @@ const rmuiToUnifyIdentifierRenames = { 'TablePaginationLabelDisplayedRowsArgs', }; -/// The namespace that will be used for the `unify_ui/components/wsd.dart` import that is added. -const unifyWsdNamespace = 'unify_wsd'; - /// The uri for the `unify_ui/components/wsd.dart` import that is added. const unifyWsdUri = 'package:unify_ui/components/wsd.dart'; diff --git a/lib/src/unify_package_rename_suggestors/import_renamer.dart b/lib/src/unify_package_rename_suggestors/import_renamer.dart index e9b2948e..228660d0 100644 --- a/lib/src/unify_package_rename_suggestors/import_renamer.dart +++ b/lib/src/unify_package_rename_suggestors/import_renamer.dart @@ -22,8 +22,6 @@ import 'constants.dart'; Suggestor importRenamerSuggestorBuilder({ required String oldPackageName, required String newPackageName, - required String oldPackageNamespace, - required String newPackageNamespace, }) { return (context) async* { final libraryResult = await context.getResolvedLibrary(); @@ -52,33 +50,21 @@ Suggestor importRenamerSuggestorBuilder({ final namespace = import.prefix?.name; var newImportUri = importUri?.replaceFirst( 'package:$oldPackageName/', 'package:$newPackageName/'); - var newNamespace = - namespace == oldPackageNamespace ? newPackageNamespace : namespace; // Check for special cases where the unify_ui import path does not match the previous RMUI path. final specialCaseRmuiImport = rmuiImportsToUpdate.where((i) => importUri == i.rmuiUri); if (specialCaseRmuiImport.isNotEmpty) { newImportUri = specialCaseRmuiImport.single.uri; - - final specialCaseNamespace = specialCaseRmuiImport.single.namespace; - if (namespace != null && - specialCaseNamespace != null && - (specialCaseRmuiImport.single.possibleMuiNamespaces - ?.contains(namespace) ?? - false)) { - newNamespace = specialCaseNamespace; - } } if (newImportUri != null) { // Collect info on new imports to add. newImportsInfo.add(UnifyImportInfo(newImportUri, - namespace: newNamespace, - showHideInfo: import.combinators - .map((c) => c.toSource()) - .toList() - .join(' '))); + namespace: namespace, + showHideInfo: import.combinators.isEmpty + ? null + : import.combinators.map((c) => c.toSource()).join(' '))); } final prevTokenEnd = import.beginToken.previous?.end; diff --git a/lib/src/unify_package_rename_suggestors/unify_rename_suggestor.dart b/lib/src/unify_package_rename_suggestors/unify_rename_suggestor.dart index 7480e6c9..4d29caad 100644 --- a/lib/src/unify_package_rename_suggestors/unify_rename_suggestor.dart +++ b/lib/src/unify_package_rename_suggestors/unify_rename_suggestor.dart @@ -15,12 +15,12 @@ import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/visitor.dart'; import 'package:codemod/codemod.dart'; -import 'package:collection/collection.dart'; import 'package:logging/logging.dart'; import '../util.dart'; import '../util/class_suggestor.dart'; import '../util/element_type_helpers.dart'; +import '../util/importer.dart'; import 'constants.dart'; final _log = Logger('UnifyRenameSuggestor'); @@ -30,38 +30,14 @@ final _log = Logger('UnifyRenameSuggestor'); /// /// - Rename specific components and objects /// - Update WSD ButtonColor usages -/// - Rename import namespaces 'mui' => 'unify' /// - Add fix me comments for manual checks /// /// Also see migration guide: https://github.com/Workiva/react_material_ui/tree/master/react_material_ui#how-to-migrate-from-reactmaterialui-to-unifyui class UnifyRenameSuggestor extends GeneralizingAstVisitor with ClassSuggestor { UnifyRenameSuggestor(); - @override - visitMethodInvocation(MethodInvocation node) { - super.visitMethodInvocation(node); - - // Replace 'mui' namespaces usage with 'unify' for method invocations. - final uri = node.methodName.staticElement?.source?.uri; - if (uri != null && - (isUriWithinPackage(uri, 'react_material_ui') || - isUriWithinPackage(uri, 'unify_ui'))) { - final importNamespace = node.target; - if (importNamespace != null) { - final newImportNamespace = rmuiImportsToUpdate - .where((import) => - import.possibleMuiNamespaces - ?.contains(importNamespace.toSource()) ?? - false) - .singleOrNull - ?.namespace; - if (newImportNamespace != null) { - yieldPatch( - newImportNamespace, importNamespace.offset, importNamespace.end); - } - } - } - } + /// Whether or not to add [unifyWsdUri] import. + late bool needsWsdImport; @override visitIdentifier(Identifier node) { @@ -82,13 +58,11 @@ class UnifyRenameSuggestor extends GeneralizingAstVisitor with ClassSuggestor { isUriWithinPackage(uri, 'unify_ui'))) { // Update components and objects that were renamed in unify_ui. final newName = rmuiToUnifyIdentifierRenames[identifier?.name]; - var isFromWsdEntrypoint = newName?.startsWith('Wsd') ?? false; if (identifier != null && newName != null) { - if (isFromWsdEntrypoint) { - // Overwrite or add import namespace for components that will be imported from the separate - // unify_ui/components/wsd.dart entrypoint so we can keep the namespace of the import - // we add consistent with the components that use it. - yieldPatch('$unifyWsdNamespace.$newName', node.offset, node.end); + if (newName.startsWith('Wsd')) { + needsWsdImport = true; + // Overwrite namespace as well because wsd import will be added with no namespace. + yieldPatch(newName, node.offset, node.end); } else { yieldPatch(newName, identifier.offset, identifier.end); } @@ -99,21 +73,21 @@ class UnifyRenameSuggestor extends GeneralizingAstVisitor with ClassSuggestor { // Update WSD constant properties objects to use the WSD versions if applicable. yieldWsdRenamePatchIfApplicable( Expression node, String? objectName, String? propertyName) { - const alertConstantNames = [ + const wsdConstantNames = [ 'AlertSize', 'AlertColor', 'AlertVariant', - 'AlertSeverity' + 'AlertSeverity', + 'LinkButtonType', + 'LinkButtonSize', ]; if (objectName == 'ButtonColor' && (propertyName?.startsWith('wsd') ?? false)) { - isFromWsdEntrypoint = true; - yieldPatch('$unifyWsdNamespace.WsdButtonColor.$propertyName', - node.offset, node.end); - } else if (alertConstantNames.contains(objectName)) { - isFromWsdEntrypoint = true; - yieldPatch('$unifyWsdNamespace.Wsd$objectName.$propertyName', - node.offset, node.end); + needsWsdImport = true; + yieldPatch('WsdButtonColor.$propertyName', node.offset, node.end); + } else if (wsdConstantNames.contains(objectName)) { + needsWsdImport = true; + yieldPatch('Wsd$objectName.$propertyName', node.offset, node.end); } } @@ -127,21 +101,17 @@ class UnifyRenameSuggestor extends GeneralizingAstVisitor with ClassSuggestor { } } - // Replace 'mui' namespaces usage with 'unify'. - final newNamespace = rmuiImportsToUpdate - .where((import) => - import.possibleMuiNamespaces?.contains(prefix?.name) ?? false) - .singleOrNull - ?.namespace; - if (prefix != null && newNamespace != null && !isFromWsdEntrypoint) { - yieldPatch(newNamespace, prefix.offset, prefix.end); - } - // Add comments for components that need manual verification. if (identifier?.name == 'Badge' || identifier?.name == 'LinearProgress') { yieldInsertionPatch( lineComment( - 'FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, remove this FIXME - no action is required; otherwise, migrate this component back to Web Skin Dart.'), + 'FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, manually QA this component and remove this FIXME; otherwise, migrate this component back to Web Skin Dart.'), + node.offset); + } else if (identifier?.name == 'Alert' || + identifier?.name == 'AlertPropsMixin') { + yieldInsertionPatch( + lineComment( + 'FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `${identifier?.name}` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME.'), node.offset); } } @@ -156,7 +126,19 @@ class UnifyRenameSuggestor extends GeneralizingAstVisitor with ClassSuggestor { throw Exception( 'Could not get resolved result for "${context.relativePath}"'); } + needsWsdImport = false; result.unit.visitChildren(this); + + if (needsWsdImport) { + final insertInfo = insertionLocationForPackageImport( + unifyWsdUri, result.unit, result.lineInfo); + yieldPatch( + insertInfo.leadingNewlines + + "import '$unifyWsdUri';" + + insertInfo.trailingNewlines, + insertInfo.offset, + insertInfo.offset); + } } @override diff --git a/test/unify_package_rename_suggestors/import_renamer_test.dart b/test/unify_package_rename_suggestors/import_renamer_test.dart index 7d9c6717..1e87daf3 100644 --- a/test/unify_package_rename_suggestors/import_renamer_test.dart +++ b/test/unify_package_rename_suggestors/import_renamer_test.dart @@ -23,8 +23,6 @@ void main() { importRenamerSuggestorBuilder( oldPackageName: 'react_material_ui', newPackageName: 'unify_ui', - oldPackageNamespace: 'mui', - newPackageNamespace: 'unify', ), ); @@ -79,9 +77,9 @@ void main() { ''', expectedOutput: ''' import 'package:''' - '''unify_ui/styles/styled.dart' as unify; + '''unify_ui/styles/styled.dart' as mui; import 'package:''' - '''unify_ui/unify_ui.dart' as unify; + '''unify_ui/unify_ui.dart' as mui; content() => Dom.div()(); ''', @@ -98,7 +96,9 @@ void main() { import 'package:web_skin_dart/ui_components.dart'; import 'package:react_material_ui/for_cp_use_only/styled.dart'; import 'package:react_material_ui/components/mui_list.dart'; + import 'package:react_material_ui/components/usage_must_be_approved_by_unify_team_for_legal_reasons_rmui/data_grid_premium.dart'; import 'package:react_material_ui/styles/styled.dart'; + content() => Dom.div()(); ''', @@ -107,6 +107,8 @@ void main() { import 'package:''' '''unify_ui/components/list.dart'; import 'package:''' + '''unify_ui/components/usage_must_be_approved_by_unify_team_for_legal_reasons/data_grid_premium.dart'; + import 'package:''' '''unify_ui/styles/styled.dart'; import 'package:''' '''unify_ui/styles/styled.dart'; @@ -141,15 +143,15 @@ void main() { import 'package:''' '''unify_ui/components/alert.dart' as something_else; import 'package:''' - '''unify_ui/components/badge.dart' as unify; + '''unify_ui/components/badge.dart' as mui; import 'package:''' - '''unify_ui/styles/theme_provider.dart' as unify_theme show UnifyThemeProvider; + '''unify_ui/styles/theme_provider.dart' as mui_theme show UnifyThemeProvider; import 'package:''' - '''unify_ui/unify_ui.dart' as unify; + '''unify_ui/unify_ui.dart' as mui; import 'package:''' - '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_unify; + '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_mui; import 'package:''' - '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_unify; + '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as mui_alpha; content() => Dom.div()(); ''', @@ -173,11 +175,11 @@ void main() { import 'package:''' '''unify_ui/components/badge.dart' show Badge hide BadgeColor; import 'package:''' - '''unify_ui/styles/theme_provider.dart' as unify_theme show UnifyThemeProvider; + '''unify_ui/styles/theme_provider.dart' as mui_theme show UnifyThemeProvider; import 'package:''' '''unify_ui/unify_ui.dart' hide Alert; import 'package:''' - '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_unify hide Alert show LinearProgress; + '''unify_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as mui_alpha hide Alert show LinearProgress; content() => Dom.div()(); ''', @@ -210,8 +212,6 @@ void main() { importRenamerSuggestorBuilder( oldPackageName: 'old', newPackageName: 'new', - oldPackageNamespace: 'o', - newPackageNamespace: 'n', ), ); await testSuggestor( @@ -228,7 +228,7 @@ void main() { import 'package:''' '''new/components/badge.dart'; import 'package:''' - '''new/old.dart' as n; + '''new/old.dart' as o; import 'package:over_react/over_react.dart'; content() => Dom.div()(); diff --git a/test/unify_package_rename_suggestors/unify_rename_suggestor_test.dart b/test/unify_package_rename_suggestors/unify_rename_suggestor_test.dart index 139cad2d..6a4f58cd 100644 --- a/test/unify_package_rename_suggestors/unify_rename_suggestor_test.dart +++ b/test/unify_package_rename_suggestors/unify_rename_suggestor_test.dart @@ -31,198 +31,24 @@ void main() { resolvedContext: resolvedContext, ); - group('namespace on component usage', () { - test('mui namespace from react_material_ui is migrated to unify', - () async { - await testSuggestor( - input: /*language=dart*/ ''' + test('does not update namespaces', () async { + await testSuggestor( + input: /*language=dart*/ ''' import 'package:react_material_ui/react_material_ui.dart' as mui; + import 'package:react_material_ui/react_material_ui.dart' as abc; import 'package:react_material_ui/styles/color_utils.dart' as mui; + import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_mui; content() { mui.Button()(); - mui.Checkbox()(); mui.ButtonColor.success; mui.useTheme(); mui.UnifyIcons.expandMore()(); - mui.Button; - mui.Button(); - mui.darken('abc', 1); - } -''', - expectedOutput: /*language=dart*/ ''' - import 'package:react_material_ui/react_material_ui.dart' as mui; - import 'package:react_material_ui/styles/color_utils.dart' as mui; - - content() { - unify.Button()(); - unify.Checkbox()(); - unify.ButtonColor.success; - unify.useTheme(); - unify.UnifyIcons.expandMore()(); - unify.Button; - unify.Button(); - unify.darken('abc', 1); - } -''', - ); - }); - - test('alpha namespace from react_material_ui is migrated to unify', - () async { - await testSuggestor( - input: /*language=dart*/ ''' - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_mui; - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as mui_alpha; - - content() { alpha_mui.Rating()(); - mui_alpha.Rating()(); - alpha_mui.TimelinePosition.left; - alpha_mui.useGridApiRef(); - alpha_mui.Popper; - alpha_mui.Popper(); - mui_alpha.TimelinePosition.left; - mui_alpha.useGridApiRef(); - mui_alpha.Popper; - mui_alpha.Popper(); - } -''', - expectedOutput: /*language=dart*/ ''' - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as alpha_mui; - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as mui_alpha; - - content() { - alpha_unify.Rating()(); - alpha_unify.Rating()(); - alpha_unify.TimelinePosition.left; - alpha_unify.useGridApiRef(); - alpha_unify.Popper; - alpha_unify.Popper(); - alpha_unify.TimelinePosition.left; - alpha_unify.useGridApiRef(); - alpha_unify.Popper; - alpha_unify.Popper(); - } -''', - ); - }); - - test('nested component implementations', () async { - await testSuggestor( - input: /*language=dart*/ ''' - import 'package:react_material_ui/react_material_ui.dart' as mui; - import 'package:over_react/over_react.dart'; - - content() { - Fragment()(mui.ButtonToolbar()( - (mui.Button()..color = mui.ButtonColor.wsdBtnLight)('Foo'), - (mui.Button() - ..size = mui.ButtonSize.small - ..color = mui.ButtonColor.primary - )( - 'Bar', - ), - )); - - return (mui.Autocomplete() - ..componentsProps = { - 'popper': mui.Popper()..placement = 'top-end', - 'popupIndicator': mui.IconButton()..sx = {'width': '20px'}, - } - ..sx = { - 'color': (mui.Theme theme) => - mui.getThemePalette(theme).common.white - } - ..renderInput = mui.wrapRenderInput((textFieldProps) => (mui.TextField() - ..addProps(textFieldProps) - ..InputLabelProps = (mui.InputLabel() - ..shrink = false) - )()) - ); - } -''', - expectedOutput: /*language=dart*/ ''' - import 'package:react_material_ui/react_material_ui.dart' as mui; - import 'package:over_react/over_react.dart'; - - content() { - Fragment()(unify.ButtonToolbar()( - (unify.Button()..color = unify_wsd.WsdButtonColor.wsdBtnLight)('Foo'), - (unify.Button() - ..size = unify.ButtonSize.small - ..color = unify.ButtonColor.primary - )( - 'Bar', - ), - )); - - return (unify.Autocomplete() - ..componentsProps = { - 'popper': unify.Popper()..placement = 'top-end', - 'popupIndicator': unify.IconButton()..sx = {'width': '20px'}, - } - ..sx = { - 'color': (unify.Theme theme) => - unify.getThemePalette(theme).common.white - } - ..renderInput = unify.wrapRenderInput((textFieldProps) => (unify.TextField() - ..addProps(textFieldProps) - ..InputLabelProps = (unify.InputLabel() - ..shrink = false) - )()) - ); - } -''', - ); - }); - - test('mui namespace from a different package is not migrated', () async { - await testSuggestor( - input: /*language=dart*/ ''' - import 'package:over_react/over_react.dart' as mui; - import 'package:over_react/over_react.dart' as alpha_mui; - import 'package:over_react/over_react.dart' as mui_alpha; - - content() { - mui.Fragment()(); - alpha_mui.Fragment()(); - mui_alpha.Fragment()(); - mui.useRef(); - } -''', - ); - }); - - test('non-mui namespace on a react_material_ui import', () async { - await testSuggestor( - input: /*language=dart*/ ''' - import 'package:react_material_ui/react_material_ui.dart' as abc; - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as other; - import 'package:react_material_ui/z_alpha_may_break_at_runtime_do_not_release_to_customers.dart' as something; - - content() { abc.Button()(); - abc.Checkbox()(); - other.Rating; - something.Rating(); - } -''', - ); - }); - - test('no namespace on a react_material_ui import', () async { - await testSuggestor( - input: /*language=dart*/ ''' - import 'package:react_material_ui/react_material_ui.dart'; - - content() { - Button()(); - Checkbox()(); } ''', - ); - }); + ); }); group('renames', () { @@ -238,11 +64,15 @@ void main() { mui.Alert()(); mui.Alert(); mui.Alert; + mui.AlertPropsMixin; mui.AlertSize.small; AlertSize.small; + LinkButtonSize.small; + LinkButtonType.submit; AlertSeverity.error; mui.AlertColor.warning; mui.AlertVariant.outlined; + mui.LinkButtonSize.xxsmall; Alert()(); random_rmui_namespace.Alert()(); mui.LinkButton()(); @@ -259,22 +89,33 @@ void main() { import 'package:react_material_ui/react_material_ui.dart'; import 'package:react_material_ui/react_material_ui.dart' as random_rmui_namespace; import 'package:react_material_ui/components/providers/workiva_mui_theme_provider.dart'; + import 'package:unify_ui/components/wsd.dart'; content() { - unify_wsd.WsdAlert()(); - unify_wsd.WsdAlert(); - unify_wsd.WsdAlert; - unify_wsd.WsdAlertSize.small; - unify_wsd.WsdAlertSize.small; - unify_wsd.WsdAlertSeverity.error; - unify_wsd.WsdAlertColor.warning; - unify_wsd.WsdAlertVariant.outlined; - unify_wsd.WsdAlert()(); - unify_wsd.WsdAlert()(); - unify_wsd.WsdLinkButton()(); - unify_wsd.WsdLinkButton()(); - unify_wsd.WsdLinkButton()(); - unify.UnifyList()(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `Alert` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlert()(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `Alert` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlert(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `Alert` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlert; + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `AlertPropsMixin` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlertPropsMixin; + WsdAlertSize.small; + WsdAlertSize.small; + WsdLinkButtonSize.small; + WsdLinkButtonType.submit; + WsdAlertSeverity.error; + WsdAlertColor.warning; + WsdAlertVariant.outlined; + WsdLinkButtonSize.xxsmall; + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `Alert` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlert()(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, update this to `Alert` from `unify_ui/components/alert.dart`, manually QA this component, and remove this FIXME; otherwise, remove this FIXME. + WsdAlert()(); + WsdLinkButton()(); + WsdLinkButton()(); + WsdLinkButton()(); + mui.UnifyList()(); UnifyList()(); random_rmui_namespace.UnifyList()(); UnifyThemeProvider()(); @@ -305,8 +146,8 @@ void main() { import 'package:react_material_ui/react_material_ui.dart' as random_rmui_namespace; content() { - unify.AutocompleteChangeDetails; - unify.AutocompleteChangeDetails(); + mui.AutocompleteChangeDetails; + mui.AutocompleteChangeDetails(); random_rmui_namespace.BackdropObject; BadgeOriginHorizontal; MenuPopoverOrigin(); @@ -336,16 +177,17 @@ void main() { expectedOutput: /*language=dart*/ ''' import 'package:react_material_ui/react_material_ui.dart' as mui; import 'package:react_material_ui/react_material_ui.dart'; + import 'package:unify_ui/components/wsd.dart'; content() { - unify.ButtonColor.success; - unify_wsd.WsdButtonColor.wsdBtnInverse; - unify_wsd.WsdButtonColor.wsdBtnLight; - unify_wsd.WsdButtonColor.wsdBtnWhite; + mui.ButtonColor.success; + WsdButtonColor.wsdBtnInverse; + WsdButtonColor.wsdBtnLight; + WsdButtonColor.wsdBtnWhite; ButtonColor.success; - unify_wsd.WsdButtonColor.wsdBtnInverse; - unify_wsd.WsdButtonColor.wsdBtnLight; - unify_wsd.WsdButtonColor.wsdBtnWhite; + WsdButtonColor.wsdBtnInverse; + WsdButtonColor.wsdBtnLight; + WsdButtonColor.wsdBtnWhite; } ''', ); @@ -398,13 +240,13 @@ void main() { import 'package:react_material_ui/react_material_ui.dart'; content() { - // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, remove this FIXME - no action is required; otherwise, migrate this component back to Web Skin Dart. - unify.Badge()(); - // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, remove this FIXME - no action is required; otherwise, migrate this component back to Web Skin Dart. + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, manually QA this component and remove this FIXME; otherwise, migrate this component back to Web Skin Dart. + mui.Badge()(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, manually QA this component and remove this FIXME; otherwise, migrate this component back to Web Skin Dart. Badge()(); - // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, remove this FIXME - no action is required; otherwise, migrate this component back to Web Skin Dart. - unify.LinearProgress()(); - // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, remove this FIXME - no action is required; otherwise, migrate this component back to Web Skin Dart. + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, manually QA this component and remove this FIXME; otherwise, migrate this component back to Web Skin Dart. + mui.LinearProgress()(); + // FIXME(unify_package_rename) Check what theme provider is wrapping this component: if it is a UnifyThemeProvider, manually QA this component and remove this FIXME; otherwise, migrate this component back to Web Skin Dart. LinearProgress()(); } ''',