Setting up dev tools

This commit is contained in:
Jamie Hewitt 2022-08-15 15:57:57 +03:00
parent 279ccc65d7
commit 2f12e3a4f5
6 changed files with 7386 additions and 0 deletions

33
.eslintrc Normal file
View File

@ -0,0 +1,33 @@
{
"parser": "@babel/eslint-parser",
"extends": ["eslint:recommended", "prettier"],
"env": { "es6": true, "browser": true, "node": true, "jest": true },
"settings": {
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["**/*.ts", "**/*.test.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
"react/prop-types": "off",
"react/no-unused-prop-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error"
}
}
]
}

104
.gitignore vendored Normal file
View File

@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port

7
.prettierrc Normal file
View File

@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2,
"endOfLine": "auto"
}

7175
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

47
package.json Normal file
View File

@ -0,0 +1,47 @@
{
"name": "subgraph-fetch-price",
"description": "Ocean Protocol Proxy Server",
"version": "0.0.0",
"author": "Ocean Protocol <devops@oceanprotocol.com>",
"license": "Apache-2.0",
"main": "./dist/app.js",
"scripts": {
"start": "node dist/app.js",
"dev": "nodemon src/app.ts",
"prepare": "husky install",
"build": "npm run clean && tsc --sourcemap",
"build:docker": "npm run build && docker build . -t ocean/subgraph-fetch-price",
"start:docker": "docker run -p 49160:3000 -d ocean/subgraph-fetch-price",
"lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx . && npm run type-check",
"clean": "rm -rf ./dist",
"format": "prettier --ignore-path .gitignore './**/*.{css,yml,js,ts,tsx,json}' --write",
"test:format": "npm run format && npm run lint",
"type-check": "tsc --noEmit",
"test:integration": "mocha --config=test/.mocharc.json --node-env=test --exit 'test/**/*.test.ts'",
"test": "npm run test:format && npm run test:integration"
},
"dependencies": {
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/preset-typescript": "^7.16.7",
"@types/express": "^4.17.11",
"@types/mocha": "^9.1.1",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.29.0",
"chai": "^4.3.6",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.0",
"mocha": "^10.0.0",
"nodemon": "^2.0.16",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"supertest": "^6.2.3",
"ts-node": "^10.8.1",
"typescript": "4.7.3"
}
}

20
tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"resolveJsonModule": true,
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"lib": ["es2017", "es6", "es7", "dom"],
"declaration": true,
"module": "commonjs",
"target": "es5",
"removeComments": true,
"experimentalDecorators": true,
"preserveConstEnums": true,
"outDir": "./dist/",
"sourceMap": true,
"typeRoots": ["node_modules/@types"]
},
"exclude": ["node_modules", "*.js", "*.json"],
"include": ["./src/**/*", "./test/**/*"]
}