forked from gitcoinco/web
-
Notifications
You must be signed in to change notification settings - Fork 0
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
a6ab52b
commit a46afe5
Showing
12 changed files
with
7,395 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,10 @@ | ||
# editorconfig.org | ||
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 @@ | ||
dist |
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,218 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"jquery": true, | ||
"amd": true, | ||
"commonjs": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 6, | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"arrowFunctions": true | ||
} | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": [ | ||
"error", | ||
"always", { | ||
"objectsInArrays": false, | ||
"singleValue": false | ||
} | ||
], | ||
"block-scoped-var": "error", | ||
"block-spacing": "error", | ||
"brace-style": "error", | ||
"camelcase": "off", | ||
"class-methods-use-this": "error", | ||
"comma-dangle": [ | ||
"error", | ||
"never" | ||
], | ||
"comma-spacing": [ | ||
"error", { | ||
"before": false, | ||
"after": true | ||
} | ||
], | ||
"comma-style": [ | ||
"error", | ||
"last" | ||
], | ||
"guard-for-in": "error", | ||
"indent": [ | ||
"error", | ||
2, { | ||
"SwitchCase": 1, | ||
"VariableDeclarator": { | ||
"var": 2, | ||
"let": 2, | ||
"const": 3 | ||
}, | ||
"ArrayExpression": 1, | ||
"ObjectExpression": 1 | ||
} | ||
], | ||
"key-spacing": [ | ||
"error", { | ||
"beforeColon": false, | ||
"afterColon": true, | ||
"mode": "strict" | ||
} | ||
], | ||
"keyword-spacing": [ | ||
"error", { | ||
"before": true, | ||
"after": true | ||
} | ||
], | ||
"lines-around-directive": [ | ||
"error", { | ||
"before": "always", | ||
"after": "never" | ||
} | ||
], | ||
"newline-after-var": [ | ||
"error", "always" | ||
], | ||
"no-console": "warn", | ||
"no-div-regex": "error", | ||
"no-else-return": "error", | ||
"no-empty": [ | ||
"error", { | ||
"allowEmptyCatch": true | ||
} | ||
], | ||
"no-empty-function": "error", | ||
"no-eq-null": "warn", | ||
"no-extra-bind": "error", | ||
"no-extra-label": "error", | ||
"no-implicit-globals": "error", | ||
"no-labels": [ | ||
"error", { | ||
"allowLoop": true, | ||
"allowSwitch": true | ||
} | ||
], | ||
"no-lone-blocks": "error", | ||
"no-lonely-if": "error", | ||
"no-loop-func": "error", | ||
"no-mixed-spaces-and-tabs": [ | ||
"error", | ||
"smart-tabs" | ||
], | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 2, | ||
"maxEOF": 1, | ||
"maxBOF": 1 | ||
} | ||
], | ||
"no-multi-spaces": "error", | ||
"no-new": "error", | ||
"no-new-func": "error", | ||
"no-new-object": "error", | ||
"no-trailing-spaces": [ | ||
"error", { | ||
"skipBlankLines": true | ||
} | ||
], | ||
"no-return-assign": 2, | ||
"no-self-compare": "error", | ||
"no-undef": 0, | ||
"no-unneeded-ternary": "error", | ||
"no-unused-vars": 0, | ||
"no-useless-concat": "error", | ||
"no-useless-escape": "warn", | ||
"no-whitespace-before-property": "error", | ||
"nonblock-statement-body-position": [ | ||
"error", | ||
"below" | ||
], | ||
"one-var": [ | ||
"error", { | ||
"var": "never", | ||
"let": "never", | ||
"const": "never" | ||
} | ||
], | ||
"one-var-declaration-per-line": [ | ||
"error", | ||
"always" | ||
], | ||
"operator-linebreak": [ | ||
"error", | ||
"after", { | ||
"overrides": { | ||
"+=": "before", | ||
"?": "ignore", | ||
":": "ignore" | ||
} | ||
} | ||
], | ||
"quotes": [ | ||
"error", | ||
"single", { | ||
"avoidEscape": true | ||
} | ||
], | ||
"quote-props": [ | ||
"error", | ||
"as-needed", { | ||
"keywords": true, | ||
"unnecessary": false | ||
} | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"semi-spacing": [ | ||
"error", { | ||
"after": true, | ||
"before": false | ||
} | ||
], | ||
"space-before-blocks": [ | ||
"error", | ||
"always" | ||
], | ||
"space-before-function-paren": [ | ||
"error", | ||
"never" | ||
], | ||
"space-in-parens": [ | ||
"error", | ||
"never" | ||
], | ||
"space-infix-ops": "error", | ||
"space-unary-ops": [ | ||
"error", { | ||
"nonwords": false, | ||
"overrides": { | ||
"++": false, | ||
"new": false | ||
}, | ||
"words": true | ||
} | ||
], | ||
"spaced-comment": [ | ||
"error", | ||
"always", { | ||
"line": { | ||
"markers": ["/"] | ||
}, | ||
"block": { | ||
"exceptions": ["/"], | ||
"balanced": true | ||
} | ||
}], | ||
"wrap-regex": "error" | ||
} | ||
} |
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 @@ | ||
dist | ||
node_modules |
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 @@ | ||
src |
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,29 @@ | ||
{ | ||
"extends": "stylelint-config-recommended", | ||
"rules": { | ||
"at-rule-no-unknown": [ | ||
true, { | ||
"ignoreAtRules": [ | ||
"extends", | ||
"ignores" | ||
] | ||
} | ||
], | ||
"indentation": 2, | ||
"number-leading-zero": null, | ||
"selector-combinator-space-after": "always", | ||
"selector-combinator-space-before": "always", | ||
"unit-whitelist": [ | ||
"px", | ||
"em", | ||
"rem", | ||
"s", | ||
"%", | ||
"deg", | ||
"vw", | ||
"vh", | ||
"pt", | ||
"vmin" | ||
] | ||
} | ||
} |
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,65 @@ | ||
# Gitcoin SDK | ||
|
||
## Dynamic Widget | ||
|
||
### Example | ||
|
||
Step 1: Include the JavaScript SDK on your page once, ideally right after the opening body tag. | ||
|
||
```html | ||
<div id="gc-root"></div> | ||
<script>(function(d, s, id) { | ||
var js, gjs = d.getElementsByTagName(s)[0]; | ||
if (d.getElementById(id)) return; | ||
js = d.createElement(s); js.id = id; | ||
js.src = "https://unpkg.com/gitcoin-sdk"; | ||
gjs.parentNode.insertBefore(js, gjs); | ||
}(document, 'script', 'gitcoin-jssdk'));</script> | ||
``` | ||
|
||
Step 2: Place this code wherever you want the plugin to appear on your page. | ||
|
||
```html | ||
<div class="gitcoin-widget" | ||
data-limit="2" | ||
data-order-by="-expires_date" | ||
data-orginisation="MetaMask" | ||
data-repository="metamask-extension" | ||
></div> | ||
``` | ||
|
||
### Autoloading | ||
|
||
Importing the SDK into your application will attempt to autoload the widget by searching for '.gitcoin-widget' selectors | ||
|
||
```javascript | ||
import 'gitcoin-sdk'; | ||
``` | ||
or | ||
```javascript | ||
require('gitcoin-sdk'); | ||
``` | ||
|
||
### Programmatically | ||
|
||
You can also use the Widget programmatically. | ||
|
||
```javascript | ||
import { Widget } from 'gitcoin-sdk'; | ||
``` | ||
or | ||
```javascript | ||
const { Widget } = require('gitcoin-sdk'); | ||
``` | ||
|
||
Widget can be instantiated by passing a selector option, or an element reference. | ||
|
||
```javascript | ||
new Widget({ | ||
limit: 10, | ||
orderBy: '-expires_date', | ||
orginisation: 'MetaMask', | ||
repository: 'metamask-extension', | ||
selector: '.gitcoin-widget', | ||
}); | ||
``` |
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,39 @@ | ||
{ | ||
"name": "gitcoin-sdk", | ||
"version": "1.0.2", | ||
"description": "Gitcoin SDK.", | ||
"scripts": { | ||
"dev": "webpack --config webpack.config.js --mode development --progress --colors", | ||
"build": "webpack --config webpack.config.js --mode production --progress --colors", | ||
"prepublish": "npm run build", | ||
"eslint": "./node_modules/eslint/bin/eslint.js --quiet --config .eslintrc ./src/*.js", | ||
"eslint:fix": "./node_modules/eslint/bin/eslint.js --quiet --fix --config .eslintrc ./src/*.js", | ||
"stylelint": "stylelint ./src/*.css", | ||
"stylelint:fix": "stylelint --fix ./src/*.css", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": ["Gitcoin", "SDK"], | ||
"author": "Matthew Lilley", | ||
"license": "MIT", | ||
"files": [ | ||
"dist/index.js" | ||
], | ||
"main": "dist/index.js", | ||
"unpkg": "dist/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.46", | ||
"@babel/preset-env": "^7.0.0-beta.46", | ||
"babel-eslint": "^8.2.3", | ||
"babel-loader": "^8.0.0-beta", | ||
"clean-webpack-plugin": "^0.1.19", | ||
"css-loader": "^0.28.11", | ||
"eslint": "^4.19.1", | ||
"siema": "^1.5.1", | ||
"style-loader": "^0.21.0", | ||
"stylelint": "^9.2.0", | ||
"stylelint-config-recommended": "^2.1.0", | ||
"uglifyjs-webpack-plugin": "^1.2.5", | ||
"webpack": "^4.6.0", | ||
"webpack-cli": "^2.0.15" | ||
} | ||
} |
Oops, something went wrong.