From 27ea9f07e01078b0a793e4a991e4852053b82ff7 Mon Sep 17 00:00:00 2001 From: marcusnewton Date: Mon, 20 Sep 2021 18:14:37 +1000 Subject: [PATCH] fix publish bug, update documentation --- README.md | 21 +++++++++++++++++++++ shell.nix | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 97ddaf048..b535e03ef 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,27 @@ Navigate to http://localhost:3000/ to view the docs site generated with Docusaur 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` +### Publish npm Package + +Inside nix-shell run `prepublish` + +This will bump package version for to a new patch version, + +Please manually commit this change, and push up to the GitHub repo. + +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) + +Locally: +e.g. +``` +git tag v0.0.1 -am "0.0.1" +git push origin v0.0.1 +``` + +Remotely: +Go to Releases -> Draft a new release +Select this branch and create a new tag for this commit e.g. `v0.0.1` + ### Audits Audits can be found in the `audits` folder. diff --git a/shell.nix b/shell.nix index 39b74c366..947b7a1be 100644 --- a/shell.nix +++ b/shell.nix @@ -98,21 +98,43 @@ let npm run build cp artifacts/contracts/**/*.json artifacts - rm artifacts/*.dbg.json - rm artifacts/*Test* - rm artifacts/*Reentrant* - rm artifacts/*ForceSendEther* - rm artifacts/*Mock* + rm -rf artifacts/*.dbg.json + rm -rf artifacts/*Test* + rm -rf artifacts/*Reentrant* + rm -rf artifacts/*ForceSendEther* + rm -rf artifacts/*Mock* - rm typechain/**/*Test* - rm typechain/**/*Reentrant* - rm typechain/**/*ForceSendEther* - rm typechain/**/*Mock* + rm -rf typechain/**/*Test* + rm -rf typechain/**/*Reentrant* + rm -rf typechain/**/*ForceSendEther* + rm -rf typechain/**/*Mock* ''; prepublish = pkgs.writeShellScriptBin "prepublish" '' npm version patch --no-git-tag-version - # manually commit and tag + PACKAGE_NAME=$(node -p "require('./package.json').name") + PACKAGE_VERSION=$(node -p "require('./package.json').version") + cat << EOF + + + Package version for $PACKAGE_NAME bumped to $PACKAGE_VERSION + + Please manually commit this change, and push up to the GitHub repo. + + Now, you should either: + - tag this commit locally and push it up + - remotely cut a release on the GitHub repo (if you're having issues tagging the commit locally) + + Locally: + $ git tag v$PACKAGE_VERSION -am "$PACKAGE_VERSION" + $ git push origin v$PACKAGE_VERSION + + Remotely: + Go to Releases -> Draft a new release + Select this branch and create a new release with the following tag: v$PACKAGE_VERSION + + + EOF ''; publish = pkgs.writeShellScriptBin "publish" ''