Skip to content

Commit

Permalink
chore: init sdk config
Browse files Browse the repository at this point in the history
  • Loading branch information
goums committed May 6, 2022
0 parents commit 44f5363
Show file tree
Hide file tree
Showing 9 changed files with 2,267 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cache/
dist/
node_modules
88 changes: 88 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true,
"mocha": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 12
},
// Typescript config
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": { "project": "./tsconfig.json" },
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"prettier"
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "variable",
"format": ["PascalCase"],
"filter": "^Log"
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": ["objectLiteralProperty"],
"format": ["camelCase", "PascalCase"]
},
{
"selector": ["classProperty"],
"modifiers": ["private", "static"],
"format": ["PascalCase", "UPPER_CASE"]
},
{
"selector": ["classProperty", "classMethod"],
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": ["classProperty", "classMethod"],
"modifiers": ["protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": ["enumMember"],
"format": ["PascalCase"]
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should", "has", "can", "did", "will"]
}
]
}
}
]
}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Dependency directory
node_modules

# local env variables
.env
.env.testing

# hardhat
artifacts
cache
deployments/localhost

# cache
.eslintcache

# VS Code
.vscode

# macOS
.DS_Store
*.icloud

dist
.idea

# redis
dump.rdb

# coverage
coverage
.nyc_output

# typechain
typechain

test/contracts/types
src/logs/

.eslintcache
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
artifacts
cache
dist
node_modules
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@gelatonetwork/ops-sdk",
"version": "0.0.1",
"description": "SDK to create Gelato Ops tasks",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*"
],
"scripts": {
"build": "yarn generate-contracts-typings && tsc --project tsconfig.prod.json && yarn copy-contracts-types",
"copy-contracts-types": "cp ./src/contracts/types/*.ts ./dist/contracts/types",
"format": "prettier --write '*/**/*.{js,json,md,ts}'",
"format:check": "prettier --check '*/**/*.{js,json,md,ts}'",
"generate-contracts-typings": "npx typechain --target=ethers-v5 --out-dir src/contracts/types ./src/**/abis/*.json",
"lint": "eslint --cache .",
"prepare": "yarn build && yarn format && yarn lint",
"test": "ts-mocha --check-leaks --exit --timeout 60000 'test/**/*.spec.ts'"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"@typechain/ethers-v5": "^10.0.0",
"@types/node": "^16.11.12",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2",
"ts-generator": "^0.1.1",
"typechain": "^8.0.0",
"typescript": "^4.5.3"
},
"dependencies": {
"axios": "^0.24.0",
"ethers": "^5.5.2"
}
}
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"compilerOptions": {
"lib": ["es2020"],
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"skipLibCheck": true,
"moduleResolution": "node",
"pretty": true,
"resolveJsonModule": true,
"typeRoots": ["./node_modules/@types"],
"outDir": "dist",
"rootDir": "src",
"declaration": true,
"useUnknownInCatchVariables": false
},
"include": ["src/**/*.ts", "src/**/*.d.ts"],
"exclude": ["node_modules"]
}
18 changes: 18 additions & 0 deletions tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noImplicitAny": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"typeRoots": ["./node_modules/@types"],
"declaration": true,
"esModuleInterop": true,
"outDir": "dist",
"baseUrl": "src",
"rootDir": "src"
},
"exclude": ["node_modules"]
}
Loading

0 comments on commit 44f5363

Please sign in to comment.