Skip to content

Commit

Permalink
Merge branch 'main' into use-yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
jm42 authored Nov 27, 2024
2 parents b2981e9 + 8d260e7 commit 6f73490
Show file tree
Hide file tree
Showing 16 changed files with 1,178 additions and 473 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: Run checks

on:
pull_request:
Expand All @@ -25,5 +25,8 @@ jobs:
- name: Build packages
run: yarn build

- name: Run lint
run: yarn lint

- name: Run tests
run: yarn test
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

![Build Status](https://github.com/poap-xyz/poap.js/actions/workflows/npm_publish.yml/badge.svg)

The POAP.js is a collection of SDKs and utilities for interacting with the POAP ecosystem. The library provides a set of
classes and methods to simplify working with it.
The POAP.js is a collection of SDKs and utilities for interacting with the POAP ecosystem. The
library provides a set of classes and methods to simplify working with it.

## Table of Contents

Expand Down Expand Up @@ -85,7 +85,10 @@ Contributions to the POAP Package Library are welcome. To contribute, please fol
4. Create a pull request, describing the changes you made and why.
5. Wait for a maintainer to review your pull request and provide feedback.

Please ensure that your code adheres to the project's code style and passes all tests before submitting a pull request.
Please ensure that your code adheres to the project's code style and passes all tests before
submitting a pull request.

See [`CONTRIBUTING.md`](../.github/CONTRIBUTING.md) file for guidelines on how to get involved.

## Active contributors

Expand Down
14 changes: 8 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# POAP.js Documentation Website

This is a documentation website for POAP.js, a library for integrating with the POAP platform in JavaScript applications.
This is a documentation website for POAP.js, a library for integrating with the POAP platform in
JavaScript applications.

## Getting Started

To get started with this website, you'll need to install its dependencies and start the development server. You can do this using yarn:

### NPM
To get started with this website, you'll need to install its dependencies and start the development
server. You can do this using yarn:

```bash
yarn install
yarn dev
```

Once the development server is running, you can view the website in your web browser by navigating to `http://localhost:3000`.
Once the development server is running, you can view the website in your web browser by navigating
to `http://localhost:3000`.

## Contributing

We welcome contributions! Please see the `CONTRIBUTING.md` file for guidelines.
We welcome contributions! Please see the [`CONTRIBUTING.md`](../.github/CONTRIBUTING.md) file for
guidelines on how to get involved.

## License

Expand Down
104 changes: 104 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import globals from 'globals';
import path from 'node:path';
import url from 'node:url';
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
'./dist/',
'**/dist/',
'**/node_modules/',
],
},
...compat.extends(
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
),
{
plugins: {
'@typescript-eslint': tsPlugin,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: 'module',

parserOptions: {
project: 'tsconfig.json',
},
},

rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['error'],
'@typescript-eslint/no-explicit-any': ['error'],
'@typescript-eslint/prefer-as-const': ['error'],
'@typescript-eslint/restrict-plus-operands': ['error'],
'@typescript-eslint/await-thenable': ['error'],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-misused-promises': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],

complexity: ['error', 5],

'max-len': [
'error',
{
code: 200,
ignorePattern: '^import |^export ',
},
],

'max-statements': ['error', 10],
},
},
{
files: ['packages/*/src/**/*.ts'],

languageOptions: {
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
project: [
'./packages/moments/tsconfig.json',
'./packages/drops/tsconfig.json',
'./packages/providers/tsconfig.json',
'./packages/utils/tsconfig.json',
'./packages/poaps/tsconfig.json',
'./packages/frames/tsconfig.json',
'./tsconfig.json',
],
},
},
},
{
files: ['**/*.spec.ts'],

rules: {
'max-lines-per-function': 'off',
'max-statements': 'off',
},
},
];
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@
},
"homepage": "https://github.com/poap-xyz/poap.js#readme",
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@types/jest": "^29.5.11",
"@types/node": "^20.11.10",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"eslint": "^9.15.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jest-mock-extended": "^3.0.5",
Expand Down
14 changes: 7 additions & 7 deletions packages/drops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

@poap-xyz/drops is a package to interact with POAP Drops.
`@poap-xyz/drops` is a package to interact with POAP Drops.

## Features

Expand Down Expand Up @@ -40,16 +40,16 @@ yarn add @poap-xyz/drops @poap-xyz/utils @poap-xyz/providers axios

## Documentation

For more detailed documentation, please visit [this link](https://documentation.poap.tech/docs).
For more detailed documentation, please visit:

## Examples

For example scripts and usage, please check the [examples](https://github.com/poap-xyz/poap.js/tree/main/examples).
- [`@poap-xyz/drops` documentation](https://sdk.poap.tech/packages/drops)
- [POAP documentation](https://documentation.poap.tech/docs)

## Contributing

We welcome contributions! Please see the `CONTRIBUTING.md` file for guidelines.
We welcome contributions! Please see the [`CONTRIBUTING.md`](../../.github/CONTRIBUTING.md) file for
guidelines on how to get involved.

## License

@poap-xyz/drops is released under the [MIT License](https://opensource.org/licenses/MIT).
`@poap-xyz/drops` is released under the [MIT License](https://opensource.org/licenses/MIT).
16 changes: 10 additions & 6 deletions packages/frames/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

@poap-xyz/frames is a package to help with the development of Farcaster Frames.
`@poap-xyz/frames` is a package to help with the development of Farcaster Frames.

## Features

Expand Down Expand Up @@ -44,22 +44,26 @@ return (
### HTML render
```javascript
```typescript
// /api/frame.ts
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const frame = new Frame({ ... });
return res.status(200).send(frame.render());
}
```
## Examples
## Documentation
For more detailed documentation, please visit:
For example scripts and usage, please check the [examples](https://github.com/poap-xyz/poap.js/tree/main/examples).
- [`@poap-xyz/frames` documentation](https://sdk.poap.tech/packages/frames)
- [POAP documentation](https://documentation.poap.tech/docs)
## Contributing
We welcome contributions! Please see the `CONTRIBUTING.md` file for guidelines.
We welcome contributions! Please see the [`CONTRIBUTING.md`](../../.github/CONTRIBUTING.md) file for
guidelines on how to get involved.
## License
@poap-xyz/frames is released under the [MIT License](https://opensource.org/licenses/MIT).
`@poap-xyz/frames` is released under the [MIT License](https://opensource.org/licenses/MIT).
16 changes: 8 additions & 8 deletions packages/moments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

@poap-xyz/moments is a package to interact with POAP Moments.
`@poap-xyz/moments` is a package to interact with POAP Moments.

## Features

Expand All @@ -26,7 +26,7 @@ yarn add @poap-xyz/moments @poap-xyz/utils @poap-xyz/providers axio

## Usage

```javascript
```typescript
import {MomentsClient, CreateMomentInput, Moment} from '@poap-xyz/moments';
import {PoapCompass, PoapMomentsApi, AuthenticationProviderHttp} from '@poap-xyz/providers';
import fs from 'fs';
Expand Down Expand Up @@ -75,16 +75,16 @@ Explanations for each step:

## Documentation

For more detailed documentation, please visit [this link](https://documentation.poap.tech/docs).
For more detailed documentation, please visit:

## Examples

For example scripts and usage, please check the [examples](https://github.com/poap-xyz/poap.js/tree/main/examples).
- [`@poap-xyz/moments` documentation](https://sdk.poap.tech/packages/moments)
- [POAP documentation](https://documentation.poap.tech/docs)

## Contributing

We welcome contributions! Please see the `CONTRIBUTING.md` file for guidelines.
We welcome contributions! Please see the [`CONTRIBUTING.md`](../../.github/CONTRIBUTING.md) file for
guidelines on how to get involved.

## License

@poap-xyz/moments is released under the [MIT License](https://opensource.org/licenses/MIT).
`@poap-xyz/moments` is released under the [MIT License](https://opensource.org/licenses/MIT).
4 changes: 4 additions & 0 deletions packages/moments/src/client/MomentsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export class MomentsClient {
media.fileBinary,
url,
media.fileType,
// FIXME the given function could return a promise but
// - moments api provider doesn't expect a fouth argument
// - poap moments api accepts a function that does not returns a promise
// eslint-disable-next-line @typescript-eslint/no-misused-promises
onFileUploadProgress,
);

Expand Down
Loading

0 comments on commit 6f73490

Please sign in to comment.