@doggoapp/doggo-mobile-components-ts v1.0.27
@doggoapp/doggo-mobile-components-ts
doggo mobile components
Başlamadan Önce
- Installation
- Development workflow
- Development
- Scripts
- Commit message convention
- Directory Structure
- All Compoenents
- Usage
- ImagesEnum ve SvgEnum Kullanimi
- npm publish
- Local import
Installation
npm
npm install @doggoapp/doggo-mobile-components-ts
yarn
yarn add @doggoapp/doggo-mobile-components-ts
Development workflow
To get started with the project, run yarn
in the root directory to install the required dependencies for each package:
yarn
Development
To start the packager:
yarn example start
To run the example app on Android:
yarn example android
To run the example app on iOS:
yarn example ios
To run the example app on Web:
yarn example web
Remember to add tests for your change if possible. Run the unit tests by:
yarn test
Make sure your code passes TypeScript and ESLint. Run the following to verify:
yarn typescript
yarn lint
To fix formatting errors, run the following:
yarn lint --fix
Scripts
The package.json
file contains various scripts for common tasks:
yarn bootstrap
: setup project by installing all dependencies and pods.yarn typescript
: type-check files with TypeScript.yarn lint
: lint files with ESLint.yarn test
: run unit tests with Jest.yarn example start
: start the Metro server for the example app.yarn example android
: run the example app on Android.yarn example ios
: run the example app on iOS.
Commit message convention
fix
: bug fixes, e.g. fix crash due to deprecated method.feat
: new features, e.g. add new method to the module.refactor
: code refactor, e.g. migrate from class components to hooks.docs
: changes into documentation, e.g. add usage example for the module..test
: adding or updating tests, e.g. add integration tests using detox.chore
: tooling changes, e.g. change CI config.
Directory Structure
Yeni eklenecek dosyalarin daha onceki yapiya uygun olmasi gerekmektedir. Bu yuzden yeni dosya duzenini asagidaki sekilde uygulayiniz.
Components
.
├── components
├── Button # component name
├── __test__
├── Button.test.tsx # test file for current component
├── index.tsx # component codes
├── styles.ts # style codes
All Compoenents
import {
DogGOAlertModal,
DogGOButton,
DogGOCalendarPicker,
DogGOCircularButton,
DogGOCircularTextInput,
DogGODateTimePicker,
DogGODialogBox,
DogGODistrictsPicker,
DogGOFilterPicker,
DogGOFixedModal,
DogGOFlatListModal,
DogGOHeader,
DogGOImage,
DogGOInform,
DogGOModalListItem,
DogGOPicker,
DogGOProfileItem,
DogGOProgressBar,
DogGORadioButton,
DogGORadioButtonForm,
DogGORadioButtonNumberedForm,
DogGOSelectButton,
DogGOSlider,
DogGOSquaredRadioButton,
DogGOStarVote,
DogGOSvg,
DogGOSvgBackground,
DogGOText,
DogGOTextInput,
DogGOTitle,
FilterModalPickerNew,
DogGOCalendar,
DogGODayItem,
DogGODayPicker,
DogGOSwiperCard,
DogGOVoteItem,
DogGONotification,
} from '@doggoapp/doggo-mobile-components-ts';
Usage
import { DogGOText } from '@doggoapp/doggo-mobile-components-ts';
// ...
const App = () => {
return <DogGOText text="Deneme" {...restProps} />;
};
ImagesEnum ve SvgEnum Kullanimi
DogGOSvg ve DogGOImage kullanilirken image prop`u string degeri yerine SvgEnum veya ImagesEnum alir. Ornek kullanimlari asagidaki gibidir.
import {
DogGOSvg,
DogGOImage,
SvgEnum,
ImagesEnum,
} from '@doggoapp/doggo-mobile-components-ts';
// ...
const App = () => {
return (
<>
<DogGOSvg image={SvgEnum.PrimaryBackIcon} {...restProps} />
<DogGOImage image={ImagesEnum.dropdown_icon} {...restProps} />
</>
);
};
npm publish
npm init
# just first npm publish
npm login
npm publish
Uyarı:
npm publish
komutundan once package.json dan versiyonu arttirmalisiniz.
Local import
if you want to use npm package with your changes you must import from local package.
step 1
in the root of npm package run this code.
npm link
# sudo npm link
step 2
in your project, which you want to use npm package.
npm link @doggoapp/doggo-mobile-components-ts
Warning:
Do not push the project codes before npm publish. The local npm changes will not be committed to git. When you are ready to share your code, publish a new version of @doggoapp/doggo-mobile-components-ts, after that update version of npm in current project`s pacage.json.
License
MIT
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago