After following Getting Started with PowerApps Code Components using React and TypeScript and customising the solution according to the requirement. We will package the solution. Follow the below steps.
1. Create a folder called Solutions
in your PowerApps Code Component solution.

2. Navigate to Solutions
folder and type the below command
pac solution init --publisher-name OpenCodeBook --publisher-prefix ocb

3. Type the below command to set reference to your PowerApps Code Component solution folder
pac solution add-reference --path C:\Opencodebook.com

4. Now from Solutions
folder type the following command to build the solution
msbuild /t:build /restore

5. Now at \bin\Debug
a .zip file will be created which can be uploaded to Power Apps Solution Library.

6. Now follow Importing PowerApps Code Component Solution into PowerApps Solution Library.