-
Notifications
You must be signed in to change notification settings - Fork 149
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
Showing
14 changed files
with
329 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,14 @@ | ||
const useESModules = !!process.env.MODULE; | ||
|
||
module.exports = (api) => { | ||
api.cache(() => process.env.MODULE); | ||
return { | ||
plugins: [ | ||
['@babel/transform-runtime', { useESModules }], | ||
'@babel/proposal-object-rest-spread', | ||
'@babel/proposal-class-properties', | ||
'@babel/proposal-export-default-from' | ||
], | ||
presets: useESModules ? ['@babel/typescript'] : ['@babel/typescript', '@babel/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,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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/ | ||
dist/ | ||
main/ | ||
module/ | ||
coverage/ |
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,71 @@ | ||
module.exports = { | ||
plugins: ['prettier'], | ||
extends: ['eslint:recommended', 'prettier'], | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
ecmaVersion: 11, | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true | ||
} | ||
}, | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true, | ||
jest: true | ||
}, | ||
rules: { | ||
'no-debugger': 2, | ||
'no-alert': 2, | ||
'no-await-in-loop': 0, | ||
'no-prototype-builtins': 0, | ||
'no-return-assign': ['error', 'except-parens'], | ||
'no-restricted-syntax': [ | ||
2, | ||
'ForInStatement', | ||
'LabeledStatement', | ||
'WithStatement' | ||
], | ||
'no-unused-vars': [ | ||
0, | ||
{ | ||
ignoreSiblings: true, | ||
argsIgnorePattern: 'React|res|next|^_' | ||
} | ||
], | ||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all' | ||
} | ||
], | ||
'no-unused-expressions': [ | ||
2, | ||
{ | ||
allowTaggedTemplates: true | ||
} | ||
], | ||
'no-console': 1, | ||
'comma-dangle': 2, | ||
'jsx-quotes': [2, 'prefer-double'], | ||
'linebreak-style': ['error', 'unix'], | ||
quotes: [ | ||
2, | ||
'single', | ||
{ | ||
avoidEscape: true, | ||
allowTemplateLiterals: true | ||
} | ||
], | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
trailingComma: 'none', | ||
singleQuote: true, | ||
printWidth: 80 | ||
} | ||
] | ||
} | ||
}; |
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,48 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# dist | ||
main | ||
module | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Editors | ||
.idea | ||
|
||
# Lib | ||
lib | ||
|
||
# npm package lock | ||
package-lock.json | ||
yarn.lock | ||
|
||
# others | ||
.DS_Store |
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,32 @@ | ||
*.log | ||
npm-debug.log* | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
.nyc_output | ||
|
||
# Dependency directories | ||
node_modules | ||
|
||
# npm package lock | ||
package-lock.json | ||
yarn.lock | ||
|
||
# project files | ||
__fixtures__ | ||
__tests__ | ||
.babelrc | ||
.babelrc.js | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.eslintrc.js | ||
.gitignore | ||
.travis.yml | ||
.vscode | ||
CHANGELOG.md | ||
examples | ||
jest.config.js | ||
package.json | ||
src | ||
test |
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 @@ | ||
scripts-prepend-node-path=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,16 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"[javascriptreact]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[javascript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact" | ||
] | ||
} |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2022 Eliot Baker <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
# react |
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,10 @@ | ||
import fun from '../src'; | ||
import cases from 'jest-in-case'; | ||
|
||
cases( | ||
'first test', | ||
options => { | ||
fun(options); | ||
}, | ||
[{ name: 'strings' }, { name: 'booleans' }, { name: 'noUnderscores' }] | ||
); |
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,80 @@ | ||
{ | ||
"name": "@cosmos-wallet/react", | ||
"version": "0.0.1", | ||
"description": "@cosmos-wallet react adapter", | ||
"author": "Eliot Baker <[email protected]>", | ||
"homepage": "https://github.com/DA0-DA0/cosmos-wallet#readme", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"main": "main/index.js", | ||
"module": "module/index.js", | ||
"typings": "types/index.d.ts", | ||
"directories": { | ||
"lib": "src", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"types", | ||
"main", | ||
"module" | ||
], | ||
"scripts": { | ||
"build:main": "cross-env BABEL_ENV=production babel src --out-dir main --delete-dir-on-start --extensions \".tsx,.ts,.js\"", | ||
"build:module": "cross-env MODULE=true babel src --out-dir module --delete-dir-on-start --extensions \".tsx,.ts,.js\"", | ||
"build": "npm run build:module && npm run build:main", | ||
"build:ts": "tsc --project ./tsconfig.json", | ||
"prepublish": "npm run build", | ||
"dev": "cross-env NODE_ENV=development babel-node src/index", | ||
"watch": "cross-env NODE_ENV=development babel-watch src/index", | ||
"lint": "eslint src --fix", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:debug": "node --inspect node_modules/.bin/jest --runInBand" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DA0-DA0/cosmos-wallet" | ||
}, | ||
"keywords": [], | ||
"bugs": { | ||
"url": "https://github.com/DA0-DA0/cosmos-wallet/issues" | ||
}, | ||
"jest": { | ||
"testPathIgnorePatterns": [ | ||
"main/", | ||
"module/", | ||
"types/" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.17.6", | ||
"@babel/core": "7.17.8", | ||
"@babel/eslint-parser": "^7.5.4", | ||
"@babel/node": "^7.10.5", | ||
"@babel/plugin-proposal-class-properties": "7.16.7", | ||
"@babel/plugin-proposal-export-default-from": "7.16.7", | ||
"@babel/plugin-proposal-object-rest-spread": "7.17.3", | ||
"@babel/plugin-transform-runtime": "7.17.0", | ||
"@babel/preset-env": "7.16.11", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@types/jest": "^27.4.1", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "27.5.1", | ||
"babel-watch": "^7.0.0", | ||
"cross-env": "^7.0.2", | ||
"eslint": "8.12.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.5.1", | ||
"jest-in-case": "^1.0.2", | ||
"prettier": "^2.1.2", | ||
"regenerator-runtime": "^0.13.7", | ||
"ts-jest": "^27.1.4", | ||
"typescript": "^4.6.2" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.11.2" | ||
} | ||
} |
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,3 @@ | ||
export default () => { | ||
|
||
}; |
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,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"declarationDir": "./types", | ||
"emitDeclarationOnly": true, | ||
"isolatedModules": true, | ||
"allowJs": true | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |