Skip to content

Commit

Permalink
chore: install snapshot-labs config (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e authored Jul 18, 2023
1 parent 5269505 commit 1d93114
Show file tree
Hide file tree
Showing 9 changed files with 526 additions and 440 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint
on: [push]

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- run: yarn install
- run: yarn lint:nofix
- run: yarn typecheck
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test
on: [push]

jobs:
build-test:
test:
runs-on: ubuntu-20.04
env:
FLEEK_API_KEY: ${{ secrets.FLEEK_API_KEY }}
Expand All @@ -22,7 +22,6 @@ jobs:
node-version: '16'
cache: 'yarn'
- run: yarn
- run: yarn lint
- run: yarn test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default {
testEnvironment: 'node',
setupFiles: ['dotenv/config'],
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/dist/'],
moduleFileExtensions: ['js', 'ts'],
moduleFileExtensions: ['js', 'ts']
};
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
"version": "0.1.0",
"license": "MIT",
"scripts": {
"lint": "eslint . --ext .ts --fix",
"lint": "yarn lint:nofix --fix",
"lint:nofix": "eslint . --ext .ts",
"build": "tsc",
"dev": "nodemon src/index.ts",
"start": "node dist/src/index.js",
"test": "yarn jest"
"test": "yarn jest",
"typecheck": "tsc --noEmit"
},
"eslintConfig": {
"extends": "@snapshot-labs"
},
"prettier": "@snapshot-labs/prettier-config",
"dependencies": {
"@aws-sdk/client-s3": "^3.75.0",
"@fleekhq/fleek-storage-js": "^1.0.21",
Expand All @@ -28,13 +34,16 @@
"web3.storage": "^4.2.0"
},
"devDependencies": {
"@snapshot-labs/eslint-config": "^0.1.0-beta.2",
"@snapshot-labs/eslint-config": "^0.1.0-beta.9",
"@snapshot-labs/prettier-config": "^0.1.0-beta.7",
"@types/express": "^4.17.11",
"@types/jest": "^28.1.0",
"@types/multer": "^1.4.7",
"@types/node": "^17.0.35",
"@types/sharp": "^0.30.2",
"eslint": "^8.45.0",
"jest": "^28.1.0",
"prettier": "^2.8.8",
"ts-jest": "^28.0.4"
}
}
2 changes: 1 addition & 1 deletion src/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const dir = 'pineapple';
async function streamToString(stream: Readable): Promise<string> {
return await new Promise((resolve, reject) => {
const chunks: Uint8Array[] = [];
stream.on('data', (chunk) => chunks.push(chunk));
stream.on('data', chunk => chunks.push(chunk));
stream.on('error', reject);
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
});
Expand Down
4 changes: 2 additions & 2 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ router.get('/ipfs/*', async (req, res) => {
const cache = await get(`cache/${key}`);
if (cache) return res.json(cache);
const json = await Promise.any(
gateways.map((gateway) => {
gateways.map(gateway => {
const url = `https://${gateway}${req.originalUrl}`;
return fetch(url).then((res) => res.json());
return fetch(url).then(res => res.json());
})
);
res.json(json);
Expand Down
1 change: 0 additions & 1 deletion src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Promise from 'bluebird';
import { MAX, rpcError, rpcSuccess } from './utils';
import { set as setFleek } from './providers/fleek';
import { set as setInfura } from './providers/infura';
import { set as setPinata } from './providers/pinata';
import { set as setWeb3Storage } from './providers/web3storage';
import { set as set4everland } from './providers/4everland';
import { set as setAws } from './aws';
Expand Down
Loading

0 comments on commit 1d93114

Please sign in to comment.