Skip to content

Commit 05c2952

Browse files
committed
chore: prepare for npm publication
1 parent 04ad181 commit 05c2952

File tree

8 files changed

+71
-8
lines changed

8 files changed

+71
-8
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,4 @@ dist
173173

174174
# Finder (MacOS) folder config
175175
.DS_Store
176+
dist/

Diff for: LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: README.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# helloasso
22

3-
To install dependencies:
3+
Largely converted from the [official Python wrapper](https://github.com/HelloAsso/HaApiV5) to TypeScript.
4+
5+
## Installation
46

57
```bash
6-
bun install
8+
npm install helloasso
79
```
810

9-
To run:
11+
## Usage
1012

11-
```bash
12-
bun run index.ts
13+
```typescript
14+
import { ApiV5Client as HelloAsso } from "helloasso"
15+
16+
const helloAsso = new HelloAsso({
17+
apiBase: "api.helloasso.com",
18+
clientId: "your-client-id",
19+
clientSecret: "your-client",
20+
})
21+
22+
const response = await helloAsso.call("/v5/users/me/organizations")
23+
console.log(await response.json())
1324
```
1425

15-
This project was created using `bun init` in bun v1.1.8. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
26+
## Development
27+
28+
This package is developed using [Bun](https://bun.sh).

Diff for: build.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import dts from 'bun-plugin-dts'
2+
3+
await Bun.build({
4+
entrypoints: ['./src/index.ts'],
5+
outdir: './dist',
6+
minify: true,
7+
plugins: [dts()]
8+
})

Diff for: bun.lockb

7.24 KB
Binary file not shown.

Diff for: package.json

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
{
22
"name": "helloasso",
33
"module": "index.ts",
4+
"version": "0.0.1",
45
"type": "module",
6+
"scripts": {
7+
"build": "bun run build.mjs",
8+
"prepublishOnly": "bun run build"
9+
},
10+
"files": ["dist"],
11+
"keywords": ["bun", "helloasso", "api"],
12+
"license": "MIT",
13+
"homepage": "https://git.inpt.fr/inp-net/helloasso-js",
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://git.inpt.fr/inp-net/helloasso-js.git"
17+
},
18+
"bugs": {
19+
"url": "https://git.inpt.fr/inp-net/helloasso-js/-/issues"
20+
},
21+
"author": {
22+
"email": "[email protected]",
23+
"name": "net7 / INP-net members",
24+
"url": "https://net7.dev"
25+
},
526
"devDependencies": {
627
"@types/bun": "latest",
28+
"bun-plugin-dts": "^0.2.3",
729
"zod": "^3.23.8"
830
},
931
"peerDependencies": {
@@ -13,4 +35,4 @@
1335
"dotenv": "^16.4.5",
1436
"oauth2": "^0.0.1"
1537
}
16-
}
38+
}

Diff for: index.ts renamed to src/index.ts

File renamed without changes.

Diff for: index.test.ts renamed to test/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from "bun:test"
2-
import { ApiV5Client } from "."
2+
import { ApiV5Client } from "../src/index"
33
import "dotenv/config"
44
import { z } from "zod"
55

0 commit comments

Comments
 (0)