-
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.
feat(library): Make emprops-clients a library (#6)
- Loading branch information
1 parent
84bc8f5
commit f1dc149
Showing
21 changed files
with
1,112 additions
and
447 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,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{js,jsx,ts,tsx,json}] | ||
indent_size = 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,19 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:prettier/recommended", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"plugins": ["prettier", "@typescript-eslint"], | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"no-prototype-builtins": "warn", | ||
"no-async-promise-executor": "warn", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/ban-ts-comment": "warn" | ||
} | ||
} |
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 @@ | ||
name: build | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node: ['18.x'] | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install deps and build (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Build | ||
run: yarn build |
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,31 @@ | ||
name: Publish NPM | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install npm toolchain | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
|
||
- run: npm install | ||
- run: npm run build | ||
- run: npm version ${{github.ref_name}} --git-tag-version false | ||
- run: npm pkg set version=${{github.ref_name}} | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "release: ${{github.ref_name}}" | ||
branch: master | ||
file_pattern: package.json | ||
- run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
- run: npm publish --access public |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
node_modules | ||
.DS_Store | ||
node_modules | ||
dist | ||
.env | ||
types | ||
*-error.log | ||
output |
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,50 @@ | ||
import prettier from "eslint-plugin-prettier"; | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ["**/node_modules/", "**/dist/", "**/types/"], | ||
}, | ||
...compat.extends( | ||
"plugin:prettier/recommended", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
), | ||
{ | ||
plugins: { | ||
prettier, | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
|
||
parser: tsParser, | ||
}, | ||
ignores: ["node_modules/*", "dist/*", "types/*"], | ||
files: ["**/*.ts"], | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"no-prototype-builtins": "warn", | ||
"no-async-promise-executor": "warn", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/ban-ts-comment": "warn", | ||
}, | ||
}, | ||
]; |
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 |
---|---|---|
@@ -1,26 +1,35 @@ | ||
{ | ||
"name": "contract-client", | ||
"name": "@emprops/clients", | ||
"version": "0.0.1", | ||
"description": "Library to interact with EmProps smart contracts in different blockchains", | ||
"main": "index.js", | ||
"description": "Core clients EmProps library", | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"types" | ||
], | ||
"author": "David Rodriguez <[email protected]>", | ||
"license": "MIT", | ||
"private": true, | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"dev": "ts-node-dev --respawn --transpile-only src/index.ts", | ||
"build": "tsc", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"build": "rm -rf dist && tsc", | ||
"lint": "eslint --fix ." }, | ||
"dependencies": { | ||
"@dynamic-labs/utils": "^2.2.7", | ||
"discord.js": "^14.15.3", | ||
"typescript": "^5.4.5", | ||
"viem": "^2.16.5", | ||
"viem": "^2.17.10", | ||
"web3": "^4.10.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.12.13", | ||
"ts-node": "^10.9.2", | ||
"ts-node-dev": "^2.0.0" | ||
"@typescript-eslint/eslint-plugin": "^7.17.0", | ||
"@typescript-eslint/parser": "^7.17.0", | ||
"eslint": "^9.7.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.5.4" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
} | ||
} |
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 @@ | ||
#!/bin/bash | ||
|
||
cd packages/core | ||
rm -rf node_modules | ||
yarn install -f | ||
npm version $1 | ||
npm publish | ||
cd ../.. | ||
git add . | ||
git commit -m "release: publish $1" | ||
git tag $1 | ||
git push origin master --tags |
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
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
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
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
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,4 @@ | ||
export * from "./types"; | ||
export * from "./factory"; | ||
export * from "./base/v1"; | ||
export * from "./utils"; |
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
Oops, something went wrong.