Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

22 make publish ignore example packages #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ node_modules
/dist
lerna-debug.log

/wip
/wip
chain-data
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm i @prosopo/typechain-polkadot
Pass the folder with artifacts(in the example it is `artifacts`) as input argument
and the output folder(in the example it is `typed_contracts`):
```bash
npx @prosopo/typechain-polkadot --in artifacts --out typed_contracts
npx typechain-polkadot --in artifacts --out typed_contracts
```

Import the contract what you want to use(in the example it is [`my_psp22`](https://github.com/727-Ventures/openbrush-contracts/tree/main/examples/psp22)):
Expand Down
4 changes: 2 additions & 2 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ And install it with `npm install`.

7) Now, let's run `typechain-compiler`:
```bash
$ npx @prosopo/typechain-compiler --config typechain.config.json
$ npx typechain-compiler --config typechain.config.json
```

8) And now, you can use generated code in your project. For example, you can create a file `index.ts`:
Expand Down Expand Up @@ -406,7 +406,7 @@ $ cp ./contracts/psp22/target/ink/metadata.json artifacts/psp22.json

5) Let's run `typechain-polkadot`:
```bash
$ npx @prosopo/typechain-polkadot --in ./artifacts --out ./typechain-generated
$ npx typechain-polkadot --in ./artifacts --out ./typechain-generated
```

Wow! We've just generated code for our contracts using typechain directly! 🎉
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This directory contains examples of parsed contracts and pieces of advice how to
```
- Run typechain with
```bash
npx @prosopo/typechain-polkadot --in path/to/artifacts --out path/to/output
npx typechain-polkadot --in path/to/artifacts --out path/to/output
```

> Note: you should move metadata.json to artifacts directory and rename it to <contract-name>.json, also if you want to deploy the contract you should also move <contract-name>.contract to artifacts directory from your target dir
6 changes: 5 additions & 1 deletion examples/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "plugins-typechain-example",
"version": "1.0.0",
"publishConfig": {
"access": "restricted"
},
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"generate": "echo No generate script",
"start": "npx @prosopo/typechain-polkadot --plugins ./plugins --input ./artifacts --output ./output"
"start": "npx typechain-polkadot --plugins ./plugins --input ./artifacts --output ./output"
},
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
Expand Down
4 changes: 4 additions & 0 deletions examples/psp22/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "psp22",
"version": "1.0.0",
"publishConfig": {
"access": "restricted"
},
"private": true,
"description": "",
"main": "index.js",
"scripts": {
Expand Down
44 changes: 24 additions & 20 deletions examples/psp34/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"name": "psp34",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate": "npx typechain-polkadot --in ./artifacts --out ./out",
"start": "ts-node index.ts"
},
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@types/node": "^18.8.0",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@types/bn.js": "^5.1.1"
},
"author": "Supercolony-net",
"license": "ISC"
"name": "psp34",
"version": "1.0.0",
"publishConfig": {
"access": "restricted"
},
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"generate": "npx typechain-polkadot --in ./artifacts --out ./out",
"start": "ts-node index.ts"
},
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@types/node": "^18.8.0",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@types/bn.js": "^5.1.1"
},
"author": "Supercolony-net",
"license": "ISC"
}
44 changes: 24 additions & 20 deletions examples/psp34_enumerable/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"name": "psp34_enumerable",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate": "npx typechain-polkadot --in ./artifacts --out ./out",
"start": "ts-node index.ts"
},
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@types/node": "^18.8.0",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@types/bn.js": "^5.1.0"
},
"author": "Supercolony-net",
"license": "ISC"
"name": "psp34_enumerable",
"version": "1.0.0",
"publishConfig": {
"access": "restricted"
},
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"generate": "npx typechain-polkadot --in ./artifacts --out ./out",
"start": "ts-node index.ts"
},
"dependencies": {
"@prosopo/typechain-polkadot": "1.1.13",
"@prosopo/typechain-types": "1.1.13",
"@types/node": "^18.8.0",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
"@polkadot/api": "10.11.1",
"@polkadot/api-contract": "10.11.1",
"@types/bn.js": "^5.1.0"
},
"author": "Supercolony-net",
"license": "ISC"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
],
"private": true,
"scripts": {
"start-typechain": "npx @prosopo/typechain-polkadot --in ./artifacts --out ./out",
"start-typechain": "npx typechain-polkadot --in ./artifacts --out ./out",
"build:all": "npm run --workspaces --if-present build",
"publish:dry-run": "npm --workspaces publish --dry-run",
"publish": "npm --workspaces publish --access=public",
"gen-test-ts": "npx @prosopo/typechain-polkadot --in tests/artifacts --out tests/generated",
"gen-test-ts": "npx typechain-polkadot --in tests/artifacts --out tests/generated",
"only-test": "npx jest --no-cache --maxWorkers 1",
"test": "npm run gen-test-ts && npm run only-test",
"lint": "eslint \"{packages, examples}/**/*.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/typechain-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Also you can override the config value via CLI arguments.
To compile your project, and generate TS definitions & runtime code for it, run the following command:

```bash
npx @prosopo/typechain-compiler --config path/to/config.json
npx typechain-compiler --config path/to/config.json
```

Also you can provide additional arguments to the compiler:
Expand Down
2 changes: 1 addition & 1 deletion packages/typechain-compiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Typechain(
input: string,
output: string
) {
execSync(`npx @prosopo/typechain-polkadot --in ${input} --out ${output}`);
execSync(`npx typechain-polkadot --in ${input} --out ${output}`);
}

function main() {
Expand Down
4 changes: 3 additions & 1 deletion packages/typechain-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"access": "public"
},
"description": "Util to test and compile your rust project",
"bin": "bin/index.js",
"bin": {
"typechain-compiler": "bin/index.js"
},
"scripts": {
"build": "npx tsc",
"start": "ts-node ./index.ts --config config.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/typechain-polkadot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Typechain can be used in two ways:
After installing the package, you can use it as a CLI tool. To use it, run the following command:

```bash
npx @prosopo/typechain-polkadot --input path/to/abis --output path/to/output
npx typechain-polkadot --input path/to/abis --output path/to/output
```

## Methods and namespaces used in the typechain, and their description
Expand Down Expand Up @@ -244,7 +244,7 @@ typechain.loadPlugins(new MyPlugin());
Or you can load them via cli:

```bash
npx @prosopo/typechain-polkadot --input path/to/abis --output path/to/output --plugins ./plugins-directory
npx typechain-polkadot --input path/to/abis --output path/to/output --plugins ./plugins-directory
```
> Note: if you're using the cli, every plugin should end with `.plugin.ts` and have default export of the plugin itself.

Expand Down
2 changes: 1 addition & 1 deletion packages/typechain-polkadot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* # Usage from CLI
* ```bash
* $ npm i @prosopo/typechain-polkadot
* $ npx @prosopo/typechain-polkadot --in path/to/abis --out path/to/output/folder
* $ npx typechain-polkadot --in path/to/abis --out path/to/output/folder
* ```
*
* @packageDocumentation
Expand Down
4 changes: 3 additions & 1 deletion packages/typechain-polkadot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint --fix \"{src,tests}/**/*.{js,jsx,ts,tsx}\""
},
"bin": "bin/index.js",
"bin": {
"typechain-polkadot": "bin/index.js"
},
"files": [
"index.ts",
"src",
Expand Down
Loading