Skip to content

Commit

Permalink
chore: scripts run
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan2406 committed May 26, 2023
1 parent 872c555 commit d4edfd1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 44 deletions.
11 changes: 2 additions & 9 deletions scripts/babel-build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const childProcess = require('child_process');
const glob = require('glob');
const path = require('path');
const { promisify } = require('util');

Expand All @@ -11,7 +10,6 @@ const outDirs = {
};

async function run() {
const relativeOutDir = '..';
const env = {
NODE_ENV: process.env.BABEL_ENV || process.env.NODE_ENV,
};
Expand All @@ -22,12 +20,7 @@ async function run() {

const srcDir = path.resolve(__dirname, '../src');
const extensions = ['.js', '.jsx'];
const ignore = ['**/*.spec.js', '**/*.spec.jsx', '**/*.test.js', '**/*.test.jsx'];

const topLevelNonIndexFiles = glob.sync(`*{${extensions.join(',')}}`, { cwd: srcDir, ignore }).filter((file) => {
return path.basename(file, path.extname(file)) !== 'index';
});
const topLevelPathImportsCanBePackages = topLevelNonIndexFiles.length === 0;
const ignore = ['**/__mocks__/*', '**/*.spec.js', '**/*.spec.jsx', '**/*.test.js', '**/*.test.jsx'];

const outDir = path.resolve(__dirname, '..', outDirs[env.NODE_ENV]);

Expand All @@ -43,7 +36,7 @@ async function run() {

const command = ['npx babel', ...babelArgs].join(' ');

const { stderr, stdout } = await exec(command, { env: { ...process.env, ...env } });
const { stderr } = await exec(command, { env: { ...process.env, ...env } });

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
if (stderr) {
throw new Error(`'${command}' failed with \n${stderr}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface BreadcrumbProps {
rootNode?: BreadcrumbRootNode;
divider?: React.ReactNode;
nodes?: BreadcrumbNodes[];
onClick?: (...args: any[]) => any;
onClick: (...args: any[]) => any;
disabled?: boolean;
className?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmModal/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface ConfirmModalProps {
/**
* function called when modalApply event is fired
*/
modalApply?: (...args: any[]) => any;
modalApply: (...args: any[]) => any;
/**
* function called when modalClose event is fired
*/
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPicker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export interface ListPickerProps {
itemType?: string;
labelFormatter?: (...args: any[]) => any;
addonFormatter?: (...args: any[]) => any;
modalApply?: (...args: any[]) => any;
modalApply: (...args: any[]) => any;
modalDescription?: string;
modalClassName?: string;
modalClose?: (...args: any[]) => any;
modalClose: (...args: any[]) => any;
modalFootnote?: string;
modalTitle?: string;
show?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListPickerPure/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export interface ListPickerPureSelectedItems {

export interface ListPickerPureProps {
allowMultiSelection?: boolean;
deselectItem?: (...args: any[]) => any;
deselectItem: (...args: any[]) => any;
emptyMessage?: string;
emptySvgSymbol?: React.ReactNode;
labelFormatter?: (...args: any[]) => any;
addonFormatter?: (...args: any[]) => any;
itemHeaders?: ListPickerPureItemHeaders;
items?: ListPickerPureItems[];
itemType?: string;
selectItem?: (...args: any[]) => any;
selectItem: (...args: any[]) => any;
selectedItems?: ListPickerPureSelectedItems[];
}

Expand Down
27 changes: 0 additions & 27 deletions src/components/Toast/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,6 @@ export interface ToastContainerProps {

declare const ToastContainer: React.FC<ToastContainerProps>;

export type ToastNotificationPosition =
| 'top-right'
| 'top-center'
| 'top-left'
| 'bottom-right'
| 'bottom-center'
| 'bottom-left';

export type ToastNotificationAutoClose = number | boolean;

export type ToastNotificationTheme = 'success' | 'info' | 'alert' | 'attention';

export interface ToastNotificationProps {
/**
* PropTypes.oneOf(['top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left'])
*/
position?: ToastNotificationPosition;
autoClose?: ToastNotificationAutoClose;
title?: string;
theme?: ToastNotificationTheme;
message: React.ReactNode;
dts?: string;
}

declare const ToastNotification: React.FC<ToastNotificationProps>;

export type notifyTheme = 'success' | 'info' | 'alert' | 'attention';

export interface notifyProps {
Expand All @@ -71,7 +45,6 @@ declare const dismiss: React.FC<dismissProps>;

declare const Toast: {
Container: typeof ToastContainer;
Notification: typeof ToastNotification;
notify: typeof notify;
dismiss: typeof dismiss;
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/UserListPicker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export interface UserListPickerProps {
* Array of { avatar: PropTypes.string, givenName: PropTypes.string, surname: PropTypes.string, id: PropTypes.number }
*/
initialSelection?: UserListPickerInitialSelection[];
modalApply?: (...args: any[]) => any;
modalApply: (...args: any[]) => any;
modalDescription?: string;
modalClose?: (...args: any[]) => any;
modalClose: (...args: any[]) => any;
modalTitle?: string;
show?: boolean;
/**
Expand Down

0 comments on commit d4edfd1

Please sign in to comment.