mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
Merge branch 'master' into feature/consume-flow
This commit is contained in:
commit
8de81991df
9
client/.gitignore → .gitignore
vendored
9
client/.gitignore → .gitignore
vendored
@ -1,15 +1,14 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
node_modules
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
/coverage
|
coverage
|
||||||
|
|
||||||
# production
|
# production
|
||||||
/build
|
build
|
||||||
|
dist
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
@ -1,2 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
build
|
build
|
||||||
|
dist
|
10
.travis.yml
10
.travis.yml
@ -1,12 +1,14 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js: node
|
||||||
- "11.10.1"
|
|
||||||
|
|
||||||
script: "./.travis.sh"
|
script:
|
||||||
|
- ./scripts/install.sh
|
||||||
|
- ./scripts/test.sh
|
||||||
|
- ./scripts/build.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
24
README.md
24
README.md
@ -2,40 +2,44 @@
|
|||||||
|
|
||||||
<h1 align="center">commons-marketplace</h1>
|
<h1 align="center">commons-marketplace</h1>
|
||||||
|
|
||||||
> Marketplace front-end to explore, download, and publish open data sets.
|
> Marketplace front-end and backend server to explore, download, and publish open data sets.
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.com/oceanprotocol/commons-marketplace.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/commons-marketplace)
|
[![Build Status](https://travis-ci.com/oceanprotocol/commons-marketplace.svg?token=3psqw6c8KMDqfdGQ2x6d&branch=master)](https://travis-ci.com/oceanprotocol/commons-marketplace)
|
||||||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier)
|
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-7b1173.svg?style=flat-square)](https://github.com/prettier/prettier)
|
||||||
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
|
[![js oceanprotocol](https://img.shields.io/badge/js-oceanprotocol-7b1173.svg)](https://github.com/oceanprotocol/eslint-config-oceanprotocol)
|
||||||
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
|
[![css bigchaindb](https://img.shields.io/badge/css-bigchaindb-39BA91.svg)](https://github.com/bigchaindb/stylelint-config-bigchaindb)
|
||||||
|
|
||||||
- [Development](#development)
|
- [Get Started](#get-started)
|
||||||
|
- [Production](#production)
|
||||||
- [Testing](#testing)
|
- [Testing](#testing)
|
||||||
- [Code Style](#code-style)
|
- [Code Style](#code-style)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
<img alt="screen shot 2019-02-08 at 16 53 57" src="https://user-images.githubusercontent.com/90316/52489283-27080e80-2bc2-11e9-8ec0-508c21eb86f7.png">
|
<img alt="screen shot 2019-02-08 at 16 53 57" src="https://user-images.githubusercontent.com/90316/52489283-27080e80-2bc2-11e9-8ec0-508c21eb86f7.png">
|
||||||
|
|
||||||
## Development
|
## Get Started
|
||||||
|
|
||||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
To spin up both, the client and the server in a watch mode for local development, execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
npm install
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Runs the app in the development mode.<br>
|
This will run client and server in development mode.<br>
|
||||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
Open [http://localhost:3000](http://localhost:3000) to view the client in the browser.
|
||||||
|
|
||||||
The page will reload if you make edits.<br>
|
The page will reload if you make edits to files in either `./client` or `./server`.
|
||||||
You will also see any lint errors in the console.
|
|
||||||
|
## Production
|
||||||
|
|
||||||
|
To create a production build of both, the client and the server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Builds the app for production to the `build` folder.<br>
|
Builds the client for production to the `./client/build` folder, and the server into the `./server/dist` folder.
|
||||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js: node
|
|
||||||
|
|
||||||
script:
|
|
||||||
- npm test
|
|
||||||
- npm run build
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
1625
client/package-lock.json
generated
1625
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "commons-marketplace",
|
"name": "commons-marketplace-client",
|
||||||
|
"description": "Ocean Protocol marketplace frontend to explore, download, and publish open data sets.",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts --max_old_space_size=4096 build",
|
||||||
"test": "npm run lint && react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject"
|
||||||
"format:js": "prettier --parser typescript --write '**/*.{js,jsx,ts,tsx}'",
|
|
||||||
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
|
|
||||||
"format": "npm run format:js && npm run format:css",
|
|
||||||
"lint:css": "stylelint './src/**/*.{css,scss}'",
|
|
||||||
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
|
||||||
"lint:fix": "eslint --fix --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
|
||||||
"lint": "npm run lint:js && npm run lint:css"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oceanprotocol/art": "^2.2.0",
|
"@oceanprotocol/art": "^2.2.0",
|
||||||
@ -22,46 +16,36 @@
|
|||||||
"filesize": "^4.1.2",
|
"filesize": "^4.1.2",
|
||||||
"is-url": "^1.2.4",
|
"is-url": "^1.2.4",
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"query-string": "^6.2.0",
|
"query-string": "^6.4.0",
|
||||||
"react": "^16.8.3",
|
"react": "^16.8.5",
|
||||||
"react-dom": "^16.8.3",
|
"react-dom": "^16.8.5",
|
||||||
"react-helmet": "^5.2.0",
|
"react-helmet": "^5.2.0",
|
||||||
"react-moment": "^0.8.4",
|
"react-moment": "^0.8.4",
|
||||||
"react-popper": "^1.3.3",
|
"react-popper": "^1.3.3",
|
||||||
"react-router-dom": "^4.3.1",
|
"react-router-dom": "^5.0.0",
|
||||||
"react-transition-group": "^2.6.0",
|
"react-transition-group": "^2.7.0",
|
||||||
"slugify": "^1.3.4",
|
"slugify": "^1.3.4",
|
||||||
"web3": "^1.0.0-beta.48"
|
"web3": "^1.0.0-beta.50"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/classnames": "^2.2.7",
|
"@types/classnames": "^2.2.7",
|
||||||
"@types/filesize": "^4.0.1",
|
"@types/filesize": "^4.1.0",
|
||||||
"@types/is-url": "^1.2.28",
|
"@types/is-url": "^1.2.28",
|
||||||
"@types/jasmine": "^3.3.9",
|
"@types/jest": "^24.0.11",
|
||||||
"@types/jest": "^24.0.9",
|
"@types/query-string": "^6.3.0",
|
||||||
"@types/node": "^11.9.5",
|
"@types/react": "^16.8.8",
|
||||||
"@types/query-string": "^6.2.0",
|
"@types/react-dom": "^16.8.3",
|
||||||
"@types/react": "^16.8.5",
|
|
||||||
"@types/react-dom": "^16.8.2",
|
|
||||||
"@types/react-helmet": "^5.0.8",
|
"@types/react-helmet": "^5.0.8",
|
||||||
"@types/react-router-dom": "^4.3.1",
|
"@types/react-router-dom": "^4.3.1",
|
||||||
"@types/react-transition-group": "^2.0.16",
|
"@types/react-transition-group": "^2.0.16",
|
||||||
"@types/web3": "^1.0.18",
|
"@types/web3": "^1.0.18",
|
||||||
"@typescript-eslint/eslint-plugin": "^1.4.2",
|
|
||||||
"@typescript-eslint/parser": "^1.4.2",
|
|
||||||
"eslint": "5.12.0",
|
|
||||||
"eslint-config-oceanprotocol": "^1.3.0",
|
|
||||||
"eslint-config-prettier": "^4.1.0",
|
|
||||||
"eslint-plugin-prettier": "^3.0.1",
|
|
||||||
"node-sass": "^4.11.0",
|
"node-sass": "^4.11.0",
|
||||||
"prettier": "^1.16.4",
|
"react-scripts": "^2.1.8",
|
||||||
"prettier-stylelint": "^0.4.2",
|
"typescript": "^3.3.4000"
|
||||||
"react-scripts": "^2.1.5",
|
},
|
||||||
"stylelint": "^9.10.1",
|
"repository": {
|
||||||
"stylelint-config-bigchaindb": "^1.2.1",
|
"type": "git",
|
||||||
"stylelint-config-css-modules": "^1.3.0",
|
"url": "https://github.com/oceanprotocol/commons-marketplace"
|
||||||
"stylelint-config-standard": "^18.2.0",
|
|
||||||
"typescript": "^3.3.3333"
|
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
">0.2%",
|
">0.2%",
|
||||||
|
@ -4,7 +4,6 @@ import Route from '../components/templates/Route'
|
|||||||
import { User } from '../context/User'
|
import { User } from '../context/User'
|
||||||
import Asset from '../components/molecules/Asset'
|
import Asset from '../components/molecules/Asset'
|
||||||
import styles from './Search.module.scss'
|
import styles from './Search.module.scss'
|
||||||
import { Logger } from '@oceanprotocol/squid'
|
|
||||||
|
|
||||||
interface SearchState {
|
interface SearchState {
|
||||||
results: any[]
|
results: any[]
|
||||||
|
6848
package-lock.json
generated
Normal file
6848
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
41
package.json
Normal file
41
package.json
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "commons-marketplace",
|
||||||
|
"description": "Ocean Protocol marketplace to explore, download, and publish open data sets.",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"install": "./scripts/install.sh",
|
||||||
|
"start": "concurrently \"cd client && npm run start\" \"cd server && npm run start-watch\"",
|
||||||
|
"build": "./scripts/build.sh",
|
||||||
|
"test": "npm run lint && scripts/test.sh",
|
||||||
|
"format:js": "prettier --parser typescript --write '**/*.{js,jsx,ts,tsx}'",
|
||||||
|
"format:css": "prettier-stylelint --ignore-path .gitignore --write --quiet '**/*.{css,scss}'",
|
||||||
|
"format": "npm run format:js && npm run format:css",
|
||||||
|
"lint:css": "stylelint --ignore-path .gitignore './**/*.{css,scss}'",
|
||||||
|
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
||||||
|
"lint:fix": "eslint --fix --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
||||||
|
"lint": "npm run lint:js && npm run lint:css"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@typescript-eslint/eslint-plugin": "^1.4.2",
|
||||||
|
"@typescript-eslint/parser": "^1.4.2",
|
||||||
|
"concurrently": "^4.1.0",
|
||||||
|
"eslint": "5.12.0",
|
||||||
|
"eslint-config-oceanprotocol": "^1.3.0",
|
||||||
|
"eslint-config-prettier": "^4.1.0",
|
||||||
|
"eslint-plugin-prettier": "^3.0.1",
|
||||||
|
"prettier": "^1.16.4",
|
||||||
|
"prettier-stylelint": "^0.4.2",
|
||||||
|
"stylelint": "^9.10.1",
|
||||||
|
"stylelint-config-bigchaindb": "^1.2.1",
|
||||||
|
"stylelint-config-css-modules": "^1.3.0",
|
||||||
|
"stylelint-config-standard": "^18.2.0",
|
||||||
|
"typescript": "^3.3.4000"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/oceanprotocol/commons-marketplace"
|
||||||
|
}
|
||||||
|
}
|
12
scripts/build.sh
Executable file
12
scripts/build.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#/usr/bin/env/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
components="server client"
|
||||||
|
|
||||||
|
for component in $components
|
||||||
|
do
|
||||||
|
echo "Building: $component"
|
||||||
|
cd $component
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
done
|
12
scripts/install.sh
Executable file
12
scripts/install.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#/usr/bin/env/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
components="server client"
|
||||||
|
|
||||||
|
for component in $components
|
||||||
|
do
|
||||||
|
echo "\n\nInstalling dependencies: $component\n"
|
||||||
|
cd $component
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
done
|
@ -1,12 +1,12 @@
|
|||||||
#/usr/bin/env/sh
|
#/usr/bin/env/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
components="server client"
|
components="server client"
|
||||||
|
|
||||||
for component in $components
|
for component in $components
|
||||||
do
|
do
|
||||||
echo "Testing: $component"
|
echo "Testing: $component"
|
||||||
cd $component
|
cd $component
|
||||||
npm install
|
|
||||||
npm test
|
npm test
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
38
server/.gitignore
vendored
38
server/.gitignore
vendored
@ -1,38 +0,0 @@
|
|||||||
lib-cov
|
|
||||||
*.seed
|
|
||||||
*.log
|
|
||||||
*.csv
|
|
||||||
*.dat
|
|
||||||
*.out
|
|
||||||
*.pid
|
|
||||||
*.gz
|
|
||||||
*.swp
|
|
||||||
|
|
||||||
pids
|
|
||||||
logs
|
|
||||||
results
|
|
||||||
tmp
|
|
||||||
|
|
||||||
# Build
|
|
||||||
dist
|
|
||||||
|
|
||||||
# Coverage reports
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# API keys and secrets
|
|
||||||
.env
|
|
||||||
|
|
||||||
# Dependency directory
|
|
||||||
node_modules
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# Editors
|
|
||||||
.idea
|
|
||||||
*.iml
|
|
||||||
|
|
||||||
# OS metadata
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Ignore built ts files
|
|
||||||
dist/**/*
|
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"watch": ["src"],
|
"watch": ["src"],
|
||||||
"ext": "ts",
|
"ext": "ts",
|
||||||
"ignore": ["src/**/*.spec.ts"],
|
"ignore": ["src/**/*.spec.ts"],
|
||||||
"exec": "ts-node src/index.ts"
|
"exec": "ts-node src/index.ts"
|
||||||
}
|
}
|
||||||
|
135
server/package-lock.json
generated
135
server/package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "backend",
|
"name": "commons-marketplace-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
@ -574,65 +574,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
|
||||||
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
|
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
|
||||||
},
|
},
|
||||||
"babel-code-frame": {
|
|
||||||
"version": "6.26.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
|
|
||||||
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"chalk": "^1.1.3",
|
|
||||||
"esutils": "^2.0.2",
|
|
||||||
"js-tokens": "^3.0.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
|
||||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"ansi-styles": {
|
|
||||||
"version": "2.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
|
||||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"chalk": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-styles": "^2.2.1",
|
|
||||||
"escape-string-regexp": "^1.0.2",
|
|
||||||
"has-ansi": "^2.0.0",
|
|
||||||
"strip-ansi": "^3.0.0",
|
|
||||||
"supports-color": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"js-tokens": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
|
|
||||||
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"strip-ansi": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
|
||||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"supports-color": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"babel-jest": {
|
"babel-jest": {
|
||||||
"version": "24.1.0",
|
"version": "24.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.1.0.tgz",
|
||||||
@ -899,12 +840,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
||||||
},
|
},
|
||||||
"builtin-modules": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"busboy": {
|
"busboy": {
|
||||||
"version": "0.2.14",
|
"version": "0.2.14",
|
||||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz",
|
"resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz",
|
||||||
@ -1144,7 +1079,8 @@
|
|||||||
"version": "2.17.1",
|
"version": "2.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
|
||||||
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
|
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"compare-versions": {
|
"compare-versions": {
|
||||||
"version": "3.4.0",
|
"version": "3.4.0",
|
||||||
@ -2866,23 +2802,6 @@
|
|||||||
"function-bind": "^1.1.1"
|
"function-bind": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"has-ansi": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
|
||||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"has-flag": {
|
"has-flag": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||||
@ -3834,9 +3753,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "3.12.2",
|
"version": "3.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz",
|
||||||
"integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==",
|
"integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"argparse": "^1.0.7",
|
"argparse": "^1.0.7",
|
||||||
@ -6110,47 +6029,11 @@
|
|||||||
"yn": "^3.0.0"
|
"yn": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tslib": {
|
|
||||||
"version": "1.9.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
|
||||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"tslint": {
|
|
||||||
"version": "5.13.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.13.1.tgz",
|
|
||||||
"integrity": "sha512-fplQqb2miLbcPhyHoMV4FU9PtNRbgmm/zI5d3SZwwmJQM6V0eodju+hplpyfhLWpmwrDNfNYU57uYRb8s0zZoQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"babel-code-frame": "^6.22.0",
|
|
||||||
"builtin-modules": "^1.1.1",
|
|
||||||
"chalk": "^2.3.0",
|
|
||||||
"commander": "^2.12.1",
|
|
||||||
"diff": "^3.2.0",
|
|
||||||
"glob": "^7.1.1",
|
|
||||||
"js-yaml": "^3.7.0",
|
|
||||||
"minimatch": "^3.0.4",
|
|
||||||
"mkdirp": "^0.5.1",
|
|
||||||
"resolve": "^1.3.2",
|
|
||||||
"semver": "^5.3.0",
|
|
||||||
"tslib": "^1.8.0",
|
|
||||||
"tsutils": "^2.27.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tsscmp": {
|
"tsscmp": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",
|
||||||
"integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA=="
|
"integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA=="
|
||||||
},
|
},
|
||||||
"tsutils": {
|
|
||||||
"version": "2.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
|
|
||||||
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"tslib": "^1.8.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tunnel-agent": {
|
"tunnel-agent": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
||||||
@ -6194,9 +6077,9 @@
|
|||||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.3.3333",
|
"version": "3.3.4000",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz",
|
||||||
"integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==",
|
"integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
|
@ -1,22 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "backend",
|
"name": "commons-marketplace-server",
|
||||||
|
"description": "Ocean Protocol marketplace backend.",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"license": "Apache-2.0",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run serve",
|
"start": "node dist/index.js",
|
||||||
"start-watch": "nodemon",
|
"start-watch": "nodemon",
|
||||||
"build": "npm run build-ts && npm run tslint",
|
"build": "tsc",
|
||||||
"watch": "npm run watch-ts",
|
"watch": "tsc -w",
|
||||||
"serve": "node dist/index.js",
|
|
||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
"watch-test": "npm run test --watchAll",
|
"watch-test": "npm run test --watchAll"
|
||||||
"build-ts": "tsc",
|
|
||||||
"watch-ts": "tsc -w",
|
|
||||||
"tslint": "tslint -c tslint.json -p tsconfig.json"
|
|
||||||
},
|
},
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.18.3",
|
"body-parser": "^1.18.3",
|
||||||
"color-js": "^1.0.5",
|
"color-js": "^1.0.5",
|
||||||
@ -48,8 +43,11 @@
|
|||||||
"supertest": "^3.4.2",
|
"supertest": "^3.4.2",
|
||||||
"ts-jest": "^24.0.0",
|
"ts-jest": "^24.0.0",
|
||||||
"ts-node": "^8.0.2",
|
"ts-node": "^8.0.2",
|
||||||
"tslint": "^5.12.1",
|
"typescript": "^3.3.4000"
|
||||||
"typescript": "^3.3.3"
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/oceanprotocol/commons-marketplace"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"preset": "ts-jest"
|
"preset": "ts-jest"
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
module.exports = {
|
const config = {
|
||||||
app: {
|
app: {
|
||||||
port: 4000
|
port: 4000
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default config
|
||||||
|
@ -1,58 +1,65 @@
|
|||||||
import debug from "debug";
|
import debug from 'debug'
|
||||||
import express from "express";
|
import express from 'express'
|
||||||
import compression from "compression";
|
import compression from 'compression'
|
||||||
import morgan from "morgan";
|
import morgan from 'morgan'
|
||||||
import bodyParser from "body-parser";
|
import bodyParser from 'body-parser'
|
||||||
|
|
||||||
// routes
|
// routes
|
||||||
import UrlCheckRouter from "./routes/UrlCheckRouter";
|
import UrlCheckRouter from './routes/UrlCheckRouter'
|
||||||
|
|
||||||
// config
|
// config
|
||||||
const config = require("./config/config");
|
import config from './config/config'
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
const log = debug("server:index");
|
const log = debug('server:index')
|
||||||
|
|
||||||
const app = express();
|
const app = express()
|
||||||
app.use((req, res, next) => {
|
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
|
||||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization");
|
|
||||||
res.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, DELETE");
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
app.use(morgan("dev"));
|
|
||||||
app.use(bodyParser.json());
|
|
||||||
app.use(bodyParser.urlencoded({ extended: false }));
|
|
||||||
app.use(compression());
|
|
||||||
// routes
|
|
||||||
app.use("/api/v1/urlcheck", UrlCheckRouter);
|
|
||||||
/// catch 404
|
|
||||||
app.use((req, res, next) => {
|
|
||||||
res.status(404).send();
|
|
||||||
});
|
|
||||||
// listen
|
|
||||||
const server = app.listen(config.app.port);
|
|
||||||
server.on("listening", onListening);
|
|
||||||
server.on("error", onError);
|
|
||||||
|
|
||||||
function onListening(): void {
|
function onListening(): void {
|
||||||
log("Server thread started");
|
log('Server thread started')
|
||||||
}
|
}
|
||||||
|
|
||||||
function onError(error: NodeJS.ErrnoException): void {
|
function onError(error: NodeJS.ErrnoException): void {
|
||||||
if (error.syscall !== "listen") throw error;
|
if (error.syscall !== 'listen') throw error
|
||||||
switch (error.code) {
|
switch (error.code) {
|
||||||
case "EACCES":
|
case 'EACCES':
|
||||||
log("Required elevated privileges");
|
log('Required elevated privileges')
|
||||||
process.exit(1);
|
process.exit(1)
|
||||||
break;
|
case 'EADDRINUSE':
|
||||||
case "EADDRINUSE":
|
log('Port is already in use')
|
||||||
log("Port is already in use");
|
process.exit(1)
|
||||||
process.exit(1);
|
default:
|
||||||
break;
|
throw error
|
||||||
default:
|
}
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default server;
|
app.use((req, res, next) => {
|
||||||
|
res.header('Access-Control-Allow-Origin', '*')
|
||||||
|
res.header(
|
||||||
|
'Access-Control-Allow-Headers',
|
||||||
|
'Origin, X-Requested-With, Content-Type, Accept, Authorization'
|
||||||
|
)
|
||||||
|
res.header(
|
||||||
|
'Access-Control-Allow-Methods',
|
||||||
|
'GET, POST, OPTIONS, PUT, DELETE'
|
||||||
|
)
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
app.use(morgan('dev'))
|
||||||
|
app.use(bodyParser.json())
|
||||||
|
app.use(bodyParser.urlencoded({ extended: false }))
|
||||||
|
app.use(compression())
|
||||||
|
// routes
|
||||||
|
app.use('/api/v1/urlcheck', UrlCheckRouter)
|
||||||
|
|
||||||
|
/// catch 404
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
res.status(404).send()
|
||||||
|
})
|
||||||
|
|
||||||
|
// listen
|
||||||
|
const server = app.listen(config.app.port)
|
||||||
|
server.on('listening', onListening)
|
||||||
|
server.on('error', onError)
|
||||||
|
|
||||||
|
export default server
|
||||||
|
@ -1,58 +1,69 @@
|
|||||||
import { Router, Request, Response, NextFunction } from "express";
|
import { Router, Request, Response, NextFunction } from 'express'
|
||||||
import request from "request";
|
import request from 'request'
|
||||||
|
|
||||||
export class UrlCheckRouter {
|
export class UrlCheckRouter {
|
||||||
router: Router;
|
public router: Router
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the UrlCheckRouter
|
* Initialize the UrlCheckRouter
|
||||||
*/
|
*/
|
||||||
constructor() {
|
public constructor() {
|
||||||
this.router = Router();
|
this.router = Router()
|
||||||
}
|
|
||||||
|
|
||||||
public checkUrl(req: Request, res: Response, next: NextFunction) {
|
|
||||||
if (!req.body.url) {
|
|
||||||
return res.send({ status: "error", message: "missing url" });
|
|
||||||
}
|
}
|
||||||
request(
|
|
||||||
{
|
|
||||||
method: "HEAD",
|
|
||||||
url: req.body.url,
|
|
||||||
headers: { Range: "bytes=0-" }
|
|
||||||
},
|
|
||||||
(error, response) => {
|
|
||||||
if (response.statusCode.toString().startsWith("2")) {
|
|
||||||
const result: any = {};
|
|
||||||
result.found = true;
|
|
||||||
if (response.headers["content-length"]) {
|
|
||||||
result.contentLength = response.headers["content-length"];
|
|
||||||
}
|
|
||||||
if (response.headers["content-type"]) {
|
|
||||||
const typeAndCharset = response.headers["content-type"].split(";");
|
|
||||||
result.contentType = typeAndCharset[0];
|
|
||||||
if (typeAndCharset[1]) {
|
|
||||||
result.contentCharset = typeAndCharset[1].split("=")[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res.send({ status: "success", result: result });
|
|
||||||
}
|
|
||||||
return res.send({ status: "error", message: error });
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public checkUrl(req: Request, res: Response, next: NextFunction) {
|
||||||
* Take each handler, and attach to one of the Express.Router's
|
if (!req.body.url) {
|
||||||
* endpoints.
|
return res.send({ status: 'error', message: 'missing url' })
|
||||||
*/
|
}
|
||||||
init() {
|
request(
|
||||||
this.router.post("/", this.checkUrl);
|
{
|
||||||
}
|
method: 'HEAD',
|
||||||
|
url: req.body.url,
|
||||||
|
headers: { Range: 'bytes=0-' }
|
||||||
|
},
|
||||||
|
(error, response) => {
|
||||||
|
if (response.statusCode.toString().startsWith('2')) {
|
||||||
|
const result: any = {}
|
||||||
|
result.found = true
|
||||||
|
|
||||||
|
if (response.headers['content-length']) {
|
||||||
|
result.contentLength =
|
||||||
|
response.headers['content-length']
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.headers['content-type']) {
|
||||||
|
const typeAndCharset = response.headers[
|
||||||
|
'content-type'
|
||||||
|
].split(';')
|
||||||
|
|
||||||
|
result.contentType = typeAndCharset[0] // eslint-disable-line prefer-destructuring
|
||||||
|
|
||||||
|
if (typeAndCharset[1]) {
|
||||||
|
/* eslint-disable prefer-destructuring */
|
||||||
|
result.contentCharset = typeAndCharset[1].split(
|
||||||
|
'='
|
||||||
|
)[1]
|
||||||
|
/* eslint-enable prefer-destructuring */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res.send({ status: 'success', result })
|
||||||
|
}
|
||||||
|
return res.send({ status: 'error', message: error })
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Take each handler, and attach to one of the Express.Router's
|
||||||
|
* endpoints.
|
||||||
|
*/
|
||||||
|
public init() {
|
||||||
|
this.router.post('/', this.checkUrl)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the MeRouter, and export its configured Express.Router
|
// Create the MeRouter, and export its configured Express.Router
|
||||||
const urlCheckRoutes = new UrlCheckRouter();
|
const urlCheckRoutes = new UrlCheckRouter()
|
||||||
urlCheckRoutes.init();
|
urlCheckRoutes.init()
|
||||||
|
|
||||||
export default urlCheckRoutes.router;
|
export default urlCheckRoutes.router
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import request from "supertest";
|
import request from 'supertest'
|
||||||
import server from "../src";
|
import server from '../src'
|
||||||
import {} from "jasmine";
|
import {} from 'jasmine'
|
||||||
|
|
||||||
afterAll((done) => {
|
afterAll(done => {
|
||||||
server.close(done);
|
server.close(done)
|
||||||
});
|
})
|
||||||
|
|
||||||
describe("POST /api/v1/urlcheck", () => {
|
describe('POST /api/v1/urlcheck', () => {
|
||||||
it('responds with json', function(done) {
|
it('responds with json', function(done) {
|
||||||
request(server)
|
request(server)
|
||||||
.post('/api/v1/urlcheck')
|
.post('/api/v1/urlcheck')
|
||||||
.expect(200, done);
|
.expect(200, done)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"*": [
|
"*": ["node_modules/*", "src/types/*"]
|
||||||
"node_modules/*",
|
|
||||||
"src/types/*"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"types": [ "node" ],
|
|
||||||
"typeRoots": [
|
|
||||||
"node_modules/@types"
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
"include": [
|
"types": ["node"],
|
||||||
"src/**/*"
|
"typeRoots": ["node_modules/@types"]
|
||||||
]
|
},
|
||||||
}
|
"include": ["src/**/*"]
|
||||||
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"rules": {
|
|
||||||
"class-name": true,
|
|
||||||
"comment-format": [
|
|
||||||
true,
|
|
||||||
"check-space"
|
|
||||||
],
|
|
||||||
"indent": [
|
|
||||||
true,
|
|
||||||
"spaces"
|
|
||||||
],
|
|
||||||
"one-line": [
|
|
||||||
true,
|
|
||||||
"check-open-brace",
|
|
||||||
"check-whitespace"
|
|
||||||
],
|
|
||||||
"no-var-keyword": true,
|
|
||||||
"quotemark": [
|
|
||||||
true,
|
|
||||||
"double",
|
|
||||||
"avoid-escape"
|
|
||||||
],
|
|
||||||
"semicolon": [
|
|
||||||
true,
|
|
||||||
"always",
|
|
||||||
"ignore-bound-class-methods"
|
|
||||||
],
|
|
||||||
"whitespace": [
|
|
||||||
true,
|
|
||||||
"check-branch",
|
|
||||||
"check-decl",
|
|
||||||
"check-operator",
|
|
||||||
"check-module",
|
|
||||||
"check-separator",
|
|
||||||
"check-type"
|
|
||||||
],
|
|
||||||
"typedef-whitespace": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"call-signature": "nospace",
|
|
||||||
"index-signature": "nospace",
|
|
||||||
"parameter": "nospace",
|
|
||||||
"property-declaration": "nospace",
|
|
||||||
"variable-declaration": "nospace"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"call-signature": "onespace",
|
|
||||||
"index-signature": "onespace",
|
|
||||||
"parameter": "onespace",
|
|
||||||
"property-declaration": "onespace",
|
|
||||||
"variable-declaration": "onespace"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-internal-module": true,
|
|
||||||
"no-trailing-whitespace": true,
|
|
||||||
"no-null-keyword": true,
|
|
||||||
"prefer-const": true,
|
|
||||||
"jsdoc-format": true
|
|
||||||
}
|
|
||||||
}
|
|
3
tsconfig.json
Normal file
3
tsconfig.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"include": ["client/src", "server/src"]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user