Skip to content

Commit 6b541f3

Browse files
authored
build(config): improve publish release automation (#210)
* refactor: remove unused fields from networks.json * build: add Makefile in project root * docs(config): fix typo in README * build: update root package-lock.json on release
1 parent e056724 commit 6b541f3

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
LANG := en_US.UTF-8
2+
SHELL := /bin/bash
3+
.SHELLFLAGS := --norc --noprofile -e -u -o pipefail -c
4+
.DEFAULT_GOAL := help
5+
6+
nvm_brew = /usr/local/opt/nvm/nvm.sh
7+
ifneq ("$(wildcard $(nvm_brew))", "")
8+
nvm_sh = $(nvm_brew)
9+
endif
10+
nvm_default = $(HOME)/.nvm/nvm.sh
11+
ifneq ("$(wildcard $(nvm_default))", "")
12+
nvm_sh = $(nvm_default)
13+
endif
14+
define npm
15+
@$(eval npm_args=$(1))
16+
bash --norc --noprofile -e -o pipefail -l -c "source $(nvm_sh) && nvm exec npm $(npm_args)"
17+
endef
18+
export NODE_ENV := "development"
19+
20+
.PHONY: npm-install
21+
npm-install: ## Run 'npm install'
22+
$(call npm, install)
23+
24+
.PHONY: clean
25+
clean: ## Remove generated files
26+
$(RM) -r \
27+
node_modules
28+
29+
.PHONY: help
30+
help: ## Show Help
31+
@grep -E '^[a-zA-Z0-9_\-\/]+%?:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-20s %s\n", $$1, $$2}' | sort

packages/config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const wsRpcEndpoints: RPCEndpoint[] = chains.ethereum.getRPCEndpointsByProtocol(
2525

2626
You can also load configuration based on `$NODE_ENV` environment variable:
2727
```typescript
28-
import * as config from "config"
28+
import * as config from "@streamr/config"
2929

3030
const chains: Chains = config.Chains.loadFromNodeEnv()
3131
```

packages/config/package-lock.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/config/release-npm-update-version-package-json.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ fi
3030

3131
sed -i '' -e 's/"version": ".*",$/"version": "'"$version"'",/g' package.json
3232
git add package.json
33-
make npm-install
34-
git add package-lock.json
33+
make npm-install -C ../..
34+
git add ../../package-lock.json

packages/config/src/networks.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@
9797
},
9898
"binance": {
9999
"id": 56,
100-
"rpcHttpUrl": "",
101-
"rpcWsUrl": "",
102100
"rpcEndpoints": [
103101
{
104102
"url": "https://bsc-dataseed.binance.org"

0 commit comments

Comments
 (0)