<commit_before># release-script

Release tool for npm and bower packages.

With this tool there is no need to commit transpiled `lib`, `build`
or `distr` files into git repo.

Because `Bower` keeps its files in the github repo,
this tools helps to deal with that too.

Just create new additional github repo for `Bower` version of your project.
This repo will contain only commits generated by this tool.

Say the name of your project is:
`original-project-name`.
Then name `bower` github repo as:
`original-project-name-bower`.

Add `'release-script'.bowerRepo` into your `package.json`:
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<author>/original-project-name-bower.git"
}
```

Then add additional step into your building process,
which will create `bower` package files in the `amd` folder,
(basically it is just copying of `lib` files, README and LICENSE)
and that's all.

Now `release-script` will do all those steps (described next),
including `bower` publishing, for you automatically.


Initial idea is got from `React-Bootstrap` release tools `./tools/release`,
that have been written by [<NAME> @mtscout6](https://github.com/mtscout6)

#### Options

All options for this package are kept under `'release-script'` node in your project's `package.json`

- `bowerRepo` - the full url to github project for the bower pkg files
- `bowerRoot` - the folder name where your `npm run build` command will put/transpile files for bower pkg
- `tmpBowerRepo` - the folder name for temporary files for bower pkg.

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

E.g.:
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<org-author-name>/<name-of-project>-bower.git",
  "bowerRoot": "amd",
  "tmpBowerRepo": "tmp-bower-repo"
}
```

#### This script does following steps:

- ensures that git repo has no pending changes
- ensures that git repo last version is fetched
- checks linting and tests by running `npm run test` command
- does version bump, with `preid` if it is requested
- builds all by `npm run build` command
- if one of `[rf|mt]-changelog` is used in 'devDependencies', then changelog is generated
- adds and commits changed `package.json` (and `CHANGELOG.md`, if used) files to git repo
- adds git tag with new version (and changelog message, if used)
- pushes changes to github repo
- releases npm package by `npm publish` command
- if `bowerRepo` field is present in the `package.json`, then it releases bower package:
  - clones bower repo to local `tmpBowerRepo` temp folder. `git clone bowerRepo tmpBowerRepo`
  - then it cleans up all but `.git` files in the `tmpBowerRepo`
  - then copies all files from `bowerRoot` to `tmpBowerRepo`
    - (that has to be generated with `npm run build`)
  - then by `git add -A .` adds all bower distr files to the temporary git repo
  - commits, tags and pushes the same as for the `npm` package.
  - then deletes the `tmpBowerRepo` folder

## Installation

```sh
> npm install -D release-script
```

Set `'release-script'.bowerRepo` into your `package.json` if you need `bower` releases too.
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<org-author-name>/<name-of-project>-bower.git"
}
```

Then you can release like that:
```sh
> release patch
> release minor --preid alpha
```

You can use `--dry-run` option to check first what will be done and if it is OK.
```sh
> release major --dry-run --verbose
```
This option prevents `danger` steps from running. (`git push`, `npm publish` etc)

If you don't have smth like that in your shell:
```sh
# npm
export PATH="./node_modules/.bin:$PATH"
```
then you have to type the commands like this:
```sh
> ./node_modules/.bin/release minor --preid alpha
```

Or you just can install `release-script` globally.

You also can add some helpful `script` commands to your `package.json`,
and because `npm` adds `node_modules/.bin` into `PATH` for running scripts automatically,
you can add them just like that:
```js
"scripts": {
    ...
    "patch": "release patch",
    "minor": "release minor",
    "major": "release major"
```


## License
`release-script` is licensed under the [MIT License](https://github.com/alexkval/release-script/blob/master/LICENSE).
<commit_msg>Small style and typos fixes<commit_after># release-script

Release tool for npm and bower packages.

With this tool there is no need to keep (transpiled) `lib`, `build`
or `distr` files in the git repo.

Because `Bower` keeps its files in the github repo,
this tools helps to deal with that too.

Just create new additional github repo for `Bower` version of your project.
This repo will contain only commits generated by this tool.

Say the name of your project is:
`original-project-name`.
Then name the `bower` github repo as:
`original-project-name-bower`.

Add `'release-script'.bowerRepo` into your `package.json`:
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<author>/original-project-name-bower.git"
}
```

Then add additional step into your building process,
which will create `bower` package files in the `amd` folder,
(basically it is just a process of copying the `lib` files, README and LICENSE)
and that's all.

Now `release-script` will do all those steps (described next),
including `bower` publishing, for you - automatically.


_Initial idea is got from `React-Bootstrap` release tools `./tools/release`,
that have been written by [<NAME> @mtscout6](https://github.com/mtscout6)_

#### Options

All options for this package are kept under `'release-script'` node in your project's `package.json`

- `bowerRepo` - the full url to github project for the bower pkg files
- `bowerRoot` - the folder name where your `npm run build` command will put/transpile files for bower pkg
- `tmpBowerRepo` - the folder name for temporary files for bower pkg.

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

E.g.:
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<org-author-name>/<name-of-project>-bower.git",
  "bowerRoot": "amd",
  "tmpBowerRepo": "tmp-bower-repo"
}
```

#### This script does following steps:

- ensures that git repo has no pending changes
- ensures that git repo last version is fetched
- checks linting and tests by running `npm run test` command
- does version bump, with `preid` if it is requested
- builds all by `npm run build` command
- if one of `[rf|mt]-changelog` is used in 'devDependencies', then changelog is generated
- adds and commits changed `package.json` (and `CHANGELOG.md`, if used) files to git repo
- adds git tag with new version (and changelog message, if used)
- pushes changes to github repo
- releases npm package by `npm publish` command
- if `bowerRepo` field is present in the `package.json`, then it releases bower package:
  - clones bower repo to local `tmpBowerRepo` temp folder. `git clone bowerRepo tmpBowerRepo`
  - then it cleans up all but `.git` files in the `tmpBowerRepo`
  - then copies all files from `bowerRoot` to `tmpBowerRepo`
    - (that has to be generated with `npm run build`)
  - then by `git add -A .` adds all bower distr files to the temporary git repo
  - commits, tags and pushes the same as for the `npm` package.
  - then deletes the `tmpBowerRepo` folder

## Installation

```sh
> npm install -D release-script
```

Set `'release-script'.bowerRepo` into your `package.json` if you need `bower` releases too.
```js
"release-script": {
  "bowerRepo": "<EMAIL>:<org-author-name>/<name-of-project>-bower.git"
}
```

Then you can release like that:
```sh
> release patch
> release minor --preid alpha
```

You can use `--dry-run` option to check first what will be done and if it is OK.
```sh
> release major --dry-run --verbose
```
This option prevents `danger` steps from running. (`git push`, `npm publish` etc)

If you don't have smth like that in your shell:
```sh
# npm
export PATH="./node_modules/.bin:$PATH"
```
then you have to type the commands like this:
```sh
> ./node_modules/.bin/release minor --preid alpha
```

Or you just can install `release-script` globally.

You also can add some helpful `script` commands to your `package.json`,
and because `npm` adds `node_modules/.bin` into `PATH` for running scripts automatically,
you can add them just like that:
```js
"scripts": {
    ...
    "patch": "release patch",
    "minor": "release minor",
    "major": "release major"
```


## License
`release-script` is licensed under the [MIT License](https://github.com/alexkval/release-script/blob/master/LICENSE).

{'fraction_non_alphanumeric': 0.115375531412376, 'fraction_numerical': 0.0004723665564478035, 'mean_word_length': 4.132727272727273, 'pattern_counts': {'":': 24, '<': 21, '<?xml version=': 0, '>': 31, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6212506', 'n_tokens_mistral': 2686, 'n_tokens_neox': 2582, 'n_words': 1125}