DEV Community

Cover image for My first Open Source library
Francesco Pigozzi
Francesco Pigozzi

Posted on

My first Open Source library

Thanks to Lisheng Chang @changlisheng for making this photo available freely on Unsplash ๐ŸŽ

Long story short

It all started as a pet project, I know you understand me.

But rapidly it became more like a developer need: to have something that works as you want it to, something you could share with other developers and be proud of it because, damn, youโ€™ve just became part of an amazing ecosystem called Open Source!

I was finding myself in the need of using the plain JS SDK of Amazonโ€™s Product Advertising API, link here, but it was barely usable, with a lot of conventions, zero explicitness and a whole set of unreadable code.

Maybe itโ€™s just me but in the past year Iโ€™ve started to appreciate when you jump into a project and you can understand easily how things get passed around. I needed Typescript.

There was little to no libraries as I expect them to be and finally I came to one conclusion: I needed to do it myself.

And I did it! ๐Ÿ‘‡โญ๏ธ

GitHub logo Pigotz / paapi5-typescript-sdk

TypeScript SDK for Product Advertising API 5.0

paapi5-typescript-sdk

Unofficial TypeScript SDK for Product Advertising API 5.0

Installation

In order to install this SDK, you just have to run you well-known npm or yarn scripts:

npm i -S paapi5-typescript-sdk
Enter fullscreen mode Exit fullscreen mode

Or

yarn add paapi5-typescript-sdk
Enter fullscreen mode Exit fullscreen mode

And there you go! Enjoy ๐Ÿ˜Ž

API

Everything is exported from the SDK: requests' classes, models, utility types, helper and so on..

If you want to import everything

import * as SDK from 'paapi5-typescript-sdk';
Enter fullscreen mode Exit fullscreen mode

And use what you need later

const request = new SDK.SearchItemsRequest(/* ... */);
Enter fullscreen mode Exit fullscreen mode

You can refer to the Amazon Product Advertising API 5.0 for further details about every request

Auth

In order to validate all the requests against the APIs, I've implemented almost from scratch the AWS V4 signing process, creating the SignHelper class.

This is intended for interal use, but if you want to use it for other purposes, here you canโ€ฆ

Honest work meme

I need feedback ๐Ÿ™†โ€โ™‚๏ธ

This is a small project but a whole set of TS is involved and needs to be maintained โš™๏ธ

This is my first time being the author of an Open Source repository so any feedback and proposal is welcome ๐Ÿ™

If you are just lazy, leave a GitHub โญ๏ธ and a ๐Ÿฆ„ here, it would be enough for me!

Thanks for reading!

Top comments (13)

Collapse
 
harshilparmar profile image
Harshil Parmar

Great, ๐Ÿ’ฅ I am also thinking to make an open-source project.
It would be great if you provide some guidance related to that.

Collapse
 
darkwiiplayer profile image
๐’ŽWii ๐Ÿณ๏ธโ€โšง๏ธ

Slap an MIT license on your project and push it to github. The rest is just telling people you know about it and waiting if people find it useful.

There's nothing hard about open source nor anything you need to know: It's just about sharing.

Collapse
 
pigozzifr profile image
Francesco Pigozzi

I personally agree with all the other advice!

I just want to add one more little thing: start from the little things like

  • contributing to the docs
  • opening GitHub issues in a proactive way, not by just pasting some logs and asking for help
  • contributing to RFCs
  • commenting, reacting, commentig and reacting again on PRs of your interest

I hope to have been helpful ๐Ÿ™†โ€โ™‚๏ธ

Collapse
 
harshilparmar profile image
Harshil Parmar

Thank you so much !!

Collapse
 
pigozzifr profile image
Francesco Pigozzi

Do you mean some guidance related to Open Source? ๐Ÿ™†โ€โ™‚๏ธ Or specifically to my project?

Collapse
 
harshilparmar profile image
Harshil Parmar

More about how to make an open-source library? How to think in that way? Sorry, I forgot to mention ๐Ÿ˜ƒ

Thread Thread
 
rxliuli profile image
rxliuli

If you plan to make a JavaScript open source library, you can use rollup, but if you need a complete guide, then some Google articles may work. Moreover, modern front-end open source libraries generally use TypeScript and Lerna

Thread Thread
 
harshilparmar profile image
Harshil Parmar

Thanks ๐Ÿ˜Š

Thread Thread
 
rxliuli profile image
rxliuli

You can also take a look at the monorepo open source library that I recently refactored using lerna, which is a typical rollup+ts+lerna project
github.com/rxliuli/liuli-util

Collapse
 
bias profile image
Tobias Nickel

good job ๐Ÿ‘

looks to me like you are working for free for Amazon. should't Jeff Bezos make sure the SDK is as easy to use as pissible?

Collapse
 
pigozzifr profile image
Francesco Pigozzi

Iโ€™m waiting for a message of thanks from him directly ๐Ÿ˜Ž

Collapse
 
lukejordanrogers profile image
Luke Rogers

I have a project that i want to work on open source but i'm worried about my intellectual property being stolen as i have not copyrighted the idea. Can someone explain how i can still go ahead with it using people to help me build the project?

Collapse
 
rafaacioly profile image
Rafael Acioly

I'm sorry but you can't ask for help on a private repository and expect people to help for free :(

Open source is a two way street, if you want help for free you have to offer something for free as well.