-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6224f0d
commit 13f7a4d
Showing
14 changed files
with
427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"next/babel", | ||
{ | ||
"preset-env": { | ||
"useBuiltIns": "usage" | ||
} | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"alias": { | ||
"src": "./src" | ||
} | ||
} | ||
], | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
"env": { | ||
"test": { | ||
"presets": [["@babel/preset-env", { "modules": false }], "next/babel"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
DATABASE_URL="postgresql://user:pass@localhost:5432/db?schema=public" | ||
API_HOST="http://localhost:3000" | ||
|
||
TESTWYRE_ACCOUNT_ID="AC_TJM7VTUR2JG" | ||
TESTWYRE_API_HOST="api.testwyre.com" | ||
TESTWYRE_PAY_HOST="pay.testwyre.com" | ||
TESTWYRE_API_KEY="AK-78ETD827-66W4ZMAP-LDXXHDNH-92LV9FFC" | ||
TESTWYRE_SECRET_KEY="SK-AZCMZ3Z4-3ECW6M2P-PN7FPATH-RDC63MLL" | ||
|
||
SENDWYRE_ACCOUNT_ID="AC_DWVWRDXUNTH" | ||
SENDWYRE_API_HOST="api.sendwyre.com" | ||
SENDWYRE_PAY_HOST="pay.sendwyre.com" | ||
SENDWYRE_API_KEY="" | ||
SENDWYRE_SECRET_KEY="" | ||
|
||
WYRE_WEBHOOK_KEY="ac0468799de598a447f5c53ee73cfd3845d0e6507abbedf7352ab9524414c1a5" | ||
|
||
TEST_MOON_PAY_HOST="buy-staging.moonpay.io" | ||
TEST_MOON_PAY_KEY="pk_test_w0ehD69XnRdMapvfmMjK1t33NlZPPD" | ||
TEST_MOON_PAY_SECRET_KEY="sk_test_Oso8znoaLIlsmLPP9wqNFWjqdSGNh5k" | ||
PROD_MOON_PAY_HOST="buy.moonpay.io" | ||
PROD_MOON_PAY_KEY="" | ||
PROD_MOON_PAY_SECRET_KEY="" | ||
MOONPAY_API_HOST="api.moonpay.io/v3" | ||
|
||
LATAMEX_ENABLED=1 | ||
LATAMEX_API_HOST="https://api-staging.zetl.network" | ||
LATAMEX_API_USER="[email protected]" | ||
LATAMEX_API_PASSWORD="9T7YkEMQivBQ5D4qhHJr" | ||
|
||
CHALLENGE_JWT_SECRET="ABC123" | ||
USER_JWT_SECRET="A123124124" | ||
|
||
COMPOUND_API_HOST="api.compound.finance" | ||
|
||
GRAPH_API_HOST="api.thegraph.com" | ||
|
||
CONTACT_EMAILS_SENDER=[email protected] | ||
CONTACT_EMAILS_RECEIVER=[email protected] | ||
SMTP_USERNAME=[email protected] | ||
SMTP_PASSWORD_SECRET=5EY58GHxqwJSNKRkBv | ||
SMTP_SERVER_NAME=smtp.ethereal.email | ||
SMTP_PORT=587 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
{ | ||
"ignorePatterns": ["node_modules/"], | ||
"env": { | ||
"es6": true | ||
}, | ||
"extends": ["typestrict"], | ||
"plugins": ["no-only-tests", "simple-import-sort", "import", "react", "unused-imports"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"unused-imports/no-unused-imports-ts": "error", | ||
"react/jsx-uses-react": "error", | ||
"react/jsx-uses-vars": "error", | ||
"import/no-default-export": "error", | ||
"simple-import-sort/sort": [ | ||
"error", | ||
{ | ||
"groups": [ | ||
// Side effect imports. | ||
["^\\u0000"], | ||
// Packages. | ||
// Things that start with a letter (or digit or underscore), or `@` followed by a letter. | ||
["^@?\\w"], | ||
// Absolute imports and other imports such as Vue-style `@/foo`. | ||
// Anything that does not start with a dot. | ||
["^[^.]"], | ||
// Relative imports. | ||
// Anything that starts with a dot. | ||
// anything that stars with /src (out custom path) | ||
["(^\\.|src/)"] | ||
] | ||
} | ||
], | ||
"func-style": ["error", "declaration"], | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-useless-constructor": "error", | ||
"accessor-pairs": "error", | ||
"constructor-super": "error", | ||
"eqeqeq": [ | ||
"error", | ||
"always", | ||
{ | ||
"null": "ignore" | ||
} | ||
], | ||
"handle-callback-err": ["error", "^(err|error)$"], | ||
"new-parens": "error", | ||
"no-array-constructor": "error", | ||
"no-async-promise-executor": "error", | ||
"no-caller": "error", | ||
"no-class-assign": "error", | ||
"no-compare-neg-zero": "error", | ||
"no-cond-assign": "error", | ||
"no-const-assign": "error", | ||
"no-constant-condition": [ | ||
"error", | ||
{ | ||
"checkLoops": false | ||
} | ||
], | ||
"no-control-regex": "error", | ||
"no-debugger": "error", | ||
"no-delete-var": "error", | ||
"no-dupe-args": "error", | ||
"no-dupe-keys": "error", | ||
"no-duplicate-case": "error", | ||
"no-empty-character-class": "error", | ||
"no-empty-pattern": "error", | ||
"no-eval": "error", | ||
"no-ex-assign": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "error", | ||
"no-extra-boolean-cast": "error", | ||
"no-fallthrough": "error", | ||
"no-floating-decimal": "error", | ||
"no-func-assign": "error", | ||
"no-global-assign": "error", | ||
"no-implied-eval": "error", | ||
"no-inner-declarations": ["error", "functions"], | ||
"no-invalid-regexp": "error", | ||
"no-iterator": "error", | ||
"no-label-var": "error", | ||
"no-labels": [ | ||
"error", | ||
{ | ||
"allowLoop": false, | ||
"allowSwitch": false | ||
} | ||
], | ||
"no-lone-blocks": "error", | ||
"no-misleading-character-class": "error", | ||
"no-multi-str": "error", | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 1, | ||
"maxEOF": 0 | ||
} | ||
], | ||
"no-negated-in-lhs": "error", | ||
"no-new": "error", | ||
"no-new-func": "error", | ||
"no-new-object": "error", | ||
"no-new-require": "error", | ||
"no-new-symbol": "error", | ||
"no-new-wrappers": "error", | ||
"no-obj-calls": "error", | ||
"no-octal": "error", | ||
"no-octal-escape": "error", | ||
"no-path-concat": "error", | ||
"no-proto": "error", | ||
"no-redeclare": [ | ||
"error", | ||
{ | ||
"builtinGlobals": false | ||
} | ||
], | ||
"no-invalid-this": "off", | ||
"no-use-before-define": "off", | ||
"no-regex-spaces": "error", | ||
"no-return-assign": ["error", "except-parens"], | ||
"no-self-assign": "error", | ||
"no-self-compare": "error", | ||
"no-sequences": "error", | ||
"no-shadow-restricted-names": "error", | ||
"no-sparse-arrays": "error", | ||
"no-tabs": "error", | ||
"no-this-before-super": "error", | ||
"no-throw-literal": "error", | ||
"no-unexpected-multiline": "error", | ||
"no-unmodified-loop-condition": "error", | ||
"no-unneeded-ternary": [ | ||
"error", | ||
{ | ||
"defaultAssignment": false | ||
} | ||
], | ||
"no-unreachable": "error", | ||
"no-unsafe-finally": "error", | ||
"no-unsafe-negation": "error", | ||
"no-restricted-imports": ["error"], | ||
"no-useless-call": "error", | ||
"no-useless-catch": "error", | ||
"no-useless-computed-key": "error", | ||
"no-useless-escape": "error", | ||
"no-useless-rename": "error", | ||
"no-useless-return": "error", | ||
"no-with": "error", | ||
"object-curly-spacing": ["error", "always"], | ||
"object-property-newline": [ | ||
"error", | ||
{ | ||
"allowMultiplePropertiesPerLine": true | ||
} | ||
], | ||
"one-var": [ | ||
"error", | ||
{ | ||
"initialized": "never" | ||
} | ||
], | ||
"prefer-const": [ | ||
"error", | ||
{ | ||
"destructuring": "all" | ||
} | ||
], | ||
"prefer-promise-reject-errors": "error", | ||
"symbol-description": "error", | ||
"unicode-bom": ["error", "never"], | ||
"use-isnan": "error", | ||
"valid-typeof": [ | ||
"error", | ||
{ | ||
"requireStringLiterals": true | ||
} | ||
], | ||
"wrap-iife": [ | ||
"error", | ||
"any", | ||
{ | ||
"functionPrototypeMethods": true | ||
} | ||
], | ||
"yoda": ["error", "never"], | ||
"no-only-tests/no-only-tests": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["pages/**/*.{ts,tsx}"], | ||
"rules": { | ||
"import/no-default-export": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["**/*.tsx"], | ||
"rules": { | ||
"func-style": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { join } = require('path') | ||
const { existsSync } = require('fs') | ||
process.env.NODE_ENV = 'test' | ||
|
||
// if test config exists in cwd prefer this one | ||
const testTsconfigPath = join(process.cwd(), 'tsconfig.test.json') | ||
if (existsSync(testTsconfigPath)) { | ||
process.env.TS_NODE_PROJECT = testTsconfigPath | ||
} | ||
|
||
// we need to transpile typescript files in node_modules because some dependencies are distributed as typescript files | ||
// transpile pg_packet-stream because it's written in TS :O | ||
process.env.TS_NODE_IGNORE = '/^node_modules/((?!pg-packet-stream).)*$/' | ||
|
||
module.exports = { | ||
require: ['ts-node/register/transpile-only', 'tsconfig-paths/register'], | ||
extension: ['ts'], | ||
watchExtensions: ['ts'], | ||
spec: ['./helpers/**/*.test.ts', './components/**/*.test.ts'], | ||
timeout: 1000, | ||
} | ||
|
||
// do not import files that we don't care about | ||
function noop() { | ||
return null | ||
} | ||
require.extensions['.svg'] = noop | ||
require.extensions['.mdx'] = noop | ||
|
||
// setup chai | ||
var chai = require('chai') | ||
var sinonChai = require('sinon-chai') | ||
chai.use(sinonChai) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.vscode | ||
package.json | ||
**/dist/** | ||
.next/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 100, | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"proseWrap": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { RouterContext } from 'next/dist/next-server/lib/router-context' | ||
import { useState } from 'react' | ||
import Router from 'next/router' | ||
|
||
function RouterMock(storyFn) { | ||
const [pathname, setPathname] = useState('/') | ||
|
||
const mockRouter = { | ||
query: {}, | ||
pathname, | ||
prefetch: () => {}, | ||
push: async (newPathname) => { | ||
setPathname(newPathname) | ||
}, | ||
} | ||
|
||
Router.router = mockRouter | ||
|
||
return <RouterContext.Provider value={mockRouter}>{storyFn()}</RouterContext.Provider> | ||
} | ||
|
||
export default RouterMock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react' | ||
import { ThemeProvider } from 'theme-ui' | ||
import { theme } from '../theme' | ||
import { merge } from 'lodash' | ||
|
||
const ThemeDecorator = (storyFn) => <ThemeProvider theme={theme}>{storyFn()}</ThemeProvider> | ||
|
||
export default ThemeDecorator |
Oops, something went wrong.