Skip to content

Commit c75ee0a

Browse files
author
nebarf
committed
Merge branch 'main' of github.com:nebarf/react-http-fetch into tests
2 parents 3e4265c + e4d160b commit c75ee0a

File tree

5 files changed

+84
-6
lines changed

5 files changed

+84
-6
lines changed

.release-it.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
"git": {
33
"tagName": "v${version}",
44
"commitMessage": "Release v${version}",
5-
"requireBranch": "main"
5+
"requireBranch": "main",
6+
"requireCommits": true
67
},
78
"hooks": {
9+
"before:init": [
10+
"yarn before-release-init"
11+
],
812
"after:bump": [
9-
"npm run changelog",
13+
"yarn changelog",
1014
"git add CHANGELOG.md"
15+
],
16+
"before:npm:release": [
17+
"yarn clean-build",
18+
"yarn build"
1119
]
1220
},
1321
"npm": {

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [v1.0.0-beta.1](https://github.com/nebarf/react-http-fetch/compare/v1.0.0-beta.0...v1.0.0-beta.1)
8+
## [v1.0.0-beta.3](https://github.com/nebarf/react-http-fetch/compare/v1.0.0-beta.2...v1.0.0-beta.3)
9+
10+
11+
### Merged
12+
13+
- Run lib build before npm publish [`#36`](https://github.com/nebarf/react-http-fetch/pull/36)
14+
15+
16+
17+
## [v1.0.0-beta.2](https://github.com/nebarf/react-http-fetch/compare/v1.0.0-beta.1...v1.0.0-beta.2) - 2021-12-15
18+
19+
20+
### Merged
21+
22+
- Revert exposed api [`#35`](https://github.com/nebarf/react-http-fetch/pull/35)
23+
- Fix contributing md [`#34`](https://github.com/nebarf/react-http-fetch/pull/34)
24+
- Http context [`#33`](https://github.com/nebarf/react-http-fetch/pull/33)
25+
- Expose only consumer facing API [`#32`](https://github.com/nebarf/react-http-fetch/pull/32)
26+
- Allow to provide unserialized req body to http client [`#31`](https://github.com/nebarf/react-http-fetch/pull/31)
27+
28+
29+
### Commits
30+
31+
- Add type for http request body [`5e8a363`](https://github.com/nebarf/react-http-fetch/commit/5e8a36370a84a9758dba311daa6f05cbfc21e8d3)
32+
- Allow to provide arbitrary user data carried by the http request [`8550f60`](https://github.com/nebarf/react-http-fetch/commit/8550f6059ef79ef4cb565b3d43b42e04f1e03585)
33+
- Align codebase to generics naming styleguide [`c2042cd`](https://github.com/nebarf/react-http-fetch/commit/c2042cdd604f8393992a68cedd3d8b4e2620182f)
34+
35+
## [v1.0.0-beta.1](https://github.com/nebarf/react-http-fetch/compare/v1.0.0-beta.0...v1.0.0-beta.1) - 2021-11-24
936

1037

1138
### Merged

bin/before-release-init.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-disable no-console */
2+
import shell from 'shelljs';
3+
4+
const upstream = '@{u}';
5+
6+
const isUpstreamConfigured =
7+
shell.exec(`git rev-parse --abbrev-ref --symbolic-full-name ${upstream}`).code === 0;
8+
9+
if (!isUpstreamConfigured) {
10+
console.error('You must configure upstream for the branch.');
11+
shell.exit();
12+
}
13+
14+
const local = shell.exec('git rev-parse @');
15+
const remote = shell.exec(`git rev-parse ${upstream}`);
16+
const base = shell.exec(`git merge-base @ ${upstream}`);
17+
18+
// Branch is up to date with or ahead to remote.
19+
if (local === remote || remote === base) {
20+
shell.exit(0);
21+
}
22+
23+
// The local branch is behind the remote version, a pull is needed.
24+
if (local === base) {
25+
console.error('The local branch is behind the remote version');
26+
shell.exit();
27+
}
28+
29+
// Local and remote diverged.
30+
console.log('Local branch and remote branch diverged!');
31+
shell.exit();

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-http-fetch",
3-
"version": "1.0.0-beta.1",
3+
"version": "1.0.0-beta.3",
44
"description": "An http library for React JS built on top of native JS fetch",
55
"main": "index.js",
66
"module": "./lib/esm/index.js",
@@ -41,17 +41,21 @@
4141
"react-dom": "^17.0.2",
4242
"react-hooks-testing-library": "^0.6.0",
4343
"release-it": "^14.11.6",
44+
"shelljs": "^0.8.4",
45+
"shx": "^0.3.3",
4446
"ts-jest": "^27.0.5",
4547
"typescript": "^4.4.3"
4648
},
4749
"scripts": {
50+
"before-release-init": "node ./bin/before-release-init.mjs",
4851
"build": "yarn build:esm && yarn build:cjs",
4952
"build:prod": "yarn build:prod:esm && yarn build:prod:cjs",
5053
"build:watch": "yarn build:esm -w && yarn build:cjs -w",
5154
"build:esm": "tsc",
5255
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
5356
"build:prod:esm": "tsc -p tsconfig.prod.json",
5457
"build:prod:cjs": "tsc -p tsconfig.prod.json --module commonjs --outDir lib/cjs",
58+
"clean-build": "shx rm -rf lib",
5559
"changelog": "auto-changelog -p --template ./changelog.template.hbs",
5660
"prepare": "husky install",
5761
"pre-commit": "lint-staged",

yarn.lock

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,7 @@ minimatch@^3.0.4:
38343834
dependencies:
38353835
brace-expansion "^1.1.7"
38363836

3837-
minimist@^1.2.0, minimist@^1.2.5:
3837+
minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5:
38383838
version "1.2.5"
38393839
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
38403840
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
@@ -4694,7 +4694,7 @@ shebang-regex@^3.0.0:
46944694
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
46954695
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
46964696

4697-
shelljs@0.8.4:
4697+
shelljs@0.8.4, shelljs@^0.8.4:
46984698
version "0.8.4"
46994699
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
47004700
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
@@ -4703,6 +4703,14 @@ shelljs@0.8.4:
47034703
interpret "^1.0.0"
47044704
rechoir "^0.6.2"
47054705

4706+
shx@^0.3.3:
4707+
version "0.3.3"
4708+
resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.3.tgz#681a88c7c10db15abe18525349ed474f0f1e7b9f"
4709+
integrity sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==
4710+
dependencies:
4711+
minimist "^1.2.3"
4712+
shelljs "^0.8.4"
4713+
47064714
side-channel@^1.0.4:
47074715
version "1.0.4"
47084716
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"

0 commit comments

Comments
 (0)