Skip to content

Commit

Permalink
Merge pull request #198 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
improve(codemod): Add BackgroundTaskManager member for `@alipay/ob-ui` => `@oceanbase/ui`
  • Loading branch information
dengfuping authored Oct 20, 2023
2 parents 3d83619 + c9e0c1c commit b710a10
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Alert, Button, BasicLayout, Login, PageContainer } from '@alipay/ob-ui';
import { Alert, Button, BackgroundTaskManager, BackgroundTaskManagerConstants, BasicLayout, Login, PageContainer } from '@alipay/ob-ui';
import type { BackgroundTaskManagerRef, ITaskMgrPreset, ITaskMgrQueue, TaskMgrID } from '@alipay/ob-ui';
import type { BasicLayoutProps } from '@alipay/ob-ui/es/BasicLayout';
import type { LoginProps } from '@alipay/ob-ui/es/Login';
import type { PageContainerProps } from '@alipay/ob-ui/es/PageContainer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Alert, Button } from '@oceanbase/design';
import { BasicLayout, Login, PageContainer } from '@oceanbase/ui';
import { BackgroundTaskManager, BackgroundTaskManagerConstants, BasicLayout, Login, PageContainer } from '@oceanbase/ui';
import type { BackgroundTaskManagerRef, ITaskMgrPreset, ITaskMgrQueue, TaskMgrID } from '@oceanbase/ui';
import type { BasicLayoutProps } from '@oceanbase/ui/es/BasicLayout';
import type { LoginProps } from '@oceanbase/ui/es/Login';
import type { PageContainerProps } from '@oceanbase/ui/es/PageContainer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = (file, api, options) => {
'PageContainer',
'Action',
'BackgroundTaskManager',
'BackgroundTaskManagerConstants',
'BasicLayout',
'BatchOperationBar',
'Boundary',
Expand All @@ -27,6 +28,10 @@ module.exports = (file, api, options) => {
'PageContainerProps',
'ActionProps',
'BackgroundTaskManagerProps',
'BackgroundTaskManagerRef',
'ITaskMgrPreset',
'ITaskMgrQueue',
'TaskMgrID',
'BasicLayoutProps',
'BatchOperationBarProps',
'BoundaryProps',
Expand Down
1 change: 1 addition & 0 deletions packages/codemod/transforms/utils/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// https://github.com/benjamn/recast/blob/master/lib/options.ts
const printOptions = {
quote: 'single',
wrapColumn: 500,
};

module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion packages/codemod/transforms/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ function addModuleImport(j, root, { pkgName, importSpecifier, importKind, before

return a.imported.name.localeCompare(b.imported.name);
});
return j.importDeclaration(mergedImportSpecifiers, j.literal(pkgName));
const importStatement = j.importDeclaration(mergedImportSpecifiers, j.literal(pkgName));
importStatement.importKind = importKind;
return importStatement;
});
return true;
}
Expand Down

0 comments on commit b710a10

Please sign in to comment.