Skip to content

Commit

Permalink
project maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Feb 2, 2022
1 parent a708594 commit 1ba026a
Show file tree
Hide file tree
Showing 14 changed files with 626 additions and 6,179 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": { "project": "./tsconfig.json", "sourceType": "module" },
"env": { "es6": true },
"ignorePatterns": ["node_modules", "build", "coverage", "*.config.js"],
"plugins": ["import", "eslint-comments"],
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"prettier"
],
"rules": {
"import/order": [
"error",
{ "newlines-between": "always", "alphabetize": { "order": "asc" } }
],
"sort-imports": [
"error",
{ "ignoreDeclarationSort": true, "ignoreCase": true }
]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
build

.DS_Store
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run all test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/**/*.test.ts"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": ["<node_internals>/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Run current test file",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--timeout", "999999", "--colors", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": ["<node_internals>/**/*.js"]
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
7 changes: 3 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "hardhat-gas-reporter";
import "@nomiclabs/hardhat-ethers"
import "hardhat-gas-reporter"

export default {
paths: {
Expand Down Expand Up @@ -28,4 +27,4 @@ export default {
mocha: {
timeout: 2000000,
},
};
}
79 changes: 35 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,50 @@
"version": "1.0.0",
"description": "{{mustache}} templates compiling to Solidity",
"scripts": {
"build": "hardhat compile",
"test": "hardhat test",
"test:watch": "mocha -w",
"deploy": "hardhat initialDeploy --network",
"verify": "hardhat verifyEtherscan --network",
"upgrade": "hardhat upgrade --network",
"coverage": "hardhat coverage",
"lint": "yarn lint:sol && yarn lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:ts": "eslint --max-warnings 0 .",
"fmt:sol": "prettier 'contracts/**/*.sol' -w",
"fmt:ts": "prettier '(src|test)/**/*.ts' -w",
"prepack": "yarn build"
"prepare": "yarn build",
"prebuild": "rimraf build",
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"check": "yarn check:prettier && yarn check:lint",
"check:lint": "eslint src test --ext .ts",
"check:prettier": "prettier \"(src|test)/**/*.ts\" --list-different",
"fix": "yarn fix:prettier && yarn fix:lint",
"fix:prettier": "prettier \"(src|test)/**/*.ts\" --write",
"fix:lint": "eslint src --ext .ts --fix",
"test": "mocha",
"test:watch": "mocha -w"
},
"repository": {
"type": "git"
},
"author": "[email protected]",
"license": "LGPL-3.0+",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "2.0.3",
"@nomiclabs/hardhat-waffle": "2.0.1",
"@types/chai": "4.3.0",
"@types/mocha": "9.0.0",
"@types/node": "17.0.8",
"@typescript-eslint/eslint-plugin": "5.9.0",
"@typescript-eslint/parser": "5.9.0",
"argv": "0.0.2",
"chai": "4.3.4",
"debug": "4.3.3",
"dotenv": "10.0.0",
"eslint": "8.6.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-no-only-tests": "2.6.0",
"eslint-plugin-prettier": "4.0.0",
"ethereum-waffle": "3.4.0",
"ethers": "5.5.2",
"hardhat": "2.8.0",
"hardhat-gas-reporter": "1.0.6",
"prettier": "2.5.1",
"prettier-plugin-solidity": "1.0.0-beta.19",
"solc": "0.8.11",
"solhint": "3.3.6",
"solhint-plugin-prettier": "0.0.5",
"ts-node": "10.4.0",
"typescript": "4.5.4"
},
"resolutions": {
"bitcore-lib": "8.25.0"
"@nomiclabs/hardhat-ethers": "^2.0.3",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.8",
"@types/prettier": "^2.4.3",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"chai": "^4.3.4",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"ethers": "^5.5.2",
"hardhat": "^2.8.0",
"hardhat-gas-reporter": "^1.0.6",
"rimraf": "^3.0.2",
"solc": "^0.8.11",
"ts-node": "^10.4.0",
"typescript": "^4.5.4"
},
"dependencies": {
"@handlebars/parser": "^2.1.0",
"@rari-capital/solmate": "^6.2.0"
"prettier": "^2.5.1",
"prettier-plugin-solidity": "^1.0.0-beta.19"
}
}
33 changes: 0 additions & 33 deletions src/Template.sol

This file was deleted.

37 changes: 0 additions & 37 deletions src/Template.sol.hbs

This file was deleted.

10 changes: 7 additions & 3 deletions test/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs"
import path from "path"

import { expect } from "chai"
import { Contract } from "ethers"
import { ethers } from "hardhat"

import "@nomiclabs/hardhat-ethers"
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs"
import path from "path"

import { compile } from "../src/compile"
import { Contract } from "ethers"

// eslint-disable-next-line @typescript-eslint/no-var-requires
const solc = require("solc")

function solCompile(contractSource: string) {
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"noEmit": false,
"target": "es2017",
"outDir": "build/cjs",
"module": "commonjs"
},
"include": ["./src"]
}
9 changes: 9 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"noEmit": false,
"outDir": "build/esm",
"module": "esnext"
},
"include": ["./src"]
}
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"skipLibCheck": true,
"strict": true,
"target": "es2020",
"lib": ["es2016"],
"lib": ["es2020"],
"typeRoots": ["node_modules/@types", "typings"]
},
"include": ["./src", "./test"],
"files": ["./hardhat.config.ts"]
"include": ["./src", "./test"]
}
Loading

0 comments on commit 1ba026a

Please sign in to comment.