Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
patch: builds upon install and removes dist folder (#19)
Browse files Browse the repository at this point in the history
* patch: removes dist and old scripts
* chore: changes deps to npm
* chore: updates README
  • Loading branch information
jurajpiar authored Jun 20, 2022
1 parent 9cead60 commit 1e4f5ba
Show file tree
Hide file tree
Showing 33 changed files with 16 additions and 673 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
node_modules/
build/
# we need to add this ignore and remove the dist folder after we publish this library
#dist/
.idea/
dist/
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
44 changes: 6 additions & 38 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ This project works as a dependency and needs to be installed in order to be used

### Dependencies

To start working with this project you need to first enable `postinstall` scripts (refer to section [Enabling postinstall scripts](#enabling-postinstall-scripts)).
Install all dependencies by running `npm install`.

Then just run `npm install` to install all dependencies.
The project is ready to be used at this point.

## Usage

Expand All @@ -44,43 +44,14 @@ Install with:
npm i --save @rsksmart/rif-relay-common
```

### Use the repo distributable

Modify your `package.json` file to add the following line:

```
"@rsksmart/rif-relay-common": "https://github.com/infuy/rif-relay-common",
```

### Use a local distributable

Clone this repository inside your project's root folder, and modify your `package.json` file to add the following line:

```
"@rsksmart/rif-relay-common": "../rif-relay-common",
```
Clone this repository inside your project's root folder and use the `npm link` mechanism (https://docs.npmjs.com/cli/v8/commands/npm-link) to add it to your project.

## Development

If you need to modify resources inside this repository:
- make sure that [`postinstall` scripts are enabled](#enabling-postinstall-scripts) in the `package.json` file. These are disabled by default due to distribution issues (which will be solved in the future), but will enable husky and other tools.
- run `npm install` to execute the post install hooks.

After that, make your modifications and then run `npm run build` to validate them.

After you are done with your changes you can publish them by creating a distributable version.

### Enabling postinstall scripts

To enable `postinstall` scripts you need to modify the `package.json` file, specifically the `scripts` section and change this line:

```
"_postinstall": "scripts/postinstall",
```
to
```
"postinstall": "scripts/postinstall",
```
Make your modifications and then run `npm run build` to validate them.
When you are done with your changes, you can publish them by creating a distributable version.

### Husky and linters

Expand All @@ -95,16 +66,13 @@ to check and fix the errors before trying to commit again:

### Generating a new distributable version

**IMPORTANT: when you publish a version postinstall scripts must be disabled. This is disabled by default, so don't push any changes to the postinstall scripts section in the `package.json` file.**

1. Run the `npm run dist` command to generate the `dist` folder with the distributable version inside.
2. Bump the version on the `package.json` file (not strictly needed).
3. Commit and push any changes, including the version bump.

#### For GitHub

1. Run `npm pack` to generate the tarball to be published as a release on GitHub.
2. Generate a new release on GitHub and upload the generated tarball.
1. Create a new tag with the new version (from `package.json`) and github actions will update npm

#### For NPM

Expand Down
16 changes: 0 additions & 16 deletions dist/AmountRequired.d.ts

This file was deleted.

21 changes: 0 additions & 21 deletions dist/Constants.d.ts

This file was deleted.

132 changes: 0 additions & 132 deletions dist/ContractInteractor.d.ts

This file was deleted.

26 changes: 0 additions & 26 deletions dist/EIP712/ForwardRequest.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions dist/EIP712/RelayData.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions dist/EIP712/RelayRequest.d.ts

This file was deleted.

48 changes: 0 additions & 48 deletions dist/EIP712/TypedRequestData.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions dist/Environments.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions dist/ErrorReplacerJSON.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions dist/PingResponse.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions dist/TokenResponse.d.ts

This file was deleted.

Loading

0 comments on commit 1e4f5ba

Please sign in to comment.