Skip to content

Commit

Permalink
Replace rollup with tsc (snapshot-labs#2)
Browse files Browse the repository at this point in the history
* Replace rollup with tsc

* TSC build fixes (snapshot-labs#6)

* Merge master into fabien/tsc

* TSC build fixes

* Fix files in package.json

* README import in tsc build (snapshot-labs#10)

Co-authored-by: Chaitanya <[email protected]>
  • Loading branch information
bonustrack and ChaituVR authored Aug 6, 2021
1 parent 5c960f8 commit b6be3af
Show file tree
Hide file tree
Showing 47 changed files with 313 additions and 2,774 deletions.
2,850 changes: 264 additions & 2,586 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 16 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"name": "@snapshot-labs/strategies",
"version": "0.1.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js"
},
"files": [
"dist"
],
"repository": "snapshot-labs/snapshot-strategies",
"license": "MIT",
"main": "dist/snapshot.cjs.js",
"module": "dist/snapshot.esm.js",
"browser": "dist/snapshot.min.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"build:cjs": "rollup -c rollup.cjs.config.js",
"dev": "rollup -c -w",
"build": "tsc -p .",
"test": "jest test/index.spec.ts --runInBand --testTimeout=120000",
"pretest": "npm run build:cjs",
"lint": "eslint . --ext .ts --fix",
"prepare": "npm run build"
"pretest": "npm run build",
"prepublishOnly": "npm run build",
"prepare": "npm run build",
"postbuild": "copyfiles -u 1 src/**/*.md dist/",
"lint": "eslint . --ext .ts --fix"
},
"dependencies": {
"@ethersproject/abi": "^5.0.4",
Expand All @@ -34,33 +38,20 @@
"lodash.set": "^4.3.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@types/jest": "^26.0.23",
"@types/node": "^13.9.5",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"copyfiles": "^2.4.1",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^26.6.3",
"prettier": "2.2.0",
"rollup": "^2.35.1",
"rollup-plugin-filesize": "^9.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.0",
"rollup-plugin-typescript2": "^0.27.0",
"typescript": "^3.8.3"
},
"engines": {
"node": ">=14"
},
"files": [
"dist",
"src"
]
}
}
22 changes: 0 additions & 22 deletions rollup.cjs.config.js

This file was deleted.

50 changes: 0 additions & 50 deletions rollup.config.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/strategies/aave-governance-power/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { BigNumber } from '@ethersproject/bignumber';
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'kartojal';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

/**
* Aave Governance strategy to measure voting or
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/balance-of-with-thresholds/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'lucid-eleven';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function balanceOf(address account) external view returns (uint256)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/brightid/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'bonustrack';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function isVerifiedUser(address _user) external view returns (bool)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/cake/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import fetch from 'cross-fetch';
import { subgraphRequest } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'pancake-swap';
export const version = '0.0.1';
export const examples = examplesFile;
export const about = aboutFile;

type VotingResponse = {
verificationHash: string;
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/celer-sgn-delegation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { BigNumber } from '@ethersproject/bignumber';
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'dominator008';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
{
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/contract-call/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'in19farkt';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

function getArgs(options, address: string) {
const args: Array<string | number> = options.args || ['%{address}'];
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/ctoken/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import aboutFile from './README.md';

export const author = 'arr00';
export const version = '0.1.0';
export const about = aboutFile;

const abi = [
{
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/curio-cards-erc20-weighted/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'fafrd';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

export async function strategy(
space,
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/dittomoney/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits, parseUnits } from '@ethersproject/units';
import Multicaller from '../../utils/multicaller';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'codingsh';
export const version = '0.1.1';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
{
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/ens-domains-owned/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getAddress } from '@ethersproject/address';
import { subgraphRequest } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

const ENS_SUBGRAPH_URL = {
'1': 'https://api.thegraph.com/subgraphs/name/ensdomains/ens',
Expand All @@ -13,7 +12,6 @@ const ENS_SUBGRAPH_URL = {
export const author = 'makoto';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

export async function strategy(
_space,
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/ens-reverse-record/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { call } from '../../utils';
import namehash from 'eth-ens-namehash';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'makoto';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
{
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc20-balance-of-quadratic-delegation/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of';
import { getDelegations } from '../../utils/delegation';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'ferittuncer';
export const version = '1.0.0';
export const examples = examplesFile;
export const about = aboutFile;

export async function strategy(
space,
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc20-balance-of/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import { BigNumberish } from '@ethersproject/bignumber';
import { formatUnits } from '@ethersproject/units';
import Multicaller from '../../utils/multicaller';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'bonustrack';
export const version = '0.1.1';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function balanceOf(address account) external view returns (uint256)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc20-price/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import fetch from 'cross-fetch';
import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'snapshot-labs';
export const version = '0.0.1';
export const examples = examplesFile;
export const about = aboutFile;

const networksWithPlatforms = {
1: 'ethereum',
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc20-received/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { Web3Provider } from '@ethersproject/providers';
import { formatUnits } from '@ethersproject/units';
import { BigNumber } from '@ethersproject/bignumber';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'mccallofthewild';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

export async function strategy(
...args: [
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc721-with-multiplier/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = '2fd';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function balanceOf(address account) external view returns (uint256)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc721-with-tokenid/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'dimsome';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function ownerOf(uint256 tokenId) public view returns (address owner)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/erc721/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'bonustrack';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
'function balanceOf(address account) external view returns (uint256)'
Expand Down
2 changes: 0 additions & 2 deletions src/strategies/esd/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { formatUnits } from '@ethersproject/units';
import { multicall } from '../../utils';
import examplesFile from './examples.json';
import aboutFile from './README.md';

export const author = 'l3wi';
export const version = '0.1.0';
export const examples = examplesFile;
export const about = aboutFile;

const abi = [
{
Expand Down
Loading

0 comments on commit b6be3af

Please sign in to comment.