Skip to content

Commit

Permalink
feat: publishing the package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdeyyy committed Apr 11, 2024
1 parent fd77607 commit a5ea2da
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/slow-mice-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"paystack-api": minor
---

initial release
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI
on:
push:
branches:
- "**"
jobs:
build:
name: build-app
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Lint and build package
run: bun run lint && bun run build
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: bun run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
env:
PAYSTACK_SECRET: ${{ secrets.PAYSTACK_SECRET }}
CUSTOMER_CODE: ${{ secrets.CUSTOMER_CODE }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Install Bun
run: npm install -g bun
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Run Tests
- name: Lint and build package
run: bun test
env:
PAYSTACK_SECRET: ${{ secrets.PAYSTACK_SECRET }}
CUSTOMER_CODE: ${{ secrets.CUSTOMER_CODE }}
Binary file modified bun.lockb
Binary file not shown.
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Paystack } from "./lib";

export {
Paystack
}
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"name": "paystack-api",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"version": "0.0.1",
"description": "an api wrapper for paystack's api with types",
"build": "bun build ./src/index.ts --outdir ./dist",
"scripts": {
"build": "bunx tsup index.ts --format cjs,esm --dts",
"release": "bun run build && changeset publish",
"lint": "tsc"
},
"license": "GPL-3",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {
"tsc": "^2.0.4",
"tsup": "^8.0.2"
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess":true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
Expand Down

0 comments on commit a5ea2da

Please sign in to comment.