Skip to content

Commit 81f7e7f

Browse files
committed
feat: 🎸 Npm package moved into ./package directory
1 parent 441711a commit 81f7e7f

15 files changed

+9503
-40
lines changed

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ artifacts
1212
cache
1313
./**/*.sol
1414
typechain
15-
typechainV6
15+
package

.github/workflows/release.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,23 @@ jobs:
1818
with:
1919
node-version: "lts/*"
2020
- name: Install dependencies
21-
run: yarn install --frozen-lockfile
21+
run: |
22+
yarn install --frozen-lockfile
23+
yarn --cwd package install --frozen-lockfile
2224
- name: Lint
23-
run: yarn lint
25+
run: |
26+
yarn lint
27+
yarn --cwd package lint
2428
- name: Test
25-
run: yarn test:src && yarn test:contracts
29+
run: yarn test:contracts
2630
- name: Build project
2731
run: |
2832
yarn build:contracts
29-
yarn build:src
33+
yarn package:update
3034
- name: Release
3135
env:
3236
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3337
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34-
run: npx semantic-release
38+
run: |
39+
cd package
40+
npx semantic-release

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ cache
2020
typechain
2121
typechainV6
2222
network/volumes
23+
deployments/localhost

.lintstagedrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2-
"*.{ts,js}": ["prettier --write", "eslint --config ./.eslintrc --ignore-path ./.eslintignore --cache --fix"],
2+
"*.{ts,js}": [
3+
"prettier --write",
4+
"eslint --config ./.eslintrc --ignore-path ./.eslintignore --cache --fix"
5+
],
36
"*.md": ["prettier --write"]
47
}

package.json

+2-33
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,7 @@
1919
"Kostiantyn Smyrnov <[email protected]>"
2020
],
2121
"license": "MIT",
22-
"private": false,
23-
"types": "./lib/src/index.d.ts",
24-
"main": "./lib/src/index.js",
25-
"files": [
26-
"lib/src/*",
27-
"lib/artifacts/*",
28-
"lib/typechain/*",
29-
"!**/*.tsbuildinfo",
30-
"!**/**.dbg.json"
31-
],
32-
"release": {
33-
"branches": [
34-
{
35-
"name": "main"
36-
},
37-
{
38-
"name": "beta",
39-
"channel": "beta",
40-
"prerelease": true
41-
}
42-
],
43-
"plugins": [
44-
"@semantic-release/commit-analyzer",
45-
"@semantic-release/changelog",
46-
"@semantic-release/release-notes-generator",
47-
"@semantic-release/npm",
48-
"@semantic-release/github"
49-
]
50-
},
51-
"publishConfig": {
52-
"access": "public"
53-
},
22+
"private": true,
5423
"devDependencies": {
5524
"@types/node": "^18.15.11",
5625
"@types/mocha": "^10.0.1",
@@ -97,7 +66,7 @@
9766
},
9867
"scripts": {
9968
"build:contracts": "hardhat compile",
100-
"build:src": "rm -rf ./lib && typechain --target=ethers-v6 --out-dir typechainV6 ./artifacts/contracts/Config.sol/Config.json ./artifacts/contracts/EntitiesRegistry.sol/EntitiesRegistry.json ./artifacts/contracts/Market.sol/Market.json && tsc -p ./tsconfig.build.json",
69+
"package:update": "rm -rf ./package/typechain ./package/artifacts && yarn build:contracts && cp -r ./artifacts ./package/artifacts && cp ./README.md ./package/README.md && yarn --cwd ./package build",
10170
"test:contracts": "hardhat test",
10271
"test:src": "mocha -t 60000 --extension spec.ts test/src",
10372
"lint": "solhint . && eslint --ext .ts",
File renamed without changes.
File renamed without changes.

package/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Winding Tree
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

package/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[![@windingtree/contracts](https://img.shields.io/npm/v/@windingtree/contracts)](https://www.npmjs.com/package/@windingtree/contracts)
2+
[![Beta Release](https://github.com/windingtree/contracts/actions/workflows/release.yml/badge.svg?branch=beta)](https://github.com/windingtree/contracts/actions/workflows/release.yml)
3+
4+
# @windingtree/contracts
5+
6+
The WindingTree market protocol smart contracts and utilities
7+
8+
## Deployments
9+
10+
### Polygon zkEVM
11+
12+
- Config ([0x098b1d12cAfE7315C77b6d308A62ce02806260Ee](https://explorer.public.zkevm-test.net/address/0x098b1d12cAfE7315C77b6d308A62ce02806260Ee/read-proxy#address-tabs)): the protocol configuration smart contract
13+
- EntitiesRegistry ([0x4bB51528C83844b509E1152EEb05260eE1bf60e6](https://explorer.public.zkevm-test.net/address/0x4bB51528C83844b509E1152EEb05260eE1bf60e6/read-proxy#address-tabs)): the protocol identity management
14+
- Market ([0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57](https://explorer.public.zkevm-test.net/address/0xDd5B6ffB3585E109ECddec5293e31cdc1e9DeD57/read-proxy#address-tabs)): the protocol entry point
15+
- LIF ([0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009](https://explorer.public.zkevm-test.net/address/0xba515AB7FfDa899a2e6c8FDbcDf351c8c15f4009/read-proxy#address-tabs)): Test version of LIF token
16+
17+
## Install package
18+
19+
```bash
20+
yarn add @windingtree/contracts
21+
```
22+
23+
## Setup
24+
25+
```bash
26+
yarn
27+
yarn build:contracts
28+
```
29+
30+
## Testing
31+
32+
```bash
33+
yarn test:contracts
34+
```
35+
36+
## Contributing
37+
38+
[Contribution guidelines](https://windingtree.github.io/sdk/#/docs/contribution)

package/package.json

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"name": "@windingtree/contracts",
3+
"version": "0.0.0-semantic-release",
4+
"description": "The WindingTree market protocol smart contracts and utilities",
5+
"repository": "[email protected]:windingtree/contracts.git",
6+
"bugs": "https://github.com/windingtree/contracts/issues",
7+
"homepage": "https://github.com/windingtree/contracts#readme",
8+
"author": "Kostiantyn Smyrnov <[email protected]>",
9+
"keywords": [
10+
"windingtree",
11+
"market",
12+
"protocol",
13+
"solidity",
14+
"typescript",
15+
"contract",
16+
"smart contract"
17+
],
18+
"contributors": [
19+
"Kostiantyn Smyrnov <[email protected]>"
20+
],
21+
"license": "MIT",
22+
"private": false,
23+
"types": "./lib/src/index.d.ts",
24+
"main": "./lib/src/index.js",
25+
"files": [
26+
"src",
27+
"lib",
28+
"artifacts",
29+
"typechain",
30+
"!**/*.tsbuildinfo",
31+
"!**/**.dbg.json"
32+
],
33+
"typesVersions": {
34+
"*": {
35+
"*": [
36+
"*",
37+
"lib/*",
38+
"lib/*/index"
39+
]
40+
}
41+
},
42+
"exports": {
43+
".": {
44+
"types": "./lib/index.d.ts",
45+
"import": "./lib/index.js"
46+
},
47+
"./types": {
48+
"types": "./lib/typechain/index.d.ts",
49+
"import": "./lib/typechain/index.js"
50+
}
51+
},
52+
"release": {
53+
"branches": [
54+
{
55+
"name": "main"
56+
},
57+
{
58+
"name": "beta",
59+
"channel": "beta",
60+
"prerelease": true
61+
}
62+
],
63+
"plugins": [
64+
"@semantic-release/commit-analyzer",
65+
"@semantic-release/changelog",
66+
"@semantic-release/release-notes-generator",
67+
"@semantic-release/npm",
68+
"@semantic-release/github"
69+
]
70+
},
71+
"publishConfig": {
72+
"access": "public"
73+
},
74+
"devDependencies": {
75+
"@types/node": "^20.1.5",
76+
"semantic-release": "^21.0.2",
77+
"semantic-release-cli": "^5.4.4",
78+
"@semantic-release/changelog": "^6.0.3",
79+
"@commitlint/config-conventional": "^17.6.3",
80+
"@commitlint/cli": "^17.6.3",
81+
"lint-staged": "^13.2.2",
82+
"eslint": "^8.40.0",
83+
"@typescript-eslint/eslint-plugin": "^5.59.5",
84+
"@typescript-eslint/parser": "^5.59.5",
85+
"prettier": "^2.8.8",
86+
"prettier-plugin-jsdoc": "^0.4.2",
87+
"ts-node": "^10.9.1",
88+
"typescript": "^5.0.4",
89+
"ethers": "^6.3.0",
90+
"typechain": "^8.1.1",
91+
"@typechain/ethers-v6": "^0.3.2"
92+
},
93+
"scripts": {
94+
"build": "rm -rf ./lib && typechain --target=ethers-v6 --out-dir typechain ./artifacts/contracts/Config.sol/Config.json ./artifacts/contracts/EntitiesRegistry.sol/EntitiesRegistry.json ./artifacts/contracts/Market.sol/Market.json && tsc -p ./tsconfig.build.json",
95+
"lint": "eslint --ext .ts",
96+
"lint:fix": "eslint --ext .ts --fix && prettier --check !network --write ."
97+
}
98+
}
File renamed without changes.
File renamed without changes.

package/tsconfig.build.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./lib"
5+
}
6+
}

package/tsconfig.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"esModuleInterop": true,
5+
"lib": ["DOM.Iterable"],
6+
"target": "ES2022",
7+
"module": "CommonJS",
8+
"moduleResolution": "node",
9+
"skipLibCheck": true,
10+
"checkJs": true,
11+
"allowJs": true,
12+
"declaration": true,
13+
"declarationMap": true,
14+
"allowSyntheticDefaultImports": true,
15+
"resolveJsonModule": true,
16+
"noErrorTruncation": true,
17+
"forceConsistentCasingInFileNames": true,
18+
"useUnknownInCatchVariables": true,
19+
"importsNotUsedAsValues": "remove",
20+
"noImplicitReturns": true
21+
},
22+
"include": ["src/**/*.ts", "typechain/**/*.ts"]
23+
}

0 commit comments

Comments
 (0)