From 79c115ded5cbc896dde87219bc6737d8c662027c Mon Sep 17 00:00:00 2001 From: barbmarcio Date: Wed, 17 Jul 2024 13:26:28 +0100 Subject: [PATCH] feat: changelog markdown and minor in readme and contributing --- CHANGELOG.md | 8 ++++++++ CONTRIBUTING.md | 6 +++--- README.md | 38 ++++++++++++++++++++------------------ package.json | 13 ++++++++++--- 4 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5bdde4a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +We follow the format used by [Open Telemetry](https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md). + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5fc7854..c8520d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ We'd love to accept your patches and contributions to this project. Bellow, you - [Running Locally](#running-locally) - [Building the SDK](#building-the-sdk) - [Tests](#tests) - - [Integration Tests](#integration-tests) + - [Unit Tests](#unit-tests) - [Code Standards](#code-standards) - [Submitting contributions](#submitting-contributions) - [Commit Messages](#commit-messages) @@ -80,9 +80,9 @@ This command cleans the `dist` directory and compiles the Typescript files into ## Tests -### Integration Tests +### Unit Tests -To run the integration tests, use the following command: +To run the unit tests, use the following command: ```sh bun run test diff --git a/README.md b/README.md index f69d4af..9258fb5 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ yarn add @topsort/topsort.js --save To create an auction, use the createAuction function. Here is an example: ```js -import { createAuction, TopsortAuction } from '@topsort/topsort.js'; +import { createAuction, type TopsortAuction } from '@topsort/topsort.js'; const auctionDetails: TopsortAuction = { auctions: [ @@ -54,7 +54,8 @@ const auctionDetails: TopsortAuction = { }; const config = { - apiKey: "your-api-key", + // generate your api key in the auction manager - it should look some thing like this + apiKey: "TSE_4S6o1g1CB5tyRENfhDMAn6viR7A5cy3j1JAR", }; createAuction(config, auctionDetails) @@ -64,7 +65,7 @@ createAuction(config, auctionDetails) #### Parameters -`config`: An object containing configuration details including the API key. +`config`: An object containing configuration details including the API key. Please refer to [Auction Manager](https://app.topsort.com/new/en-US/marketplace/account-settings/api-integration) `auctionDetails`: An object containing the details of the auction to be created, please refer to [Topsort's Auction API doc](https://docs.topsort.com/reference/createauctions) for body specification. @@ -95,12 +96,12 @@ createAuction(config, auctionDetails) 400: ```json { - status: 400, - statusText: "No Content", - body: { - errCode: "bad_request", - docUrl: "https://docs.topsort.com/reference/errors", - message: "The request could not be parsed.", + "status": 400, + "statusText": "No Content", + "body": { + "errCode": "bad_request", + "docUrl": "https://docs.topsort.com/reference/errors", + "message": "The request could not be parsed.", }, } ``` @@ -110,7 +111,7 @@ createAuction(config, auctionDetails) To report an event, use the reportEvent function. Here is an example: ```js -import { reportEvent, TopsortEvent } from 'topsort.js'; +import { reportEvent, type TopsortEvent } from 'topsort.js'; const event: TopsortEvent = { impressions: [ @@ -128,7 +129,8 @@ const event: TopsortEvent = { }; const config = { - apiKey: "your-api-key", + // generate your api key in the auction manager - it should look some thing like this + apiKey: "TSE_4S6o1g1CB5tyRENfhDMAn6viR7A5cy3j1JAR", }; reportEvent(config, event) @@ -138,7 +140,7 @@ reportEvent(config, event) #### Parameters -`config`: An object containing configuration details including the API key. +`config`: An object containing configuration details including the API key. Please refer to [Auction Manager](https://app.topsort.com/new/en-US/marketplace/account-settings/api-integration) `event`: An object containing the details of the event to be reported, please refer to [Topsort's Event API doc](https://docs.topsort.com/reference/reportevents) for body specification. @@ -153,12 +155,12 @@ reportEvent(config, event) 400: ```json { - status: 204, - statusText: "No Content", - body: { - errCode: "bad_request", - docUrl: "https://docs.topsort.com/reference/errors", - message: "The request could not be parsed.", + "status": 204, + "statusText": "No Content", + "body": { + "errCode": "bad_request", + "docUrl": "https://docs.topsort.com/reference/errors", + "message": "The request could not be parsed.", }, } ``` diff --git a/package.json b/package.json index b6766d8..d2140ab 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "topsort.js", - "version": "1.0.0", + "version": "0.1.0", "description": "", - "private": true, "packageManager": "bun@1.1.20", "main": "dist/index.js", "module": "dist/index.mjs", @@ -15,7 +14,15 @@ "require": "./dist/index.js" } }, - "files": ["dist/*"], + "files": [ + "dist/index.js", + "dist/index.mjs", + "dist/*.d.ts", + "package.json", + "LICENSE", + "CHANGELOG.md", + "README.md" + ], "scripts": { "build": "rm -rf dist && bun run tsup", "test": "bun test",