DEV Community

loading...
Cover image for My first Open Source library

My first Open Source library

pigozzifr profile image Francesco Pigozzi ・1 min read

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!

Discussion (13)

pic
Editor guide
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
DarkWiiPlayer

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 Author

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 Author

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 Author

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.