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

Commit 27ea9f0

Browse files
committed
fix publish bug, update documentation
1 parent 7bcf04a commit 27ea9f0

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ Navigate to http://localhost:3000/ to view the docs site generated with Docusaur
8181

8282
Documentation files are written in Markdown and can be found under the `docs/` directory in this repo. The main config file can be found at `docusaurus/docusaurus.config.js`, and sidebar config at `docusaurus/siderbars.js`
8383

84+
### Publish npm Package
85+
86+
Inside nix-shell run `prepublish`
87+
88+
This will bump package version for to a new patch version,
89+
90+
Please manually commit this change, and push up to the GitHub repo.
91+
92+
Now, you can either tag this commit locally and push it up, or directly cut a release on the GitHub repo (if you're having issues tagging the commit locally)
93+
94+
Locally:
95+
e.g.
96+
```
97+
git tag v0.0.1 -am "0.0.1"
98+
git push origin v0.0.1
99+
```
100+
101+
Remotely:
102+
Go to Releases -> Draft a new release
103+
Select this branch and create a new tag for this commit e.g. `v0.0.1`
104+
84105
### Audits
85106

86107
Audits can be found in the `audits` folder.

shell.nix

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,43 @@ let
9898
npm run build
9999
100100
cp artifacts/contracts/**/*.json artifacts
101-
rm artifacts/*.dbg.json
102-
rm artifacts/*Test*
103-
rm artifacts/*Reentrant*
104-
rm artifacts/*ForceSendEther*
105-
rm artifacts/*Mock*
101+
rm -rf artifacts/*.dbg.json
102+
rm -rf artifacts/*Test*
103+
rm -rf artifacts/*Reentrant*
104+
rm -rf artifacts/*ForceSendEther*
105+
rm -rf artifacts/*Mock*
106106
107-
rm typechain/**/*Test*
108-
rm typechain/**/*Reentrant*
109-
rm typechain/**/*ForceSendEther*
110-
rm typechain/**/*Mock*
107+
rm -rf typechain/**/*Test*
108+
rm -rf typechain/**/*Reentrant*
109+
rm -rf typechain/**/*ForceSendEther*
110+
rm -rf typechain/**/*Mock*
111111
'';
112112

113113
prepublish = pkgs.writeShellScriptBin "prepublish" ''
114114
npm version patch --no-git-tag-version
115-
# manually commit and tag
115+
PACKAGE_NAME=$(node -p "require('./package.json').name")
116+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
117+
cat << EOF
118+
119+
120+
Package version for $PACKAGE_NAME bumped to $PACKAGE_VERSION
121+
122+
Please manually commit this change, and push up to the GitHub repo.
123+
124+
Now, you should either:
125+
- tag this commit locally and push it up
126+
- remotely cut a release on the GitHub repo (if you're having issues tagging the commit locally)
127+
128+
Locally:
129+
$ git tag v$PACKAGE_VERSION -am "$PACKAGE_VERSION"
130+
$ git push origin v$PACKAGE_VERSION
131+
132+
Remotely:
133+
Go to Releases -> Draft a new release
134+
Select this branch and create a new release with the following tag: v$PACKAGE_VERSION
135+
136+
137+
EOF
116138
'';
117139

118140
publish = pkgs.writeShellScriptBin "publish" ''

0 commit comments

Comments
 (0)