Skip to content

Commit

Permalink
Rewrite classes (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulshryock authored Jul 21, 2021
1 parent b395bf8 commit 94a7330
Show file tree
Hide file tree
Showing 14 changed files with 771 additions and 441 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,7 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

# temp files
legacy
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/paulshryock/release-bump/compare/HEAD..1.3.0)

### Added
- Bump WordPress plugin.

### Changed
- Rewrite classes.

### Deprecated

### Removed
- Remove configuration.

### Fixed

Expand All @@ -21,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.3.0](https://github.com/paulshryock/release-bump/releases/tag/v1.3.0) - 5/20/2021

### Added
- Bump WordPress theme version.
- Bump WordPress theme.

## [1.2.1](https://github.com/paulshryock/release-bump/releases/tag/v1.2.1) - 4/5/2021

Expand Down
69 changes: 23 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

`release-bump` handles version bump tasks for a code release.

## Announcements

Version `2.0.0` includes breaking changes:
- CLI configuration has been removed
- JavaScript API configuration has been removed
- [JavaScript class instantiation](#javascript-api) should be followed by a call to `init()` inside an async function.

## Features

- [Bump Changelog](#bump-changelog)
- [Bump WordPress theme or plugin](#bump-wordpress-theme-or-plugin)

[View roadmap](https://github.com/paulshryock/release-bump/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)

### Bump Changelog

Add lines to your Changelog beneath the Unreleased header as you make changes.
If your project has a Changelog, add lines beneath the Unreleased header as you make changes. If there is no Changelog, one is automatically created.

`release-bump` will change this:

Expand Down Expand Up @@ -58,15 +68,15 @@ to this:
- Fix another bug.
```

### Bump WordPress theme
### Bump WordPress theme or plugin

If your project has a file named `style.css` in the root directory, it will bump the version, if there is one.
If your project has a file named `style.css` or a PHP file of the folder name in the root directory, it will bump the version.

`release-bump` will change this:

```css
/*
Theme Name: ...
...
Version: 0.0.1
...
*/
Expand All @@ -76,7 +86,7 @@ to this:

```css
/*
Theme Name: ...
...
Version: 1.0.0
...
*/
Expand Down Expand Up @@ -106,54 +116,21 @@ Now whenever you run `npm version <major|minor|patch>`, all of the `release-bump

#### Configuration

| Option | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `-h` | boolean | `false` | Log help information. |
| `-p` | string | `./CHANGELOG.md` | The Changelog file path. |
| `-r` | string | `github` | The Git remote. (`github`|`bitbucket`) |
| `-s` | boolean | `false` | Whether to skip `v` in the version. |
| `-t` | string | empty string | The initial Changelog text. |
| `-u` | string | `https://keepachangelog.com/en/1.0.0/` | The initial Changelog text URL. |
| `-v` | boolean | `false` | Log package version. |
| `-w` | boolean | `false` | Whether to skip WordPress theme bump. |
In version `2.0.0`, CLI configuration has been removed. This will be added back in a future version.

### JavaScript API

If you prefer to run `release-bump` programattically, just require and instantiate a `release-bump` class:
If you prefer to run `release-bump` programmatically, just require and instantiate a `release-bump` class inside an async function; then call `init()`:

```javascript
const Bump = require('release-bump')
new Bump()
```
import Bump from 'release-bump'

Pass configuration options if you want to override the defaults:

```javascript
const Bump = require('release-bump')
new Bump({
changelog: {
filePath: './CHANGELOG.md',
gitRemote: 'github',
initialText: '',
initialTextUrl: 'https://keepachangelog.com/en/1.0.0/',
skipV: false,
},
help: false,
skipWordPress: false,
version: false,
})
;(async function () {
const bump = new Bump()
await bump.init()
})();
```

#### Configuration

| Option | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `changelog` | Object | | The Changelog options. |
| `changelog.filePath` | string | `./CHANGELOG.md` | The Changelog file path. |
| `changelog.gitRemote` | string | `github` | The Git remote. (`github`|`bitbucket`) |
| `changelog.initialText` | string | empty string | The initial Changelog text. |
| `changelog.initialTextUrl` | string | `https://keepachangelog.com/en/1.0.0/` | The initial Changelog text URL. |
| `changelog.skipV` | boolean | `false` | Whether to skip `v` in the version. |
| `help` | boolean | `false` | Whether to log help information. |
| `skipWordPress` | boolean | `false` | Whether to skip WordPress theme bump. |
| `version` | boolean | `false` | Whether to log package version. |
In version `2.0.0`, JavaScript API configuration has been removed. This will be added back in a future version.
7 changes: 7 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import Bump from './src/Bump.js'

;(async function () {
const bump = new Bump()
await bump.init()
})();
Loading

0 comments on commit 94a7330

Please sign in to comment.