Skip to content

Add more paths aliases #1292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generatedTypes/components/text/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import { TextProps as RNTextProps, TextStyle } from 'react-native';
import { BaseComponentInjectedProps, ForwardRefInjectedProps, MarginModifiers, TypographyModifiers, ColorsModifiers } from '../../commons/new';
import { BaseComponentInjectedProps, ForwardRefInjectedProps, MarginModifiers, TypographyModifiers, ColorsModifiers } from 'commonsNew';
export declare type TextProps = RNTextProps & TypographyModifiers & ColorsModifiers & MarginModifiers & {
/**
* color of the text
Expand Down
2 changes: 1 addition & 1 deletion generatedTypes/components/view/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Animated, ViewProps as RNViewProps, StyleProp, ViewStyle } from 'react-native';
import { ContainerModifiers } from '../../commons/new';
import { ContainerModifiers } from 'commonsNew';
export interface ViewProps extends Omit<RNViewProps, 'style'>, ContainerModifiers {
/**
* If true, will render as SafeAreaView
Expand Down
9 changes: 7 additions & 2 deletions src/.babelrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
{
"root": ["./src"],
"alias": {
"style": "./src/style",
"helpers": "./src/helpers"
"commons": "./src/commons",
"commonsNew": "./src/commons/new",
"helpers": "./src/helpers",
"hooks": "./src/hooks",
"optionalDeps": "./src/optionalDependencies",
"services": "./src/services",
"style": "./src/style"
}
}
]
Expand Down
7 changes: 5 additions & 2 deletions src/components/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import _ from 'lodash';
import React, {PureComponent} from 'react';
import {Platform, StyleSheet, LayoutAnimation, LayoutChangeEvent, ImageStyle} from 'react-native';
import {asBaseComponent, forwardRef} from '../../commons/new';
import {asBaseComponent, forwardRef} from 'commonsNew';
import {Constants} from 'helpers';
import {Colors, Typography, BorderRadiuses} from 'style';
import {extractColorValue, extractTypographyValue} from '../../commons/modifiers';
// @ts-ignore need to migrate to commonsNew
import {modifiers} from 'commons';
import TouchableOpacity from '../touchableOpacity';
import Text from '../text';
import Image from '../image';
Expand All @@ -14,6 +15,8 @@ export {ButtonSize, ButtonAnimationDirection, ButtonProps, ButtonPropTypes};

import {PADDINGS, HORIZONTAL_PADDINGS, MIN_WIDTH, DEFAULT_SIZE, DISABLED_COLOR} from './ButtonConstants';

const {extractColorValue, extractTypographyValue} = modifiers;

class Button extends PureComponent<Props, ButtonState> {
static displayName = 'Button';

Expand Down
7 changes: 3 additions & 4 deletions src/components/text/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {PureComponent} from 'react';
import {Text as RNText, StyleSheet, TextProps as RNTextProps, TextStyle, Animated} from 'react-native';
import _ from 'lodash';
import {
asBaseComponent,
forwardRef,
Expand All @@ -8,10 +9,8 @@ import {
MarginModifiers,
TypographyModifiers,
ColorsModifiers
} from '../../commons/new';
import {Colors} from '../../style';
import _ from 'lodash';

} from 'commonsNew';
import {Colors} from 'style';

export type TextProps = RNTextProps & TypographyModifiers & ColorsModifiers & MarginModifiers & {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
BaseComponentInjectedProps,
ForwardRefInjectedProps,
ContainerModifiers
} from '../../commons/new';
import Constants from '../../helpers/Constants';
} from 'commonsNew';
import {Constants} from 'helpers';


export interface ViewProps extends Omit<RNViewProps, 'style'>, ContainerModifiers {
Expand Down
2 changes: 1 addition & 1 deletion src/incubator/TextField/useFieldState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useCallback, useState, useEffect, useMemo} from 'react';
import {TextInputProps} from 'react-native';
import _ from 'lodash';
import * as Presenter from './Presenter';
import {useDidUpdate} from '../../hooks';
import {useDidUpdate} from 'hooks';
import {Validator} from './types';


Expand Down
2 changes: 1 addition & 1 deletion src/services/HapticService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {HapticFeedbackPackage} from '../optionalDependencies';
import {HapticFeedbackPackage} from 'optionalDeps';

const options = {
enableVibrateFallback: false,
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
"baseUrl": ".",
"paths": {
"react-native-ui-lib": ["index.d.ts"],
"style": ["./src/style"],
"commons": ["./src/commons"],
"commonsNew": ["./src/commons/new"],
"helpers": ["./src/helpers"],
"hooks": ["./src/hooks"],
"optionalDeps": ["./src/optionalDependencies"],
"services": ["./src/services"],
"style": ["./src/style"]
}
},
"include": ["src/**/*", "typings/**/*", "demo/**/*"],
"exclude": [ "node_modules", "src/index.ts"]
"exclude": ["node_modules", "src/index.ts"]
}