Skip to content

Commit ac330fe

Browse files
committed
English fixes in Readme.
1 parent aa58f47 commit ac330fe

File tree

1 file changed

+71
-99
lines changed

1 file changed

+71
-99
lines changed

README.md

Lines changed: 71 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,6 @@ Release tool for npm and bower packages.
55
[![Build Status](https://travis-ci.org/AlexKVal/release-script.svg)](https://travis-ci.org/AlexKVal/release-script)
66

77
---
8-
##### Human factor
9-
10-
**Because of human nature to make mistakes, by default this script runs in `dry mode`.
11-
It prevents `danger` steps (`git push`, `npm publish` etc) from accidental running.**
12-
13-
**For actual running your command please add `--run` option.**
14-
15-
*If you don't want this behavior you can add `"defaultDryRun": "false"` into your `package.json`.*
16-
```json
17-
"release-script": {
18-
"defaultDryRun": "false"
19-
}
20-
```
21-
*Then you can use `--dry-run` option for checks.*
22-
23-
---
24-
258
#### Description
269

2710
With this tool there is no need to keep (transpiled) `lib`, `build`
@@ -59,13 +42,10 @@ that have been written by [Matt Smith @mtscout6](https://github.com/mtscout6)_
5942

6043
_Kind of "migration manual"_ https://github.com/AlexKVal/release-script/issues/23
6144

62-
#### Documents pages publishing
63-
64-
If your project compiles static documentation pages (as e.g. `React-Boostrap` does)
65-
and needs to publish them to standalone repo / hosting (via `git push`),
66-
you can do it the same way the `bower` package releasing done.
45+
#### Documentation pages publishing
6746

68-
Just create additional github repo for your static documents site.
47+
If your project generates static documentation pages (as `React-Boostrap` does)
48+
and needs publishing them to a standalone repo (via `git push`), just create additional github repo for the documentation pages.
6949

7050
E.g. [react-bootstrap.github.io.git](https://github.com/react-bootstrap/react-bootstrap.github.io)
7151

@@ -75,9 +55,9 @@ Add it as `'release-script'.docsRepo` into your `package.json`:
7555
"docsRepo": "[email protected]:<author>/original-project-name-github.io.git"
7656
}
7757
```
78-
Default folders for documents are:
79-
- `"docsRoot": "docs-built"` folder where the documents files will be built (by your custom building scripts)
80-
- `"tmpDocsRepo": "tmp-docs-repo"` temporary folder.
58+
Default folders for documentation pages are:
59+
- `"docsRoot": "docs-built"` folder where the files will be built to. (by your custom building script)
60+
- `"tmpDocsRepo": "tmp-docs-repo"` temporary folder. (for the release-script usage)
8161

8262
It is advised to add them both into `.gitignore`.
8363

@@ -90,33 +70,33 @@ You can customize them as you need:
9070
}
9171
```
9272

93-
If you need to publish only documents (say with some minor fixes),
94-
this is as simple as:
73+
If you need to publish only documentation pages (say with some minor fixes),
74+
you can do it this way:
9575
```
96-
> release --only-docs --run
76+
> release --only-docs
9777
```
9878
In this case the `package.json` version will be bumped with `--preid docs` as `0.10.0` => `0.10.0-docs.0`.
9979

10080
If `npm run docs-build` script is present, then it will be used instead of `npm run build` script.
10181

102-
*Note: Documents are not published with pre-release version,
82+
*Note: Documentation pages are not published when you are releasing "pre-release" version,
10383
(i.e. when you run it with `--preid` option).*
10484

10585
#### Pre-release versions publishing
10686

10787
Say you need to publish pre-release `v0.25.100-pre.0` version
10888
with the `canary` npm tag name (instead of default one `latest`).
10989

110-
You can do it by this way:
90+
You can do it this way:
11191
```
112-
> release 0.25.100 --preid pre --tag canary --run
92+
> release 0.25.100 --preid pre --tag canary
11393
or
114-
> npm run release 0.25.100 -- --preid pre --tag canary --run
94+
> npm run release 0.25.100 -- --preid pre --tag canary
11595
```
11696

117-
If your `preid` tag and npm tag name are the same, then you can just:
97+
If your `preid` tag and npm tag are the same, then you can just:
11898
```
119-
> release 0.25.100 --preid beta --run
99+
> release 0.25.100 --preid beta
120100
```
121101
It will produce `v0.25.100-beta.0` and `npm publish --tag beta`.
122102

@@ -125,8 +105,8 @@ and with the next release this file will be removed.
125105

126106
#### Alternative npm package root folder
127107

128-
Say you want to publish to `npmjs` only the content of your `lib` folder.
129-
Then you can do it as simple as adding this option to your `package.json`
108+
Say you want to publish the content of your `lib` folder as an npm package's root folder.
109+
Then you can do it as simple as adding the following to your `package.json`
130110
```json
131111
"release-script": {
132112
"altPkgRootFolder": "lib"
@@ -142,7 +122,7 @@ If you run building scripts within your `npm run test` step, e.g.
142122
"test": "npm run lint && npm run build && npm run tests-set",
143123
}
144124
```
145-
then you can disable superfluous `npm run build` step running
125+
then you can prevent `npm run build` step from running
146126
by setting `'release-script'.skipBuildStep` option:
147127
```json
148128
"release-script": {
@@ -159,13 +139,11 @@ All options for this package are kept under `'release-script'` node in your proj
159139
- `default` value: `'amd'`
160140
- `tmpBowerRepo` - the folder name for temporary files for bower pkg.
161141
- `default` value: `'tmp-bower-repo'`
162-
- `altPkgRootFolder` - the folder name for alternative npm package root folder
142+
- `altPkgRootFolder` - the folder name for alternative npm package's root folder
163143

164144
It is advised to add `bowerRoot` and `tmpBowerRepo` folders to your `.gitignore` file.
165145

166-
All options are optional.
167-
168-
E.g.:
146+
Example:
169147
```json
170148
"release-script": {
171149
"bowerRepo": "[email protected]:<org-author-name>/<name-of-project>-bower.git",
@@ -177,113 +155,107 @@ E.g.:
177155

178156
#### GitHub releases
179157

180-
If you want this script to publish github releases,
181-
you can generate token https://github.com/settings/tokens for it
182-
and set `env.GITHUB_TOKEN` to it like this:
158+
If you need this script to publish github releases,
159+
you can generate a github token at https://github.com/settings/tokens
160+
and put it to `env.GITHUB_TOKEN` this way:
183161
```sh
184162
> GITHUB_TOKEN="xxxxxxxxxxxx" && release-script patch
185163
```
186-
or through your shell scripts
164+
or into your shell scripts
187165
```sh
188166
export GITHUB_TOKEN="xxxxxxxxxxxx"
189167
```
190-
You can set a custom message for release via `--notes` CLI option:
168+
You can set a custom message for github release via `--notes` CLI option:
191169
```
192-
> release patch --notes "This is small fix" --run
170+
> release patch --notes "This is a small fix"
193171
```
194172

195173

196-
#### This script does following steps:
174+
#### This script does the following steps:
197175

198176
- ensures that git repo has no pending changes
199-
- ensures that git repo last version is fetched
177+
- ensures that the latest version is fetched
200178
- checks linting and tests by running `npm run test` command
201-
- does version bump, with `preid` if it is requested
179+
- does version bumping
202180
- builds all by running `npm run build` command
203181
- If there is no `build` script, then `release-script` just skips the `build` step.
204-
- if one of `[rf|mt]-changelog` is used in 'devDependencies', then changelog is generated
205-
- adds and commits changed `package.json` (and `CHANGELOG.md`, if used) files to git repo
206-
- adds git tag with new version (and changelog message, if used)
182+
- if one of `[rf|mt]-changelog` is used in 'devDependencies', then changelog is to be generated
183+
- adds and commits `package.json` with changed version and `CHANGELOG.md` if it's used
184+
- adds git tag with new version and changelog message if it's used
207185
- pushes changes to github repo
208-
- if github token is present, publishes release to GitHub, named as `<repo> vx.x.x`
209-
- if `--preid` tag set, then `npm publish --tag` command for npm publishing is used
210-
- through `--tag` one can set `npm tag name` for the pre-release version (e.g. `alpha` or `canary`)
211-
- othewise `--preid` value will be used
212-
- if `altPkgRootFolder` doesn't set it will just `npm publish [--tag]` as usual
213-
- otherwise if `altPkgRootFolder` set then this script
214-
- will `npm publish [--tag]` from the `altPkgRootFolder` folder
215-
- with the custom version of `package.json` with removed `scripts` and `devDependencies`
216-
- also it will remove the `altPkgRootFolder` part from the `main` file path
217-
- if `bowerRepo` field is present in the `package.json`, then it releases bower package:
218-
- clones bower repo to local `tmpBowerRepo` temp folder. `git clone bowerRepo tmpBowerRepo`
219-
- then it cleans up all but `.git` files in the `tmpBowerRepo`
220-
- then copies all files from `bowerRoot` to `tmpBowerRepo`
221-
- (that has to be generated with `npm run build`)
222-
- then by `git add -A .` adds all bower distr files to the temporary git repo
223-
- commits, tags and pushes the same as for the `npm` package.
224-
- then deletes the `tmpBowerRepo` folder
225-
- id `docsRepo` field is present in the `package.json`, then it pushes builded documents to their repo.
226-
It is done the same way as `bower` repo.
227-
228-
If command line `--only-docs` option is set, then `github`, `npm` and `bower` publishing steps will be skipped.
186+
- if github token is present the script publishes the release to the GitHub
187+
- if `--preid` tag set then `npm publish --tag` command for npm publishing is used
188+
- with `--tag` option one can set `npm tag name` for a pre-release version (e.g. `alpha` or `canary`)
189+
- otherwise `--preid` value will be used
190+
- if `altPkgRootFolder` isn't set it will just `npm publish [--tag]` as usual. Otherwise:
191+
- the release-script will `npm publish [--tag]` from the inside `altPkgRootFolder` folder
192+
- `scripts` and `devDependencies` will be removed from `package.json`
193+
- if `bowerRepo` field is present in the `package.json` then bower package will be released.
194+
- the script will clone the bower repo to the `tmpBowerRepo` folder
195+
- clean up all files but `.git` in the `tmpBowerRepo` folder
196+
- copy all files from `bowerRoot` to `tmpBowerRepo` (they has to be generated by `npm run build`)
197+
- add all files to the temporary git repo with `git add -A .`
198+
- then it will commit, tag and push. The same as for the `npm` package.
199+
- and at the end it will remove the `tmpBowerRepo` folder
200+
- if `docsRepo` option is set then documentation pages are being pushed to their repo.
201+
It is done the same way as `bower` publishing process.
202+
203+
If `--only-docs` command line option is set then `github`, `npm` and `bower` publishing steps will be skipped.
229204

230205
## Installation
231206

232207
```sh
233208
> npm install -D release-script
234209
```
235210

236-
If you need `bower` releases too, then add `'release-script'.bowerRepo` into your `package.json` like this:
211+
If you need `bower` releases too then add `'release-script'.bowerRepo` into your `package.json`:
237212
```json
238213
"release-script": {
239214
"bowerRepo": "[email protected]:<org-author-name>/<name-of-project>-bower.git"
240215
}
241216
```
242217

243-
Then you can release like that:
244-
```sh
245-
> release patch --run
246-
> release minor --preid alpha --run
247-
```
248-
249-
If you don't have smth like that in your shell:
218+
If you have smth like that in your shell:
250219
```sh
251220
# npm
252221
export PATH="./node_modules/.bin:$PATH"
253222
```
254-
then you have to type the commands like this:
223+
or you had installed `release-script` globally via `npm install -g release-script`,
224+
then you can release your new versions this way:
255225
```sh
256-
> ./node_modules/.bin/release minor --preid alpha --run
226+
> release patch
227+
or
228+
> release minor --preid alpha
257229
```
258230

259-
Or you just can install `release-script` globally.
231+
Otherwise you need to type in the commands this way:
232+
```sh
233+
> ./node_modules/.bin/release minor --preid alpha
234+
```
260235

261-
You also can add some helpful `script` commands to your `package.json`,
262-
and because `npm` adds `node_modules/.bin` into `PATH` for running scripts automatically,
263-
you can add them just like that:
236+
You can as well add some helpful `script` commands to your `package.json`:
264237
```json
265238
"scripts": {
266239
...
267-
"patch": "release patch --run",
268-
"minor": "release minor --run",
269-
"major": "release major --run",
270-
"release-dry-run": "release patch"
240+
"patch": "release patch",
241+
"minor": "release minor",
242+
"major": "release major"
271243
```
272244

273-
Also you can add it like this:
245+
And you can add it like this:
274246
```json
275247
"scripts": {
276248
...
277249
"release": "release",
278250
```
279-
And then you can run it like that:
251+
This way it became possible to run it like that:
280252
```
281-
> npm run release minor -- --preid alpha --run
282-
> npm run release patch -- --notes "This is small fix --run"
283-
> npm run release major // for dry run
253+
> npm run release minor -- --preid alpha
254+
> npm run release patch -- --notes "This is small fix"
255+
> npm run release major --dry-run // for dry run
284256
etc
285257
```
286-
_Notice: you have to add additional `--` before any `--option`. That way additional options will get straight to `release-script`._
258+
_Notice: You have to add additional double slash `--` before any `--option`. This way additional options get through to `release-script`._
287259

288260

289261
## License

0 commit comments

Comments
 (0)