tofisa-package
v7.0.1
Published
This is a private package for using in our project. I use [Typescript](https://www.typescriptlang.org/docs/), cause It enables us to add type safety to our project. That you can use it with installing ***npm i tofisa-package*** in your terminal.
Downloads
1,029
Readme
Introduction
This is a private package for using in our project. I use Typescript, cause It enables us to add type safety to our project. That you can use it with installing npm i tofisa-package in your terminal.
Upgrade package version
1.npx tsc
2.npm init
3.npm login(if you are login you can escape this part)
4.npm publish
Structure
dist
Here, we are telling TypeScript to store the output in dist directory. If we does not specify this option, TypeScript by default puts the output JavaScript file alongside the TypeScript files. Keeping a separate output directory makes development easier. You can find every part of project inside of this folder that when you use this package, you can import components from this part and you don't access the src folder.
src
There are some folders and files inside of this part that I describe every part of that.
src/assets:
In this folder I save public things like, fonts-icons-images that we use them in many components.
src/components:
We create this project for this part, defining every part of main project that use a lot in different sections. Every component has interface. Interfaces get used to ensure that the object contains the required data with the correct data type. In index.ts I just export all the things inside every file That it is important for creating our dist folder.
src/styles:
For style, we use bootstrap-sass. We create our custom.scss that help us to added our bootstap classes to avoid of repetition. We have global.css here just for defining global fonts. Sometimes we need CSS for global styles for this reason we have index.css file. Also, we export both of them inside the index.ts file.
src/index.ts:
This file is used for export the important part of project that it is components.
src/react-app-env.d.ts:
This file references TypeScript types declarations that are specific to projects started with Create React App. These type declarations add support for importing resource files such as bmp, gif, jpeg, jpg, png, webp, and svg. That means that the following import will work as expected without errors:
import logo from './logo.svg';
It also adds support for importing CSS Modules.